# PulpcoreClient::TasksApi

All URIs are relative to *http://localhost:24817*

Method | HTTP request | Description
------------- | ------------- | -------------
[**tasks_add_role**](TasksApi.md#tasks_add_role) | **POST** {task_href}add_role/ | 
[**tasks_cancel**](TasksApi.md#tasks_cancel) | **PATCH** {task_href} | Cancel a task
[**tasks_delete**](TasksApi.md#tasks_delete) | **DELETE** {task_href} | Delete a task
[**tasks_list**](TasksApi.md#tasks_list) | **GET** /pulp/api/v3/tasks/ | List tasks
[**tasks_list_roles**](TasksApi.md#tasks_list_roles) | **GET** {task_href}list_roles/ | 
[**tasks_my_permissions**](TasksApi.md#tasks_my_permissions) | **GET** {task_href}my_permissions/ | 
[**tasks_purge**](TasksApi.md#tasks_purge) | **POST** /pulp/api/v3/tasks/purge/ | Purge Completed Tasks
[**tasks_read**](TasksApi.md#tasks_read) | **GET** {task_href} | Inspect a task
[**tasks_remove_role**](TasksApi.md#tasks_remove_role) | **POST** {task_href}remove_role/ | 



## tasks_add_role

> NestedRoleResponse tasks_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.tasks_add_role(task_href, nested_role)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_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


## 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


## tasks_delete

> tasks_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.tasks_delete(task_href)
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_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


## tasks_list

> PaginatedTaskResponseList tasks_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 | Filter results where child_tasks matches value
  created_resources: 'created_resources_example', # String | 
  exclusive_resources: 'exclusive_resources_example', # String | 
  exclusive_resources__in: ['exclusive_resources__in_example'], # Array<String> | Multiple values may be separated by commas.
  finished_at: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where finished_at matches value
  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<DateTime> | 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 | Filter results where logging_cid matches value
  logging_cid__contains: 'logging_cid__contains_example', # String | Filter results where logging_cid contains value
  name: 'name_example', # String | Filter results where name matches value
  name__contains: 'name__contains_example', # String | Filter results where name contains value
  name__in: ['name__in_example'], # Array<String> | Filter results where name is in a comma-separated list of values
  offset: 56, # Integer | The initial index from which to return the results.
  ordering: ['ordering_example'], # Array<String> | Ordering
  parent_task: 'parent_task_example', # String | Filter results where parent_task matches value
  reserved_resources: 'reserved_resources_example', # String | 
  reserved_resources__in: ['reserved_resources__in_example'], # Array<String> | Multiple values may be separated by commas.
  reserved_resources_record: ['reserved_resources_record_example'], # Array<String> | 
  shared_resources: 'shared_resources_example', # String | 
  shared_resources__in: ['shared_resources__in_example'], # Array<String> | Multiple values may be separated by commas.
  started_at: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter results where started_at matches value
  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<DateTime> | Filter results where started_at is between two comma separated values
  state: 'state_example', # String | Filter results where state matches value
  state__in: ['state__in_example'], # Array<String> | Filter results where state is in a comma-separated list of values
  task_group: 'task_group_example', # String | Filter results where task_group matches value
  worker: 'worker_example', # String | Filter results where worker matches value
  worker__in: ['worker__in_example'], # Array<String> | Filter results where worker is in a comma-separated list of values
  fields: ['fields_example'], # Array<String> | A list of fields to include in the response.
  exclude_fields: ['exclude_fields_example'] # Array<String> | A list of fields to exclude from the response.
}

begin
  #List tasks
  result = api_instance.tasks_list(opts)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_list: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **child_tasks** | **String**| Filter results where child_tasks matches value | [optional] 
 **created_resources** | [**String**](.md)|  | [optional] 
 **exclusive_resources** | **String**|  | [optional] 
 **exclusive_resources__in** | [**Array&lt;String&gt;**](String.md)| Multiple values may be separated by commas. | [optional] 
 **finished_at** | **DateTime**| Filter results where finished_at matches value | [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&lt;DateTime&gt;**](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**| Filter results where logging_cid matches value | [optional] 
 **logging_cid__contains** | **String**| Filter results where logging_cid contains value | [optional] 
 **name** | **String**| Filter results where name matches value | [optional] 
 **name__contains** | **String**| Filter results where name contains value | [optional] 
 **name__in** | [**Array&lt;String&gt;**](String.md)| Filter results where name is in a comma-separated list of values | [optional] 
 **offset** | **Integer**| The initial index from which to return the results. | [optional] 
 **ordering** | [**Array&lt;String&gt;**](String.md)| Ordering | [optional] 
 **parent_task** | **String**| Filter results where parent_task matches value | [optional] 
 **reserved_resources** | **String**|  | [optional] 
 **reserved_resources__in** | [**Array&lt;String&gt;**](String.md)| Multiple values may be separated by commas. | [optional] 
 **reserved_resources_record** | [**Array&lt;String&gt;**](String.md)|  | [optional] 
 **shared_resources** | **String**|  | [optional] 
 **shared_resources__in** | [**Array&lt;String&gt;**](String.md)| Multiple values may be separated by commas. | [optional] 
 **started_at** | **DateTime**| Filter results where started_at matches value | [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&lt;DateTime&gt;**](DateTime.md)| Filter results where started_at is between two comma separated values | [optional] 
 **state** | **String**| Filter results where state matches value | [optional] 
 **state__in** | [**Array&lt;String&gt;**](String.md)| Filter results where state is in a comma-separated list of values | [optional] 
 **task_group** | **String**| Filter results where task_group matches value | [optional] 
 **worker** | **String**| Filter results where worker matches value | [optional] 
 **worker__in** | [**Array&lt;String&gt;**](String.md)| Filter results where worker is in a comma-separated list of values | [optional] 
 **fields** | [**Array&lt;String&gt;**](String.md)| A list of fields to include in the response. | [optional] 
 **exclude_fields** | [**Array&lt;String&gt;**](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


## tasks_list_roles

> ObjectRolesResponse tasks_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<String> | A list of fields to include in the response.
  exclude_fields: ['exclude_fields_example'] # Array<String> | A list of fields to exclude from the response.
}

begin
  result = api_instance.tasks_list_roles(task_href, opts)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_list_roles: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **task_href** | **String**|  | 
 **fields** | [**Array&lt;String&gt;**](String.md)| A list of fields to include in the response. | [optional] 
 **exclude_fields** | [**Array&lt;String&gt;**](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


## tasks_my_permissions

> MyPermissionsResponse tasks_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<String> | A list of fields to include in the response.
  exclude_fields: ['exclude_fields_example'] # Array<String> | A list of fields to exclude from the response.
}

begin
  result = api_instance.tasks_my_permissions(task_href, opts)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_my_permissions: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **task_href** | **String**|  | 
 **fields** | [**Array&lt;String&gt;**](String.md)| A list of fields to include in the response. | [optional] 
 **exclude_fields** | [**Array&lt;String&gt;**](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


## tasks_purge

> AsyncOperationResponse tasks_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.tasks_purge(purge)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_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


## tasks_read

> TaskResponse tasks_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<String> | A list of fields to include in the response.
  exclude_fields: ['exclude_fields_example'] # Array<String> | A list of fields to exclude from the response.
}

begin
  #Inspect a task
  result = api_instance.tasks_read(task_href, opts)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_read: #{e}"
end
```

### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **task_href** | **String**|  | 
 **fields** | [**Array&lt;String&gt;**](String.md)| A list of fields to include in the response. | [optional] 
 **exclude_fields** | [**Array&lt;String&gt;**](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


## tasks_remove_role

> NestedRoleResponse tasks_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.tasks_remove_role(task_href, nested_role)
  p result
rescue PulpcoreClient::ApiError => e
  puts "Exception when calling TasksApi->tasks_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