cisco.dnac.task – Manage Task objects of Task

Note

This plugin is part of the cisco.dnac collection (version 2.0.7).

To install it use: ansible-galaxy collection install cisco.dnac.

To use it in a playbook, specify: cisco.dnac.task.

New in version 1.0.0: of cisco.dnac

Synopsis

  • Returns Task(s) based on filter criteria.

  • Returns a Task by specified id.

  • Returns Task count.

  • Returns root Tasks associated with an Operationid.

  • Returns a Task with its children Tasks by based on their id.

Note

This module has a corresponding action plugin.

Requirements

The below requirements are needed on the host that executes this module.

  • dnacentersdk

Parameters

Parameter Choices/Defaults Comments
count
boolean / required
    Choices:
  • no
  • yes
If true gets the number of objects.
data
string
Fetch Tasks that contains this data.
end_time
string
This is the epoch end time upto which audit records need to be fetched.
error_code
string
Fetch Tasks that have this error code.
failure_reason
string
Fetch Tasks that contains this failure reason.
is_error
string
Fetch Tasks ended as success or failure. Valid values true, false.
limit
raw
Limit query parameter.
The maximum value of {limit} supported is 500. Base 1 indexing for {limit}, minimum value is 1.
Type str for state query.
Type int for state query.
offset
raw
Offset query parameter.
Index, minimum value is 0.
Type str for state query.
Type int for state query.
operation_id
string / required
OperationId path parameter.
order
string
Sort order - asc or dsc.
parent_id
string
Fetch Tasks that have this parent Id.
progress
string
Fetch Tasks that contains this progress.
service_type
string
Fetch Tasks with this service type.
sort_by
string
Sort results by this field.
start_time
string
This is the epoch start time from which Tasks need to be fetched.
task_id
string / required
UUID of the Task.
tree
boolean / required
    Choices:
  • no
  • yes
If true retrieves the Task tree.
username
string
Fetch Tasks with this username.

See Also

See also

cisco.dnac.plugins.module_utils.definitions.task

The official documentation on the cisco.dnac.plugins.module_utils.definitions.task module.

Task reference

Complete reference of the Task object model.

Task reference

SDK reference.

Examples

- name: get_tasks
  cisco.dnac.task:
    state: query  # required
    data: SomeValue  # string
    end_time: SomeValue  # string
    error_code: SomeValue  # string
    failure_reason: SomeValue  # string
    is_error: SomeValue  # string
    limit: SomeValue  # string
    offset: SomeValue  # string
    order: SomeValue  # string
    parent_id: SomeValue  # string
    progress: SomeValue  # string
    service_type: SomeValue  # string
    sort_by: SomeValue  # string
    start_time: SomeValue  # string
    username: SomeValue  # string
  register: nm_get_tasks

- name: get_task_by_id
  cisco.dnac.task:
    state: query  # required
    task_id: SomeValue  # string, required
  register: nm_get_task_by_id

- name: get_task_count
  cisco.dnac.task:
    state: query  # required
    count: True  # boolean, required
    data: SomeValue  # string
    end_time: SomeValue  # string
    error_code: SomeValue  # string
    failure_reason: SomeValue  # string
    is_error: SomeValue  # string
    parent_id: SomeValue  # string
    progress: SomeValue  # string
    service_type: SomeValue  # string
    start_time: SomeValue  # string
    username: SomeValue  # string
  register: nm_get_task_count

- name: get_task_by_operationid
  cisco.dnac.task:
    state: query  # required
    limit: 1  #  integer, required
    offset: 1  #  integer, required
    operation_id: SomeValue  # string, required
  register: nm_get_task_by_operationid

- name: get_task_tree
  cisco.dnac.task:
    state: query  # required
    task_id: SomeValue  # string, required
    tree: True  # boolean, required
  register: nm_get_task_tree

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
dnac_response
dictionary
always
A dictionary with the response returned by the DNA Center Python SDK

Sample:
{'response': 29, 'version': '1.0'}
missing_params
list / elements=string
when the function request schema is not satisfied
Provided arguments do not comply with the schema of the DNA Center Python SDK function

sdk_function
string
always
The DNA Center SDK function used to execute the task

Sample:
task.get_task_by_id


Authors

  • Rafael Campos (@racampos)