# PulpcoreClient::TasksApi All URIs are relative to *https://pulp* Method | HTTP request | Description ------------- | ------------- | ------------- [**add_role**](TasksApi.md#add_role) | **POST** {task_href}add_role/ | [**delete**](TasksApi.md#delete) | **DELETE** {task_href} | Delete a task [**list**](TasksApi.md#list) | **GET** /pulp/api/v3/tasks/ | List tasks [**list_roles**](TasksApi.md#list_roles) | **GET** {task_href}list_roles/ | [**my_permissions**](TasksApi.md#my_permissions) | **GET** {task_href}my_permissions/ | [**purge**](TasksApi.md#purge) | **POST** /pulp/api/v3/tasks/purge/ | Purge Completed Tasks [**read**](TasksApi.md#read) | **GET** {task_href} | Inspect a task [**remove_role**](TasksApi.md#remove_role) | **POST** {task_href}remove_role/ | [**tasks_cancel**](TasksApi.md#tasks_cancel) | **PATCH** {task_href} | Cancel a task ## add_role > NestedRoleResponse add_role(task_href, nested_role) Add a role for this object to users/groups. ### 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::TasksApi.new task_href = 'task_href_example' # String | nested_role = PulpcoreClient::NestedRole.new # NestedRole | begin result = api_instance.add_role(task_href, nested_role) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->add_role: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_href** | **String**| | **nested_role** | [**NestedRole**](NestedRole.md)| | ### Return type [**NestedRoleResponse**](NestedRoleResponse.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(task_href) Delete a task A customized named ModelViewSet that knows how to register itself with the Pulp API router. This viewset is discoverable by its name. \"Normal\" Django Models and Master/Detail models are supported by the ``register_with`` method. Attributes: lookup_field (str): The name of the field by which an object should be looked up, in addition to any parent lookups if this ViewSet is nested. Defaults to 'pk' endpoint_name (str): The name of the final path segment that should identify the ViewSet's collection endpoint. nest_prefix (str): Optional prefix under which this ViewSet should be nested. This must correspond to the \"parent_prefix\" of a router with rest_framework_nested.NestedMixin. None indicates this ViewSet should not be nested. parent_lookup_kwargs (dict): Optional mapping of key names that would appear in self.kwargs to django model filter expressions that can be used with the corresponding value from self.kwargs, used only by a nested ViewSet to filter based on the parent object's identity. schema (DefaultSchema): The schema class to use by default in a viewset. ### 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::TasksApi.new task_href = 'task_href_example' # String | begin #Delete a task api_instance.delete(task_href) rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->delete: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_href** | **String**| | ### Return type nil (empty response body) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined ## list > PaginatedTaskResponseList list(opts) List tasks A customized named ModelViewSet that knows how to register itself with the Pulp API router. This viewset is discoverable by its name. \"Normal\" Django Models and Master/Detail models are supported by the ``register_with`` method. Attributes: lookup_field (str): The name of the field by which an object should be looked up, in addition to any parent lookups if this ViewSet is nested. Defaults to 'pk' endpoint_name (str): The name of the final path segment that should identify the ViewSet's collection endpoint. nest_prefix (str): Optional prefix under which this ViewSet should be nested. This must correspond to the \"parent_prefix\" of a router with rest_framework_nested.NestedMixin. None indicates this ViewSet should not be nested. parent_lookup_kwargs (dict): Optional mapping of key names that would appear in self.kwargs to django model filter expressions that can be used with the corresponding value from self.kwargs, used only by a nested ViewSet to filter based on the parent object's identity. schema (DefaultSchema): The schema class to use by default in a viewset. ### 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::TasksApi.new opts = { child_tasks: 'child_tasks_example', # String | Foreign Key referenced by HREF created_resources: 'created_resources_example', # String | finished_at: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | ISO 8601 formatted dates are supported finished_at__gt: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where finished_at is greater than value finished_at__gte: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where finished_at is greater than or equal to value finished_at__lt: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where finished_at is less than value finished_at__lte: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where finished_at is less than or equal to value finished_at__range: [DateTime.parse('2013-10-20T19:20:30+01:00')], # Array | Filter results where finished_at is between two comma separated values limit: 56, # Integer | Number of results to return per page. logging_cid: 'logging_cid_example', # String | logging_cid__contains: 'logging_cid__contains_example', # String | Filter results where logging_cid contains value name: 'name_example', # String | name__contains: 'name__contains_example', # String | Filter results where name contains value offset: 56, # Integer | The initial index from which to return the results. ordering: ['ordering_example'], # Array | Ordering parent_task: 'parent_task_example', # String | Foreign Key referenced by HREF reserved_resources_record: ['reserved_resources_record_example'], # Array | started_at: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | ISO 8601 formatted dates are supported started_at__gt: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where started_at is greater than value started_at__gte: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where started_at is greater than or equal to value started_at__lt: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where started_at is less than value started_at__lte: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where started_at is less than or equal to value started_at__range: [DateTime.parse('2013-10-20T19:20:30+01:00')], # Array | Filter results where started_at is between two comma separated values state: 'state_example', # String | state__in: ['state__in_example'], # Array | Filter results where state is in a comma-separated list of values task_group: 'task_group_example', # String | Foreign Key referenced by HREF worker: 'worker_example', # String | Foreign Key referenced by HREF worker__in: ['worker__in_example'], # Array | Filter results where worker is in a comma-separated list of values 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 tasks result = api_instance.list(opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->list: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **child_tasks** | [**String**](.md)| Foreign Key referenced by HREF | [optional] **created_resources** | [**String**](.md)| | [optional] **finished_at** | **DateTime**| ISO 8601 formatted dates are supported | [optional] **finished_at__gt** | **DateTime**| Filter results where finished_at is greater than value | [optional] **finished_at__gte** | **DateTime**| Filter results where finished_at is greater than or equal to value | [optional] **finished_at__lt** | **DateTime**| Filter results where finished_at is less than value | [optional] **finished_at__lte** | **DateTime**| Filter results where finished_at is less than or equal to value | [optional] **finished_at__range** | [**Array<DateTime>**](DateTime.md)| Filter results where finished_at is between two comma separated values | [optional] **limit** | **Integer**| Number of results to return per page. | [optional] **logging_cid** | **String**| | [optional] **logging_cid__contains** | **String**| Filter results where logging_cid contains value | [optional] **name** | **String**| | [optional] **name__contains** | **String**| Filter results where name contains value | [optional] **offset** | **Integer**| The initial index from which to return the results. | [optional] **ordering** | [**Array<String>**](String.md)| Ordering | [optional] **parent_task** | [**String**](.md)| Foreign Key referenced by HREF | [optional] **reserved_resources_record** | [**Array<String>**](String.md)| | [optional] **started_at** | **DateTime**| ISO 8601 formatted dates are supported | [optional] **started_at__gt** | **DateTime**| Filter results where started_at is greater than value | [optional] **started_at__gte** | **DateTime**| Filter results where started_at is greater than or equal to value | [optional] **started_at__lt** | **DateTime**| Filter results where started_at is less than value | [optional] **started_at__lte** | **DateTime**| Filter results where started_at is less than or equal to value | [optional] **started_at__range** | [**Array<DateTime>**](DateTime.md)| Filter results where started_at is between two comma separated values | [optional] **state** | **String**| | [optional] **state__in** | [**Array<String>**](String.md)| Filter results where state is in a comma-separated list of values | [optional] **task_group** | [**String**](.md)| Foreign Key referenced by HREF | [optional] **worker** | [**String**](.md)| Foreign Key referenced by HREF | [optional] **worker__in** | [**Array<String>**](String.md)| Filter results where worker is in a comma-separated list of values | [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 [**PaginatedTaskResponseList**](PaginatedTaskResponseList.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## list_roles > ObjectRolesResponse list_roles(task_href, opts) List roles assigned to this object. ### 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::TasksApi.new task_href = 'task_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 result = api_instance.list_roles(task_href, opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->list_roles: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_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 [**ObjectRolesResponse**](ObjectRolesResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## my_permissions > MyPermissionsResponse my_permissions(task_href, opts) List permissions available to the current user on this object. ### 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::TasksApi.new task_href = 'task_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 result = api_instance.my_permissions(task_href, opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->my_permissions: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_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 [**MyPermissionsResponse**](MyPermissionsResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## purge > AsyncOperationResponse purge(purge) Purge Completed Tasks Trigger an asynchronous task that deletes completed tasks that finished prior to a specified timestamp (tech-preview, may change in the future). ### 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::TasksApi.new purge = PulpcoreClient::Purge.new # Purge | begin #Purge Completed Tasks result = api_instance.purge(purge) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->purge: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **purge** | [**Purge**](Purge.md)| | ### Return type [**AsyncOperationResponse**](AsyncOperationResponse.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 > TaskResponse read(task_href, opts) Inspect a task A customized named ModelViewSet that knows how to register itself with the Pulp API router. This viewset is discoverable by its name. \"Normal\" Django Models and Master/Detail models are supported by the ``register_with`` method. Attributes: lookup_field (str): The name of the field by which an object should be looked up, in addition to any parent lookups if this ViewSet is nested. Defaults to 'pk' endpoint_name (str): The name of the final path segment that should identify the ViewSet's collection endpoint. nest_prefix (str): Optional prefix under which this ViewSet should be nested. This must correspond to the \"parent_prefix\" of a router with rest_framework_nested.NestedMixin. None indicates this ViewSet should not be nested. parent_lookup_kwargs (dict): Optional mapping of key names that would appear in self.kwargs to django model filter expressions that can be used with the corresponding value from self.kwargs, used only by a nested ViewSet to filter based on the parent object's identity. schema (DefaultSchema): The schema class to use by default in a viewset. ### 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::TasksApi.new task_href = 'task_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 task result = api_instance.read(task_href, opts) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->read: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_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 [**TaskResponse**](TaskResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json ## remove_role > NestedRoleResponse remove_role(task_href, nested_role) Remove a role for this object from users/groups. ### 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::TasksApi.new task_href = 'task_href_example' # String | nested_role = PulpcoreClient::NestedRole.new # NestedRole | begin result = api_instance.remove_role(task_href, nested_role) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->remove_role: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_href** | **String**| | **nested_role** | [**NestedRole**](NestedRole.md)| | ### Return type [**NestedRoleResponse**](NestedRoleResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data - **Accept**: application/json ## tasks_cancel > TaskResponse tasks_cancel(task_href, patched_task_cancel) Cancel a task This operation cancels a task. ### 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::TasksApi.new task_href = 'task_href_example' # String | patched_task_cancel = PulpcoreClient::PatchedTaskCancel.new # PatchedTaskCancel | begin #Cancel a task result = api_instance.tasks_cancel(task_href, patched_task_cancel) p result rescue PulpcoreClient::ApiError => e puts "Exception when calling TasksApi->tasks_cancel: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **task_href** | **String**| | **patched_task_cancel** | [**PatchedTaskCancel**](PatchedTaskCancel.md)| | ### Return type [**TaskResponse**](TaskResponse.md) ### Authorization [basicAuth](../README.md#basicAuth) ### HTTP request headers - **Content-Type**: application/json, application/x-www-form-urlencoded, multipart/form-data - **Accept**: application/json