# PulpcoreClient::RolesApi All URIs are relative to *https://pulp* Method | HTTP request | Description ------------- | ------------- | ------------- [**create**](RolesApi.md#create) | **POST** /pulp/api/v3/roles/ | Create a role [**delete**](RolesApi.md#delete) | **DELETE** {role_href} | Delete a role [**list**](RolesApi.md#list) | **GET** /pulp/api/v3/roles/ | List roles [**partial_update**](RolesApi.md#partial_update) | **PATCH** {role_href} | Update a role [**read**](RolesApi.md#read) | **GET** {role_href} | Inspect a role [**update**](RolesApi.md#update) | **PUT** {role_href} | Update a role ## create > RoleResponse create(role) Create a role ViewSet for Role. NOTE: This API endpoint is in \"tech preview\" and subject to change ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::RolesApi.new role = PulpcoreClient::Role.new # Role | begin #Create a role result = api_instance.create(role) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling RolesApi->create: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **role** | [**Role**](Role.md)| | ### Return type [**RoleResponse**](RoleResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data - **Accept**: application/json ## delete > delete(role_href) Delete a role ViewSet for Role. NOTE: This API endpoint is in \"tech preview\" and subject to change ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::RolesApi.new role_href = 'role_href_example' # String | begin #Delete a role api_instance.delete(role_href) rescue PulpcoreClient::ApiError => e puts "Exception when calling RolesApi->delete: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **role_href** | **String**| | ### Return type nil (empty response body) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined ## list > PaginatedRoleResponseList list(opts) List roles ViewSet for Role. NOTE: This API endpoint is in \"tech preview\" and subject to change ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::RolesApi.new opts = { contains_permission: ['contains_permission_example'], # Array | Filter roles that have any of the permissions in the list. description: 'description_example', # String | Filter results where description matches value description__contains: 'description__contains_example', # String | Filter results where description contains value description__icontains: 'description__icontains_example', # String | Filter results where description contains value description__iexact: 'description__iexact_example', # String | Filter results where description matches value for_object_type: 'for_object_type_example', # String | Filter roles that only have permissions for the specified object HREF. limit: 56, # Integer | Number of results to return per page. locked: true, # Boolean | Filter results where locked matches value name: 'name_example', # String | Filter results where name matches value name__contains: 'name__contains_example', # String | Filter results where name contains value name__icontains: 'name__icontains_example', # String | Filter results where name contains value name__in: ['name__in_example'], # Array | Filter results where name is in a comma-separated list of values name__startswith: 'name__startswith_example', # String | Filter results where name starts with value offset: 56, # Integer | The initial index from which to return the results. ordering: ['ordering_example'], # Array | Ordering fields: ['fields_example'], # Array | A list of fields to include in the response. exclude_fields: ['exclude_fields_example'] # Array | A list of fields to exclude from the response. } begin #List roles result = api_instance.list(opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling RolesApi->list: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **contains_permission** | [**Array<String>**](String.md)| Filter roles that have any of the permissions in the list. | [optional] **description** | **String**| Filter results where description matches value | [optional] **description__contains** | **String**| Filter results where description contains value | [optional] **description__icontains** | **String**| Filter results where description contains value | [optional] **description__iexact** | **String**| Filter results where description matches value | [optional] **for_object_type** | **String**| Filter roles that only have permissions for the specified object HREF. | [optional] **limit** | **Integer**| Number of results to return per page. | [optional] **locked** | **Boolean**| Filter results where locked matches value | [optional] **name** | **String**| Filter results where name matches value | [optional] **name__contains** | **String**| Filter results where name contains value | [optional] **name__icontains** | **String**| Filter results where name contains value | [optional] **name__in** | [**Array<String>**](String.md)| Filter results where name is in a comma-separated list of values | [optional] **name__startswith** | **String**| Filter results where name starts with value | [optional] **offset** | **Integer**| The initial index from which to return the results. | [optional] **ordering** | [**Array<String>**](String.md)| Ordering | [optional] **fields** | [**Array<String>**](String.md)| A list of fields to include in the response. | [optional] **exclude_fields** | [**Array<String>**](String.md)| A list of fields to exclude from the response. | [optional] ### Return type [**PaginatedRoleResponseList**](PaginatedRoleResponseList.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## partial_update > RoleResponse partial_update(role_href, patched_role) Update a role ViewSet for Role. NOTE: This API endpoint is in \"tech preview\" and subject to change ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::RolesApi.new role_href = 'role_href_example' # String | patched_role = PulpcoreClient::PatchedRole.new # PatchedRole | begin #Update a role result = api_instance.partial_update(role_href, patched_role) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling RolesApi->partial_update: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **role_href** | **String**| | **patched_role** | [**PatchedRole**](PatchedRole.md)| | ### Return type [**RoleResponse**](RoleResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data - **Accept**: application/json ## read > RoleResponse read(role_href, opts) Inspect a role ViewSet for Role. NOTE: This API endpoint is in \"tech preview\" and subject to change ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::RolesApi.new role_href = 'role_href_example' # String | opts = { fields: ['fields_example'], # Array | A list of fields to include in the response. exclude_fields: ['exclude_fields_example'] # Array | A list of fields to exclude from the response. } begin #Inspect a role result = api_instance.read(role_href, opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling RolesApi->read: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **role_href** | **String**| | **fields** | [**Array<String>**](String.md)| A list of fields to include in the response. | [optional] **exclude_fields** | [**Array<String>**](String.md)| A list of fields to exclude from the response. | [optional] ### Return type [**RoleResponse**](RoleResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## update > RoleResponse update(role_href, role) Update a role ViewSet for Role. NOTE: This API endpoint is in \"tech preview\" and subject to change ### Example ```ruby # load the gem require 'pulpcore_client' # setup authorization PulpcoreClient.configure do |config| # Configure HTTP basic authorization: basicAuth config.username = 'YOUR USERNAME' config.password = 'YOUR PASSWORD' end api_instance = PulpcoreClient::RolesApi.new role_href = 'role_href_example' # String | role = PulpcoreClient::Role.new # Role | begin #Update a role result = api_instance.update(role_href, role) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling RolesApi->update: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **role_href** | **String**| | **role** | [**Role**](Role.md)| | ### Return type [**RoleResponse**](RoleResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data - **Accept**: application/json