cisco.dnac.path_trace_workflow_manager module – Resource module for managing PathTrace settings in Cisco Catalyst Center
Note
This module is part of the cisco.dnac collection (version 6.39.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install cisco.dnac
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: cisco.dnac.path_trace_workflow_manager
.
New in cisco.dnac 6.31.0
Synopsis
This module allows the management of PathTrace settings in Cisco Catalyst Center. - It supports creating and deleting PathTrace configurations. - This module configures PathTrace settings in Cisco Catalyst Center, including source/destination IPs, ports, and protocols.
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk >= 2.8.6
python >= 3.9
Parameters
Parameter |
Comments |
---|---|
A list containing the details for Path Trace configuration. |
|
Boolean value indicating whether to delete the path trace after generation. This applies only when periodic_refresh is set to false.. Choices:
|
|
The destination IP address for the path trace. Either flow_analysis_id or both source_ip and dest_ip are required. |
|
The destination port for the path trace (optional). |
|
The Flow Analysis ID for the path trace, used to delete an existing path trace when in the ‘deleted’ state. If not provided, the module will search and delete based on the following search parameters. When create a path trace, it returns a flow_analysis_id (the “id” from the “request” section), which should be shown in a register |
|
Boolean value to display the last result again for the path trace. Choices:
|
|
A list of optional statistics (multiple choice) to include in the path trace, such as QOS statistics or additional details. Examples: “DEVICE_STATS”, “INTERFACE_STATS”, “QOS_STATS”, “PERFORMANCE_STATS”, “ACL_TRACE”. - DEVICE_STATS - Collects hardware-related statistics of network devices along the path, including CPU usage, memory, uptime, and interface status. - INTERFACE_STATS - Gathers details about interfaces used in the path, such as interface type, bandwidth usage, errors, and drops. - QOS_STATS - Displays Quality of Service (QoS) settings on interfaces, including traffic classification, priority settings, and congestion management. - PERFORMANCE_STATS: Provides network performance metrics like latency, jitter, and packet loss. - ACL_TRACE: Analyzes Access Control List (ACL) rules applied along the path to identify blocked traffic or policy mismatches. |
|
Boolean value to enable periodic refresh for the path trace. Choices:
|
|
The protocol to use for the path trace, e.g., TCP, UDP (optional). Choices:
|
|
The source IP address for the path trace. Either flow_analysis_id or both source_ip and dest_ip are required. |
|
The source port for the path trace (optional). |
|
Set to `true` to enable configuration verification on Cisco DNA Center after applying the playbook configuration. This ensures that the system validates the configuration state after the change is applied. Choices:
|
|
Defines the timeout in seconds for API calls to retrieve task details. If the task details are not received within this period, the process will end, and a timeout notification will be logged. Default: |
|
Indicates whether debugging is enabled in the Cisco Catalyst Center SDK. Choices:
|
|
The hostname of the Cisco Catalyst Center. |
|
Flag to enable/disable playbook execution logging. When true and dnac_log_file_path is provided, - Create the log file at the execution location with the specified name. When true and dnac_log_file_path is not provided, - Create the log file at the execution location with the name ‘dnac.log’. When false, - Logging is disabled. If the log file doesn’t exist, - It is created in append or write mode based on the “dnac_log_append” flag. If the log file exists, - It is overwritten or appended based on the “dnac_log_append” flag. Choices:
|
|
Determines the mode of the file. Set to True for ‘append’ mode. Set to False for ‘write’ mode. Choices:
|
|
Governs logging. Logs are recorded if dnac_log is True. If path is not specified, - When ‘dnac_log_append’ is True, ‘dnac.log’ is generated in the current Ansible directory; logs are appended. - When ‘dnac_log_append’ is False, ‘dnac.log’ is generated; logs are overwritten. If path is specified, - When ‘dnac_log_append’ is True, the file opens in append mode. - When ‘dnac_log_append’ is False, the file opens in write (w) mode. - In shared file scenarios, without append mode, content is overwritten after each module execution. - For a shared log file, set append to False for the 1st module (to overwrite); for subsequent modules, set append to True. Default: |
|
Sets the threshold for log level. Messages with a level equal to or higher than this will be logged. Levels are listed in order of severity [CRITICAL, ERROR, WARNING, INFO, DEBUG]. CRITICAL indicates serious errors halting the program. Displays only CRITICAL messages. ERROR indicates problems preventing a function. Displays ERROR and CRITICAL messages. WARNING indicates potential future issues. Displays WARNING, ERROR, CRITICAL messages. INFO tracks normal operation. Displays INFO, WARNING, ERROR, CRITICAL messages. DEBUG provides detailed diagnostic info. Displays all log messages. Default: |
|
The password for authentication at the Cisco Catalyst Center. |
|
Specifies the port number associated with the Cisco Catalyst Center. Default: |
|
Specifies the interval in seconds between successive calls to the API to retrieve task details. Default: |
|
The username for authentication at the Cisco Catalyst Center. Default: |
|
Flag to enable or disable SSL certificate verification. Choices:
|
|
Specifies the version of the Cisco Catalyst Center that the SDK should use. Default: |
|
Specifies the desired state for the configuration. If `merged`, the module will create or update the configuration, adding new settings or modifying existing ones. If `deleted`, it will remove the specified settings. Choices:
|
|
Flag for Cisco Catalyst Center SDK to enable the validation of request bodies against a JSON schema. Choices:
|
Notes
Note
SDK Method used are path_trace.PathTraceWorkflow.retrieves_all_previous_pathtraces_summary, path_trace.PathTraceWorkflow.retrieves_previous_pathtraces_summary, path_trace.PathTraceWorkflow.initiate_a_new_pathtrace, path_trace.PathTraceWorkflow.delete_pathtrace_by_id, - API paths used are GET/dna/intent/api/v1/flow-analysis POST/dna/intent/api/v1/flow-analysis GET/dna/intent/api/v1/flow-analysis/{flowAnalysisId} DELETE/dna/intent/api/v1/flow-analysis/{flowAnalysisId}
Does not support
check_mode
The plugin runs on the control node and does not use any ansible connection plugins instead embedded connection manager from Cisco Catalyst Center SDK
The parameters starting with dnac_ are used by the Cisco Catalyst Center Python SDK to establish the connection
Examples
---
- hosts: dnac_servers
vars_files:
- credentials.yml
gather_facts: false
connection: local
tasks:
- name: Create and auto-delete path trace on Cisco
Catalyst Center
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log: true
dnac_log_level: DEBUG
dnac_log_append: true
state: merged
config_verify: true
config:
- source_ip: "204.1.2.3" # required field
dest_ip: "204.1.2.4" # required field
source_port: 4020 # optional field
dest_port: 4021 # optional field
protocol: "TCP" # optional field
include_stats: # optional field
- DEVICE_STATS
- INTERFACE_STATS
- QOS_STATS
- PERFORMANCE_STATS
- ACL_TRACE
periodic_refresh: false # optional field
delete_on_completion: true # optional field
- name: Delete path trace based on source and destination IP
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log_level: DEBUG
dnac_log: true
state: deleted
config_verify: true
config:
- source_ip: "204.1.2.3" # required field
dest_ip: "204.1.2.4" # required field
- name: Retrieve last path trace
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log_level: DEBUG
dnac_log: true
state: merged
config_verify: true
config:
- source_ip: "204.1.2.3" # required field
dest_ip: "204.1.2.4" # required field
get_last_pathtrace_result: true
- name: Retrieve path trace based on the flow analysis
id
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log_level: DEBUG
dnac_log: true
state: merged
config_verify: true
config:
# When create a path trace, it returns a flow_analysis_id
# (the "id" from the "request" section), which should be
# shown in a register.
- flow_analysis_id: 99e067de-8776-40d2-9f6a-1e6ab2ef083c
delete_on_completion: false # optional field
register: output_list
- name: Retrieve and Delete path trace based on
the required field
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log_level: DEBUG
dnac_log: true
state: merged
config_verify: true
config:
- source_ip: "204.1.2.3" # required field
dest_ip: "204.1.2.4" # required field
register: output_list
- name: Delete path trace based on registered flow
analysis id
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log_level: DEBUG
dnac_log: true
state: deleted
config_verify: true
config:
- flow_analysis_id: output_list.request.id
- name: delete path trace based on the flow analysis
id
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log_level: DEBUG
dnac_log: true
state: deleted
config_verify: true
config:
# When create a path trace, it returns a flow_analysis_id
# (the "id" from the "request" section), which should be
# shown in a register.
- flow_analysis_id: 99e067de-8776-40d2-9f6a-1e6ab2ef083c
- name: Create/Retrieve Path trace for the config
list.
cisco.dnac.path_trace_workflow_manager:
dnac_host: "{{ dnac_host }}"
dnac_port: "{{ dnac_port }}"
dnac_username: "{{ dnac_username }}"
dnac_password: "{{ dnac_password }}"
dnac_verify: "{{ dnac_verify }}"
dnac_debug: "{{ dnac_debug }}"
dnac_version: "{{ dnac_version }}"
dnac_log_level: DEBUG
dnac_log: true
state: merged
config_verify: true
config:
- source_ip: "204.1.2.3" # required field
dest_ip: "204.1.2.4" # required field
source_port: 4020 # optional field
dest_port: 4021 # optional field
protocol: "TCP" # optional field
include_stats: # optional field
- DEVICE_STATS
- INTERFACE_STATS
- QOS_STATS
- PERFORMANCE_STATS
- ACL_TRACE
periodic_refresh: false # optional field
delete_on_completion: true # optional field
- source_ip: "204.1.1.2" # required field
dest_ip: "204.1.2.4" # required field
get_last_pathtrace_result: true # optional field
delete_on_completion: true # optional field
- flow_analysis_id: 99e067de-8776-40d2-9f6a-1e6ab2ef083c
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |
|
A dictionary or list with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |
|
A dictionary or list with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |
|
A dictionary or list with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |
|
A dictionary or list with the response returned by the Cisco Catalyst Center Python SDK Returned: always Sample: |