diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 4360b599ac..ac477470e6 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -778,3 +778,9 @@ releases: - Set dnac log level if it is not set in the playbook. - Handle provisioning of device if it is not in managed state for longer. - Set the logging levels for device credentails intent module. + 6.10.3: + release_date: "2024-01-30" + changes: + release_summary: Fixing swim_import_local action. + minor_changes: + - Building additional parameters needed in sdk. \ No newline at end of file diff --git a/galaxy.yml b/galaxy.yml index 7f79631987..a8cb8689e1 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,7 +1,7 @@ --- namespace: cisco name: dnac -version: 6.10.2 +version: 6.10.3 readme: README.md authors: - Rafael Campos diff --git a/playbooks/swim_import_local.yml b/playbooks/swim_import_local.yml new file mode 100644 index 0000000000..8f6c559948 --- /dev/null +++ b/playbooks/swim_import_local.yml @@ -0,0 +1,22 @@ +- hosts: dnac_servers + vars_files: + - credentials.yml + gather_facts: false + connection: local + tasks: + - name: Import Local + cisco.dnac.swim_import_local: + 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}}" + #headers: "{{my_headers | from_json}}" + isThirdParty: False + thirdPartyVendor: "string" + thirdPartyImageFamily: "string" + thirdPartyApplicationType: "string" + filePath: "./tests/test-1592357065255.csv" + register: result \ No newline at end of file diff --git a/playbooks/tests/test-1592357065255.csv b/playbooks/tests/test-1592357065255.csv new file mode 100644 index 0000000000..95d096fa3d --- /dev/null +++ b/playbooks/tests/test-1592357065255.csv @@ -0,0 +1,3 @@ +Device IP,Device Name,DeviceType,Target Image,Target Version,Image Type,Reboot,Check Type,Description,PreCheck Status,LastChecked +10.10.20.51,3504_WLC,Wireless Controller,AIR-CT3504-K9-8-10-121-0,8.10.121.0,WLC_SW,Yes,Service Entitlement Check,Service Entitlement Check: WARNING : Unable to validate license for Device. Not enough information to validate.,WARNING,2020-06-17 01:24:04, +10.10.20.51,3504_WLC,Wireless Controller,AIR-CT3504-K9-8-10-121-0,8.10.121.0,WLC_SW,Yes,Flash check,Upgrade Analysis feature is not supported for Cisco Interfaces and Modules/Content Networking/Third Party devices/Wireless Controllers excluding Cisco 5760 Series; : ,SUCCESS,2020-06-17 01:24:04, diff --git a/plugins/action/swim_import_local.py b/plugins/action/swim_import_local.py index 57946e44e0..b5e3b8a6c9 100644 --- a/plugins/action/swim_import_local.py +++ b/plugins/action/swim_import_local.py @@ -20,6 +20,7 @@ DNACSDK, dnac_argument_spec, ) +import os # Get common arguements specification argument_spec = dnac_argument_spec() @@ -41,7 +42,8 @@ class ActionModule(ActionBase): def __init__(self, *args, **kwargs): if not ANSIBLE_UTILS_IS_INSTALLED: - raise AnsibleActionFail("ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") + raise AnsibleActionFail( + "ansible.utils is not installed. Execute 'ansible-galaxy collection install ansible.utils'") super(ActionModule, self).__init__(*args, **kwargs) self._supports_async = False self._supports_check_mode = False @@ -70,8 +72,12 @@ def get_object(self, params): is_third_party=params.get("isThirdParty"), third_party_vendor=params.get("thirdPartyVendor"), third_party_image_family=params.get("thirdPartyImageFamily"), - third_party_application_type=params.get("thirdPartyApplicationType"), + third_party_application_type=params.get( + "thirdPartyApplicationType"), file_path=params.get("filePath"), + multipart_fields={'file': (os.path.basename(params.get( + "filePath")), open(params.get("filePath"), 'rb'))}, + multipart_monitor_callback=None ) return new_object