cisco.dnac.swim_intent module – Intent module for SWIM related functions
Note
This module is part of the cisco.dnac collection (version 6.10.0).
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.swim_intent
.
New in cisco.dnac 6.6.0
Synopsis
Manage operation related to image importation, distribution, activation and tagging image as golden
API to fetch a software image from remote file system using URL for HTTP/FTP and upload it to DNA Center. Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2.
API to fetch a software image from local file system and upload it to DNA Center Supported image files extensions are bin, img, tar, smu, pie, aes, iso, ova, tar_gz and qcow2.
API to tag/untag image as golen for a given family of devices
API to distribute a software image on a given device. Software image must be imported successfully into DNA Center before it can be distributed.
API to activate a software image on a given device. Software image must be present in the device flash.
Requirements
The below requirements are needed on the host that executes this module.
dnacentersdk == 2.4.5
python >= 3.5
Parameters
Parameter |
Comments |
---|---|
List of details of SWIM image being managed |
|
Details for SWIM image activation. Device on which the image needs to activated can be speciifed using any of the following parameters - deviceSerialNumber, deviceIPAddress, deviceHostname or deviceMacAddress. |
|
ActivateLowerImageVersion flag. Choices: |
|
Device family name |
|
Device hostname where the image needs to be activated |
|
Device IP address where the image needs to be activated |
|
Device MAC address where the image needs to be activated |
|
Device Role. Permissible Values ALL, UNKNOWN, ACCESS, BORDER ROUTER, DISTRIBUTION and CORE. |
|
Device serial number where the image needs to be activated |
|
Swim Trigger Activation’s deviceUpgradeMode. |
|
DistributeIfNeeded flag. Choices: |
|
SWIM image’s name |
|
ScheduleValidate query parameter. ScheduleValidate, validates data before schedule (Optional). Choices: |
|
Used to get device details associated to this site. |
|
Details for SWIM image distribution. Device on which the image needs to distributed can be speciifed using any of the following parameters - deviceSerialNumber, deviceIPAddress, deviceHostname or deviceMacAddress. |
|
Device family name |
|
Device hostname where the image needs to be distributed |
|
Device IP address where the image needs to be distributed |
|
Device MAC address where the image needs to be distributed |
|
Device Role. Permissible Values ALL, UNKNOWN, ACCESS, BORDER ROUTER, DISTRIBUTION and CORE. |
|
Device serial number where the image needs to be distributed |
|
SWIM image’s name |
|
Used to get device details associated to this site. |
|
Details of image being imported |
|
Details of the local path of the image to be imported. |
|
File absolute path. |
|
IsThirdParty query parameter. Third party Image check. Choices: |
|
ThirdPartyApplicationType query parameter. Third Party Application Type. |
|
ThirdPartyImageFamily query parameter. Third Party image family. |
|
ThirdPartyVendor query parameter. Third Party Vendor. |
|
The source of import, supports url import or local import. |
|
URL details for SWIM import |
|
Swim Import Via Url’s payload. |
|
Swim Import Via Url’s applicationType. |
|
Swim Import Via Url’s imageFamily. |
|
Swim Import Image Via Url. |
|
ThirdParty flag. Choices: |
|
Swim Import Via Url’s vendor. |
|
ScheduleAt query parameter. Epoch Time (The number of milli-seconds since January 1 1970 UTC) at which the distribution should be scheduled (Optional). |
|
ScheduleDesc query parameter. Custom Description (Optional). |
|
ScheduleOrigin query parameter. Originator of this call (Optional). |
|
Details for tagging or untagging an image as golden |
|
Device family name(Eg Switches and Hubs) |
|
Device Role. Permissible Values ALL, UNKNOWN, ACCESS, BORDER ROUTER, DISTRIBUTION and CORE. |
|
Type of the device (Eg Cisco Catalyst 9300 Switch) |
|
SWIM image name which will be tagged or untagged as golden. |
|
Site name for which SWIM image will be tagged/untagged as golden. If not provided, SWIM image will be mapped to global site. |
|
Booelan value to tag/untag SWIM image as golden If True then the given image will be tagged as golden. If False then the given image will be un-tagged as golden. Choices: |
|
Flag for Cisco DNA Center SDK to enable debugging. Choices: |
|
The Cisco DNA Center hostname. |
|
Flag for logging playbook execution details. If set to true the log file will be created at the location of the execution with the name dnac.log Choices: |
|
The Cisco DNA Center password to authenticate. |
|
The Cisco DNA Center port. Default: :ansible-option-default:`"443"` |
|
The Cisco DNA Center username to authenticate. Default: :ansible-option-default:`"admin"` |
|
Flag to enable or disable SSL certificate verification. Choices: |
|
Informs the SDK which version of Cisco DNA Center to use. Default: :ansible-option-default:`"2.2.3.3"` |
|
The state of DNAC after module completion. Choices:
|
|
Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema. Choices: |
Notes
Note
SDK Method used are software_image_management_swim.SoftwareImageManagementSwim.import_software_image_via_url, software_image_management_swim.SoftwareImageManagementSwim.tag_as_golden_image, software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_distribution, software_image_management_swim.SoftwareImageManagementSwim.trigger_software_image_activation,
Paths used are post /dna/intent/api/v1/image/importation/source/url, post /dna/intent/api/v1/image/importation/golden, post /dna/intent/api/v1/image/distribution, post /dna/intent/api/v1/image/activation/device,
Does not support
check_mode
The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco DNAC SDK
The parameters starting with dnac_ are used by the Cisco DNAC Python SDK to establish the connection
Examples
- name: Import an image from a URL, tag it as golden and load it on device
cisco.dnac.swim_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log: True
config:
- import_image_details:
type: string
urlDetails:
payload:
- source_url: string
is_third_party: bool
image_family: string
vendor: string
application_type: string
schedule_at: string
schedule_desc: string
schedule_origin: string
tagging_details:
image_name: string
device_role: string
device_family_name: string
site_name: string
tagging: bool
image_distribution_details:
image_name: string
device_serial_number: string
image_activation_details:
schedule_validate: bool
activate_lower_image_version: bool
distribute_if_needed: bool
device_serial_number: string
image_name: string
- name: Tag the given image as golden and load it on device
cisco.dnac.swim_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log: True
config:
- tagging_details:
image_name: string
device_role: string
device_family_name: string
device_type: string
site_name: string
tagging: bool
- name: Distribute the given image on devices associated to that site with specified role.
cisco.dnac.swim_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log: True
config:
- image_distribution_details:
image_name: string
site_name: string
device_role: string
device_family_name: string
- name: Activate the given image on devices associated to that site with specified role.
cisco.dnac.swim_intent:
dnac_host: "{{dnac_host}}"
dnac_username: "{{dnac_username}}"
dnac_password: "{{dnac_password}}"
dnac_verify: "{{dnac_verify}}"
dnac_port: "{{dnac_port}}"
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
dnac_log: True
config:
- image_activation_details:
image_name: string
site_name: string
device_role: string
device_family_name: string
scehdule_validate: bool
activate_lower_image_version: bool
distribute_if_needed: bool
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
A dictionary with activation details as returned by the DNAC Python SDK Returned: always |
Authors
Madhan Sankaranarayanan (@madhansansel) Rishita Chowdhary (@rishitachowdhary) Abhishek Maheshwari (@abmahesh)