diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 0385062e6b..152c2574b9 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -630,4 +630,51 @@ releases: release_summary: New method to compare changes bugfixes: - A new method to compare changes for specific cases has been added. - - network_device - Used a new method to compare changes. \ No newline at end of file + - network_device - Used a new method to compare changes. + 6.7.0: + release_date: "xxxx-xx-xx" + changes: + release_summary: New method to compare changes + minor_changes: + - accesspoint_configuration_details_by_task_id_info - new module + - authentication_policy_servers_info - new module + - credential_to_site_by_siteid_create_v2 - new module + - device_reboot_apreboot_info - new module + - dnac_packages_info - new module + - eox_status_device_info - new module + - eox_status_summary_info - new module + - event_email_config - new module + - event_email_config_info - new module + - event_snmp_config_info - new module + - event_syslog_config - new module + - event_syslog_config_info - new module + - execute_suggested_actions_commands - new module + - global_credential_v2 - new module + - global_credential_v2_info - new module + - integration_settings_instances_itsm - new module + - integration_settings_instances_itsm_info - new module + - lan_automation_log_by_serial_number_info - new module + - network_device_user_defined_field - new module + - network_device_user_defined_field_info - new module + - network_v2 - new module + - network_v2_info - new module + - role_permissions_info - new module + - roles_info - new module + - service_provider_v2 - new module + - service_provider_v2_info - new module + - sp_profile_delete_v2 - new module + - user - new module + - user_info - new module + - users_external_servers_info - new module + - wireless_accespoint_configuration - new module + - wireless_accesspoint_configuration_summary_info - new module + - device_interface_info - attributes `lastInputTime` and `lastOutputTime` were added. + - pnp_device_claim_to_site - attributes `removeInactive` and `hostname` were removed. + - sda_fabric_border_device - attributes `routeDistributionProtocol` and `borderPriority` were added. + - sda_fabric_control_plane_device attribute `routeDistributionProtocol` was added. + - sda_fabric_edge_device - attribute `siteNameHierarchy` was added. + - sda_fabric_site - attribute `fabricType` was added. + - sda_port_assignment_for_user_device - attribute `interfaceNames` was added. + - sda_virtual_network - attribute `vManageVpnId` was added. + - sda_virtual_network_ip_pool - attribute `isBridgeModeVm` was added. + - sda_virtual_network_v2 - attribute `isBridgeModeVm` was added. \ No newline at end of file diff --git a/plugins/action/accesspoint_configuration_details_by_task_id_info.py b/plugins/action/accesspoint_configuration_details_by_task_id_info.py new file mode 100644 index 0000000000..0e290527dd --- /dev/null +++ b/plugins/action/accesspoint_configuration_details_by_task_id_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + task_id=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + task_id=params.get("task_id"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("task_id") + if id: + response = dnac.exec( + family="wireless", + function='get_access_point_configuration_task_result', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/authentication_policy_servers_info.py b/plugins/action/authentication_policy_servers_info.py new file mode 100644 index 0000000000..0f219af216 --- /dev/null +++ b/plugins/action/authentication_policy_servers_info.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + isIseEnabled=dict(type="bool"), + state_=dict(type="str"), + role=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + is_ise_enabled=params.get("isIseEnabled"), + state=params.get("state_"), + role=params.get("role"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="system_settings", + function='get_authentication_and_policy_servers', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/business_sda_hostonboarding_ssid_ippool.py b/plugins/action/business_sda_hostonboarding_ssid_ippool.py index 0b7698743f..75eda00d33 100644 --- a/plugins/action/business_sda_hostonboarding_ssid_ippool.py +++ b/plugins/action/business_sda_hostonboarding_ssid_ippool.py @@ -35,6 +35,7 @@ scalableGroupName=dict(type="str"), ssidNames=dict(type="list"), siteNameHierarchy=dict(type="str"), + headers=dict(type="dict"), )) required_if = [ @@ -54,6 +55,7 @@ def __init__(self, params, dnac): scalableGroupName=params.get("scalableGroupName"), ssidNames=params.get("ssidNames"), siteNameHierarchy=params.get("siteNameHierarchy"), + headers=params.get("headers"), ) def get_all_params(self, name=None, id=None): @@ -138,7 +140,7 @@ def update(self): result = None result = self.dnac.exec( family="fabric_wireless", - function="update_ssid_to_ip_pool_mapping2", + function="update_ssid_to_ip_pool_mapping", params=self.update_all_params(), op_modifies=True, ) diff --git a/plugins/action/compliance_device_details_info.py b/plugins/action/compliance_device_details_info.py index 7d18336f4b..4fedf1aab5 100644 --- a/plugins/action/compliance_device_details_info.py +++ b/plugins/action/compliance_device_details_info.py @@ -28,8 +28,8 @@ complianceType=dict(type="str"), complianceStatus=dict(type="str"), deviceUuid=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), headers=dict(type="dict"), )) diff --git a/plugins/action/configuration_template_deploy.py b/plugins/action/configuration_template_deploy.py index 48ccdcf3ad..55b033a763 100644 --- a/plugins/action/configuration_template_deploy.py +++ b/plugins/action/configuration_template_deploy.py @@ -28,7 +28,7 @@ forcePushTemplate=dict(type="bool"), isComposite=dict(type="bool"), mainTemplateId=dict(type="str"), - memberTemplateDeploymentInfo=dict(type="list"), + memberTemplateDeploymentInfo=dict(type="str"), targetInfo=dict(type="list"), templateId=dict(type="str"), )) diff --git a/plugins/action/configuration_template_deploy_v2.py b/plugins/action/configuration_template_deploy_v2.py index fe1ec9b760..802c84d98b 100644 --- a/plugins/action/configuration_template_deploy_v2.py +++ b/plugins/action/configuration_template_deploy_v2.py @@ -28,7 +28,7 @@ forcePushTemplate=dict(type="bool"), isComposite=dict(type="bool"), mainTemplateId=dict(type="str"), - memberTemplateDeploymentInfo=dict(type="list"), + memberTemplateDeploymentInfo=dict(type="str"), targetInfo=dict(type="list"), templateId=dict(type="str"), )) diff --git a/plugins/action/configuration_template_project.py b/plugins/action/configuration_template_project.py index 65017e94d1..e6e356aa0b 100644 --- a/plugins/action/configuration_template_project.py +++ b/plugins/action/configuration_template_project.py @@ -37,7 +37,7 @@ id=dict(type="str"), lastUpdateTime=dict(type="int"), name=dict(type="str"), - templates=dict(type="list"), + templates=dict(type="dict"), projectId=dict(type="str"), )) diff --git a/plugins/action/credential_to_site_by_siteid_create_v2.py b/plugins/action/credential_to_site_by_siteid_create_v2.py new file mode 100644 index 0000000000..9c20820a32 --- /dev/null +++ b/plugins/action/credential_to_site_by_siteid_create_v2.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + cliId=dict(type="str"), + snmpV2ReadId=dict(type="str"), + snmpV2WriteId=dict(type="str"), + snmpV3Id=dict(type="str"), + httpRead=dict(type="str"), + httpWrite=dict(type="str"), + siteId=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + cliId=params.get("cliId"), + snmpV2ReadId=params.get("snmpV2ReadId"), + snmpV2WriteId=params.get("snmpV2WriteId"), + snmpV3Id=params.get("snmpV3Id"), + httpRead=params.get("httpRead"), + httpWrite=params.get("httpWrite"), + site_id=params.get("siteId"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='assign_device_credential_to_site_v2', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/device_interface_info.py b/plugins/action/device_interface_info.py index d1923f51f3..085c24c71e 100644 --- a/plugins/action/device_interface_info.py +++ b/plugins/action/device_interface_info.py @@ -27,6 +27,8 @@ argument_spec.update(dict( offset=dict(type="int"), limit=dict(type="int"), + lastInputTime=dict(type="str"), + lastOutputTime=dict(type="str"), id=dict(type="str"), headers=dict(type="dict"), )) @@ -68,6 +70,8 @@ def get_object(self, params): new_object = dict( offset=params.get("offset"), limit=params.get("limit"), + last_input_time=params.get("lastInputTime"), + last_output_time=params.get("lastOutputTime"), id=params.get("id"), headers=params.get("headers"), ) diff --git a/plugins/action/device_reboot_apreboot_info.py b/plugins/action/device_reboot_apreboot_info.py new file mode 100644 index 0000000000..e42c86d1be --- /dev/null +++ b/plugins/action/device_reboot_apreboot_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + parentTaskId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + parent_task_id=params.get("parentTaskId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='get_access_point_reboot_task_result', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/dnac_packages_info.py b/plugins/action/dnac_packages_info.py new file mode 100644 index 0000000000..04d7c84de5 --- /dev/null +++ b/plugins/action/dnac_packages_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="platform", + function='cisco_dna_center_packages_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/eox_status_device_info.py b/plugins/action/eox_status_device_info.py new file mode 100644 index 0000000000..06ef71e8bd --- /dev/null +++ b/plugins/action/eox_status_device_info.py @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + deviceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + device_id=params.get("deviceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("deviceId") + if id: + response = dnac.exec( + family="eo_x", + function='get_eo_x_details_per_device', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + response = dnac.exec( + family="eo_x", + function='get_eo_x_status_for_all_devices', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/eox_status_summary_info.py b/plugins/action/eox_status_summary_info.py new file mode 100644 index 0000000000..5b449d6623 --- /dev/null +++ b/plugins/action/eox_status_summary_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="eo_x", + function='get_eo_x_summary', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/event_email_config.py b/plugins/action/event_email_config.py new file mode 100644 index 0000000000..a80fe0eb03 --- /dev/null +++ b/plugins/action/event_email_config.py @@ -0,0 +1,221 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + emailConfigId=dict(type="str"), + primarySMTPConfig=dict(type="dict"), + secondarySMTPConfig=dict(type="dict"), + fromEmail=dict(type="str"), + toEmail=dict(type="str"), + subject=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class EventEmailConfig(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + emailConfigId=params.get("emailConfigId"), + primarySMTPConfig=params.get("primarySMTPConfig"), + secondarySMTPConfig=params.get("secondarySMTPConfig"), + fromEmail=params.get("fromEmail"), + toEmail=params.get("toEmail"), + subject=params.get("subject"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['emailConfigId'] = self.new_object.get('emailConfigId') + new_object_params['primarySMTPConfig'] = self.new_object.get('primarySMTPConfig') + new_object_params['secondarySMTPConfig'] = self.new_object.get('secondarySMTPConfig') + new_object_params['fromEmail'] = self.new_object.get('fromEmail') + new_object_params['toEmail'] = self.new_object.get('toEmail') + new_object_params['subject'] = self.new_object.get('subject') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['emailConfigId'] = self.new_object.get('emailConfigId') + new_object_params['primarySMTPConfig'] = self.new_object.get('primarySMTPConfig') + new_object_params['secondarySMTPConfig'] = self.new_object.get('secondarySMTPConfig') + new_object_params['fromEmail'] = self.new_object.get('fromEmail') + new_object_params['toEmail'] = self.new_object.get('toEmail') + new_object_params['subject'] = self.new_object.get('subject') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="event_management", + function="get_email_destination", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("emailConfigId", "emailConfigId"), + ("primarySMTPConfig", "primarySMTPConfig"), + ("secondarySMTPConfig", "secondarySMTPConfig"), + ("fromEmail", "fromEmail"), + ("toEmail", "toEmail"), + ("subject", "subject"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="event_management", + function="create_email_destination", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="event_management", + function="update_email_destination", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = EventEmailConfig(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/event_email_config_info.py b/plugins/action/event_email_config_info.py new file mode 100644 index 0000000000..1e380d1ae2 --- /dev/null +++ b/plugins/action/event_email_config_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_email_destination', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/event_snmp_config_info.py b/plugins/action/event_snmp_config_info.py new file mode 100644 index 0000000000..1bc024081f --- /dev/null +++ b/plugins/action/event_snmp_config_info.py @@ -0,0 +1,97 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + configId=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + config_id=params.get("configId"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_snmp_destination', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/event_syslog_config.py b/plugins/action/event_syslog_config.py new file mode 100644 index 0000000000..e4aae36bbe --- /dev/null +++ b/plugins/action/event_syslog_config.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + configId=dict(type="str"), + name=dict(type="str"), + description=dict(type="str"), + host=dict(type="str"), + protocol=dict(type="str"), + port=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["name"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class EventSyslogConfig(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + configId=params.get("configId"), + name=params.get("name"), + description=params.get("description"), + host=params.get("host"), + protocol=params.get("protocol"), + port=params.get("port"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['config_id'] = self.new_object.get('configId') or \ + self.new_object.get('config_id') + new_object_params['name'] = name or self.new_object.get('name') + new_object_params['protocol'] = self.new_object.get('protocol') + new_object_params['offset'] = self.new_object.get('offset') + new_object_params['limit'] = self.new_object.get('limit') + new_object_params['sort_by'] = self.new_object.get('sortBy') or \ + self.new_object.get('sort_by') + new_object_params['order'] = self.new_object.get('order') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['configId'] = self.new_object.get('configId') + new_object_params['name'] = self.new_object.get('name') + new_object_params['description'] = self.new_object.get('description') + new_object_params['host'] = self.new_object.get('host') + new_object_params['protocol'] = self.new_object.get('protocol') + new_object_params['port'] = self.new_object.get('port') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['configId'] = self.new_object.get('configId') + new_object_params['name'] = self.new_object.get('name') + new_object_params['description'] = self.new_object.get('description') + new_object_params['host'] = self.new_object.get('host') + new_object_params['protocol'] = self.new_object.get('protocol') + new_object_params['port'] = self.new_object.get('port') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="event_management", + function="get_syslog_destination", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("configId", "configId"), + ("name", "name"), + ("description", "description"), + ("host", "host"), + ("protocol", "protocol"), + ("port", "port"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="event_management", + function="create_syslog_destination", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="event_management", + function="update_syslog_destination", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = EventSyslogConfig(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/event_syslog_config_info.py b/plugins/action/event_syslog_config_info.py new file mode 100644 index 0000000000..bcef02393f --- /dev/null +++ b/plugins/action/event_syslog_config_info.py @@ -0,0 +1,101 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + configId=dict(type="str"), + name=dict(type="str"), + protocol=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), + sortBy=dict(type="str"), + order=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + config_id=params.get("configId"), + name=params.get("name"), + protocol=params.get("protocol"), + offset=params.get("offset"), + limit=params.get("limit"), + sort_by=params.get("sortBy"), + order=params.get("order"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="event_management", + function='get_syslog_destination', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/execute_suggested_actions_commands.py b/plugins/action/execute_suggested_actions_commands.py new file mode 100644 index 0000000000..48d7108aee --- /dev/null +++ b/plugins/action/execute_suggested_actions_commands.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + entity_type=dict(type="str"), + entity_value=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + entity_type=params.get("entity_type"), + entity_value=params.get("entity_value"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="issues", + function='execute_suggested_actions_commands', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/global_credential_v2.py b/plugins/action/global_credential_v2.py new file mode 100644 index 0000000000..1831c0457e --- /dev/null +++ b/plugins/action/global_credential_v2.py @@ -0,0 +1,270 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + cliCredential=dict(type="list"), + snmpV2cRead=dict(type="list"), + snmpV2cWrite=dict(type="list"), + snmpV3=dict(type="list"), + httpsRead=dict(type="list"), + httpsWrite=dict(type="list"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id"], True), + ("state", "absent", ["id"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class GlobalCredentialV2(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + cliCredential=params.get("cliCredential"), + snmpV2cRead=params.get("snmpV2cRead"), + snmpV2cWrite=params.get("snmpV2cWrite"), + snmpV3=params.get("snmpV3"), + httpsRead=params.get("httpsRead"), + httpsWrite=params.get("httpsWrite"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['cliCredential'] = self.new_object.get('cliCredential') + new_object_params['snmpV2cRead'] = self.new_object.get('snmpV2cRead') + new_object_params['snmpV2cWrite'] = self.new_object.get('snmpV2cWrite') + new_object_params['snmpV3'] = self.new_object.get('snmpV3') + new_object_params['httpsRead'] = self.new_object.get('httpsRead') + new_object_params['httpsWrite'] = self.new_object.get('httpsWrite') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['cliCredential'] = self.new_object.get('cliCredential') + new_object_params['snmpV2cRead'] = self.new_object.get('snmpV2cRead') + new_object_params['snmpV2cWrite'] = self.new_object.get('snmpV2cWrite') + new_object_params['snmpV3'] = self.new_object.get('snmpV3') + new_object_params['httpsRead'] = self.new_object.get('httpsRead') + new_object_params['httpsWrite'] = self.new_object.get('httpsWrite') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="discovery", + function="get_all_global_credentials_v2", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="discovery", + function="get_all_global_credentials_v2", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("cliCredential", "cliCredential"), + ("snmpV2cRead", "snmpV2cRead"), + ("snmpV2cWrite", "snmpV2cWrite"), + ("snmpV3", "snmpV3"), + ("httpsRead", "httpsRead"), + ("httpsWrite", "httpsWrite"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="discovery", + function="create_global_credentials_v2", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="discovery", + function="update_global_credentials_v2", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="discovery", + function="delete_global_credential_v2", + params=self.delete_by_id_params(), + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = GlobalCredentialV2(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/global_credential_v2_info.py b/plugins/action/global_credential_v2_info.py new file mode 100644 index 0000000000..128a49ecc5 --- /dev/null +++ b/plugins/action/global_credential_v2_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="discovery", + function='get_all_global_credentials_v2', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/global_pool_info.py b/plugins/action/global_pool_info.py index 74742e4763..56c0161a08 100644 --- a/plugins/action/global_pool_info.py +++ b/plugins/action/global_pool_info.py @@ -25,8 +25,8 @@ argument_spec = dnac_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), headers=dict(type="dict"), )) diff --git a/plugins/action/integration_settings_instances_itsm.py b/plugins/action/integration_settings_instances_itsm.py new file mode 100644 index 0000000000..1b12af772f --- /dev/null +++ b/plugins/action/integration_settings_instances_itsm.py @@ -0,0 +1,260 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + description=dict(type="str"), + data=dict(type="dict"), + dypName=dict(type="str"), + instanceId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["instanceId", "name"], True), + ("state", "absent", ["instanceId", "name"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class IntegrationSettingsInstancesItsm(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + name=params.get("name"), + description=params.get("description"), + data=params.get("data"), + dypName=params.get("dypName"), + instance_id=params.get("instanceId"), + ) + + def create_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['description'] = self.new_object.get('description') + new_object_params['data'] = self.new_object.get('data') + new_object_params['dypName'] = self.new_object.get('dypName') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['instance_id'] = self.new_object.get('instance_id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['description'] = self.new_object.get('description') + new_object_params['data'] = self.new_object.get('data') + new_object_params['dypName'] = self.new_object.get('dypName') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + # NOTE: Does not have get all + return result + + def get_object_by_id(self, id): + result = None + try: + items = self.dnac.exec( + family="itsm_integration", + function="get_itsm_integration_setting_by_id", + params={"instance_id": id} + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'instanceId', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("instance_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("instanceId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(instance_id=_id)) + if _id: + prev_obj = self.get_object_by_id(_id) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("description", "description"), + ("data", "data"), + ("dypName", "dypName"), + ("instanceId", "instance_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="itsm_integration", + function="create_itsm_integration_setting", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + id = id or self.new_object.get("instance_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("instanceId") + if id_: + self.new_object.update(dict(instance_id=id_)) + result = self.dnac.exec( + family="itsm_integration", + function="update_itsm_integration_setting", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + id = id or self.new_object.get("instance_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("instanceId") + if id_: + self.new_object.update(dict(instance_id=id_)) + result = self.dnac.exec( + family="itsm_integration", + function="delete_itsm_integration_setting", + params=self.delete_by_id_params(), + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = IntegrationSettingsInstancesItsm(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/integration_settings_instances_itsm_info.py b/plugins/action/integration_settings_instances_itsm_info.py new file mode 100644 index 0000000000..0d4bb91a83 --- /dev/null +++ b/plugins/action/integration_settings_instances_itsm_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + instanceId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + instance_id=params.get("instanceId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("instanceId") + if id: + response = dnac.exec( + family="itsm_integration", + function='get_itsm_integration_setting_by_id', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/lan_automation_create.py b/plugins/action/lan_automation_create.py index db28ee8814..5d6a732d00 100644 --- a/plugins/action/lan_automation_create.py +++ b/plugins/action/lan_automation_create.py @@ -77,7 +77,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="lan_automation", - function='lan_automation2', + function='lan_automation_start', op_modifies=True, params=self.get_object(self._task.args), ) diff --git a/plugins/action/lan_automation_delete.py b/plugins/action/lan_automation_delete.py index 99ace58aef..28bf35b793 100644 --- a/plugins/action/lan_automation_delete.py +++ b/plugins/action/lan_automation_delete.py @@ -77,7 +77,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="lan_automation", - function="lan_automation", + function="lan_automation_stop", params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/lan_automation_log_by_serial_number_info.py b/plugins/action/lan_automation_log_by_serial_number_info.py new file mode 100644 index 0000000000..eaea3d0bdc --- /dev/null +++ b/plugins/action/lan_automation_log_by_serial_number_info.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + serialNumber=dict(type="str"), + logLevel=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + serial_number=params.get("serialNumber"), + log_level=params.get("logLevel"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + id = self._task.args.get("id") + if id: + response = dnac.exec( + family="lan_automation", + function='lan_automation_logs_for_individual_devices', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result + if not id: + # NOTE: Does not have a get all method or it is in another action + response = None + dnac.object_modify_result(changed=False, result="Module does not have get all, check arguments of module") + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/lan_automation_log_info.py b/plugins/action/lan_automation_log_info.py index 0d7d1b5cb8..dfa702581c 100644 --- a/plugins/action/lan_automation_log_info.py +++ b/plugins/action/lan_automation_log_info.py @@ -25,8 +25,8 @@ argument_spec = dnac_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), id=dict(type="str"), headers=dict(type="dict"), )) diff --git a/plugins/action/lan_automation_status_info.py b/plugins/action/lan_automation_status_info.py index 880864a83e..073cfb275f 100644 --- a/plugins/action/lan_automation_status_info.py +++ b/plugins/action/lan_automation_status_info.py @@ -25,8 +25,8 @@ argument_spec = dnac_argument_spec() # Add arguments specific for this module argument_spec.update(dict( - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), id=dict(type="str"), headers=dict(type="dict"), )) diff --git a/plugins/action/license_device_count_info.py b/plugins/action/license_device_count_info.py index efe972b399..e73e32515e 100644 --- a/plugins/action/license_device_count_info.py +++ b/plugins/action/license_device_count_info.py @@ -89,7 +89,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="licenses", - function='device_count_details', + function='device_count_details2', params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/license_device_deregistration.py b/plugins/action/license_device_deregistration.py index cfed982331..5e170aa99b 100644 --- a/plugins/action/license_device_deregistration.py +++ b/plugins/action/license_device_deregistration.py @@ -77,7 +77,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="licenses", - function='device_deregistration', + function='device_deregistration2', op_modifies=True, params=self.get_object(self._task.args), ) diff --git a/plugins/action/license_device_license_details_info.py b/plugins/action/license_device_license_details_info.py index 81633b368b..8ffd3fe3d0 100644 --- a/plugins/action/license_device_license_details_info.py +++ b/plugins/action/license_device_license_details_info.py @@ -81,7 +81,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="licenses", - function='device_license_details', + function='device_license_details2', params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/license_device_license_summary_info.py b/plugins/action/license_device_license_summary_info.py index ff8875c0a5..af82708cae 100644 --- a/plugins/action/license_device_license_summary_info.py +++ b/plugins/action/license_device_license_summary_info.py @@ -99,7 +99,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="licenses", - function='device_license_summary', + function='device_license_summary2', params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/license_device_registration.py b/plugins/action/license_device_registration.py index 512de8433d..18e6755d1d 100644 --- a/plugins/action/license_device_registration.py +++ b/plugins/action/license_device_registration.py @@ -79,7 +79,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="licenses", - function='device_registration', + function='device_registration2', op_modifies=True, params=self.get_object(self._task.args), ) diff --git a/plugins/action/license_term_details_info.py b/plugins/action/license_term_details_info.py index 6f342d1067..e7e027718c 100644 --- a/plugins/action/license_term_details_info.py +++ b/plugins/action/license_term_details_info.py @@ -87,7 +87,7 @@ def run(self, tmp=None, task_vars=None): if name: response = dnac.exec( family="licenses", - function='license_term_details', + function='license_term_details2', params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/license_usage_details_info.py b/plugins/action/license_usage_details_info.py index e9d8e4ae8c..51a84a744c 100644 --- a/plugins/action/license_usage_details_info.py +++ b/plugins/action/license_usage_details_info.py @@ -87,7 +87,7 @@ def run(self, tmp=None, task_vars=None): if name: response = dnac.exec( family="licenses", - function='license_usage_details', + function='license_usage_details2', params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/license_virtual_account_change.py b/plugins/action/license_virtual_account_change.py index 0c85ea7862..f4fba19014 100644 --- a/plugins/action/license_virtual_account_change.py +++ b/plugins/action/license_virtual_account_change.py @@ -81,7 +81,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="licenses", - function='change_virtual_account', + function='change_virtual_account2', op_modifies=True, params=self.get_object(self._task.args), ) diff --git a/plugins/action/license_virtual_account_details_info.py b/plugins/action/license_virtual_account_details_info.py index 8632418fee..162c24b60a 100644 --- a/plugins/action/license_virtual_account_details_info.py +++ b/plugins/action/license_virtual_account_details_info.py @@ -81,7 +81,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="licenses", - function='virtual_account_details', + function='virtual_account_details2', params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/network_device_inventory_insight_link_mismatch_info.py b/plugins/action/network_device_inventory_insight_link_mismatch_info.py index 773e95975e..63cdcd94bd 100644 --- a/plugins/action/network_device_inventory_insight_link_mismatch_info.py +++ b/plugins/action/network_device_inventory_insight_link_mismatch_info.py @@ -26,8 +26,8 @@ # Add arguments specific for this module argument_spec.update(dict( siteId=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), category=dict(type="str"), sortBy=dict(type="str"), order=dict(type="str"), diff --git a/plugins/action/network_device_module_info.py b/plugins/action/network_device_module_info.py index 1333497ba0..b4a18aded5 100644 --- a/plugins/action/network_device_module_info.py +++ b/plugins/action/network_device_module_info.py @@ -26,8 +26,8 @@ # Add arguments specific for this module argument_spec.update(dict( deviceId=dict(type="str"), - limit=dict(type="str"), - offset=dict(type="str"), + limit=dict(type="int"), + offset=dict(type="int"), nameList=dict(type="list"), vendorEquipmentTypeList=dict(type="list"), partNumberList=dict(type="list"), diff --git a/plugins/action/network_device_register_for_wsa_info.py b/plugins/action/network_device_register_for_wsa_info.py index f5871af3cb..98532f72e1 100644 --- a/plugins/action/network_device_register_for_wsa_info.py +++ b/plugins/action/network_device_register_for_wsa_info.py @@ -83,7 +83,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="devices", - function='register_device_for_wsa', + function='get_devices_registered_for_wsa_notification', params=self.get_object(self._task.args), ) self._result.update(dict(dnac_response=response)) diff --git a/plugins/action/network_device_user_defined_field.py b/plugins/action/network_device_user_defined_field.py new file mode 100644 index 0000000000..724221ee90 --- /dev/null +++ b/plugins/action/network_device_user_defined_field.py @@ -0,0 +1,259 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present", "absent"]), + name=dict(type="str"), + description=dict(type="str"), + id=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["id", "name"], True), + ("state", "absent", ["id", "name"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NetworkDeviceUserDefinedField(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + name=params.get("name"), + description=params.get("description"), + id=params.get("id"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['id'] = id or self.new_object.get('id') + new_object_params['name'] = name or self.new_object.get('name') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['description'] = self.new_object.get('description') + return new_object_params + + def delete_by_id_params(self): + new_object_params = {} + new_object_params['id'] = self.new_object.get('id') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['name'] = self.new_object.get('name') + new_object_params['description'] = self.new_object.get('description') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method or it is in another action + try: + items = self.dnac.exec( + family="devices", + function="get_all_user_defined_fields", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + try: + items = self.dnac.exec( + family="devices", + function="get_all_user_defined_fields", + params=self.get_all_params(id=id), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'id', id) + except Exception: + result = None + return result + + def exists(self): + id_exists = False + name_exists = False + prev_obj = None + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("name", "name"), + ("description", "description"), + ("id", "id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="devices", + function="create_user_defined_field", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="devices", + function="update_user_defined_field", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + def delete(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + if id_: + self.new_object.update(dict(id=id_)) + result = self.dnac.exec( + family="devices", + function="delete_user_defined_field", + params=self.delete_by_id_params(), + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = NetworkDeviceUserDefinedField(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + elif state == "absent": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + response = obj.delete() + dnac.object_deleted() + else: + dnac.object_already_absent() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/network_device_user_defined_field_info.py b/plugins/action/network_device_user_defined_field_info.py new file mode 100644 index 0000000000..463db72de9 --- /dev/null +++ b/plugins/action/network_device_user_defined_field_info.py @@ -0,0 +1,91 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + id=dict(type="str"), + name=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + id=params.get("id"), + name=params.get("name"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="devices", + function='get_all_user_defined_fields', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/network_device_with_snmp_v3_des_info.py b/plugins/action/network_device_with_snmp_v3_des_info.py index a4acc66901..8650c51d9e 100644 --- a/plugins/action/network_device_with_snmp_v3_des_info.py +++ b/plugins/action/network_device_with_snmp_v3_des_info.py @@ -26,8 +26,8 @@ # Add arguments specific for this module argument_spec.update(dict( siteId=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), sortBy=dict(type="str"), order=dict(type="str"), headers=dict(type="dict"), diff --git a/plugins/action/network_v2.py b/plugins/action/network_v2.py new file mode 100644 index 0000000000..c1d4d0c1c2 --- /dev/null +++ b/plugins/action/network_v2.py @@ -0,0 +1,214 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + settings=dict(type="dict"), + siteId=dict(type="str"), +)) + +required_if = [ + ("state", "present", ["settings", "siteId"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class NetworkV2(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + settings=params.get("settings"), + site_id=params.get("siteId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['site_id'] = self.new_object.get('siteId') or \ + self.new_object.get('site_id') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['settings'] = self.new_object.get('settings') + return new_object_params + + def update_by_id_params(self): + new_object_params = {} + new_object_params['settings'] = self.new_object.get('settings') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="network_settings", + function="get_network_v2", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + o_id = o_id or self.new_object.get("site_id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + _id = _id or prev_obj.get("siteId") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + self.new_object.update(dict(site_id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("settings", "settings"), + ("siteId", "site_id"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="network_settings", + function="create_network_v2", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + id = id or self.new_object.get("site_id") + name = self.new_object.get("name") + result = None + if not id: + prev_obj_name = self.get_object_by_name(name) + id_ = None + if prev_obj_name: + id_ = prev_obj_name.get("id") + id_ = id_ or prev_obj_name.get("siteId") + if id_: + self.new_object.update(dict(site_id=id_)) + result = self.dnac.exec( + family="network_settings", + function="update_network_v2", + params=self.update_by_id_params(), + op_modifies=True, + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = NetworkV2(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/network_v2_info.py b/plugins/action/network_v2_info.py new file mode 100644 index 0000000000..39f1e6b208 --- /dev/null +++ b/plugins/action/network_v2_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + siteId=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + site_id=params.get("siteId"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='get_network_v2', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/nfv_profile_info.py b/plugins/action/nfv_profile_info.py index 0ab5fec881..ce5a8308b5 100644 --- a/plugins/action/nfv_profile_info.py +++ b/plugins/action/nfv_profile_info.py @@ -26,8 +26,8 @@ # Add arguments specific for this module argument_spec.update(dict( id=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), name=dict(type="str"), headers=dict(type="dict"), )) diff --git a/plugins/action/path_trace_info.py b/plugins/action/path_trace_info.py index d0ff805121..be9d0dbc26 100644 --- a/plugins/action/path_trace_info.py +++ b/plugins/action/path_trace_info.py @@ -36,8 +36,8 @@ status=dict(type="str"), taskId=dict(type="str"), lastUpdateTime=dict(type="str"), - limit=dict(type="str"), - offset=dict(type="str"), + limit=dict(type="int"), + offset=dict(type="int"), order=dict(type="str"), sortBy=dict(type="str"), flowAnalysisId=dict(type="str"), diff --git a/plugins/action/pnp_device_claim_to_site.py b/plugins/action/pnp_device_claim_to_site.py index e98e13fb4d..1ec73115c2 100644 --- a/plugins/action/pnp_device_claim_to_site.py +++ b/plugins/action/pnp_device_claim_to_site.py @@ -29,16 +29,14 @@ siteId=dict(type="str"), type=dict(type="str"), imageInfo=dict(type="dict"), - configInfo=dict(type="dict"), - hostname=dict(type="str"), - gateway=dict(type="str"), - imageId=dict(type="str"), - removeInactive=dict(type="bool"), - ipInterfaceName=dict(type="str"), + configInfo=dict(type="list"), rfProfile=dict(type="str"), staticIP=dict(type="str"), subnetMask=dict(type="str"), - vlanId=dict(type="str"), + gateway=dict(type="str"), + vlanID=dict(type="str"), + interfaceName=dict(type="str"), + sensorProfile=dict(type="str"), )) required_if = [] @@ -81,15 +79,13 @@ def get_object(self, params): type=params.get("type"), imageInfo=params.get("imageInfo"), configInfo=params.get("configInfo"), - hostname=params.get("hostname"), - gateway=params.get("gateway"), - imageId=params.get("imageId"), - removeInactive=params.get("removeInactive"), - ipInterfaceName=params.get("ipInterfaceName"), rfProfile=params.get("rfProfile"), staticIP=params.get("staticIP"), subnetMask=params.get("subnetMask"), - vlanId=params.get("vlanId"), + gateway=params.get("gateway"), + vlanID=params.get("vlanID"), + interfaceName=params.get("interfaceName"), + sensorProfile=params.get("sensorProfile"), ) return new_object diff --git a/plugins/action/reserve_ip_subpool_info.py b/plugins/action/reserve_ip_subpool_info.py index 48238b14c6..c704db1ef9 100644 --- a/plugins/action/reserve_ip_subpool_info.py +++ b/plugins/action/reserve_ip_subpool_info.py @@ -26,8 +26,8 @@ # Add arguments specific for this module argument_spec.update(dict( siteId=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), headers=dict(type="dict"), )) diff --git a/plugins/action/role_permissions_info.py b/plugins/action/role_permissions_info.py new file mode 100644 index 0000000000..39728ba461 --- /dev/null +++ b/plugins/action/role_permissions_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="userand_roles", + function='get_permissions_ap_i', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/roles_info.py b/plugins/action/roles_info.py new file mode 100644 index 0000000000..380c9c6875 --- /dev/null +++ b/plugins/action/roles_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="userand_roles", + function='get_roles_ap_i', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/sda_fabric_border_device.py b/plugins/action/sda_fabric_border_device.py index 3712ebb2c9..bea41a1139 100644 --- a/plugins/action/sda_fabric_border_device.py +++ b/plugins/action/sda_fabric_border_device.py @@ -112,9 +112,11 @@ def requires_update(self, current_obj): ("deviceManagementIpAddress", "deviceManagementIpAddress"), ("siteNameHierarchy", "siteNameHierarchy"), ("deviceRole", "deviceRole"), + ("routeDistributionProtocol", "routeDistributionProtocol"), ("externalDomainRoutingProtocolName", "externalDomainRoutingProtocolName"), ("externalConnectivityIpPoolName", "externalConnectivityIpPoolName"), ("internalAutonomouSystemNumber", "internalAutonomouSystemNumber"), + ("borderPriority", "borderPriority"), ("borderSessionType", "borderSessionType"), ("connectedToInternet", "connectedToInternet"), ("sdaTransitNetworkName", "sdaTransitNetworkName"), diff --git a/plugins/action/sda_fabric_control_plane_device.py b/plugins/action/sda_fabric_control_plane_device.py index 57d82953a4..1bb2fd0716 100644 --- a/plugins/action/sda_fabric_control_plane_device.py +++ b/plugins/action/sda_fabric_control_plane_device.py @@ -32,12 +32,12 @@ # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - payload=dict(type="list"), deviceManagementIpAddress=dict(type="str"), + siteNameHierarchy=dict(type="str"), + routeDistributionProtocol=dict(type="str"), )) required_if = [ - ("state", "present", ["payload"], True), ] required_one_of = [] mutually_exclusive = [] @@ -48,7 +48,9 @@ class SdaFabricControlPlaneDevice(object): def __init__(self, params, dnac): self.dnac = dnac self.new_object = dict( - payload=params.get("payload"), + deviceManagementIpAddress=params.get("deviceManagementIpAddress"), + siteNameHierarchy=params.get("siteNameHierarchy"), + routeDistributionProtocol=params.get("routeDistributionProtocol"), device_management_ip_address=params.get("deviceManagementIpAddress"), ) @@ -60,7 +62,9 @@ def get_all_params(self, name=None, id=None): def create_params(self): new_object_params = {} - new_object_params['payload'] = self.new_object.get('payload') + new_object_params['deviceManagementIpAddress'] = self.new_object.get('deviceManagementIpAddress') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + new_object_params['routeDistributionProtocol'] = self.new_object.get('routeDistributionProtocol') return new_object_params def delete_all_params(self): @@ -104,13 +108,12 @@ def exists(self, is_absent=False): return (it_exists, prev_obj) def requires_update(self, current_obj): - requested_obj = self.new_object.get('payload') - if requested_obj and len(requested_obj) > 0: - requested_obj = requested_obj[0] + requested_obj = self.new_object obj_params = [ ("deviceManagementIpAddress", "deviceManagementIpAddress"), ("siteNameHierarchy", "siteNameHierarchy"), + ("routeDistributionProtocol", "routeDistributionProtocol"), ("deviceManagementIpAddress", "device_management_ip_address"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/plugins/action/sda_fabric_edge_device.py b/plugins/action/sda_fabric_edge_device.py index b2ee07d94d..d51e6f00b2 100644 --- a/plugins/action/sda_fabric_edge_device.py +++ b/plugins/action/sda_fabric_edge_device.py @@ -32,13 +32,11 @@ # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - payload=dict(type="list"), deviceManagementIpAddress=dict(type="str"), + siteNameHierarchy=dict(type="str"), )) required_if = [ - ("state", "present", ["payload"], True), - ("state", "absent", ["deviceManagementIpAddress"], True), ] required_one_of = [] mutually_exclusive = [] @@ -49,7 +47,8 @@ class SdaFabricEdgeDevice(object): def __init__(self, params, dnac): self.dnac = dnac self.new_object = dict( - payload=params.get("payload"), + deviceManagementIpAddress=params.get("deviceManagementIpAddress"), + siteNameHierarchy=params.get("siteNameHierarchy"), device_management_ip_address=params.get("deviceManagementIpAddress"), ) @@ -61,7 +60,8 @@ def get_all_params(self, name=None, id=None): def create_params(self): new_object_params = {} - new_object_params['payload'] = self.new_object.get('payload') + new_object_params['deviceManagementIpAddress'] = self.new_object.get('deviceManagementIpAddress') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') return new_object_params def delete_all_params(self): @@ -105,9 +105,7 @@ def exists(self, is_absent=False): return (it_exists, prev_obj) def requires_update(self, current_obj): - requested_obj = self.new_object.get('payload') - if requested_obj and len(requested_obj) > 0: - requested_obj = requested_obj[0] + requested_obj = self.new_object obj_params = [ ("deviceManagementIpAddress", "deviceManagementIpAddress"), diff --git a/plugins/action/sda_fabric_site.py b/plugins/action/sda_fabric_site.py index 198a8d1246..2b1be14c47 100644 --- a/plugins/action/sda_fabric_site.py +++ b/plugins/action/sda_fabric_site.py @@ -34,6 +34,7 @@ state=dict(type="str", default="present", choices=["present", "absent"]), fabricName=dict(type="str"), siteNameHierarchy=dict(type="str"), + fabricType=dict(type="str"), )) required_if = [ @@ -49,6 +50,7 @@ def __init__(self, params, dnac): self.new_object = dict( fabricName=params.get("fabricName"), siteNameHierarchy=params.get("siteNameHierarchy"), + fabricType=params.get("fabricType"), site_name_hierarchy=params.get("siteNameHierarchy"), ) @@ -62,6 +64,7 @@ def create_params(self): new_object_params = {} new_object_params['fabricName'] = self.new_object.get('fabricName') new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') + new_object_params['fabricType'] = self.new_object.get('fabricType') return new_object_params def delete_all_params(self): @@ -110,6 +113,7 @@ def requires_update(self, current_obj): obj_params = [ ("fabricName", "fabricName"), ("siteNameHierarchy", "siteNameHierarchy"), + ("fabricType", "fabricType"), ("siteNameHierarchy", "site_name_hierarchy"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params diff --git a/plugins/action/sda_port_assignment_for_user_device.py b/plugins/action/sda_port_assignment_for_user_device.py index bcd2fe0964..02c99ae152 100644 --- a/plugins/action/sda_port_assignment_for_user_device.py +++ b/plugins/action/sda_port_assignment_for_user_device.py @@ -35,6 +35,7 @@ siteNameHierarchy=dict(type="str"), deviceManagementIpAddress=dict(type="str"), interfaceName=dict(type="str"), + interfaceNames=dict(type="list"), dataIpAddressPoolName=dict(type="str"), voiceIpAddressPoolName=dict(type="str"), authenticateTemplateName=dict(type="str"), @@ -56,6 +57,7 @@ def __init__(self, params, dnac): siteNameHierarchy=params.get("siteNameHierarchy"), deviceManagementIpAddress=params.get("deviceManagementIpAddress"), interfaceName=params.get("interfaceName"), + interfaceNames=params.get("interfaceNames"), dataIpAddressPoolName=params.get("dataIpAddressPoolName"), voiceIpAddressPoolName=params.get("voiceIpAddressPoolName"), authenticateTemplateName=params.get("authenticateTemplateName"), @@ -78,6 +80,7 @@ def create_params(self): new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') new_object_params['deviceManagementIpAddress'] = self.new_object.get('deviceManagementIpAddress') new_object_params['interfaceName'] = self.new_object.get('interfaceName') + new_object_params['interfaceNames'] = self.new_object.get('interfaceNames') new_object_params['dataIpAddressPoolName'] = self.new_object.get('dataIpAddressPoolName') new_object_params['voiceIpAddressPoolName'] = self.new_object.get('voiceIpAddressPoolName') new_object_params['authenticateTemplateName'] = self.new_object.get('authenticateTemplateName') @@ -133,6 +136,7 @@ def requires_update(self, current_obj): ("siteNameHierarchy", "siteNameHierarchy"), ("deviceManagementIpAddress", "deviceManagementIpAddress"), ("interfaceName", "interfaceName"), + ("interfaceNames", "interfaceNames"), ("dataIpAddressPoolName", "dataIpAddressPoolName"), ("voiceIpAddressPoolName", "voiceIpAddressPoolName"), ("authenticateTemplateName", "authenticateTemplateName"), diff --git a/plugins/action/sda_virtual_network.py b/plugins/action/sda_virtual_network.py index f67649ca53..a116f29949 100644 --- a/plugins/action/sda_virtual_network.py +++ b/plugins/action/sda_virtual_network.py @@ -32,13 +32,11 @@ # Add arguments specific for this module argument_spec.update(dict( state=dict(type="str", default="present", choices=["present", "absent"]), - payload=dict(type="list"), virtualNetworkName=dict(type="str"), siteNameHierarchy=dict(type="str"), )) required_if = [ - ("state", "present", ["payload"], True), ] required_one_of = [] mutually_exclusive = [] @@ -49,7 +47,8 @@ class SdaVirtualNetwork(object): def __init__(self, params, dnac): self.dnac = dnac self.new_object = dict( - payload=params.get("payload"), + virtualNetworkName=params.get("virtualNetworkName"), + siteNameHierarchy=params.get("siteNameHierarchy"), virtual_network_name=params.get("virtualNetworkName"), site_name_hierarchy=params.get("siteNameHierarchy"), ) @@ -64,7 +63,8 @@ def get_all_params(self, name=None, id=None): def create_params(self): new_object_params = {} - new_object_params['payload'] = self.new_object.get('payload') + new_object_params['virtualNetworkName'] = self.new_object.get('virtualNetworkName') + new_object_params['siteNameHierarchy'] = self.new_object.get('siteNameHierarchy') return new_object_params def delete_all_params(self): @@ -109,9 +109,7 @@ def exists(self, is_absent=False): return (it_exists, prev_obj) def requires_update(self, current_obj): - requested_obj = self.new_object.get('payload') - if requested_obj and len(requested_obj) > 0: - requested_obj = requested_obj[0] + requested_obj = self.new_object obj_params = [ ("virtualNetworkName", "virtualNetworkName"), diff --git a/plugins/action/sda_virtual_network_ip_pool.py b/plugins/action/sda_virtual_network_ip_pool.py index cc38d79efb..27ea5e4683 100644 --- a/plugins/action/sda_virtual_network_ip_pool.py +++ b/plugins/action/sda_virtual_network_ip_pool.py @@ -46,6 +46,7 @@ isWirelessPool=dict(type="bool"), isIpDirectedBroadcast=dict(type="bool"), isCommonPool=dict(type="bool"), + isBridgeModeVm=dict(type="bool"), poolType=dict(type="str"), )) @@ -60,6 +61,7 @@ class SdaVirtualNetworkIpPool(object): def __init__(self, params, dnac): self.dnac = dnac self.new_object = dict( + site_name_hierarchy=params.get("siteNameHierarchy"), siteNameHierarchy=params.get("siteNameHierarchy"), virtualNetworkName=params.get("virtualNetworkName"), isLayer2Only=params.get("isLayer2Only"), @@ -74,8 +76,8 @@ def __init__(self, params, dnac): isWirelessPool=params.get("isWirelessPool"), isIpDirectedBroadcast=params.get("isIpDirectedBroadcast"), isCommonPool=params.get("isCommonPool"), + isBridgeModeVm=params.get("isBridgeModeVm"), poolType=params.get("poolType"), - site_name_hierarchy=params.get("siteNameHierarchy"), virtual_network_name=params.get("virtualNetworkName"), ip_pool_name=params.get("ipPoolName"), ) @@ -106,6 +108,7 @@ def create_params(self): new_object_params['isWirelessPool'] = self.new_object.get('isWirelessPool') new_object_params['isIpDirectedBroadcast'] = self.new_object.get('isIpDirectedBroadcast') new_object_params['isCommonPool'] = self.new_object.get('isCommonPool') + new_object_params['isBridgeModeVm'] = self.new_object.get('isBridgeModeVm') new_object_params['poolType'] = self.new_object.get('poolType') return new_object_params @@ -170,6 +173,7 @@ def requires_update(self, current_obj): ("isWirelessPool", "isWirelessPool"), ("isIpDirectedBroadcast", "isIpDirectedBroadcast"), ("isCommonPool", "isCommonPool"), + ("isBridgeModeVm", "isBridgeModeVm"), ("poolType", "poolType"), ("siteNameHierarchy", "site_name_hierarchy"), ("virtualNetworkName", "virtual_network_name"), diff --git a/plugins/action/sda_virtual_network_v2.py b/plugins/action/sda_virtual_network_v2.py index e6182b51ce..2410e2a326 100644 --- a/plugins/action/sda_virtual_network_v2.py +++ b/plugins/action/sda_virtual_network_v2.py @@ -35,6 +35,7 @@ virtualNetworkName=dict(type="str"), isGuestVirtualNetwork=dict(type="bool"), scalableGroupNames=dict(type="list"), + vManageVpnId=dict(type="str"), )) required_if = [ @@ -51,6 +52,7 @@ def __init__(self, params, dnac): virtualNetworkName=params.get("virtualNetworkName"), isGuestVirtualNetwork=params.get("isGuestVirtualNetwork"), scalableGroupNames=params.get("scalableGroupNames"), + vManageVpnId=params.get("vManageVpnId"), virtual_network_name=params.get("virtualNetworkName"), ) @@ -65,6 +67,7 @@ def create_params(self): new_object_params['virtualNetworkName'] = self.new_object.get('virtualNetworkName') new_object_params['isGuestVirtualNetwork'] = self.new_object.get('isGuestVirtualNetwork') new_object_params['scalableGroupNames'] = self.new_object.get('scalableGroupNames') + new_object_params['vManageVpnId'] = self.new_object.get('vManageVpnId') return new_object_params def delete_all_params(self): @@ -77,6 +80,7 @@ def update_all_params(self): new_object_params['virtualNetworkName'] = self.new_object.get('virtualNetworkName') new_object_params['isGuestVirtualNetwork'] = self.new_object.get('isGuestVirtualNetwork') new_object_params['scalableGroupNames'] = self.new_object.get('scalableGroupNames') + new_object_params['vManageVpnId'] = self.new_object.get('vManageVpnId') return new_object_params def get_object_by_name(self, name, is_absent=False): @@ -121,6 +125,7 @@ def requires_update(self, current_obj): ("virtualNetworkName", "virtualNetworkName"), ("isGuestVirtualNetwork", "isGuestVirtualNetwork"), ("scalableGroupNames", "scalableGroupNames"), + ("vManageVpnId", "vManageVpnId"), ("virtualNetworkName", "virtual_network_name"), ] # Method 1. Params present in request (Ansible) obj are the same as the current (DNAC) params diff --git a/plugins/action/service_provider_v2.py b/plugins/action/service_provider_v2.py new file mode 100644 index 0000000000..36ce8ab086 --- /dev/null +++ b/plugins/action/service_provider_v2.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + settings=dict(type="dict"), +)) + +required_if = [ + ("state", "present", ["settings"], True), +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class ServiceProviderV2(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + settings=params.get("settings"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['settings'] = self.new_object.get('settings') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['settings'] = self.new_object.get('settings') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="network_settings", + function="get_service_provider_details_v2", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("settings", "settings"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="network_settings", + function="create_sp_profile_v2", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="network_settings", + function="update_sp_profile_v2", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = ServiceProviderV2(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/service_provider_v2_info.py b/plugins/action/service_provider_v2_info.py new file mode 100644 index 0000000000..f81c0e81c8 --- /dev/null +++ b/plugins/action/service_provider_v2_info.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function='get_service_provider_details_v2', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/site_assign_credential.py b/plugins/action/site_assign_credential.py index e5a7c0883a..8e7d1841cf 100644 --- a/plugins/action/site_assign_credential.py +++ b/plugins/action/site_assign_credential.py @@ -91,7 +91,7 @@ def run(self, tmp=None, task_vars=None): response = dnac.exec( family="network_settings", - function='assign_credential_to_site', + function='assign_device_credential_to_site', op_modifies=True, params=self.get_object(self._task.args), ) diff --git a/plugins/action/site_info.py b/plugins/action/site_info.py index 92ae021722..73e2733a18 100644 --- a/plugins/action/site_info.py +++ b/plugins/action/site_info.py @@ -28,8 +28,8 @@ name=dict(type="str"), siteId=dict(type="str"), type=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), headers=dict(type="dict"), )) diff --git a/plugins/action/site_membership_info.py b/plugins/action/site_membership_info.py index a29401803c..7c5ec8467f 100644 --- a/plugins/action/site_membership_info.py +++ b/plugins/action/site_membership_info.py @@ -26,8 +26,8 @@ # Add arguments specific for this module argument_spec.update(dict( siteId=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), deviceFamily=dict(type="str"), serialNumber=dict(type="str"), headers=dict(type="dict"), diff --git a/plugins/action/sp_profile_delete_v2.py b/plugins/action/sp_profile_delete_v2.py new file mode 100644 index 0000000000..52219be6a4 --- /dev/null +++ b/plugins/action/sp_profile_delete_v2.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + spProfileName=dict(type="str"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + sp_profile_name=params.get("spProfileName"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="network_settings", + function="delete_sp_profile_v2", + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/tag_info.py b/plugins/action/tag_info.py index 4cd2cc1c14..773cc8858b 100644 --- a/plugins/action/tag_info.py +++ b/plugins/action/tag_info.py @@ -29,8 +29,8 @@ additionalInfo_nameSpace=dict(type="str"), additionalInfo_attributes=dict(type="str"), level=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), size=dict(type="str"), field=dict(type="str"), sortBy=dict(type="str"), diff --git a/plugins/action/task_info.py b/plugins/action/task_info.py index 246342f7a3..0f79bcb065 100644 --- a/plugins/action/task_info.py +++ b/plugins/action/task_info.py @@ -35,8 +35,8 @@ isError=dict(type="str"), failureReason=dict(type="str"), parentId=dict(type="str"), - offset=dict(type="str"), - limit=dict(type="str"), + offset=dict(type="int"), + limit=dict(type="int"), sortBy=dict(type="str"), order=dict(type="str"), taskId=dict(type="str"), diff --git a/plugins/action/template_preview.py b/plugins/action/template_preview.py index 48198fe37d..1f21d5bb30 100644 --- a/plugins/action/template_preview.py +++ b/plugins/action/template_preview.py @@ -27,7 +27,7 @@ argument_spec.update(dict( deviceId=dict(type="str"), params=dict(type="dict"), - resourceParams=dict(type="list"), + resourceParams=dict(type="dict"), templateId=dict(type="str"), )) diff --git a/plugins/action/user.py b/plugins/action/user.py new file mode 100644 index 0000000000..b9c8d5c4e3 --- /dev/null +++ b/plugins/action/user.py @@ -0,0 +1,225 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, + dnac_compare_equality, + get_dict_result, +) +from ansible_collections.cisco.dnac.plugins.plugin_utils.exceptions import ( + InconsistentParameters, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + state=dict(type="str", default="present", choices=["present"]), + firstName=dict(type="str"), + lastName=dict(type="str"), + username=dict(type="str"), + password=dict(type="str", no_log=True), + email=dict(type="str"), + roleList=dict(type="list"), + userId=dict(type="str"), +)) + +required_if = [ +] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +class User(object): + def __init__(self, params, dnac): + self.dnac = dnac + self.new_object = dict( + firstName=params.get("firstName"), + lastName=params.get("lastName"), + username=params.get("username"), + password=params.get("password"), + email=params.get("email"), + roleList=params.get("roleList"), + userId=params.get("userId"), + ) + + def get_all_params(self, name=None, id=None): + new_object_params = {} + new_object_params['invoke_source'] = self.new_object.get('invokeSource') or \ + self.new_object.get('invoke_source') + return new_object_params + + def create_params(self): + new_object_params = {} + new_object_params['firstName'] = self.new_object.get('firstName') + new_object_params['lastName'] = self.new_object.get('lastName') + new_object_params['username'] = self.new_object.get('username') + new_object_params['password'] = self.new_object.get('password') + new_object_params['email'] = self.new_object.get('email') + new_object_params['roleList'] = self.new_object.get('roleList') + return new_object_params + + def update_all_params(self): + new_object_params = {} + new_object_params['firstName'] = self.new_object.get('firstName') + new_object_params['lastName'] = self.new_object.get('lastName') + new_object_params['email'] = self.new_object.get('email') + new_object_params['username'] = self.new_object.get('username') + new_object_params['userId'] = self.new_object.get('userId') + new_object_params['roleList'] = self.new_object.get('roleList') + return new_object_params + + def get_object_by_name(self, name): + result = None + # NOTE: Does not have a get by name method, using get all + try: + items = self.dnac.exec( + family="userand_roles", + function="get_users_ap_i", + params=self.get_all_params(name=name), + ) + if isinstance(items, dict): + if 'response' in items: + items = items.get('response') + result = get_dict_result(items, 'name', name) + except Exception: + result = None + return result + + def get_object_by_id(self, id): + result = None + # NOTE: Does not have a get by id method or it is in another action + return result + + def exists(self): + prev_obj = None + id_exists = False + name_exists = False + o_id = self.new_object.get("id") + name = self.new_object.get("name") + if o_id: + prev_obj = self.get_object_by_id(o_id) + id_exists = prev_obj is not None and isinstance(prev_obj, dict) + if not id_exists and name: + prev_obj = self.get_object_by_name(name) + name_exists = prev_obj is not None and isinstance(prev_obj, dict) + if name_exists: + _id = prev_obj.get("id") + if id_exists and name_exists and o_id != _id: + raise InconsistentParameters("The 'id' and 'name' params don't refer to the same object") + if _id: + self.new_object.update(dict(id=_id)) + it_exists = prev_obj is not None and isinstance(prev_obj, dict) + return (it_exists, prev_obj) + + def requires_update(self, current_obj): + requested_obj = self.new_object + + obj_params = [ + ("firstName", "firstName"), + ("lastName", "lastName"), + ("username", "username"), + ("email", "email"), + ("roleList", "roleList"), + ("userId", "userId"), + ] + # Method 1. Params present in request (Ansible) obj are the same as the current (ISE) params + # If any does not have eq params, it requires update + return any(not dnac_compare_equality(current_obj.get(dnac_param), + requested_obj.get(ansible_param)) + for (dnac_param, ansible_param) in obj_params) + + def create(self): + result = self.dnac.exec( + family="userand_roles", + function="add_user_ap_i", + params=self.create_params(), + op_modifies=True, + ) + return result + + def update(self): + id = self.new_object.get("id") + name = self.new_object.get("name") + result = None + result = self.dnac.exec( + family="userand_roles", + function="update_user_ap_i", + params=self.update_all_params(), + op_modifies=True, + ) + return result + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(self._task.args) + obj = User(self._task.args, dnac) + + state = self._task.args.get("state") + + response = None + if state == "present": + (obj_exists, prev_obj) = obj.exists() + if obj_exists: + if obj.requires_update(prev_obj): + response = obj.update() + dnac.object_updated() + else: + response = prev_obj + dnac.object_already_present() + else: + response = obj.create() + dnac.object_created() + + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/user_info.py b/plugins/action/user_info.py new file mode 100644 index 0000000000..eb9ccc38e8 --- /dev/null +++ b/plugins/action/user_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + invokeSource=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + invoke_source=params.get("invokeSource"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="userand_roles", + function='get_users_ap_i', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/users_external_servers_info.py b/plugins/action/users_external_servers_info.py new file mode 100644 index 0000000000..1436338cc6 --- /dev/null +++ b/plugins/action/users_external_servers_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + invokeSource=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + invoke_source=params.get("invokeSource"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="userand_roles", + function='get_external_authentication_servers_ap_i', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/wireless_accespoint_configuration.py b/plugins/action/wireless_accespoint_configuration.py new file mode 100644 index 0000000000..f99e312edb --- /dev/null +++ b/plugins/action/wireless_accespoint_configuration.py @@ -0,0 +1,130 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguements specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + apList=dict(type="list"), + configureAdminStatus=dict(type="bool"), + adminStatus=dict(type="bool"), + configureApMode=dict(type="bool"), + apMode=dict(type="int"), + configureApHeight=dict(type="bool"), + apHeight=dict(type="int"), + configureFailoverPriority=dict(type="bool"), + failoverPriority=dict(type="int"), + configureLedStatus=dict(type="bool"), + ledStatus=dict(type="bool"), + configureLedBrightnessLevel=dict(type="bool"), + ledBrightnessLevel=dict(type="int"), + configureLocation=dict(type="bool"), + location=dict(type="str"), + configureHAController=dict(type="bool"), + primaryControllerName=dict(type="str"), + primaryIpAddress=dict(type="dict"), + secondaryControllerName=dict(type="str"), + secondaryIpAddress=dict(type="dict"), + tertiaryControllerName=dict(type="str"), + tertiaryIpAddress=dict(type="dict"), + radioConfigurations=dict(type="list"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = False + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + apList=params.get("apList"), + configureAdminStatus=params.get("configureAdminStatus"), + adminStatus=params.get("adminStatus"), + configureApMode=params.get("configureApMode"), + apMode=params.get("apMode"), + configureApHeight=params.get("configureApHeight"), + apHeight=params.get("apHeight"), + configureFailoverPriority=params.get("configureFailoverPriority"), + failoverPriority=params.get("failoverPriority"), + configureLedStatus=params.get("configureLedStatus"), + ledStatus=params.get("ledStatus"), + configureLedBrightnessLevel=params.get("configureLedBrightnessLevel"), + ledBrightnessLevel=params.get("ledBrightnessLevel"), + configureLocation=params.get("configureLocation"), + location=params.get("location"), + configureHAController=params.get("configureHAController"), + primaryControllerName=params.get("primaryControllerName"), + primaryIpAddress=params.get("primaryIpAddress"), + secondaryControllerName=params.get("secondaryControllerName"), + secondaryIpAddress=params.get("secondaryIpAddress"), + tertiaryControllerName=params.get("tertiaryControllerName"), + tertiaryIpAddress=params.get("tertiaryIpAddress"), + radioConfigurations=params.get("radioConfigurations"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='configure_access_points', + op_modifies=True, + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/action/wireless_accesspoint_configuration_summary_info.py b/plugins/action/wireless_accesspoint_configuration_summary_info.py new file mode 100644 index 0000000000..f1f4ab0ede --- /dev/null +++ b/plugins/action/wireless_accesspoint_configuration_summary_info.py @@ -0,0 +1,89 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +from __future__ import (absolute_import, division, print_function) +__metaclass__ = type +from ansible.plugins.action import ActionBase +try: + from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import ( + AnsibleArgSpecValidator, + ) +except ImportError: + ANSIBLE_UTILS_IS_INSTALLED = False +else: + ANSIBLE_UTILS_IS_INSTALLED = True +from ansible.errors import AnsibleActionFail +from ansible_collections.cisco.dnac.plugins.plugin_utils.dnac import ( + DNACSDK, + dnac_argument_spec, +) + +# Get common arguments specification +argument_spec = dnac_argument_spec() +# Add arguments specific for this module +argument_spec.update(dict( + key=dict(type="str"), + headers=dict(type="dict"), +)) + +required_if = [] +required_one_of = [] +mutually_exclusive = [] +required_together = [] + + +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'") + super(ActionModule, self).__init__(*args, **kwargs) + self._supports_async = False + self._supports_check_mode = True + self._result = None + + # Checks the supplied parameters against the argument spec for this module + def _check_argspec(self): + aav = AnsibleArgSpecValidator( + data=self._task.args, + schema=dict(argument_spec=argument_spec), + schema_format="argspec", + schema_conditionals=dict( + required_if=required_if, + required_one_of=required_one_of, + mutually_exclusive=mutually_exclusive, + required_together=required_together, + ), + name=self._task.action, + ) + valid, errors, self._task.args = aav.validate() + if not valid: + raise AnsibleActionFail(errors) + + def get_object(self, params): + new_object = dict( + key=params.get("key"), + headers=params.get("headers"), + ) + return new_object + + def run(self, tmp=None, task_vars=None): + self._task.diff = False + self._result = super(ActionModule, self).run(tmp, task_vars) + self._result["changed"] = False + self._check_argspec() + + self._result.update(dict(dnac_response={})) + + dnac = DNACSDK(params=self._task.args) + + response = dnac.exec( + family="wireless", + function='get_access_point_configuration', + params=self.get_object(self._task.args), + ) + self._result.update(dict(dnac_response=response)) + self._result.update(dnac.exit_json()) + return self._result diff --git a/plugins/modules/accesspoint_configuration_details_by_task_id_info.py b/plugins/modules/accesspoint_configuration_details_by_task_id_info.py new file mode 100644 index 0000000000..63bf5df7ea --- /dev/null +++ b/plugins/modules/accesspoint_configuration_details_by_task_id_info.py @@ -0,0 +1,98 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: accesspoint_configuration_details_by_task_id_info +short_description: Information module for Accesspoint Configuration Details By Task Id +description: +- Get Accesspoint Configuration Details By Task Id by id. +- Users can query the access point configuration result using this intent API. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + task_id: + description: + - Task_id path parameter. Task id information of ap config. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless GetAccessPointConfigurationTaskResult + description: Complete reference of the GetAccessPointConfigurationTaskResult API. + link: https://developer.cisco.com/docs/dna-center/#!get-access-point-configuration-task-result +notes: + - SDK Method used are + wireless.Wireless.get_access_point_configuration_task_result, + + - Paths used are + get /dna/intent/api/v1/wireless/accesspoint-configuration/details/{task_id}, + +""" + +EXAMPLES = r""" +- name: Get Accesspoint Configuration Details By Task Id by id + cisco.dnac.accesspoint_configuration_details_by_task_id_info: + 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}}" + task_id: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "instanceUuid": {}, + "instanceId": 0, + "authEntityId": {}, + "displayName": "string", + "authEntityClass": {}, + "instanceTenantId": "string", + "_orderedListOEIndex": 0, + "_orderedListOEAssocName": {}, + "_creationOrderIndex": 0, + "_isBeingChanged": true, + "deployPending": "string", + "instanceCreatedOn": {}, + "instanceUpdatedOn": {}, + "changeLogList": {}, + "instanceOrigin": {}, + "lazyLoadedEntities": {}, + "instanceVersion": 0, + "apName": "string", + "controllerName": "string", + "locationHeirarchy": "string", + "macAddress": "string", + "status": "string", + "statusDetails": "string", + "internalKey": { + "type": "string", + "id": 0, + "longType": "string", + "url": "string" + } + } + ] +""" diff --git a/plugins/modules/authentication_policy_servers_info.py b/plugins/modules/authentication_policy_servers_info.py new file mode 100644 index 0000000000..cb5124de79 --- /dev/null +++ b/plugins/modules/authentication_policy_servers_info.py @@ -0,0 +1,121 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: authentication_policy_servers_info +short_description: Information module for Authentication Policy Servers +description: +- Get all Authentication Policy Servers. +- API to get Authentication and Policy Servers. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + isIseEnabled: + description: + - IsIseEnabled query parameter. Valid values are true, false. + type: bool + state_: + description: + - State query parameter. Valid values are INPROGRESS, ACTIVE, DELETED, RBAC-FAILURE, FAILED. + type: str + role: + description: + - Role query parameter. Authentication and Policy Server Role (Example primary, secondary). + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for System Settings GetAuthenticationAndPolicyServers + description: Complete reference of the GetAuthenticationAndPolicyServers API. + link: https://developer.cisco.com/docs/dna-center/#!get-authentication-and-policy-servers +notes: + - SDK Method used are + system_settings.SystemSettings.get_authentication_and_policy_servers, + + - Paths used are + get /dna/intent/api/v1/authentication-policy-servers, + +""" + +EXAMPLES = r""" +- name: Get all Authentication Policy Servers + cisco.dnac.authentication_policy_servers_info: + 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}}" + isIseEnabled: True + state_: string + role: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "ipAddress": "string", + "sharedSecret": "string", + "protocol": "string", + "role": "string", + "port": 0, + "authenticationPort": "string", + "accountingPort": "string", + "retries": 0, + "timeoutSeconds": 0, + "isIseEnabled": true, + "instanceUuid": "string", + "state": "string", + "ciscoIseDtos": [ + { + "subscriberName": "string", + "description": "string", + "password": "string", + "userName": "string", + "fqdn": "string", + "ipAddress": "string", + "trustState": "string", + "instanceUuid": "string", + "sshkey": "string", + "type": "string", + "failureReason": "string", + "role": "string", + "externalCiscoIseIpAddrDtos": { + "type": "string", + "externalCiscoIseIpAddresses": [ + { + "externalIpAddress": "string" + } + ] + } + } + ], + "encryptionScheme": "string", + "messageKey": "string", + "encryptionKey": "string", + "useDnacCertForPxgrid": true, + "iseEnabled": true, + "pxgridEnabled": true + } + ] +""" diff --git a/plugins/modules/business_sda_hostonboarding_ssid_ippool.py b/plugins/modules/business_sda_hostonboarding_ssid_ippool.py index 619474a94b..daa0bbc005 100644 --- a/plugins/modules/business_sda_hostonboarding_ssid_ippool.py +++ b/plugins/modules/business_sda_hostonboarding_ssid_ippool.py @@ -17,6 +17,9 @@ - cisco.dnac.module author: Rafael Campos (@racampos) options: + headers: + description: Additional headers. + type: dict scalableGroupName: description: Scalable Group Name. type: str @@ -37,13 +40,13 @@ - name: Cisco DNA Center documentation for Fabric Wireless AddSSIDToIPPoolMapping description: Complete reference of the AddSSIDToIPPoolMapping API. link: https://developer.cisco.com/docs/dna-center/#!add-ssid-to-ip-pool-mapping -- name: Cisco DNA Center documentation for Fabric Wireless UpdateSSIDToIPPoolMapping2 - description: Complete reference of the UpdateSSIDToIPPoolMapping2 API. - link: https://developer.cisco.com/docs/dna-center/#!update-ssid-to-ip-pool-mapping-2 +- name: Cisco DNA Center documentation for Fabric Wireless UpdateSSIDToIPPoolMapping + description: Complete reference of the UpdateSSIDToIPPoolMapping API. + link: https://developer.cisco.com/docs/dna-center/#!update-ssid-to-ip-pool-mapping notes: - SDK Method used are fabric_wireless.FabricWireless.add_ssid_to_ip_pool_mapping, - fabric_wireless.FabricWireless.update_ssid_to_ip_pool_mapping2, + fabric_wireless.FabricWireless.update_ssid_to_ip_pool_mapping, - Paths used are post /dna/intent/api/v1/business/sda/hostonboarding/ssid-ippool, @@ -62,6 +65,7 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" state: present + headers: '{{my_headers | from_json}}' scalableGroupName: string siteNameHierarchy: string ssidNames: diff --git a/plugins/modules/business_sda_virtual_network_summary_info.py b/plugins/modules/business_sda_virtual_network_summary_info.py index ff5ae17d13..941822ad5c 100644 --- a/plugins/modules/business_sda_virtual_network_summary_info.py +++ b/plugins/modules/business_sda_virtual_network_summary_info.py @@ -62,11 +62,14 @@ type: dict sample: > { - "response": { - "status": "string", - "description": "string", - "fabricCount": "string" - }, - "version": "string" + "virtualNetworkCount": 0, + "virtualNetworkSummary": [ + { + "siteNameHierarchy": "string", + "virtualNetworkName": "string" + } + ], + "status": "string", + "description": "string" } """ diff --git a/plugins/modules/business_sda_wireless_controller_delete.py b/plugins/modules/business_sda_wireless_controller_delete.py index 6afa80590f..19769adf15 100644 --- a/plugins/modules/business_sda_wireless_controller_delete.py +++ b/plugins/modules/business_sda_wireless_controller_delete.py @@ -19,6 +19,9 @@ deviceIPAddress: description: DeviceIPAddress query parameter. Device Management IP Address. type: str + headers: + description: Additional headers. + type: dict requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -47,6 +50,7 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" deviceIPAddress: string + headers: '{{my_headers | from_json}}' """ diff --git a/plugins/modules/client_detail_info.py b/plugins/modules/client_detail_info.py index 4a514e7b8f..a823da7b54 100644 --- a/plugins/modules/client_detail_info.py +++ b/plugins/modules/client_detail_info.py @@ -90,8 +90,8 @@ "string" ], "authType": "string", - "vlanId": "string", - "vnid": "string", + "vlanId": 0, + "vnid": 0, "ssid": "string", "frequency": "string", "channel": "string", diff --git a/plugins/modules/compliance_device_by_id_info.py b/plugins/modules/compliance_device_by_id_info.py index b4b595433e..92e2f73bb0 100644 --- a/plugins/modules/compliance_device_by_id_info.py +++ b/plugins/modules/compliance_device_by_id_info.py @@ -95,7 +95,7 @@ { "displayName": "string", "complianceType": "string", - "lastSyncTime": "string", + "lastSyncTime": 0, "additionalDataURL": "string", "sourceInfoList": [ { diff --git a/plugins/modules/compliance_device_details_info.py b/plugins/modules/compliance_device_details_info.py index db09857657..9eb00777b4 100644 --- a/plugins/modules/compliance_device_details_info.py +++ b/plugins/modules/compliance_device_details_info.py @@ -38,11 +38,11 @@ offset: description: - Offset query parameter. Offset/starting row. - type: str + type: int limit: description: - Limit query parameter. Number of records to be retrieved. - type: str + type: int requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -73,8 +73,8 @@ complianceType: string complianceStatus: string deviceUuid: string - offset: string - limit: string + offset: 0 + limit: 0 register: result """ @@ -90,7 +90,7 @@ "response": [ { "complianceType": "string", - "lastSyncTime": "string", + "lastSyncTime": 0, "deviceUuid": "string", "displayName": "string", "status": "string", diff --git a/plugins/modules/configuration_template.py b/plugins/modules/configuration_template.py index 7df9fc7125..35dc21ac53 100644 --- a/plugins/modules/configuration_template.py +++ b/plugins/modules/configuration_template.py @@ -497,12 +497,10 @@ suboptions: rollbackTemplateErrors: description: Validation or design conflicts errors of rollback template. - elements: dict - type: list + type: dict templateErrors: description: Validation or design conflicts errors. - elements: dict - type: list + type: dict templateId: description: UUID of template. type: str @@ -696,10 +694,8 @@ selectionType: string selectionValues: {} validationErrors: - rollbackTemplateErrors: - - {} - templateErrors: - - {} + rollbackTemplateErrors: {} + templateErrors: {} templateId: string templateVersion: string version: string diff --git a/plugins/modules/configuration_template_create.py b/plugins/modules/configuration_template_create.py index c98a2b2d34..4bb6a9a7b5 100644 --- a/plugins/modules/configuration_template_create.py +++ b/plugins/modules/configuration_template_create.py @@ -493,12 +493,10 @@ suboptions: rollbackTemplateErrors: description: Validation or design conflicts errors of rollback template. - elements: dict - type: list + type: dict templateErrors: description: Validation or design conflicts errors. - elements: dict - type: list + type: dict templateId: description: UUID of template. type: str @@ -686,10 +684,8 @@ selectionType: string selectionValues: {} validationErrors: - rollbackTemplateErrors: - - {} - templateErrors: - - {} + rollbackTemplateErrors: {} + templateErrors: {} templateId: string templateVersion: string version: string diff --git a/plugins/modules/configuration_template_deploy.py b/plugins/modules/configuration_template_deploy.py index 0b2074dae9..537fa850c0 100644 --- a/plugins/modules/configuration_template_deploy.py +++ b/plugins/modules/configuration_template_deploy.py @@ -27,8 +27,7 @@ type: str memberTemplateDeploymentInfo: description: MemberTemplateDeploymentInfo. - elements: dict - type: list + type: str targetInfo: description: Configuration Template Deploy's targetInfo. elements: dict @@ -44,8 +43,7 @@ type: dict resourceParams: description: Resource params to be provisioned. - elements: dict - type: list + type: dict type: description: Target type of device. type: str @@ -85,14 +83,12 @@ forcePushTemplate: true isComposite: true mainTemplateId: string - memberTemplateDeploymentInfo: - - {} + memberTemplateDeploymentInfo: string targetInfo: - hostName: string id: string params: {} - resourceParams: - - {} + resourceParams: {} type: string versionedTemplateId: string templateId: string diff --git a/plugins/modules/configuration_template_deploy_v2.py b/plugins/modules/configuration_template_deploy_v2.py index 62b9935c2a..3994417064 100644 --- a/plugins/modules/configuration_template_deploy_v2.py +++ b/plugins/modules/configuration_template_deploy_v2.py @@ -27,8 +27,7 @@ type: str memberTemplateDeploymentInfo: description: MemberTemplateDeploymentInfo. - elements: dict - type: list + type: str targetInfo: description: Configuration Template Deploy V2's targetInfo. elements: dict @@ -44,8 +43,7 @@ type: dict resourceParams: description: Resource params to be provisioned. - elements: dict - type: list + type: dict type: description: Target type of device. type: str @@ -85,14 +83,12 @@ forcePushTemplate: true isComposite: true mainTemplateId: string - memberTemplateDeploymentInfo: - - {} + memberTemplateDeploymentInfo: string targetInfo: - hostName: string id: string params: {} - resourceParams: - - {} + resourceParams: {} type: string versionedTemplateId: string templateId: string diff --git a/plugins/modules/configuration_template_import_template.py b/plugins/modules/configuration_template_import_template.py index 7f77a5d9f2..fc612c50fb 100644 --- a/plugins/modules/configuration_template_import_template.py +++ b/plugins/modules/configuration_template_import_template.py @@ -503,12 +503,10 @@ suboptions: rollbackTemplateErrors: description: Validation or design conflicts errors of rollback template. - elements: dict - type: list + type: dict templateErrors: description: Validation or design conflicts errors. - elements: dict - type: list + type: dict templateId: description: UUID of template. type: str @@ -703,10 +701,8 @@ selectionType: string selectionValues: {} validationErrors: - rollbackTemplateErrors: - - {} - templateErrors: - - {} + rollbackTemplateErrors: {} + templateErrors: {} templateId: string templateVersion: string version: string diff --git a/plugins/modules/configuration_template_info.py b/plugins/modules/configuration_template_info.py index 0d75606150..993d2e0b5a 100644 --- a/plugins/modules/configuration_template_info.py +++ b/plugins/modules/configuration_template_info.py @@ -341,12 +341,8 @@ } ], "validationErrors": { - "rollbackTemplateErrors": [ - {} - ], - "templateErrors": [ - {} - ], + "rollbackTemplateErrors": {}, + "templateErrors": {}, "templateId": "string", "templateVersion": "string" }, diff --git a/plugins/modules/configuration_template_project_info.py b/plugins/modules/configuration_template_project_info.py index fa1c042408..d5d60407f9 100644 --- a/plugins/modules/configuration_template_project_info.py +++ b/plugins/modules/configuration_template_project_info.py @@ -302,18 +302,13 @@ } ], "validationErrors": { - "rollbackTemplateErrors": [ - {} - ], - "templateErrors": [ - {} - ], + "rollbackTemplateErrors": {}, + "templateErrors": {}, "templateId": "string", "templateVersion": "string" }, "version": "string" } - ], - "isDeletable": true + ] } """ diff --git a/plugins/modules/credential_to_site_by_siteid_create_v2.py b/plugins/modules/credential_to_site_by_siteid_create_v2.py new file mode 100644 index 0000000000..44f2a99db8 --- /dev/null +++ b/plugins/modules/credential_to_site_by_siteid_create_v2.py @@ -0,0 +1,89 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: credential_to_site_by_siteid_create_v2 +short_description: Resource module for Credential To Site By Siteid Create V2 +description: +- Manage operation create of the resource Credential To Site By Siteid Create V2. +- API to assign Device Credential to a site. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + cliId: + description: CLI Credential Id. + type: str + httpRead: + description: HTTP(S) Read Credential Id. + type: str + httpWrite: + description: HTTP(S) Write Credential Id. + type: str + siteId: + description: SiteId path parameter. Site Id to assign credential. + type: str + snmpV2ReadId: + description: SNMPv2c Read Credential Id. + type: str + snmpV2WriteId: + description: SNMPv2c Write Credential Id. + type: str + snmpV3Id: + description: SNMPv3 Credential Id. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings AssignDeviceCredentialToSiteV2 + description: Complete reference of the AssignDeviceCredentialToSiteV2 API. + link: https://developer.cisco.com/docs/dna-center/#!assign-device-credential-to-site-v-2 +notes: + - SDK Method used are + network_settings.NetworkSettings.assign_device_credential_to_site_v2, + + - Paths used are + post /dna/intent/api/v2/credential-to-site/{siteId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.credential_to_site_by_siteid_create_v2: + 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}}" + cliId: string + httpRead: string + httpWrite: string + siteId: string + snmpV2ReadId: string + snmpV2WriteId: string + snmpV3Id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/plugins/modules/device_interface_info.py b/plugins/modules/device_interface_info.py index b94f8818c3..5f484a5201 100644 --- a/plugins/modules/device_interface_info.py +++ b/plugins/modules/device_interface_info.py @@ -29,6 +29,14 @@ description: - Limit query parameter. type: int + lastInputTime: + description: + - LastInputTime query parameter. Last Input Time. + type: str + lastOutputTime: + description: + - LastOutputTime query parameter. Last Output Time. + type: str id: description: - Id path parameter. Interface ID. @@ -67,6 +75,8 @@ headers: "{{my_headers | from_json}}" offset: 0 limit: 0 + lastInputTime: string + lastOutputTime: string register: result - name: Get Device Interface by id diff --git a/plugins/modules/device_reboot_apreboot.py b/plugins/modules/device_reboot_apreboot.py new file mode 100644 index 0000000000..78a33dfd4b --- /dev/null +++ b/plugins/modules/device_reboot_apreboot.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_reboot_apreboot +short_description: Resource module for Device Reboot Apreboot +description: +- Manage operation create of the resource Device Reboot Apreboot. +- Users can reboot multiple access points up-to 200 at a time using this API. +version_added: '3.1.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + apMacAddresses: + description: The ethernet MAC address of the access point. + elements: str + type: list +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless RebootAccessPoints + description: Complete reference of the RebootAccessPoints API. + link: https://developer.cisco.com/docs/dna-center/#!reboot-access-points +notes: + - SDK Method used are + wireless.Wireless.reboot_access_points, + + - Paths used are + post /dna/intent/api/v1/device-reboot/apreboot, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.device_reboot_apreboot: + 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}}" + state: present + apMacAddresses: + - string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/plugins/modules/device_reboot_apreboot_info.py b/plugins/modules/device_reboot_apreboot_info.py new file mode 100644 index 0000000000..09203ba5e8 --- /dev/null +++ b/plugins/modules/device_reboot_apreboot_info.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: device_reboot_apreboot_info +short_description: Information module for Device Reboot Apreboot +description: +- Get all Device Reboot Apreboot. +- Users can query the access point reboot status using this intent API. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + parentTaskId: + description: + - ParentTaskId query parameter. Task id of ap reboot request. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless GetAccessPointRebootTaskResult + description: Complete reference of the GetAccessPointRebootTaskResult API. + link: https://developer.cisco.com/docs/dna-center/#!get-access-point-reboot-task-result +notes: + - SDK Method used are + wireless.Wireless.get_access_point_reboot_task_result, + + - Paths used are + get /dna/intent/api/v1/device-reboot/apreboot/status, + +""" + +EXAMPLES = r""" +- name: Get all Device Reboot Apreboot + cisco.dnac.device_reboot_apreboot_info: + 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}}" + parentTaskId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "wlcIP": "string", + "apList": [ + { + "apName": "string", + "rebootStatus": "string", + "failureReason": {} + } + ] + } + ] +""" diff --git a/plugins/modules/disasterrecovery_system_operationstatus_info.py b/plugins/modules/disasterrecovery_system_operationstatus_info.py index 0cda92e404..8e05a778e2 100644 --- a/plugins/modules/disasterrecovery_system_operationstatus_info.py +++ b/plugins/modules/disasterrecovery_system_operationstatus_info.py @@ -20,7 +20,7 @@ description: Additional headers. type: dict requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/disasterrecovery_system_status_info.py b/plugins/modules/disasterrecovery_system_status_info.py index 7014eb3f21..40356c0f7a 100644 --- a/plugins/modules/disasterrecovery_system_status_info.py +++ b/plugins/modules/disasterrecovery_system_status_info.py @@ -20,7 +20,7 @@ description: Additional headers. type: dict requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/dnac_packages_info.py b/plugins/modules/dnac_packages_info.py new file mode 100644 index 0000000000..2d0a0e0ddb --- /dev/null +++ b/plugins/modules/dnac_packages_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: dnac_packages_info +short_description: Information module for Dnac Packages +description: +- Get all Dnac Packages. +- Provides information such as name, version of packages installed on the DNA center. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Platform CiscoDNACenterPackagesSummary + description: Complete reference of the CiscoDNACenterPackagesSummary API. + link: https://developer.cisco.com/docs/dna-center/#!cisco-dna-center-packages-summary +notes: + - SDK Method used are + platform.Platform.cisco_dna_center_packages_summary, + + - Paths used are + get /dna/intent/api/v1/dnac-packages, + +""" + +EXAMPLES = r""" +- name: Get all Dnac Packages + cisco.dnac.dnac_packages_info: + 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}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "name": "string", + "version": "string" + } + ], + "version": "string" + } +""" diff --git a/plugins/modules/endpoint_analytics_profiling_rules.py b/plugins/modules/endpoint_analytics_profiling_rules.py index 48cfa0fa28..38e2f47ecf 100644 --- a/plugins/modules/endpoint_analytics_profiling_rules.py +++ b/plugins/modules/endpoint_analytics_profiling_rules.py @@ -114,7 +114,7 @@ elements: str type: list requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/endpoint_analytics_profiling_rules_info.py b/plugins/modules/endpoint_analytics_profiling_rules_info.py index a7115eefe5..9c42ee1ead 100644 --- a/plugins/modules/endpoint_analytics_profiling_rules_info.py +++ b/plugins/modules/endpoint_analytics_profiling_rules_info.py @@ -60,7 +60,7 @@ - RuleId path parameter. Unique rule identifier. type: str requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/eox_status_device_info.py b/plugins/modules/eox_status_device_info.py new file mode 100644 index 0000000000..6843843e80 --- /dev/null +++ b/plugins/modules/eox_status_device_info.py @@ -0,0 +1,115 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: eox_status_device_info +short_description: Information module for Eox Status Device +description: +- Get all Eox Status Device. +- Get Eox Status Device by id. +- Retrieves EoX details for a device. +- Retrieves EoX status for all devices in the network. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + deviceId: + description: + - DeviceId path parameter. Device instance UUID. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for EoX GetEoXDetailsPerDevice + description: Complete reference of the GetEoXDetailsPerDevice API. + link: https://developer.cisco.com/docs/dna-center/#!get-eo-x-details-per-device +- name: Cisco DNA Center documentation for EoX GetEoXStatusForAllDevices + description: Complete reference of the GetEoXStatusForAllDevices API. + link: https://developer.cisco.com/docs/dna-center/#!get-eo-x-status-for-all-devices +notes: + - SDK Method used are + eo_x.EoX.get_eo_x_details_per_device, + eo_x.EoX.get_eo_x_status_for_all_devices, + + - Paths used are + get /dna/intent/api/v1/eox-status/device, + get /dna/intent/api/v1/eox-status/device/{deviceId}, + +""" + +EXAMPLES = r""" +- name: Get all Eox Status Device + cisco.dnac.eox_status_device_info: + 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}}" + register: result + +- name: Get Eox Status Device by id + cisco.dnac.eox_status_device_info: + 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}}" + deviceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "deviceId": "string", + "alertCount": 0, + "eoxDetails": [ + { + "bulletinHeadline": "string", + "bulletinNumber": "string", + "bulletinURL": "string", + "endOfHardwareNewServiceAttachmentDate": 0, + "endOfHardwareServiceContractRenewalDate": 0, + "endOfLastHardwareShipDate": 0, + "endOfLifeDate": 0, + "endOfLifeExternalAnnouncementDate": 0, + "endOfSaleDate": 0, + "endOfSignatureReleasesDate": 0, + "endOfSoftwareVulnerabilityOrSecuritySupportDate": 0, + "endOfSoftwareVulnerabilityOrSecuritySupportDateHw": 0, + "endOfSoftwareMaintenanceReleasesDate": 0, + "eoxAlertType": "string", + "lastDateOfSupport": 0, + "name": "string" + } + ], + "scanStatus": "string", + "comments": [ + {} + ], + "lastScanTime": 0 + }, + "version": "string" + } +""" diff --git a/plugins/modules/eox_status_summary_info.py b/plugins/modules/eox_status_summary_info.py new file mode 100644 index 0000000000..0ec8177501 --- /dev/null +++ b/plugins/modules/eox_status_summary_info.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: eox_status_summary_info +short_description: Information module for Eox Status Summary +description: +- Get all Eox Status Summary. +- Retrieves EoX summary for all devices in the network. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for EoX GetEoXSummary + description: Complete reference of the GetEoXSummary API. + link: https://developer.cisco.com/docs/dna-center/#!get-eo-x-summary +notes: + - SDK Method used are + eo_x.EoX.get_eo_x_summary, + + - Paths used are + get /dna/intent/api/v1/eox-status/summary, + +""" + +EXAMPLES = r""" +- name: Get all Eox Status Summary + cisco.dnac.eox_status_summary_info: + 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}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "hardwareCount": 0, + "softwareCount": 0, + "moduleCount": 0, + "totalCount": 0 + }, + "version": "string" + } +""" diff --git a/plugins/modules/event_email_config.py b/plugins/modules/event_email_config.py new file mode 100644 index 0000000000..3b9de49a16 --- /dev/null +++ b/plugins/modules/event_email_config.py @@ -0,0 +1,147 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_email_config +short_description: Resource module for Event Email Config +description: +- Manage operations create and update of the resource Event Email Config. +- Create Email Destination. +- Update Email Destination. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + emailConfigId: + description: Required only for update email configuration. + type: str + fromEmail: + description: From Email. + type: str + primarySMTPConfig: + description: Event Email Config's primarySMTPConfig. + suboptions: + hostName: + description: Host Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + userName: + description: User Name. + type: str + type: dict + secondarySMTPConfig: + description: Event Email Config's secondarySMTPConfig. + suboptions: + hostName: + description: Host Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: str + userName: + description: User Name. + type: str + type: dict + subject: + description: Subject. + type: str + toEmail: + description: To Email. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateEmailDestination + description: Complete reference of the CreateEmailDestination API. + link: https://developer.cisco.com/docs/dna-center/#!create-email-destination +- name: Cisco DNA Center documentation for Event Management UpdateEmailDestination + description: Complete reference of the UpdateEmailDestination API. + link: https://developer.cisco.com/docs/dna-center/#!update-email-destination +notes: + - SDK Method used are + event_management.EventManagement.create_email_destination, + event_management.EventManagement.update_email_destination, + + - Paths used are + post /dna/intent/api/v1/event/email-config, + put /dna/intent/api/v1/event/email-config, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.event_email_config: + 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}}" + state: present + emailConfigId: string + fromEmail: string + primarySMTPConfig: + hostName: string + password: string + port: string + userName: string + secondarySMTPConfig: + hostName: string + password: string + port: string + userName: string + subject: string + toEmail: string + +- name: Create + cisco.dnac.event_email_config: + 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}}" + state: present + emailConfigId: string + fromEmail: string + primarySMTPConfig: + hostName: string + password: string + port: string + userName: string + secondarySMTPConfig: + hostName: string + password: string + port: string + userName: string + subject: string + toEmail: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "statusUri": "string" + } +""" diff --git a/plugins/modules/event_email_config_info.py b/plugins/modules/event_email_config_info.py new file mode 100644 index 0000000000..6aa8558554 --- /dev/null +++ b/plugins/modules/event_email_config_info.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_email_config_info +short_description: Information module for Event Email Config +description: +- Get all Event Email Config. +- Get Email Destination. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetEmailDestination + description: Complete reference of the GetEmailDestination API. + link: https://developer.cisco.com/docs/dna-center/#!get-email-destination +notes: + - SDK Method used are + event_management.EventManagement.get_email_destination, + + - Paths used are + get /dna/intent/api/v1/event/email-config, + +""" + +EXAMPLES = r""" +- name: Get all Event Email Config + cisco.dnac.event_email_config_info: + 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}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "emailConfigId": "string", + "primarySMTPConfig": { + "hostName": "string", + "port": "string", + "userName": "string", + "password": "string", + "security": "string" + }, + "secondarySMTPConfig": { + "hostName": "string", + "port": "string", + "userName": "string", + "password": "string", + "security": "string" + }, + "fromEmail": "string", + "toEmail": "string", + "subject": "string", + "version": "string", + "tenantId": "string" + } + ] +""" diff --git a/plugins/modules/event_series_audit_logs_parent_records_info.py b/plugins/modules/event_series_audit_logs_parent_records_info.py index d23d83068f..6f6a2b6167 100644 --- a/plugins/modules/event_series_audit_logs_parent_records_info.py +++ b/plugins/modules/event_series_audit_logs_parent_records_info.py @@ -195,18 +195,18 @@ {} ], "details": {}, - "ciscoDnaEventLink": {}, - "note": {}, + "ciscoDnaEventLink": "string", + "note": "string", "tntId": "string", "context": "string", "userId": "string", "i18n": "string", - "eventHierarchy": {}, + "eventHierarchy": "string", "message": "string", - "messageParams": {}, + "messageParams": "string", "additionalDetails": {}, - "parentInstanceId": {}, - "network": {}, + "parentInstanceId": "string", + "network": "string", "childCount": 0, "tenantId": "string" } diff --git a/plugins/modules/event_snmp_config_info.py b/plugins/modules/event_snmp_config_info.py new file mode 100644 index 0000000000..6ae23c7f36 --- /dev/null +++ b/plugins/modules/event_snmp_config_info.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_snmp_config_info +short_description: Information module for Event Snmp Config +description: +- Get all Event Snmp Config. +- Get SNMP Destination. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + configId: + description: + - ConfigId query parameter. List of SNMP configurations. + type: str + offset: + description: + - Offset query parameter. The number of SNMP configuration's to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of SNMP configuration's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetSNMPDestination + description: Complete reference of the GetSNMPDestination API. + link: https://developer.cisco.com/docs/dna-center/#!get-snmp-destination +notes: + - SDK Method used are + event_management.EventManagement.get_snmp_destination, + + - Paths used are + get /dna/intent/api/v1/event/snmp-config, + +""" + +EXAMPLES = r""" +- name: Get all Event Snmp Config + cisco.dnac.event_snmp_config_info: + 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}}" + configId: string + offset: 0 + limit: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": { + "errors": [ + "string" + ] + }, + "apiStatus": "string", + "statusMessage": [ + { + "version": "string", + "tenantId": "string", + "configId": "string", + "name": "string", + "description": "string", + "ipAddress": "string", + "port": 0, + "snmpVersion": "string", + "community": "string", + "userName": "string", + "snmpMode": "string", + "snmpAuthType": "string", + "authPassword": "string", + "snmpPrivacyType": "string", + "privacyPassword": "string" + } + ] + } +""" diff --git a/plugins/modules/event_subscription_info.py b/plugins/modules/event_subscription_info.py index 9030b2a04b..7655d96762 100644 --- a/plugins/modules/event_subscription_info.py +++ b/plugins/modules/event_subscription_info.py @@ -100,7 +100,7 @@ "basePath": "string", "resource": "string", "method": "string", - "trustCert": "string", + "trustCert": true, "headers": [ { "string": "string" @@ -117,8 +117,8 @@ } ], "body": "string", - "connectTimeout": "string", - "readTimeout": "string" + "connectTimeout": 0, + "readTimeout": 0 }, "connectorType": "string" } diff --git a/plugins/modules/event_subscription_rest_info.py b/plugins/modules/event_subscription_rest_info.py index 667365634b..a26bf74739 100644 --- a/plugins/modules/event_subscription_rest_info.py +++ b/plugins/modules/event_subscription_rest_info.py @@ -179,7 +179,7 @@ "string" ] }, - "isPrivate": true, + "isPrivate": "string", "tenantId": "string" } ] diff --git a/plugins/modules/event_subscription_syslog_info.py b/plugins/modules/event_subscription_syslog_info.py index 2252f98462..dcd0770077 100644 --- a/plugins/modules/event_subscription_syslog_info.py +++ b/plugins/modules/event_subscription_syslog_info.py @@ -128,7 +128,7 @@ "name": "string", "description": "string", "host": "string", - "port": "string" + "port": 0 } }, "connectorType": "string" diff --git a/plugins/modules/event_syslog_config.py b/plugins/modules/event_syslog_config.py new file mode 100644 index 0000000000..a59316f397 --- /dev/null +++ b/plugins/modules/event_syslog_config.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_syslog_config +short_description: Resource module for Event Syslog Config +description: +- Manage operations create and update of the resource Event Syslog Config. +- Create Syslog Destination. +- Update Syslog Destination. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + configId: + description: Required only for update syslog configuration. + type: str + description: + description: Description. + type: str + host: + description: Host. + type: str + name: + description: Name. + type: str + port: + description: Port. + type: str + protocol: + description: Protocol. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management CreateSyslogDestination + description: Complete reference of the CreateSyslogDestination API. + link: https://developer.cisco.com/docs/dna-center/#!create-syslog-destination +- name: Cisco DNA Center documentation for Event Management UpdateSyslogDestination + description: Complete reference of the UpdateSyslogDestination API. + link: https://developer.cisco.com/docs/dna-center/#!update-syslog-destination +notes: + - SDK Method used are + event_management.EventManagement.create_syslog_destination, + event_management.EventManagement.update_syslog_destination, + + - Paths used are + post /dna/intent/api/v1/event/syslog-config, + put /dna/intent/api/v1/event/syslog-config, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.event_syslog_config: + 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}}" + state: present + configId: string + description: string + host: string + name: string + port: string + protocol: string + +- name: Create + cisco.dnac.event_syslog_config: + 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}}" + state: present + configId: string + description: string + host: string + name: string + port: string + protocol: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": { + "errors": [ + "string" + ] + }, + "apiStatus": "string", + "statusMessage": "string" + } +""" diff --git a/plugins/modules/event_syslog_config_info.py b/plugins/modules/event_syslog_config_info.py new file mode 100644 index 0000000000..2c26171286 --- /dev/null +++ b/plugins/modules/event_syslog_config_info.py @@ -0,0 +1,114 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: event_syslog_config_info +short_description: Information module for Event Syslog Config +description: +- Get all Event Syslog Config. +- Get Syslog Destination. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + configId: + description: + - ConfigId query parameter. Config id of syslog server. + type: str + name: + description: + - Name query parameter. Name of syslog server. + type: str + protocol: + description: + - Protocol query parameter. Protocol of syslog server. + type: str + offset: + description: + - Offset query parameter. The number of syslog configuration's to offset in the resultset whose default value 0. + type: int + limit: + description: + - Limit query parameter. The number of syslog configuration's to limit in the resultset whose default value 10. + type: int + sortBy: + description: + - SortBy query parameter. SortBy field name. + type: str + order: + description: + - Order query parameter. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Event Management GetSyslogDestination + description: Complete reference of the GetSyslogDestination API. + link: https://developer.cisco.com/docs/dna-center/#!get-syslog-destination +notes: + - SDK Method used are + event_management.EventManagement.get_syslog_destination, + + - Paths used are + get /dna/intent/api/v1/event/syslog-config, + +""" + +EXAMPLES = r""" +- name: Get all Event Syslog Config + cisco.dnac.event_syslog_config_info: + 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}}" + configId: string + name: string + protocol: string + offset: 0 + limit: 0 + sortBy: string + order: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "errorMessage": { + "errors": [ + "string" + ] + }, + "apiStatus": "string", + "statusMessage": [ + { + "version": "string", + "tenantId": "string", + "configId": "string", + "name": "string", + "description": "string", + "host": "string", + "port": 0, + "protocol": "string" + } + ] + } +""" diff --git a/plugins/modules/execute_suggested_actions_commands.py b/plugins/modules/execute_suggested_actions_commands.py new file mode 100644 index 0000000000..51df596778 --- /dev/null +++ b/plugins/modules/execute_suggested_actions_commands.py @@ -0,0 +1,77 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: execute_suggested_actions_commands +short_description: Resource module for Execute Suggested Actions Commands +description: +- Manage operation create of the resource Execute Suggested Actions Commands. +- > + This API triggers the execution of the suggested actions for an issue, given the Issue Id. It will return an + execution Id. At the completion of the execution, the output of the commands associated with the suggested actions + will be provided. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + entity_type: + description: Commands provided as part of the suggested actions for an issue can + be executed based on issue id. The value here must be issue_id. + type: str + entity_value: + description: Contains the actual value for the entity type that has been defined. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Issues ExecuteSuggestedActionsCommands + description: Complete reference of the ExecuteSuggestedActionsCommands API. + link: https://developer.cisco.com/docs/dna-center/#!execute-suggested-actions-commands +notes: + - SDK Method used are + issues.Issues.execute_suggested_actions_commands, + + - Paths used are + post /dna/intent/api/v1/execute-suggested-actions-commands, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.execute_suggested_actions_commands: + 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}}" + entity_type: string + entity_value: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + sample: > + [ + { + "actionInfo": "string", + "stepsCount": 0, + "entityId": "string", + "hostname": "string", + "stepsDescription": "string", + "command": "string", + "commandOutput": {} + } + ] +""" diff --git a/plugins/modules/global_credential_v2.py b/plugins/modules/global_credential_v2.py new file mode 100644 index 0000000000..0679fed861 --- /dev/null +++ b/plugins/modules/global_credential_v2.py @@ -0,0 +1,279 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: global_credential_v2 +short_description: Resource module for Global Credential V2 +description: +- Manage operations create, update and delete of the resource Global Credential V2. +- > + API to create new global credentials. Multiple credentials of various types can be passed at once. Please refer + sample Request Body for more information. +- Delete a global credential. Only 'id' of the credential has to be passed. +- > + API to update device credentials. Multiple credentials can be passed at once, but only a single credential of a + given type can be passed at once. Please refer sample Request Body for more information. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + cliCredential: + description: Global Credential V2's cliCredential. + suboptions: + description: + description: Description. + type: str + enablePassword: + description: Enable Password. + type: str + id: + description: Id. + type: str + password: + description: Password. + type: str + username: + description: Username. + type: str + type: dict + httpsRead: + description: Global Credential V2's httpsRead. + suboptions: + id: + description: Id. + type: str + name: + description: Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: int + username: + description: Username. + type: str + type: dict + httpsWrite: + description: Global Credential V2's httpsWrite. + suboptions: + id: + description: Id. + type: str + name: + description: Name. + type: str + password: + description: Password. + type: str + port: + description: Port. + type: int + username: + description: Username. + type: str + type: dict + id: + description: Id path parameter. Global Credential id. + type: str + snmpV2cRead: + description: Global Credential V2's snmpV2cRead. + suboptions: + description: + description: Description. + type: str + id: + description: Id. + type: str + readCommunity: + description: Read Community. + type: str + type: dict + snmpV2cWrite: + description: Global Credential V2's snmpV2cWrite. + suboptions: + description: + description: Description. + type: str + id: + description: Id. + type: str + writeCommunity: + description: Write Community. + type: str + type: dict + snmpV3: + description: Global Credential V2's snmpV3. + suboptions: + authPassword: + description: Auth Password. + type: str + authType: + description: Auth Type. + type: str + description: + description: Description. + type: str + id: + description: Id. + type: str + privacyPassword: + description: Privacy Password. + type: str + privacyType: + description: Privacy Type. + type: str + snmpMode: + description: Snmp Mode. + type: str + username: + description: Username. + type: str + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery CreateGlobalCredentialsV2 + description: Complete reference of the CreateGlobalCredentialsV2 API. + link: https://developer.cisco.com/docs/dna-center/#!create-global-credentials-v-2 +- name: Cisco DNA Center documentation for Discovery DeleteGlobalCredentialV2 + description: Complete reference of the DeleteGlobalCredentialV2 API. + link: https://developer.cisco.com/docs/dna-center/#!delete-global-credential-v-2 +- name: Cisco DNA Center documentation for Discovery UpdateGlobalCredentialsV2 + description: Complete reference of the UpdateGlobalCredentialsV2 API. + link: https://developer.cisco.com/docs/dna-center/#!update-global-credentials-v-2 +notes: + - SDK Method used are + discovery.Discovery.create_global_credentials_v2, + discovery.Discovery.delete_global_credential_v2, + discovery.Discovery.update_global_credentials_v2, + + - Paths used are + post /dna/intent/api/v2/global-credential, + delete /dna/intent/api/v2/global-credential/{id}, + put /dna/intent/api/v2/global-credential, + +""" + +EXAMPLES = r""" +- name: Update all + cisco.dnac.global_credential_v2: + 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}}" + state: present + cliCredential: + description: string + enablePassword: string + id: string + password: string + username: string + httpsRead: + id: string + name: string + password: string + port: 0 + username: string + httpsWrite: + id: string + name: string + password: string + port: 0 + username: string + snmpV2cRead: + description: string + id: string + readCommunity: string + snmpV2cWrite: + description: string + id: string + writeCommunity: string + snmpV3: + authPassword: string + authType: string + description: string + id: string + privacyPassword: string + privacyType: string + snmpMode: string + username: string + +- name: Create + cisco.dnac.global_credential_v2: + 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}}" + state: present + cliCredential: + - description: string + enablePassword: string + password: string + username: string + httpsRead: + - name: string + password: string + port: 0 + username: string + httpsWrite: + - name: string + password: string + port: 0 + username: string + snmpV2cRead: + - description: string + readCommunity: string + snmpV2cWrite: + - description: string + writeCommunity: string + snmpV3: + - authPassword: string + authType: string + description: string + privacyPassword: string + privacyType: string + snmpMode: string + username: string + +- name: Delete by id + cisco.dnac.global_credential_v2: + 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}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/plugins/modules/global_credential_v2_info.py b/plugins/modules/global_credential_v2_info.py new file mode 100644 index 0000000000..c746964cb8 --- /dev/null +++ b/plugins/modules/global_credential_v2_info.py @@ -0,0 +1,145 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: global_credential_v2_info +short_description: Information module for Global Credential V2 +description: +- Get all Global Credential V2. +- > + API to get device credentials' details. It fetches all global credentials of all types at once, without the need + to pass any input parameters. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Discovery GetAllGlobalCredentialsV2 + description: Complete reference of the GetAllGlobalCredentialsV2 API. + link: https://developer.cisco.com/docs/dna-center/#!get-all-global-credentials-v-2 +notes: + - SDK Method used are + discovery.Discovery.get_all_global_credentials_v2, + + - Paths used are + get /dna/intent/api/v2/global-credential, + +""" + +EXAMPLES = r""" +- name: Get all Global Credential V2 + cisco.dnac.global_credential_v2_info: + 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}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "cliCredential": [ + { + "password": "string", + "username": "string", + "enablePassword": "string", + "description": "string", + "comments": "string", + "credentialType": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "id": "string" + } + ], + "snmpV2cRead": [ + { + "readCommunity": "string", + "description": "string", + "comments": "string", + "credentialType": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "id": "string" + } + ], + "snmpV2cWrite": [ + { + "writeCommunity": "string", + "description": "string", + "comments": "string", + "credentialType": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "id": "string" + } + ], + "httpsRead": [ + { + "password": "string", + "port": 0, + "username": "string", + "secure": true, + "description": "string", + "comments": "string", + "credentialType": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "id": "string" + } + ], + "httpsWrite": [ + { + "password": "string", + "port": 0, + "username": "string", + "secure": true, + "description": "string", + "comments": "string", + "credentialType": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "id": "string" + } + ], + "snmpV3": [ + { + "username": "string", + "authPassword": "string", + "authType": "string", + "privacyPassword": "string", + "privacyType": "string", + "snmpMode": "string", + "description": "string", + "comments": "string", + "credentialType": "string", + "instanceTenantId": "string", + "instanceUuid": "string", + "id": "string" + } + ] + }, + "version": "string" + } +""" diff --git a/plugins/modules/global_pool_info.py b/plugins/modules/global_pool_info.py index 707a79794d..ed95446be1 100644 --- a/plugins/modules/global_pool_info.py +++ b/plugins/modules/global_pool_info.py @@ -22,11 +22,11 @@ offset: description: - Offset query parameter. Offset/starting row. - type: str + type: int limit: description: - Limit query parameter. No of Global Pools to be retrieved. - type: str + type: int requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -54,8 +54,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" - offset: string - limit: string + offset: 0 + limit: 0 register: result """ @@ -76,15 +76,15 @@ "gateways": [ "string" ], - "createTime": 0, - "lastUpdateTime": 0, - "totalIpAddressCount": 0, - "usedIpAddressCount": 0, + "createTime": "string", + "lastUpdateTime": "string", + "totalIpAddressCount": "string", + "usedIpAddressCount": "string", "parentUuid": "string", "owner": "string", - "shared": true, - "overlapping": true, - "configureExternalDhcp": true, + "shared": "string", + "overlapping": "string", + "configureExternalDhcp": "string", "usedPercentage": "string", "clientOptions": {}, "dnsServerIps": [ @@ -97,7 +97,7 @@ "contextValue": "string" } ], - "ipv6": true, + "ipv6": "string", "id": "string", "ipPoolCidr": "string" } diff --git a/plugins/modules/integration_settings_instances_itsm.py b/plugins/modules/integration_settings_instances_itsm.py new file mode 100644 index 0000000000..1bc569d9fd --- /dev/null +++ b/plugins/modules/integration_settings_instances_itsm.py @@ -0,0 +1,160 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: integration_settings_instances_itsm +short_description: Resource module for Integration Settings Instances Itsm +description: +- Manage operations create, update and delete of the resource Integration Settings Instances Itsm. +- Creates ITSM Integration setting. +- Deletes the ITSM Integration setting. +- Updates the ITSM Integration setting. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + data: + description: Integration Settings Instances Itsm's data. + suboptions: + ConnectionSettings: + description: Integration Settings Instances Itsm's ConnectionSettings. + suboptions: + Auth_Password: + description: Auth Password. + type: str + Auth_UserName: + description: Auth User Name. + type: str + Url: + description: Url. + type: str + type: dict + type: dict + description: + description: Description of the setting instance. + type: str + dypName: + description: It should be ServiceNowConnection. + type: str + instanceId: + description: InstanceId path parameter. Instance Id of the Integration setting instance. + type: str + name: + description: Name of the setting instance. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for ITSM Integration CreateITSMIntegrationSetting + description: Complete reference of the CreateITSMIntegrationSetting API. + link: https://developer.cisco.com/docs/dna-center/#!create-itsm-integration-setting +- name: Cisco DNA Center documentation for ITSM Integration DeleteITSMIntegrationSetting + description: Complete reference of the DeleteITSMIntegrationSetting API. + link: https://developer.cisco.com/docs/dna-center/#!delete-itsm-integration-setting +- name: Cisco DNA Center documentation for ITSM Integration UpdateITSMIntegrationSetting + description: Complete reference of the UpdateITSMIntegrationSetting API. + link: https://developer.cisco.com/docs/dna-center/#!update-itsm-integration-setting +notes: + - SDK Method used are + itsm_integration.ItsmIntegration.create_itsm_integration_setting, + itsm_integration.ItsmIntegration.delete_itsm_integration_setting, + itsm_integration.ItsmIntegration.update_itsm_integration_setting, + + - Paths used are + post /dna/intent/api/v1/integration-settings/instances/itsm, + delete /dna/intent/api/v1/integration-settings/instances/itsm/{instanceId}, + put /dna/intent/api/v1/integration-settings/instances/itsm/{instanceId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.integration_settings_instances_itsm: + 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}}" + state: present + data: + ConnectionSettings: + Auth_Password: string + Auth_UserName: string + Url: string + description: string + dypName: string + name: string + +- name: Update by id + cisco.dnac.integration_settings_instances_itsm: + 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}}" + state: present + data: + ConnectionSettings: + Auth_Password: string + Auth_UserName: string + Url: string + description: string + dypName: string + instanceId: string + name: string + +- name: Delete by id + cisco.dnac.integration_settings_instances_itsm: + 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}}" + state: absent + instanceId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "id": "string", + "dypId": "string", + "dypName": "string", + "name": "string", + "uniqueKey": "string", + "dypMajorVersion": 0, + "description": "string", + "data": { + "ConnectionSettings": { + "Url": "string", + "Auth_UserName": "string", + "Auth_Password": "string" + } + }, + "createdDate": 0, + "createdBy": "string", + "updatedBy": "string", + "softwareVersionLog": [ + {} + ], + "schemaVersion": 0, + "tenantId": "string" + } +""" diff --git a/plugins/modules/integration_settings_instances_itsm_info.py b/plugins/modules/integration_settings_instances_itsm_info.py new file mode 100644 index 0000000000..fc6a5de7a0 --- /dev/null +++ b/plugins/modules/integration_settings_instances_itsm_info.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: integration_settings_instances_itsm_info +short_description: Information module for Integration Settings Instances Itsm +description: +- Get Integration Settings Instances Itsm by id. +- Fetches ITSM Integration setting by ID. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + instanceId: + description: + - InstanceId path parameter. Instance Id of the Integration setting instance. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for ITSM Integration GetITSMIntegrationSettingById + description: Complete reference of the GetITSMIntegrationSettingById API. + link: https://developer.cisco.com/docs/dna-center/#!get-itsm-integration-setting-by-id +notes: + - SDK Method used are + itsm_integration.ItsmIntegration.get_itsm_integration_setting_by_id, + + - Paths used are + get /dna/intent/api/v1/integration-settings/instances/itsm/{instanceId}, + +""" + +EXAMPLES = r""" +- name: Get Integration Settings Instances Itsm by id + cisco.dnac.integration_settings_instances_itsm_info: + 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}}" + instanceId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "_id": "string", + "id": "string", + "dypId": "string", + "dypName": "string", + "dypMajorVersion": 0, + "name": "string", + "uniqueKey": "string", + "description": "string", + "data": { + "ConnectionSettings": { + "Url": "string", + "Auth_UserName": "string", + "Auth_Password": "string" + } + }, + "updatedDate": 0, + "updatedBy": "string", + "tenantId": "string" + } +""" diff --git a/plugins/modules/interface_info.py b/plugins/modules/interface_info.py index 431bf3d40f..02d4dd14ea 100644 --- a/plugins/modules/interface_info.py +++ b/plugins/modules/interface_info.py @@ -63,18 +63,62 @@ sample: > { "response": { - "interfaceUuid": "string", + "type": "string", "properties": { - "name": "string", - "applicable": true, - "failureReason": {} + "interfaceUuid": { + "type": "string" + }, + "properties": { + "type": "string", + "items": [ + { + "type": "string", + "properties": { + "name": { + "type": "string" + }, + "applicable": { + "type": "string" + }, + "failureReason": { + "type": "string" + } + }, + "required": [ + "string" + ] + } + ] + }, + "operations": { + "type": "string", + "items": [ + { + "type": "string", + "properties": { + "name": { + "type": "string" + }, + "applicable": { + "type": "string" + }, + "failureReason": { + "type": "string" + } + }, + "required": [ + "string" + ] + } + ] + } }, - "operations": { - "name": "string", - "applicable": true, - "failureReason": {} - } + "required": [ + "string" + ] }, - "version": "string" + "version": { + "type": "string" + } } """ diff --git a/plugins/modules/interface_update.py b/plugins/modules/interface_update.py index 5ac59eca5d..20d7435e44 100644 --- a/plugins/modules/interface_update.py +++ b/plugins/modules/interface_update.py @@ -94,6 +94,8 @@ "string" ] }, - "version": "string" + "version": { + "type": "string" + } } """ diff --git a/plugins/modules/lan_automation_create.py b/plugins/modules/lan_automation_create.py index d669dd73df..e87775b948 100644 --- a/plugins/modules/lan_automation_create.py +++ b/plugins/modules/lan_automation_create.py @@ -66,12 +66,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for LAN Automation LANAutomation2 - description: Complete reference of the LANAutomation2 API. - link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-2 +- name: Cisco DNA Center documentation for LAN Automation LANAutomationStart + description: Complete reference of the LANAutomationStart API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-start notes: - SDK Method used are - lan_automation.LanAutomation.lan_automation2, + lan_automation.LanAutomation.lan_automation_start, - Paths used are post /dna/intent/api/v1/lan-automation, @@ -113,9 +113,8 @@ sample: > { "response": { - "errorCode": "string", "message": "string", - "detail": "string" + "id": "string" }, "version": "string" } diff --git a/plugins/modules/lan_automation_delete.py b/plugins/modules/lan_automation_delete.py index 4439efb2f6..d4a8a6651b 100644 --- a/plugins/modules/lan_automation_delete.py +++ b/plugins/modules/lan_automation_delete.py @@ -23,12 +23,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for LAN Automation LANAutomation - description: Complete reference of the LANAutomation API. - link: https://developer.cisco.com/docs/dna-center/#!l-an-automation +- name: Cisco DNA Center documentation for LAN Automation LANAutomationStop + description: Complete reference of the LANAutomationStop API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-stop notes: - SDK Method used are - lan_automation.LanAutomation.lan_automation, + lan_automation.LanAutomation.lan_automation_stop, - Paths used are delete /dna/intent/api/v1/lan-automation/{id}, diff --git a/plugins/modules/lan_automation_log_by_serial_number_info.py b/plugins/modules/lan_automation_log_by_serial_number_info.py new file mode 100644 index 0000000000..c81f24292c --- /dev/null +++ b/plugins/modules/lan_automation_log_by_serial_number_info.py @@ -0,0 +1,95 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: lan_automation_log_by_serial_number_info +short_description: Information module for Lan Automation Log By Serial Number +description: +- Get Lan Automation Log By Serial Number by id. +- > + Invoke this API to get the LAN Automation session logs for individual devices based on the given LAN Automation + session id and device serial number. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id path parameter. LAN Automation session identifier. + type: str + serialNumber: + description: + - SerialNumber path parameter. Device serial number. + type: str + logLevel: + description: + - > + LogLevel query parameter. Supported levels are ERROR, INFO, WARNING, TRACE, CONFIG and ALL. Specifying ALL + will display device specific logs with the exception of CONFIG logs. In order to view CONFIG logs along with + the remaining logs, please leave the query parameter blank. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for LAN Automation LANAutomationLogsForIndividualDevices + description: Complete reference of the LANAutomationLogsForIndividualDevices API. + link: https://developer.cisco.com/docs/dna-center/#!l-an-automation-logs-for-individual-devices +notes: + - SDK Method used are + lan_automation.LanAutomation.lan_automation_logs_for_individual_devices, + + - Paths used are + get /dna/intent/api/v1/lan-automation/log/{id}/{serialNumber}, + +""" + +EXAMPLES = r""" +- name: Get Lan Automation Log By Serial Number by id + cisco.dnac.lan_automation_log_by_serial_number_info: + 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}}" + logLevel: string + id: string + serialNumber: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "nwOrchId": "string", + "logs": [ + { + "logLevel": "string", + "timeStamp": "string", + "record": "string" + } + ], + "serialNumber": "string" + } + ], + "version": "string" + } +""" diff --git a/plugins/modules/lan_automation_log_info.py b/plugins/modules/lan_automation_log_info.py index c0eeb71d08..ede147df97 100644 --- a/plugins/modules/lan_automation_log_info.py +++ b/plugins/modules/lan_automation_log_info.py @@ -24,11 +24,11 @@ offset: description: - Offset query parameter. Starting index of the LAN Automation session. Minimum value is 1. - type: str + type: int limit: description: - Limit query parameter. Number of LAN Automation sessions to be retrieved. Limit value can range between 1 to 10. - type: str + type: int id: description: - Id path parameter. LAN Automation session identifier. @@ -65,8 +65,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" - offset: string - limit: string + offset: 0 + limit: 0 register: result - name: Get Lan Automation Log by id diff --git a/plugins/modules/lan_automation_status_info.py b/plugins/modules/lan_automation_status_info.py index a96d32852a..62ad0a3717 100644 --- a/plugins/modules/lan_automation_status_info.py +++ b/plugins/modules/lan_automation_status_info.py @@ -24,11 +24,11 @@ offset: description: - Offset query parameter. Starting index of the LAN Automation session. Minimum value is 1. - type: str + type: int limit: description: - Limit query parameter. Number of LAN Automation sessions to be retrieved. Limit value can range between 1 to 10. - type: str + type: int id: description: - Id path parameter. LAN Automation session identifier. @@ -65,8 +65,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" - offset: string - limit: string + offset: 0 + limit: 0 register: result - name: Get Lan Automation Status by id diff --git a/plugins/modules/license_device_count_info.py b/plugins/modules/license_device_count_info.py index 3abbf7855d..efee0085a5 100644 --- a/plugins/modules/license_device_count_info.py +++ b/plugins/modules/license_device_count_info.py @@ -29,26 +29,26 @@ type: str dna_level: description: - - Dna_level query parameter. Device Cisco DNA license level. + - Dna_level query parameter. Device Cisco DNA License Level. type: str virtual_account_name: description: - - Virtual_account_name query parameter. Name of virtual account. + - Virtual_account_name query parameter. Virtual account name. type: str smart_account_id: description: - - Smart_account_id query parameter. Id of smart account. + - Smart_account_id query parameter. Smart account id. type: str requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses DeviceCountDetails - description: Complete reference of the DeviceCountDetails API. - link: https://developer.cisco.com/docs/dna-center/#!device-count-details +- name: Cisco DNA Center documentation for Licenses DeviceCountDetails2 + description: Complete reference of the DeviceCountDetails2 API. + link: https://developer.cisco.com/docs/dna-center/#!device-count-details-2 notes: - SDK Method used are - licenses.Licenses.device_count_details, + licenses.Licenses.device_count_details2, - Paths used are get /dna/intent/api/v1/licenses/device/count, diff --git a/plugins/modules/license_device_deregistration.py b/plugins/modules/license_device_deregistration.py index b126dec716..aeceb34709 100644 --- a/plugins/modules/license_device_deregistration.py +++ b/plugins/modules/license_device_deregistration.py @@ -24,12 +24,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses DeviceDeregistration - description: Complete reference of the DeviceDeregistration API. - link: https://developer.cisco.com/docs/dna-center/#!device-deregistration +- name: Cisco DNA Center documentation for Licenses DeviceDeregistration2 + description: Complete reference of the DeviceDeregistration2 API. + link: https://developer.cisco.com/docs/dna-center/#!device-deregistration-2 notes: - SDK Method used are - licenses.Licenses.device_deregistration, + licenses.Licenses.device_deregistration2, - Paths used are put /dna/intent/api/v1/licenses/smartAccount/virtualAccount/deregister, diff --git a/plugins/modules/license_device_license_details_info.py b/plugins/modules/license_device_license_details_info.py index 0d9000f4bf..5410196ca8 100644 --- a/plugins/modules/license_device_license_details_info.py +++ b/plugins/modules/license_device_license_details_info.py @@ -27,12 +27,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses DeviceLicenseDetails - description: Complete reference of the DeviceLicenseDetails API. - link: https://developer.cisco.com/docs/dna-center/#!device-license-details +- name: Cisco DNA Center documentation for Licenses DeviceLicenseDetails2 + description: Complete reference of the DeviceLicenseDetails2 API. + link: https://developer.cisco.com/docs/dna-center/#!device-license-details-2 notes: - SDK Method used are - licenses.Licenses.device_license_details, + licenses.Licenses.device_license_details2, - Paths used are get /dna/intent/api/v1/licenses/device/{device_uuid}/details, diff --git a/plugins/modules/license_device_license_summary_info.py b/plugins/modules/license_device_license_summary_info.py index c2e4888282..ae872d0956 100644 --- a/plugins/modules/license_device_license_summary_info.py +++ b/plugins/modules/license_device_license_summary_info.py @@ -63,12 +63,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses DeviceLicenseSummary - description: Complete reference of the DeviceLicenseSummary API. - link: https://developer.cisco.com/docs/dna-center/#!device-license-summary +- name: Cisco DNA Center documentation for Licenses DeviceLicenseSummary2 + description: Complete reference of the DeviceLicenseSummary2 API. + link: https://developer.cisco.com/docs/dna-center/#!device-license-summary-2 notes: - SDK Method used are - licenses.Licenses.device_license_summary, + licenses.Licenses.device_license_summary2, - Paths used are get /dna/intent/api/v1/licenses/device/summary, diff --git a/plugins/modules/license_device_registration.py b/plugins/modules/license_device_registration.py index de9ed6c3c0..6d7f5b955b 100644 --- a/plugins/modules/license_device_registration.py +++ b/plugins/modules/license_device_registration.py @@ -27,12 +27,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses DeviceRegistration - description: Complete reference of the DeviceRegistration API. - link: https://developer.cisco.com/docs/dna-center/#!device-registration +- name: Cisco DNA Center documentation for Licenses DeviceRegistration2 + description: Complete reference of the DeviceRegistration2 API. + link: https://developer.cisco.com/docs/dna-center/#!device-registration-2 notes: - SDK Method used are - licenses.Licenses.device_registration, + licenses.Licenses.device_registration2, - Paths used are put /dna/intent/api/v1/licenses/smartAccount/virtualAccount/{virtual_account_name}/register, diff --git a/plugins/modules/license_term_details_info.py b/plugins/modules/license_term_details_info.py index 055dcec781..bdf26471d0 100644 --- a/plugins/modules/license_term_details_info.py +++ b/plugins/modules/license_term_details_info.py @@ -37,12 +37,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses LicenseTermDetails - description: Complete reference of the LicenseTermDetails API. - link: https://developer.cisco.com/docs/dna-center/#!license-term-details +- name: Cisco DNA Center documentation for Licenses LicenseTermDetails2 + description: Complete reference of the LicenseTermDetails2 API. + link: https://developer.cisco.com/docs/dna-center/#!license-term-details-2 notes: - SDK Method used are - licenses.Licenses.license_term_details, + licenses.Licenses.license_term_details2, - Paths used are get /dna/intent/api/v1/licenses/term/smartAccount/{smart_account_id}/virtualAccount/{virtual_account_name}, diff --git a/plugins/modules/license_usage_details_info.py b/plugins/modules/license_usage_details_info.py index e1307e70f9..d315848c90 100644 --- a/plugins/modules/license_usage_details_info.py +++ b/plugins/modules/license_usage_details_info.py @@ -26,7 +26,7 @@ virtual_account_name: description: - > - Virtual_account_name path parameter. Name of virtual account. Putting "All" will give license usage detail + Virtual_account_name path parameter. Name of virtual account. Putting "All" will give license term detail for all virtual accounts. type: str device_type: @@ -37,12 +37,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses LicenseUsageDetails - description: Complete reference of the LicenseUsageDetails API. - link: https://developer.cisco.com/docs/dna-center/#!license-usage-details +- name: Cisco DNA Center documentation for Licenses LicenseUsageDetails2 + description: Complete reference of the LicenseUsageDetails2 API. + link: https://developer.cisco.com/docs/dna-center/#!license-usage-details-2 notes: - SDK Method used are - licenses.Licenses.license_usage_details, + licenses.Licenses.license_usage_details2, - Paths used are get /dna/intent/api/v1/licenses/usage/smartAccount/{smart_account_id}/virtualAccount/{virtual_account_name}, diff --git a/plugins/modules/license_virtual_account_change.py b/plugins/modules/license_virtual_account_change.py index 007970fd39..9e647aefcb 100644 --- a/plugins/modules/license_virtual_account_change.py +++ b/plugins/modules/license_virtual_account_change.py @@ -30,12 +30,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses ChangeVirtualAccount - description: Complete reference of the ChangeVirtualAccount API. - link: https://developer.cisco.com/docs/dna-center/#!change-virtual-account +- name: Cisco DNA Center documentation for Licenses ChangeVirtualAccount2 + description: Complete reference of the ChangeVirtualAccount2 API. + link: https://developer.cisco.com/docs/dna-center/#!change-virtual-account-2 notes: - SDK Method used are - licenses.Licenses.change_virtual_account, + licenses.Licenses.change_virtual_account2, - Paths used are post /dna/intent/api/v1/licenses/smartAccount/{smart_account_id}/virtualAccount/{virtual_account_name}/device/transfer, diff --git a/plugins/modules/license_virtual_account_details_info.py b/plugins/modules/license_virtual_account_details_info.py index 4d4bc17133..476f587584 100644 --- a/plugins/modules/license_virtual_account_details_info.py +++ b/plugins/modules/license_virtual_account_details_info.py @@ -27,12 +27,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Licenses VirtualAccountDetails - description: Complete reference of the VirtualAccountDetails API. - link: https://developer.cisco.com/docs/dna-center/#!virtual-account-details +- name: Cisco DNA Center documentation for Licenses VirtualAccountDetails2 + description: Complete reference of the VirtualAccountDetails2 API. + link: https://developer.cisco.com/docs/dna-center/#!virtual-account-details-2 notes: - SDK Method used are - licenses.Licenses.virtual_account_details, + licenses.Licenses.virtual_account_details2, - Paths used are get /dna/intent/api/v1/licenses/smartAccount/{smart_account_id}/virtualAccounts, diff --git a/plugins/modules/network_create.py b/plugins/modules/network_create.py index 98e38c408c..9c7abda29d 100644 --- a/plugins/modules/network_create.py +++ b/plugins/modules/network_create.py @@ -11,8 +11,8 @@ description: - Manage operation create of the resource Network Create. - > - API to create a network for DHCP, Syslog, SNMP, NTP, Network AAA, Client and Endpint AAA, and/or DNS center server - settings. + API to create a network for DHCP, Syslog, SNMP, NTP, Network AAA, Client and EndPoint AAA, and/or DNS center + server settings. version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module @@ -44,40 +44,40 @@ type: str type: dict dhcpServer: - description: Dhcp serve Ip (eg 1.1.1.1). + description: DHCP Server IP (eg 1.1.1.1). elements: str type: list dnsServer: description: Network Create's dnsServer. suboptions: domainName: - description: Domain name of DHCP (eg; cisco). + description: Domain Name of DHCP (eg; cisco). type: str primaryIpAddress: - description: Primary ip address for DHCP (eg 2.2.2.2). + description: Primary IP Address for DHCP (eg 2.2.2.2). type: str secondaryIpAddress: - description: Secondary ip address for DHCP (eg 3.3.3.3). + description: Secondary IP Address for DHCP (eg 3.3.3.3). type: str type: dict messageOfTheday: description: Network Create's messageOfTheday. suboptions: bannerMessage: - description: Massage for banner message (eg; Good day). + description: Massage for Banner message (eg; Good day). type: str retainExistingBanner: - description: Retain existing banner message (eg "true" or "false"). + description: Retain existing Banner Message (eg "true" or "false"). type: str type: dict netflowcollector: description: Network Create's netflowcollector. suboptions: ipAddress: - description: IP address for netflow collector (eg 3.3.3.1). + description: IP Address for NetFlow collector (eg 3.3.3.1). type: str port: - description: Port for netflow collector (eg; 443). + description: Port for NetFlow Collector (eg; 443). type: int type: dict network_aaa: @@ -87,16 +87,16 @@ description: IP address for AAA and ISE server (eg 1.1.1.1). type: str network: - description: IP address for AAA or ISE server (eg 2.2.2.2). + description: IP Address for AAA or ISE server (eg 2.2.2.2). type: str protocol: description: Protocol for AAA or ISE serve (eg RADIUS). type: str servers: - description: Server type for AAA network (eg AAA). + description: Server type for AAA Network (eg AAA). type: str sharedSecret: - description: Shared secret for ISE server. + description: Shared secret for ISE Server. type: str type: dict ntpServer: @@ -107,10 +107,10 @@ description: Network Create's snmpServer. suboptions: configureDnacIP: - description: Configuration dnac ip for snmp server (eg true). + description: Configuration DNAC IP for SNMP Server (eg true). type: bool ipAddresses: - description: IP address for snmp server (eg 4.4.4.1). + description: IP Address for SNMP Server (eg 4.4.4.1). elements: str type: list type: dict @@ -118,10 +118,10 @@ description: Network Create's syslogServer. suboptions: configureDnacIP: - description: Configuration dnac ip for syslog server (eg true). + description: Configuration DNAC IP for syslog server (eg true). type: bool ipAddresses: - description: IP address for syslog server (eg 4.4.4.4). + description: IP Address for syslog server (eg 4.4.4.4). elements: str type: list type: dict diff --git a/plugins/modules/network_device_by_serial_number_info.py b/plugins/modules/network_device_by_serial_number_info.py index 3b4a952142..4248aee8c0 100644 --- a/plugins/modules/network_device_by_serial_number_info.py +++ b/plugins/modules/network_device_by_serial_number_info.py @@ -10,7 +10,7 @@ short_description: Information module for Network Device By Serial Number description: - Get Network Device By Serial Number by id. -- Returns the network device with given serial number. +- Returns the network device if the given serial number matches with any of the serial numbers collected. version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module_info diff --git a/plugins/modules/network_device_custom_prompt_info.py b/plugins/modules/network_device_custom_prompt_info.py index 03a4e0bb67..96a9c74bcf 100644 --- a/plugins/modules/network_device_custom_prompt_info.py +++ b/plugins/modules/network_device_custom_prompt_info.py @@ -7,9 +7,9 @@ DOCUMENTATION = r""" --- module: network_device_custom_prompt_info -short_description: Information module for Network Device Custom Prompt +short_description: Information module for Network Device Custom Prompt Info description: -- Get all Network Device Custom Prompt. +- Get all Network Device Custom Prompt Info. - Returns supported custom prompts by Cisco DNA Center. version_added: '6.0.0' extends_documentation_fragment: @@ -36,8 +36,8 @@ """ EXAMPLES = r""" -- name: Get all Network Device Custom Prompt - cisco.dnac.network_device_custom_prompt_info: +- name: Get all Network Device Custom Prompt Info + cisco.dnac.network_device_custom_prompt_info_info: dnac_host: "{{dnac_host}}" dnac_username: "{{dnac_username}}" dnac_password: "{{dnac_password}}" diff --git a/plugins/modules/network_device_equipment_info.py b/plugins/modules/network_device_equipment_info.py index 88ea72c498..0e5cd5c641 100644 --- a/plugins/modules/network_device_equipment_info.py +++ b/plugins/modules/network_device_equipment_info.py @@ -25,7 +25,9 @@ type: str type: description: - - Type query parameter. Type value should be PowerSupply or Fan. + - > + Type query parameter. Type value can be PowerSupply, Fan, Chassis, Backplane, Module, PROCESSOR, Other, SFP. + If no type is mentioned, All equipments are fetched for the device. type: str requirements: - dnacentersdk >= 2.5.5 diff --git a/plugins/modules/network_device_inventory_insight_link_mismatch_info.py b/plugins/modules/network_device_inventory_insight_link_mismatch_info.py index c62e0a01d6..23f7c6c57b 100644 --- a/plugins/modules/network_device_inventory_insight_link_mismatch_info.py +++ b/plugins/modules/network_device_inventory_insight_link_mismatch_info.py @@ -26,11 +26,11 @@ offset: description: - Offset query parameter. Row Number. Default value is 1. - type: str + type: int limit: description: - Limit query parameter. Default value is 500. - type: str + type: int category: description: - Category query parameter. Links mismatch category. Value can be speed-duplex or vlan. @@ -70,8 +70,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" - offset: string - limit: string + offset: 0 + limit: 0 category: string sortBy: string order: string diff --git a/plugins/modules/network_device_module_info.py b/plugins/modules/network_device_module_info.py index 83cc6b7f91..d9924fc159 100644 --- a/plugins/modules/network_device_module_info.py +++ b/plugins/modules/network_device_module_info.py @@ -28,11 +28,11 @@ limit: description: - Limit query parameter. - type: str + type: int offset: description: - Offset query parameter. - type: str + type: int nameList: description: - NameList query parameter. @@ -90,8 +90,8 @@ dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" deviceId: string - limit: string - offset: string + limit: 0 + offset: 0 nameList: [] vendorEquipmentTypeList: [] partNumberList: [] diff --git a/plugins/modules/network_device_range_info.py b/plugins/modules/network_device_range_info.py index c9fbae5194..2aa2f9e808 100644 --- a/plugins/modules/network_device_range_info.py +++ b/plugins/modules/network_device_range_info.py @@ -10,7 +10,9 @@ short_description: Information module for Network Device Range description: - Get all Network Device Range. -- Returns the list of network devices for the given pagination range. +- > + Returns the list of network devices for the given pagination range. The maximum number of records that can be + retrieved is 500. version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module_info @@ -21,11 +23,11 @@ type: dict startIndex: description: - - StartIndex path parameter. Start index. + - StartIndex path parameter. Start index >=1. type: int recordsToReturn: description: - - RecordsToReturn path parameter. Number of records to return. + - RecordsToReturn path parameter. Number of records to return 1<= recordsToReturn <= 500. type: int requirements: - dnacentersdk >= 2.5.5 diff --git a/plugins/modules/network_device_register_for_wsa_info.py b/plugins/modules/network_device_register_for_wsa_info.py index a813bda2c7..7997fa15f4 100644 --- a/plugins/modules/network_device_register_for_wsa_info.py +++ b/plugins/modules/network_device_register_for_wsa_info.py @@ -10,7 +10,9 @@ short_description: Information module for Network Device Register For Wsa description: - Get all Network Device Register For Wsa. -- Registers a device for WSA notification. +- > + It fetches devices which are registered to receive WSA notifications. The device serial number and/or MAC address + are required to be provided as query parameters. version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module_info @@ -31,12 +33,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Devices RegisterDeviceForWSA - description: Complete reference of the RegisterDeviceForWSA API. - link: https://developer.cisco.com/docs/dna-center/#!register-device-for-wsa +- name: Cisco DNA Center documentation for Devices GetDevicesRegisteredForWSANotification + description: Complete reference of the GetDevicesRegisteredForWSANotification API. + link: https://developer.cisco.com/docs/dna-center/#!get-devices-registered-for-wsa-notification notes: - SDK Method used are - devices.Devices.register_device_for_wsa, + devices.Devices.get_devices_registered_for_wsa_notification, - Paths used are get /dna/intent/api/v1/network-device/tenantinfo/macaddress, diff --git a/plugins/modules/network_device_user_defined_field.py b/plugins/modules/network_device_user_defined_field.py new file mode 100644 index 0000000000..b350e69dd5 --- /dev/null +++ b/plugins/modules/network_device_user_defined_field.py @@ -0,0 +1,111 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_user_defined_field +short_description: Resource module for Network Device User Defined Field +description: +- Manage operations create, update and delete of the resource Network Device User Defined Field. +- Creates a new global User Defined Field, which can be assigned to devices. +- Deletes an existing Global User-Defined-Field using it's id. +- Updates an existing global User Defined Field, using it's id. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + description: + description: Description of UDF. + type: str + id: + description: Id path parameter. UDF id. + type: str + name: + description: Name of UDF. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices CreateUserDefinedField + description: Complete reference of the CreateUserDefinedField API. + link: https://developer.cisco.com/docs/dna-center/#!create-user-defined-field +- name: Cisco DNA Center documentation for Devices DeleteUserDefinedField + description: Complete reference of the DeleteUserDefinedField API. + link: https://developer.cisco.com/docs/dna-center/#!delete-user-defined-field +- name: Cisco DNA Center documentation for Devices UpdateUserDefinedField + description: Complete reference of the UpdateUserDefinedField API. + link: https://developer.cisco.com/docs/dna-center/#!update-user-defined-field +notes: + - SDK Method used are + devices.Devices.create_user_defined_field, + devices.Devices.delete_user_defined_field, + devices.Devices.update_user_defined_field, + + - Paths used are + post /dna/intent/api/v1/network-device/user-defined-field, + delete /dna/intent/api/v1/network-device/user-defined-field/{id}, + put /dna/intent/api/v1/network-device/user-defined-field/{id}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.network_device_user_defined_field: + 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}}" + state: present + description: string + name: string + +- name: Update by id + cisco.dnac.network_device_user_defined_field: + 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}}" + state: present + description: string + id: string + name: string + +- name: Delete by id + cisco.dnac.network_device_user_defined_field: + 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}}" + state: absent + id: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/plugins/modules/network_device_user_defined_field_info.py b/plugins/modules/network_device_user_defined_field_info.py new file mode 100644 index 0000000000..d72f5955e2 --- /dev/null +++ b/plugins/modules/network_device_user_defined_field_info.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_device_user_defined_field_info +short_description: Information module for Network Device User Defined Field +description: +- Get all Network Device User Defined Field. +- > + Gets existing global User Defined Fields. If no input is given, it fetches ALL the Global UDFs. Filter/search is + supported either by UDF Ids or by UDF names, but not both. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + id: + description: + - Id query parameter. Comma-seperated id(s) used for search/filtering. + type: str + name: + description: + - Name query parameter. Comma-seperated name(s) used for search/filtering. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Devices GetAllUserDefinedFields + description: Complete reference of the GetAllUserDefinedFields API. + link: https://developer.cisco.com/docs/dna-center/#!get-all-user-defined-fields +notes: + - SDK Method used are + devices.Devices.get_all_user_defined_fields, + + - Paths used are + get /dna/intent/api/v1/network-device/user-defined-field, + +""" + +EXAMPLES = r""" +- name: Get all Network Device User Defined Field + cisco.dnac.network_device_user_defined_field_info: + 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}}" + id: string + name: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "id": "string", + "name": "string", + "description": "string" + } + ], + "version": "string" + } +""" diff --git a/plugins/modules/network_device_with_snmp_v3_des_info.py b/plugins/modules/network_device_with_snmp_v3_des_info.py index c9a750920e..4fd5157c56 100644 --- a/plugins/modules/network_device_with_snmp_v3_des_info.py +++ b/plugins/modules/network_device_with_snmp_v3_des_info.py @@ -28,11 +28,11 @@ offset: description: - Offset query parameter. Row Number. Default value is 1. - type: str + type: int limit: description: - Limit query parameter. Default value is 500. - type: str + type: int sortBy: description: - SortBy query parameter. Sort By. @@ -68,8 +68,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" - offset: string - limit: string + offset: 0 + limit: 0 sortBy: string order: string siteId: string diff --git a/plugins/modules/network_update.py b/plugins/modules/network_update.py index f2bc5e8825..be67025b80 100644 --- a/plugins/modules/network_update.py +++ b/plugins/modules/network_update.py @@ -10,7 +10,9 @@ short_description: Resource module for Network Update description: - Manage operation update of the resource Network Update. -- API to update network for DHCP and DNS center server settings. +- > + API to update network settings for DHCP, Syslog, SNMP, NTP, Network AAA, Client and EndPoint AAA, and/or DNS + server settings. version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module @@ -39,40 +41,40 @@ type: str type: dict dhcpServer: - description: Dhcp serve Ip (eg 1.1.1.1). + description: DHCP Server IP (eg 1.1.1.1). elements: str type: list dnsServer: description: Network Update's dnsServer. suboptions: domainName: - description: Domain name of DHCP (eg; cisco). + description: Domain Name of DHCP (eg; cisco). type: str primaryIpAddress: - description: Primary ip address for DHCP (eg 2.2.2.2). + description: Primary IP Address for DHCP (eg 2.2.2.2). type: str secondaryIpAddress: - description: Secondary ip address for DHCP (eg 3.3.3.3). + description: Secondary IP Address for DHCP (eg 3.3.3.3). type: str type: dict messageOfTheday: description: Network Update's messageOfTheday. suboptions: bannerMessage: - description: Massage for banner message (eg; Good day). + description: Massage for Banner message (eg; Good day). type: str retainExistingBanner: - description: Retain existing banner message (eg "true" or "false"). + description: Retain existing Banner Message (eg "true" or "false"). type: str type: dict netflowcollector: description: Network Update's netflowcollector. suboptions: ipAddress: - description: IP address for netflow collector (eg 3.3.3.1). + description: IP Address for NetFlow collector (eg 3.3.3.1). type: str port: - description: Port for netflow collector (eg; 443). + description: Port for NetFlow Collector (eg; 443). type: int type: dict network_aaa: @@ -82,16 +84,16 @@ description: IP address for AAA and ISE server (eg 1.1.1.1). type: str network: - description: IP address for AAA or ISE server (eg 2.2.2.2). + description: IP Address for AAA or ISE server (eg 2.2.2.2). type: str protocol: description: Protocol for AAA or ISE serve (eg RADIUS). type: str servers: - description: Server type for AAA network (eg AAA). + description: Server type for AAA Network (eg AAA). type: str sharedSecret: - description: Shared secret for ISE server. + description: Shared secret for ISE Server. type: str type: dict ntpServer: @@ -102,10 +104,10 @@ description: Network Update's snmpServer. suboptions: configureDnacIP: - description: Configuration dnac ip for snmp server (eg true). + description: Configuration DNAC IP for SNMP Server (eg true). type: bool ipAddresses: - description: IP address for snmp server (eg 4.4.4.1). + description: IP Address for SNMP Server (eg 4.4.4.1). elements: str type: list type: dict @@ -113,10 +115,10 @@ description: Network Update's syslogServer. suboptions: configureDnacIP: - description: Configuration dnac ip for syslog server (eg true). + description: Configuration DNAC IP for syslog server (eg true). type: bool ipAddresses: - description: IP address for syslog server (eg 4.4.4.4). + description: IP Address for syslog server (eg 4.4.4.4). elements: str type: list type: dict diff --git a/plugins/modules/network_v2.py b/plugins/modules/network_v2.py new file mode 100644 index 0000000000..14ca5c2861 --- /dev/null +++ b/plugins/modules/network_v2.py @@ -0,0 +1,266 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_v2 +short_description: Resource module for Network V2 +description: +- Manage operations create and update of the resource Network V2. +- > + API to create network settings for DHCP, Syslog, SNMP, NTP, Network AAA, Client and Endpoint AAA, and/or DNS + center server settings. +- > + API to update network settings for DHCP, Syslog, SNMP, NTP, Network AAA, Client and Endpoint AAA, and/or DNS + center server settings. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + settings: + description: Network V2's settings. + suboptions: + clientAndEndpoint_aaa: + description: Network V2's clientAndEndpoint_aaa. + suboptions: + ipAddress: + description: IP address for ISE serve (eg 1.1.1.4). + type: str + network: + description: IP address for AAA or ISE server (eg 2.2.2.1). + type: str + protocol: + description: Protocol for AAA or ISE serve (eg RADIUS). + type: str + servers: + description: Server type AAA or ISE server (eg AAA). + type: str + sharedSecret: + description: Shared secret for ISE server. + type: str + type: dict + dhcpServer: + description: DHCP Server IP (eg 1.1.1.1). + elements: str + type: list + dnsServer: + description: Network V2's dnsServer. + suboptions: + domainName: + description: Domain Name of DHCP (eg; cisco). + type: str + primaryIpAddress: + description: Primary IP Address for DHCP (eg 2.2.2.2). + type: str + secondaryIpAddress: + description: Secondary IP Address for DHCP (eg 3.3.3.3). + type: str + type: dict + messageOfTheday: + description: Network V2's messageOfTheday. + suboptions: + bannerMessage: + description: Massage for Banner message (eg; Good day). + type: str + retainExistingBanner: + description: Retain existing Banner Message (eg "true" or "false"). + type: str + type: dict + netflowcollector: + description: Network V2's netflowcollector. + suboptions: + ipAddress: + description: IP Address for NetFlow collector (eg 3.3.3.1). + type: str + port: + description: Port for NetFlow Collector (eg; 443). + type: int + type: dict + network_aaa: + description: Network V2's network_aaa. + suboptions: + ipAddress: + description: IP address for AAA and ISE server (eg 1.1.1.1). + type: str + network: + description: IP Address for AAA or ISE server (eg 2.2.2.2). + type: str + protocol: + description: Protocol for AAA or ISE serve (eg RADIUS). + type: str + servers: + description: Server type for AAA Network (eg AAA). + type: str + sharedSecret: + description: Shared secret for ISE Server. + type: str + type: dict + ntpServer: + description: IP address for NTP server (eg 1.1.1.2). + elements: str + type: list + snmpServer: + description: Network V2's snmpServer. + suboptions: + configureDnacIP: + description: Configuration DNAC IP for SNMP Server (eg true). + type: bool + ipAddresses: + description: IP Address for SNMP Server (eg 4.4.4.1). + elements: str + type: list + type: dict + syslogServer: + description: Network V2's syslogServer. + suboptions: + configureDnacIP: + description: Configuration DNAC IP for syslog server (eg true). + type: bool + ipAddresses: + description: IP Address for syslog server (eg 4.4.4.4). + elements: str + type: list + type: dict + timezone: + description: Input for time zone (eg Africa/Abidjan). + type: str + type: dict + siteId: + description: SiteId path parameter. Site Id to which site details to associate with + the network settings. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings CreateNetworkV2 + description: Complete reference of the CreateNetworkV2 API. + link: https://developer.cisco.com/docs/dna-center/#!create-network-v-2 +- name: Cisco DNA Center documentation for Network Settings UpdateNetworkV2 + description: Complete reference of the UpdateNetworkV2 API. + link: https://developer.cisco.com/docs/dna-center/#!update-network-v-2 +notes: + - SDK Method used are + network_settings.NetworkSettings.create_network_v2, + network_settings.NetworkSettings.update_network_v2, + + - Paths used are + post /dna/intent/api/v2/network/{siteId}, + put /dna/intent/api/v2/network/{siteId}, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.network_v2: + 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}}" + state: present + settings: + clientAndEndpoint_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + dhcpServer: + - string + dnsServer: + domainName: string + primaryIpAddress: string + secondaryIpAddress: string + messageOfTheday: + bannerMessage: string + retainExistingBanner: string + netflowcollector: + ipAddress: string + port: 0 + network_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + ntpServer: + - string + snmpServer: + configureDnacIP: true + ipAddresses: + - string + syslogServer: + configureDnacIP: true + ipAddresses: + - string + timezone: string + siteId: string + +- name: Update by id + cisco.dnac.network_v2: + 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}}" + state: present + settings: + clientAndEndpoint_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + dhcpServer: + - string + dnsServer: + domainName: string + primaryIpAddress: string + secondaryIpAddress: string + messageOfTheday: + bannerMessage: string + retainExistingBanner: string + netflowcollector: + ipAddress: string + port: 0 + network_aaa: + ipAddress: string + network: string + protocol: string + servers: string + sharedSecret: string + ntpServer: + - string + snmpServer: + configureDnacIP: true + ipAddresses: + - string + syslogServer: + configureDnacIP: true + ipAddresses: + - string + timezone: string + siteId: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "taskId": "string", + "url": "string" + } +""" diff --git a/plugins/modules/network_v2_info.py b/plugins/modules/network_v2_info.py new file mode 100644 index 0000000000..f3b03cb76f --- /dev/null +++ b/plugins/modules/network_v2_info.py @@ -0,0 +1,81 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: network_v2_info +short_description: Information module for Network V2 +description: +- Get all Network V2. +- API to get SNMP, NTP, Network AAA, Client and Endpoint AAA, and/or DNS center server settings. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + siteId: + description: + - SiteId query parameter. Site Id to get the network settings associated with the site. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings GetNetworkV2 + description: Complete reference of the GetNetworkV2 API. + link: https://developer.cisco.com/docs/dna-center/#!get-network-v-2 +notes: + - SDK Method used are + network_settings.NetworkSettings.get_network_v2, + + - Paths used are + get /dna/intent/api/v2/network, + +""" + +EXAMPLES = r""" +- name: Get all Network V2 + cisco.dnac.network_v2_info: + 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}}" + siteId: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: list + elements: dict + sample: > + [ + { + "instanceType": "string", + "instanceUuid": "string", + "namespace": "string", + "type": "string", + "key": "string", + "version": 0, + "value": [ + "string" + ], + "groupUuid": "string", + "inheritedGroupUuid": "string", + "inheritedGroupName": "string" + } + ] +""" diff --git a/plugins/modules/nfv_profile.py b/plugins/modules/nfv_profile.py index 55f7950d0b..409c937d4f 100644 --- a/plugins/modules/nfv_profile.py +++ b/plugins/modules/nfv_profile.py @@ -54,25 +54,21 @@ suboptions: deviceType: description: Type of the device(eg Cisco 5400 Enterprise Network Compute - System), 'Cisco Integrated Services Virtual Router', 'Cisco Adaptive Security - Virtual Appliance (ASAv)', 'NFVIS', 'ASAV'. + System). type: str template: description: Name of the template(eg NFVIS template). type: str templateType: description: Name of the template type to which template is associated (eg - Cloud DayN Templates). Allowed values are 'Onboarding Template(s)' and - 'Day-N-Template(s)'. + Cloud DayN Templates). type: str type: list deviceTag: description: Device Tag name(eg dev1). type: str deviceType: - description: Name of the device used in creating nfv profile. Allowed values - are 'Cisco 5400 Enterprise Network Compute System', 'Cisco 5100 Enterprise - Network Compute System'. + description: Name of the device used in creating nfv profile. type: str directInternetAccessForFirewall: description: Direct internet access value should be boolean (eg false or true). diff --git a/plugins/modules/nfv_profile_info.py b/plugins/modules/nfv_profile_info.py index b972cea353..9468793596 100644 --- a/plugins/modules/nfv_profile_info.py +++ b/plugins/modules/nfv_profile_info.py @@ -26,11 +26,11 @@ offset: description: - Offset query parameter. Offset/starting row. - type: str + type: int limit: description: - Limit query parameter. Number of profile to be retrieved. - type: str + type: int name: description: - Name query parameter. Name of network profile to be retrieved. @@ -62,8 +62,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" - offset: string - limit: string + offset: 0 + limit: 0 name: string id: string register: result diff --git a/plugins/modules/path_trace.py b/plugins/modules/path_trace.py index 878b2e8480..a2b5519a67 100644 --- a/plugins/modules/path_trace.py +++ b/plugins/modules/path_trace.py @@ -20,32 +20,33 @@ author: Rafael Campos (@racampos) options: controlPath: - description: ControlPath flag. + description: Control path tracing. type: bool destIP: - description: Path Trace's destIP. + description: Destination IP address. type: str destPort: - description: Path Trace's destPort. + description: Destination Port. type: str flowAnalysisId: description: FlowAnalysisId path parameter. Flow analysis request id. type: str inclusions: - description: Path Trace's inclusions. + description: Subset of {INTERFACE-STATS, QOS-STATS, DEVICE-STATS, PERFORMANCE-STATS, + ACL-TRACE}. elements: str type: list periodicRefresh: - description: PeriodicRefresh flag. + description: Periodic refresh of path for every 30 sec. type: bool protocol: - description: Path Trace's protocol. + description: Protocol. type: str sourceIP: - description: Path Trace's sourceIP. + description: Source IP address. type: str sourcePort: - description: Path Trace's sourcePort. + description: Source Port. type: str requirements: - dnacentersdk >= 2.5.5 diff --git a/plugins/modules/path_trace_info.py b/plugins/modules/path_trace_info.py index e7bdc4691b..a160114ef0 100644 --- a/plugins/modules/path_trace_info.py +++ b/plugins/modules/path_trace_info.py @@ -68,11 +68,11 @@ limit: description: - Limit query parameter. Number of resources returned. - type: str + type: int offset: description: - Offset query parameter. Start index of resources returned (1-based). - type: str + type: int order: description: - Order query parameter. Order by this field. @@ -128,8 +128,8 @@ status: string taskId: string lastUpdateTime: string - limit: string - offset: string + limit: 0 + offset: 0 order: string sortBy: string register: result diff --git a/plugins/modules/pnp_device_claim_to_site.py b/plugins/modules/pnp_device_claim_to_site.py index e946b3fd62..397dc9f95b 100644 --- a/plugins/modules/pnp_device_claim_to_site.py +++ b/plugins/modules/pnp_device_claim_to_site.py @@ -10,9 +10,7 @@ short_description: Resource module for Pnp Device Claim To Site description: - Manage operation create of the resource Pnp Device Claim To Site. -- > - Claim a device based on DNA-C Site based design process. Different parameters are required for different device - platforms. +- Claim a device based on DNA-C Site-based design process. Some required parameters differ based on device platform. version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module @@ -20,77 +18,67 @@ options: configInfo: description: Pnp Device Claim To Site's configInfo. + elements: dict suboptions: configId: - description: Pnp Device Claim To Site's configId. + description: Config Id. type: str configParameters: description: Pnp Device Claim To Site's configParameters. - elements: dict suboptions: key: - description: Pnp Device Claim To Site's key. + description: Key. type: str value: - description: Pnp Device Claim To Site's value. + description: Value. type: str - type: list - type: dict + type: dict + type: list version_added: 4.2.0 deviceId: - description: Pnp Device Claim To Site's deviceId. + description: Device Id. type: str gateway: - description: Pnp Device Claim To Site's gateway. + description: For CatalystWLC/MobilityExpress. type: str version_added: 6.4.0 - hostname: - description: Pnp Device Claim To Site's hostname. - type: str - version_added: 4.2.0 - imageId: - description: Pnp Device Claim To Site's imageId. - type: str imageInfo: description: Pnp Device Claim To Site's imageInfo. suboptions: imageId: - description: Pnp Device Claim To Site's imageId. + description: Image Id. type: str skip: - description: Skip flag. + description: Skip. type: bool type: dict version_added: 4.2.0 - ipInterfaceName: - description: Pnp Device Claim To Site's ipInterfaceName. + interfaceName: + description: For Catalyst 9800 WLC. type: str - version_added: 6.4.0 - removeInactive: - description: RemoveInactive flag. - type: bool - version_added: 6.4.0 rfProfile: - description: Pnp Device Claim To Site's rfProfile. + description: For Access Points. type: str version_added: 6.1.0 + sensorProfile: + description: For Sensors. + type: str siteId: - description: Pnp Device Claim To Site's siteId. + description: Site Id. type: str staticIP: - description: Pnp Device Claim To Site's staticIP. + description: For CatalystWLC/MobilityExpress. type: str version_added: 6.4.0 subnetMask: - description: Pnp Device Claim To Site's subnetMask. + description: For CatalystWLC/MobilityExpress. type: str type: - description: Pnp Device Claim To Site's type. + description: Type. type: str - vlanId: - description: Pnp Device Claim To Site's vlanId. + vlanID: + description: For Catalyst 9800 WLC. type: str - version_added: 6.4.0 requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -118,25 +106,23 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" configInfo: - configId: string + - configId: string configParameters: - - key: string + key: string value: string deviceId: string gateway: string - hostname: string - imageId: string imageInfo: imageId: string skip: true - ipInterfaceName: string - removeInactive: true + interfaceName: string rfProfile: string + sensorProfile: string siteId: string staticIP: string subnetMask: string type: string - vlanId: string + vlanID: string """ diff --git a/plugins/modules/pnp_device_import.py b/plugins/modules/pnp_device_import.py index 874e5818b6..78ff2aadad 100644 --- a/plugins/modules/pnp_device_import.py +++ b/plugins/modules/pnp_device_import.py @@ -1118,6 +1118,7 @@ "successList": [ { "_id": "string", + "id": "string", "deviceInfo": { "source": "string", "serialNumber": "string", diff --git a/plugins/modules/profiling_rules_count_info.py b/plugins/modules/profiling_rules_count_info.py index 947cc22355..a3181b3c65 100644 --- a/plugins/modules/profiling_rules_count_info.py +++ b/plugins/modules/profiling_rules_count_info.py @@ -29,7 +29,7 @@ - IncludeDeleted query parameter. Flag to indicate whether deleted rules should be part of the records fetched. type: bool requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/profiling_rules_in_bulk_create.py b/plugins/modules/profiling_rules_in_bulk_create.py index 1c5b7ec837..8e5b49c2db 100644 --- a/plugins/modules/profiling_rules_in_bulk_create.py +++ b/plugins/modules/profiling_rules_in_bulk_create.py @@ -121,7 +121,7 @@ type: list type: list requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/projects_details_info.py b/plugins/modules/projects_details_info.py index 23cf7c28c8..704c881e2a 100644 --- a/plugins/modules/projects_details_info.py +++ b/plugins/modules/projects_details_info.py @@ -82,234 +82,18 @@ type: dict sample: > { - "response": [ + "createTime": 0, + "description": "string", + "id": "string", + "isDeletable": true, + "lastUpdateTime": 0, + "name": "string", + "tags": [ { - "createTime": 0, - "description": "string", "id": "string", - "isDeletable": true, - "lastUpdateTime": 0, - "name": "string", - "tags": [ - { - "id": "string", - "name": "string" - } - ], - "templates": [ - { - "tags": [ - { - "id": "string", - "name": "string" - } - ], - "author": "string", - "composite": true, - "containingTemplates": [ - { - "tags": [ - { - "id": "string", - "name": "string" - } - ], - "composite": true, - "description": "string", - "deviceTypes": [ - { - "productFamily": "string", - "productSeries": "string", - "productType": "string" - } - ], - "id": "string", - "language": "string", - "name": "string", - "projectName": "string", - "rollbackTemplateParams": [ - { - "binding": "string", - "customOrder": 0, - "dataType": "string", - "defaultValue": "string", - "description": "string", - "displayName": "string", - "group": "string", - "id": "string", - "instructionText": "string", - "key": "string", - "notParam": true, - "order": 0, - "paramArray": true, - "parameterName": "string", - "provider": "string", - "range": [ - { - "id": "string", - "maxValue": 0, - "minValue": 0 - } - ], - "required": true, - "selection": { - "defaultSelectedValues": [ - "string" - ], - "id": "string", - "selectionType": "string", - "selectionValues": {} - } - } - ], - "templateContent": "string", - "templateParams": [ - { - "binding": "string", - "customOrder": 0, - "dataType": "string", - "defaultValue": "string", - "description": "string", - "displayName": "string", - "group": "string", - "id": "string", - "instructionText": "string", - "key": "string", - "notParam": true, - "order": 0, - "paramArray": true, - "parameterName": "string", - "provider": "string", - "range": [ - { - "id": "string", - "maxValue": 0, - "minValue": 0 - } - ], - "required": true, - "selection": { - "defaultSelectedValues": [ - "string" - ], - "id": "string", - "selectionType": "string", - "selectionValues": {} - } - } - ], - "version": "string" - } - ], - "createTime": 0, - "customParamsOrder": true, - "description": "string", - "deviceTypes": [ - { - "productFamily": "string", - "productSeries": "string", - "productType": "string" - } - ], - "failurePolicy": "string", - "id": "string", - "language": "string", - "lastUpdateTime": 0, - "latestVersionTime": 0, - "name": "string", - "parentTemplateId": "string", - "projectId": "string", - "projectName": "string", - "rollbackTemplateContent": "string", - "rollbackTemplateParams": [ - { - "binding": "string", - "customOrder": 0, - "dataType": "string", - "defaultValue": "string", - "description": "string", - "displayName": "string", - "group": "string", - "id": "string", - "instructionText": "string", - "key": "string", - "notParam": true, - "order": 0, - "paramArray": true, - "parameterName": "string", - "provider": "string", - "range": [ - { - "id": "string", - "maxValue": 0, - "minValue": 0 - } - ], - "required": true, - "selection": { - "defaultSelectedValues": [ - "string" - ], - "id": "string", - "selectionType": "string", - "selectionValues": {} - } - } - ], - "softwareType": "string", - "softwareVariant": "string", - "softwareVersion": "string", - "templateContent": "string", - "templateParams": [ - { - "binding": "string", - "customOrder": 0, - "dataType": "string", - "defaultValue": "string", - "description": "string", - "displayName": "string", - "group": "string", - "id": "string", - "instructionText": "string", - "key": "string", - "notParam": true, - "order": 0, - "paramArray": true, - "parameterName": "string", - "provider": "string", - "range": [ - { - "id": "string", - "maxValue": 0, - "minValue": 0 - } - ], - "required": true, - "selection": { - "defaultSelectedValues": [ - "string" - ], - "id": "string", - "selectionType": "string", - "selectionValues": {} - } - } - ], - "validationErrors": { - "rollbackTemplateErrors": [ - {} - ], - "templateErrors": [ - {} - ], - "templateId": "string", - "templateVersion": "string" - }, - "version": "string" - } - ] + "name": "string" } ], - "version": "string" + "templates": {} } """ diff --git a/plugins/modules/reserve_ip_subpool_info.py b/plugins/modules/reserve_ip_subpool_info.py index e27b53ebf3..ab1a529553 100644 --- a/plugins/modules/reserve_ip_subpool_info.py +++ b/plugins/modules/reserve_ip_subpool_info.py @@ -26,11 +26,11 @@ offset: description: - Offset query parameter. Offset/starting row. - type: str + type: int limit: description: - Limit query parameter. No of Global Pools to be retrieved. - type: str + type: int requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -59,8 +59,8 @@ dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" siteId: string - offset: string - limit: string + offset: 0 + limit: 0 register: result """ diff --git a/plugins/modules/role_permissions_info.py b/plugins/modules/role_permissions_info.py new file mode 100644 index 0000000000..53d7a9b3ad --- /dev/null +++ b/plugins/modules/role_permissions_info.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: role_permissions_info +short_description: Information module for Role Permissions +description: +- Get all Role Permissions. +- Get permissions for a role from Cisco DNA Center System. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for User and Roles GetPermissionsAPI + description: Complete reference of the GetPermissionsAPI API. + link: https://developer.cisco.com/docs/dna-center/#!get-permissions-api +notes: + - SDK Method used are + userand_roles.UserandRoles.get_permissions_ap_i, + + - Paths used are + get /dna/system/api/v1/role/permissions, + +""" + +EXAMPLES = r""" +- name: Get all Role Permissions + cisco.dnac.role_permissions_info: + 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}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "resource-types": [ + { + "type": "string", + "displayName": "string", + "description": "string", + "defaultPermission": "string" + } + ] + } +""" diff --git a/plugins/modules/roles_info.py b/plugins/modules/roles_info.py new file mode 100644 index 0000000000..279f9ed107 --- /dev/null +++ b/plugins/modules/roles_info.py @@ -0,0 +1,82 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: roles_info +short_description: Information module for Roles +description: +- Get all Roles. +- Get all roles for the Cisco DNA Center system. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for User and Roles GetRolesAPI + description: Complete reference of the GetRolesAPI API. + link: https://developer.cisco.com/docs/dna-center/#!get-roles-api +notes: + - SDK Method used are + userand_roles.UserandRoles.get_roles_ap_i, + + - Paths used are + get /dna/system/api/v1/roles, + +""" + +EXAMPLES = r""" +- name: Get all Roles + cisco.dnac.roles_info: + 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}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "roles": [ + { + "resourceTypes": [ + { + "operations": [ + "string" + ], + "type": "string" + } + ], + "meta": { + "createdBy": "string", + "created": "string", + "lastModified": "string" + }, + "roleId": "string", + "name": "string", + "description": "string", + "type": "string" + } + ] + } +""" diff --git a/plugins/modules/sda_count_info.py b/plugins/modules/sda_count_info.py index cb0e4e6df9..a80b1d359a 100644 --- a/plugins/modules/sda_count_info.py +++ b/plugins/modules/sda_count_info.py @@ -20,7 +20,7 @@ description: Additional headers. type: dict requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/sda_fabric.py b/plugins/modules/sda_fabric.py index a28b2d87a5..158e6f1e62 100644 --- a/plugins/modules/sda_fabric.py +++ b/plugins/modules/sda_fabric.py @@ -21,7 +21,7 @@ description: FabricName query parameter. Fabric Name. type: str requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/sda_fabric_authentication_profile_info.py b/plugins/modules/sda_fabric_authentication_profile_info.py index c861488f9d..7d810bb815 100644 --- a/plugins/modules/sda_fabric_authentication_profile_info.py +++ b/plugins/modules/sda_fabric_authentication_profile_info.py @@ -65,11 +65,19 @@ dnac_response: description: A dictionary or list with the response returned by the Cisco DNAC Python SDK returned: always - type: dict + type: list + elements: dict sample: > - { - "siteNameHierarchy": "string", - "authenticateTemplateName": "string", - "authenticateTemplateId": "string" - } + [ + { + "siteNameHierarchy": "string", + "authenticateTemplateName": "string", + "authenticationOrder": "string", + "dot1xToMabFallbackTimeout": "string", + "wakeOnLan": true, + "numberOfHosts": "string", + "status": "string", + "description": "string" + } + ] """ diff --git a/plugins/modules/sda_fabric_border_device.py b/plugins/modules/sda_fabric_border_device.py index 3099cd0ec8..960e9d7cd5 100644 --- a/plugins/modules/sda_fabric_border_device.py +++ b/plugins/modules/sda_fabric_border_device.py @@ -25,6 +25,11 @@ description: Sda Fabric Border Device's payload. elements: dict suboptions: + borderPriority: + description: Border priority associated with a given device. Allowed range for + Border Priority is 1-9. A lower value indicates higher priority. E.g., a priority + of 1 takes precedence over 5. Default priority would be set to 10. + type: str borderSessionType: description: Border Session Type. type: str @@ -84,7 +89,6 @@ suboptions: virtualNetwork: description: Sda Fabric Border Device's virtualNetwork. - elements: dict suboptions: virtualNetworkName: description: Virtual Network Name, that is associated to Fabric @@ -96,7 +100,7 @@ 2046, 4095)). type: str version_added: 4.0.0 - type: list + type: dict version_added: 4.0.0 type: list version_added: 4.0.0 @@ -108,6 +112,10 @@ internalAutonomouSystemNumber: description: Internal Autonomouns System Number (e.g.,1-65535). type: str + routeDistributionProtocol: + description: Route Distribution Protocol for Control Plane Device. Allowed values + are "LISP_BGP" or "LISP_PUB_SUB". Default value is "LISP_BGP". + type: str sdaTransitNetworkName: description: SD-Access Transit Network Name. type: str @@ -149,7 +157,8 @@ dnac_debug: "{{dnac_debug}}" state: present payload: - - borderSessionType: string + - borderPriority: string + borderSessionType: string borderWithExternalConnectivity: true connectedToInternet: true deviceManagementIpAddress: string @@ -169,6 +178,7 @@ vlanId: string externalDomainRoutingProtocolName: string internalAutonomouSystemNumber: string + routeDistributionProtocol: string sdaTransitNetworkName: string siteNameHierarchy: string diff --git a/plugins/modules/sda_fabric_control_plane_device.py b/plugins/modules/sda_fabric_control_plane_device.py index dec6f831e4..2f7189b35e 100644 --- a/plugins/modules/sda_fabric_control_plane_device.py +++ b/plugins/modules/sda_fabric_control_plane_device.py @@ -21,20 +21,15 @@ description: DeviceManagementIpAddress query parameter. type: str version_added: 4.0.0 - payload: - description: Sda Fabric Control Plane Device's payload. - elements: dict - suboptions: - deviceManagementIpAddress: - description: Management Ip Address of the Device which is provisioned successfully. - type: str - version_added: 4.0.0 - siteNameHierarchy: - description: SiteNameHierarchy of the Provisioned Device(site should be part - of Fabric Site(site should be part of Fabric Site). - type: str - version_added: 4.0.0 - type: list + routeDistributionProtocol: + description: Route Distribution Protocol for Control Plane Device. Allowed values + are "LISP_BGP" or "LISP_PUB_SUB". Default value is "LISP_BGP". + type: str + siteNameHierarchy: + description: SiteNameHierarchy of the Provisioned Device(site should be part of + Fabric Site). + type: str + version_added: 4.0.0 requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -79,9 +74,9 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" state: present - payload: - - deviceManagementIpAddress: string - siteNameHierarchy: string + deviceManagementIpAddress: string + routeDistributionProtocol: string + siteNameHierarchy: string """ diff --git a/plugins/modules/sda_fabric_control_plane_device_info.py b/plugins/modules/sda_fabric_control_plane_device_info.py index ddab671f5a..837a4d5439 100644 --- a/plugins/modules/sda_fabric_control_plane_device_info.py +++ b/plugins/modules/sda_fabric_control_plane_device_info.py @@ -63,13 +63,12 @@ type: dict sample: > { - "status": "string", - "description": "string", - "name": "string", - "roles": [ - "string" - ], "deviceManagementIpAddress": "string", - "siteHierarchy": "string" + "deviceName": "string", + "roles": "string", + "siteNameHierarchy": "string", + "routeDistributionProtocol": "string", + "status": "string", + "description": "string" } """ diff --git a/plugins/modules/sda_fabric_edge_device.py b/plugins/modules/sda_fabric_edge_device.py index aa7e997232..800ca6d3c3 100644 --- a/plugins/modules/sda_fabric_edge_device.py +++ b/plugins/modules/sda_fabric_edge_device.py @@ -18,21 +18,13 @@ author: Rafael Campos (@racampos) options: deviceManagementIpAddress: - description: DeviceManagementIpAddress query parameter. + description: Management Ip Address of the Device which is provisioned successfully. type: str - payload: - description: Sda Fabric Edge Device's payload. - elements: dict - suboptions: - deviceManagementIpAddress: - description: Management Ip Address of the Device which is provisioned successfully. - type: str - siteNameHierarchy: - description: SiteNameHierarchy of the Provisioned Device(site should be part - of Fabric Site). - type: str - version_added: 4.0.0 - type: list + siteNameHierarchy: + description: SiteNameHierarchy of the Provisioned Device(site should be part of + Fabric Site). + type: str + version_added: 4.0.0 requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -65,9 +57,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" state: present - payload: - - deviceManagementIpAddress: string - siteNameHierarchy: string + deviceManagementIpAddress: string + siteNameHierarchy: string - name: Delete all cisco.dnac.sda_fabric_edge_device: diff --git a/plugins/modules/sda_fabric_edge_device_info.py b/plugins/modules/sda_fabric_edge_device_info.py index 0bd1a38803..7d94ac4666 100644 --- a/plugins/modules/sda_fabric_edge_device_info.py +++ b/plugins/modules/sda_fabric_edge_device_info.py @@ -62,13 +62,12 @@ type: dict sample: > { - "status": "string", - "description": "string", - "name": "string", - "roles": [ - "string" - ], "deviceManagementIpAddress": "string", - "siteHierarchy": "string" + "deviceName": "string", + "roles": "string", + "siteNameHierarchy": "string", + "fabricSiteNameHierarchy": "string", + "status": "string", + "description": "string" } """ diff --git a/plugins/modules/sda_fabric_info.py b/plugins/modules/sda_fabric_info.py index cbfe51e8df..c0e49de7d8 100644 --- a/plugins/modules/sda_fabric_info.py +++ b/plugins/modules/sda_fabric_info.py @@ -24,7 +24,7 @@ - FabricName query parameter. Fabric Name. type: str requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/sda_fabric_site.py b/plugins/modules/sda_fabric_site.py index 51f9ff0ad3..2b7e6f8d43 100644 --- a/plugins/modules/sda_fabric_site.py +++ b/plugins/modules/sda_fabric_site.py @@ -23,6 +23,10 @@ DNA Center releases. type: str version_added: 4.0.0 + fabricType: + description: Type of SD-Access Fabric. Allowed values are "FABRIC_SITE" or "FABRIC_ZONE". + Default value is "FABRIC_SITE". + type: str siteNameHierarchy: description: SiteNameHierarchy query parameter. Site Name Hierarchy. type: str @@ -71,6 +75,7 @@ dnac_debug: "{{dnac_debug}}" state: present fabricName: string + fabricType: string siteNameHierarchy: string """ diff --git a/plugins/modules/sda_fabric_site_info.py b/plugins/modules/sda_fabric_site_info.py index 44feb7cf1f..c0c1158288 100644 --- a/plugins/modules/sda_fabric_site_info.py +++ b/plugins/modules/sda_fabric_site_info.py @@ -62,8 +62,11 @@ type: dict sample: > { + "siteNameHierarchy": "string", + "fabricName": "string", + "fabricType": "string", + "fabricDomainType": "string", "status": "string", - "description": "string", - "executionStatusUrl": "string" + "description": "string" } """ diff --git a/plugins/modules/sda_multicast.py b/plugins/modules/sda_multicast.py index bd5e0893ec..4ee828f02c 100644 --- a/plugins/modules/sda_multicast.py +++ b/plugins/modules/sda_multicast.py @@ -39,6 +39,7 @@ type: str ssmInfo: description: Sda Multicast's ssmInfo. + elements: dict suboptions: ssmGroupRange: description: Valid SSM group range ip address(e.g., 230.0.0.0). @@ -46,7 +47,7 @@ ssmWildcardMask: description: Valid SSM Wildcard Mask ip address(e.g.,0.255.255.255). type: str - type: dict + type: list virtualNetworkName: description: Virtual Network Name, that is associated to Fabric Site. type: str @@ -94,7 +95,7 @@ - string ipPoolName: string ssmInfo: - ssmGroupRange: string + - ssmGroupRange: string ssmWildcardMask: string virtualNetworkName: string siteNameHierarchy: string diff --git a/plugins/modules/sda_multicast_info.py b/plugins/modules/sda_multicast_info.py index 2df58000d5..959c9ed2f6 100644 --- a/plugins/modules/sda_multicast_info.py +++ b/plugins/modules/sda_multicast_info.py @@ -62,7 +62,6 @@ type: dict sample: > { - "siteNameHierarchy": "string", "multicastMethod": "string", "multicastType": "string", "multicastVnInfo": [ @@ -73,11 +72,15 @@ "string" ], "externalRpIpAddress": "string", - "ssmInfo": { - "ssmGroupRange": "string", - "ssmWildcardMask": "string" - } + "ssmInfo": [ + { + "ssmGroupRange": "string", + "ssmWildcardMask": "string" + } + ] } - ] + ], + "status": "string", + "description": "string" } """ diff --git a/plugins/modules/sda_port_assignment_for_user_device.py b/plugins/modules/sda_port_assignment_for_user_device.py index d1b2220c0c..15c389ce6b 100644 --- a/plugins/modules/sda_port_assignment_for_user_device.py +++ b/plugins/modules/sda_port_assignment_for_user_device.py @@ -30,12 +30,16 @@ description: DeviceManagementIpAddress query parameter. type: str interfaceDescription: - description: User defined text message for this port. + description: User defined text message for port assignment. type: str version_added: 4.0.0 interfaceName: description: InterfaceName query parameter. type: str + interfaceNames: + description: List of Interface Names on the Edge Node Device. E.g."GigabitEthernet1/0/3","GigabitEthernet1/0/4". + elements: str + type: list scalableGroupName: description: Scalable Group name associated with VN. type: str @@ -99,6 +103,8 @@ deviceManagementIpAddress: string interfaceDescription: string interfaceName: string + interfaceNames: + - string scalableGroupName: string siteNameHierarchy: string voiceIpAddressPoolName: string diff --git a/plugins/modules/sda_provision_device_info.py b/plugins/modules/sda_provision_device_info.py index 01bf3e3db3..a57d733033 100644 --- a/plugins/modules/sda_provision_device_info.py +++ b/plugins/modules/sda_provision_device_info.py @@ -65,9 +65,6 @@ "deviceManagementIpAddress": "string", "siteNameHierarchy": "string", "status": "string", - "description": "string", - "taskId": "string", - "taskStatusUrl": "string", - "executionStatusUrl": "string" + "description": "string" } """ diff --git a/plugins/modules/sda_virtual_network.py b/plugins/modules/sda_virtual_network.py index 617a0005b0..5231d8b95c 100644 --- a/plugins/modules/sda_virtual_network.py +++ b/plugins/modules/sda_virtual_network.py @@ -17,17 +17,6 @@ - cisco.dnac.module author: Rafael Campos (@racampos) options: - payload: - description: Sda Virtual Network's payload. - elements: dict - suboptions: - siteNameHierarchy: - description: Path of sda Fabric Site. - type: str - virtualNetworkName: - description: Virtual Network Name, that is created at Global level. - type: str - type: list siteNameHierarchy: description: SiteNameHierarchy query parameter. type: str @@ -79,9 +68,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" state: present - payload: - - siteNameHierarchy: string - virtualNetworkName: string + siteNameHierarchy: string + virtualNetworkName: string """ diff --git a/plugins/modules/sda_virtual_network_info.py b/plugins/modules/sda_virtual_network_info.py index bd83c9b099..0739371775 100644 --- a/plugins/modules/sda_virtual_network_info.py +++ b/plugins/modules/sda_virtual_network_info.py @@ -67,13 +67,12 @@ type: dict sample: > { + "siteNameHierarchy": "string", + "virtualNetworkName": "string", + "fabricName": "string", + "isInfraVN": "string", + "isDefaultVN": "string", "status": "string", - "description": "string", - "name": "string", - "roles": [ - "string" - ], - "deviceManagementIpAddress": "string", - "siteHierarchy": "string" + "description": "string" } """ diff --git a/plugins/modules/sda_virtual_network_ip_pool.py b/plugins/modules/sda_virtual_network_ip_pool.py index 3da9b2de1f..c0242821ca 100644 --- a/plugins/modules/sda_virtual_network_ip_pool.py +++ b/plugins/modules/sda_virtual_network_ip_pool.py @@ -25,6 +25,10 @@ description: IpPoolName query parameter. type: str version_added: 4.0.0 + isBridgeModeVm: + description: Bridge Mode Vm enablement flag (applicable for L3 and L2 and default + value is False ). + type: bool isCommonPool: description: Common Pool enablement flag(applicable for L3 and L2 and default value is False ). @@ -42,8 +46,8 @@ description: Layer2 Only enablement flag and default value is False. type: bool isThisCriticalPool: - description: Critical pool enablement(applicable for L3 and default value is False - ). + description: Critical pool enablement flag(applicable for L3 and default value is + False ). type: bool version_added: 4.0.0 isWirelessPool: @@ -126,6 +130,7 @@ state: present autoGenerateVlanName: true ipPoolName: string + isBridgeModeVm: true isCommonPool: true isIpDirectedBroadcast: true isL2FloodingEnabled: true diff --git a/plugins/modules/sda_virtual_network_v2.py b/plugins/modules/sda_virtual_network_v2.py index 3c99334038..37e862ae5f 100644 --- a/plugins/modules/sda_virtual_network_v2.py +++ b/plugins/modules/sda_virtual_network_v2.py @@ -19,12 +19,15 @@ author: Rafael Campos (@racampos) options: isGuestVirtualNetwork: - description: To create guest virtual network. + description: Guest Virtual Network enablement flag, default value is False. type: bool scalableGroupNames: description: Scalable Group to be associated to virtual network. elements: str type: list + vManageVpnId: + description: VManage vpn id for SD-WAN. + type: str virtualNetworkName: description: Virtual Network Name to be assigned at global level. type: str @@ -68,6 +71,7 @@ isGuestVirtualNetwork: true scalableGroupNames: - string + vManageVpnId: string virtualNetworkName: string - name: Delete all @@ -95,6 +99,7 @@ isGuestVirtualNetwork: true scalableGroupNames: - string + vManageVpnId: string virtualNetworkName: string """ diff --git a/plugins/modules/sda_virtual_network_v2_info.py b/plugins/modules/sda_virtual_network_v2_info.py index 6a9c6f63e6..b1b408c08f 100644 --- a/plugins/modules/sda_virtual_network_v2_info.py +++ b/plugins/modules/sda_virtual_network_v2_info.py @@ -67,10 +67,8 @@ "scalableGroupNames": [ "string" ], + "vManageVpnId": "string", "status": "string", - "description": "string", - "taskId": "string", - "taskStatusUrl": "string", - "executionStatusUrl": "string" + "description": "string" } """ diff --git a/plugins/modules/service_provider_create.py b/plugins/modules/service_provider_create.py index 760d81b9b0..44ef4888b1 100644 --- a/plugins/modules/service_provider_create.py +++ b/plugins/modules/service_provider_create.py @@ -10,7 +10,7 @@ short_description: Resource module for Service Provider Create description: - Manage operation create of the resource Service Provider Create. -- API to create service provider profile QOS . +- API to create Service Provider Profile QOS . version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module diff --git a/plugins/modules/service_provider_info.py b/plugins/modules/service_provider_info.py index 363cdffa7a..6444f79783 100644 --- a/plugins/modules/service_provider_info.py +++ b/plugins/modules/service_provider_info.py @@ -64,7 +64,7 @@ "namespace": "string", "type": "string", "key": "string", - "version": 0, + "version": "string", "value": [ { "wanProvider": "string", @@ -77,6 +77,6 @@ "inheritedGroupName": "string" } ], - "version": "string" + "version": 0 } """ diff --git a/plugins/modules/service_provider_profile_delete.py b/plugins/modules/service_provider_profile_delete.py index 99bee60589..ec7330c642 100644 --- a/plugins/modules/service_provider_profile_delete.py +++ b/plugins/modules/service_provider_profile_delete.py @@ -10,7 +10,7 @@ short_description: Resource module for Service Provider Profile Delete description: - Manage operation delete of the resource Service Provider Profile Delete. -- API to delete Service Provider profile QoS . +- API to delete Service Provider Profile QoS . version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module diff --git a/plugins/modules/service_provider_update.py b/plugins/modules/service_provider_update.py index 136597d84c..f3c9a6d359 100644 --- a/plugins/modules/service_provider_update.py +++ b/plugins/modules/service_provider_update.py @@ -10,7 +10,7 @@ short_description: Resource module for Service Provider Update description: - Manage operation update of the resource Service Provider Update. -- API to update SP profile. +- API to update Service Provider Profile QoS . version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module diff --git a/plugins/modules/service_provider_v2.py b/plugins/modules/service_provider_v2.py new file mode 100644 index 0000000000..3a804288fb --- /dev/null +++ b/plugins/modules/service_provider_v2.py @@ -0,0 +1,108 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: service_provider_v2 +short_description: Resource module for Service Provider V2 +description: +- Manage operations create and update of the resource Service Provider V2. +- API to create Service Provider Profile QOS . +- API to update Service Provider Profile QoS . +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + settings: + description: Service Provider V2's settings. + suboptions: + qos: + description: Service Provider V2's qos. + elements: dict + suboptions: + model: + description: Model. + type: str + profileName: + description: Profile Name. + type: str + wanProvider: + description: Wan Provider. + type: str + type: list + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings CreateSPProfileV2 + description: Complete reference of the CreateSPProfileV2 API. + link: https://developer.cisco.com/docs/dna-center/#!create-sp-profile-v-2 +- name: Cisco DNA Center documentation for Network Settings UpdateSPProfileV2 + description: Complete reference of the UpdateSPProfileV2 API. + link: https://developer.cisco.com/docs/dna-center/#!update-sp-profile-v-2 +notes: + - SDK Method used are + network_settings.NetworkSettings.create_sp_profile_v2, + network_settings.NetworkSettings.update_sp_profile_v2, + + - Paths used are + post /dna/intent/api/v2/service-provider, + put /dna/intent/api/v2/service-provider, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.service_provider_v2: + 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}}" + state: present + settings: + qos: + - model: string + profileName: string + wanProvider: string + +- name: Update all + cisco.dnac.service_provider_v2: + 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}}" + state: present + settings: + qos: + - model: string + oldProfileName: string + profileName: string + wanProvider: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/plugins/modules/service_provider_v2_info.py b/plugins/modules/service_provider_v2_info.py new file mode 100644 index 0000000000..50635cc29a --- /dev/null +++ b/plugins/modules/service_provider_v2_info.py @@ -0,0 +1,82 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: service_provider_v2_info +short_description: Information module for Service Provider V2 +description: +- Get all Service Provider V2. +- API to get Service Provider details QoS . +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings GetServiceProviderDetailsV2 + description: Complete reference of the GetServiceProviderDetailsV2 API. + link: https://developer.cisco.com/docs/dna-center/#!get-service-provider-details-v-2 +notes: + - SDK Method used are + network_settings.NetworkSettings.get_service_provider_details_v2, + + - Paths used are + get /dna/intent/api/v2/service-provider, + +""" + +EXAMPLES = r""" +- name: Get all Service Provider V2 + cisco.dnac.service_provider_v2_info: + 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}}" + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": [ + { + "instanceType": "string", + "instanceUuid": "string", + "namespace": "string", + "type": "string", + "key": "string", + "version": 0, + "value": [ + { + "wanProvider": "string", + "spProfileName": "string", + "slaProfileName": "string" + } + ], + "groupUuid": "string", + "inheritedGroupUuid": "string", + "inheritedGroupName": "string" + } + ], + "version": "string" + } +""" diff --git a/plugins/modules/site_assign_credential.py b/plugins/modules/site_assign_credential.py index 779602a664..5cbb536845 100644 --- a/plugins/modules/site_assign_credential.py +++ b/plugins/modules/site_assign_credential.py @@ -10,7 +10,7 @@ short_description: Resource module for Site Assign Credential description: - Manage operation create of the resource Site Assign Credential. -- Assign Device Credential To Site. +- Assign Device Credential to a site. version_added: '3.1.0' extends_documentation_fragment: - cisco.dnac.module @@ -44,12 +44,12 @@ - dnacentersdk >= 2.5.5 - python >= 3.5 seealso: -- name: Cisco DNA Center documentation for Network Settings AssignCredentialToSite - description: Complete reference of the AssignCredentialToSite API. - link: https://developer.cisco.com/docs/dna-center/#!assign-credential-to-site +- name: Cisco DNA Center documentation for Network Settings AssignDeviceCredentialToSite + description: Complete reference of the AssignDeviceCredentialToSite API. + link: https://developer.cisco.com/docs/dna-center/#!assign-device-credential-to-site notes: - SDK Method used are - network_settings.NetworkSettings.assign_credential_to_site, + network_settings.NetworkSettings.assign_device_credential_to_site, - Paths used are post /dna/intent/api/v1/credential-to-site/{siteId}, diff --git a/plugins/modules/site_assign_device.py b/plugins/modules/site_assign_device.py index 2bc3f79be9..d0bdd22683 100644 --- a/plugins/modules/site_assign_device.py +++ b/plugins/modules/site_assign_device.py @@ -28,7 +28,7 @@ description: SiteId path parameter. Site id to which site the device to assign. type: str requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/site_delete.py b/plugins/modules/site_delete.py index c9ef7a266e..d36690ef41 100644 --- a/plugins/modules/site_delete.py +++ b/plugins/modules/site_delete.py @@ -56,7 +56,8 @@ type: dict sample: > { - "status": "string", + "executionId": "string", + "executionStatusURL": "string", "message": "string" } """ diff --git a/plugins/modules/site_design_floormap.py b/plugins/modules/site_design_floormap.py index f7dee8a735..a5f8683836 100644 --- a/plugins/modules/site_design_floormap.py +++ b/plugins/modules/site_design_floormap.py @@ -24,7 +24,7 @@ description: Site Design Floormap's payload type: dict requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/site_design_floormap_info.py b/plugins/modules/site_design_floormap_info.py index fe90d3c2ef..ee1fa87bf7 100644 --- a/plugins/modules/site_design_floormap_info.py +++ b/plugins/modules/site_design_floormap_info.py @@ -26,7 +26,7 @@ - FloorId path parameter. Group Id of the specified floormap. type: str requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/site_info.py b/plugins/modules/site_info.py index aa00b1349b..49bdf393cd 100644 --- a/plugins/modules/site_info.py +++ b/plugins/modules/site_info.py @@ -34,11 +34,11 @@ offset: description: - Offset query parameter. Offset/starting row. The default value is 1. - type: str + type: int limit: description: - Limit query parameter. Number of sites to be retrieved. The default value is 500. - type: str + type: int requirements: - dnacentersdk >= 2.5.5 - python >= 3.5 @@ -69,8 +69,8 @@ name: string siteId: string type: string - offset: string - limit: string + offset: 0 + limit: 0 register: result """ @@ -87,24 +87,7 @@ "parentId": "string", "name": "string", "additionalInfo": [ - { - "nameSpace": "string", - "attributes": { - "country": "string", - "address": "string", - "latitude": "string", - "addressInheritedFrom": "string", - "type": "string", - "longitude": "string", - "offsetX": "string", - "offsetY": "string", - "length": "string", - "width": "string", - "height": "string", - "rfModel": "string", - "floorIndex": "string" - } - } + "string" ], "siteHierarchy": "string", "siteNameHierarchy": "string", diff --git a/plugins/modules/site_membership_info.py b/plugins/modules/site_membership_info.py index 201cf077b5..d38f3844e2 100644 --- a/plugins/modules/site_membership_info.py +++ b/plugins/modules/site_membership_info.py @@ -26,11 +26,11 @@ offset: description: - Offset query parameter. Offset/starting row. - type: str + type: int limit: description: - Limit query parameter. Number of sites to be retrieved. - type: str + type: int deviceFamily: description: - DeviceFamily query parameter. Device family name. @@ -66,8 +66,8 @@ dnac_version: "{{dnac_version}}" dnac_debug: "{{dnac_debug}}" headers: "{{my_headers | from_json}}" - offset: string - limit: string + offset: 0 + limit: 0 deviceFamily: string serialNumber: string siteId: string diff --git a/plugins/modules/site_update.py b/plugins/modules/site_update.py index 83f52968e8..4a97a6ede9 100644 --- a/plugins/modules/site_update.py +++ b/plugins/modules/site_update.py @@ -64,8 +64,7 @@ description: Name. type: str rfModel: - description: Rf Model. Allowed values are 'Cubes And Walled Offices', 'Drywall - Office Only', 'Indoor High Ceiling', 'Outdoor Open Space'. + description: Rf Model. type: str width: description: Width. diff --git a/plugins/modules/sp_profile_delete_v2.py b/plugins/modules/sp_profile_delete_v2.py new file mode 100644 index 0000000000..1022d4de48 --- /dev/null +++ b/plugins/modules/sp_profile_delete_v2.py @@ -0,0 +1,65 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: sp_profile_delete_v2 +short_description: Resource module for Sp Profile Delete V2 +description: +- Manage operation delete of the resource Sp Profile Delete V2. +- API to delete Service Provider Profile QoS . +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + spProfileName: + description: SpProfileName path parameter. Sp profile name. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Network Settings DeleteSPProfileV2 + description: Complete reference of the DeleteSPProfileV2 API. + link: https://developer.cisco.com/docs/dna-center/#!delete-sp-profile-v-2 +notes: + - SDK Method used are + network_settings.NetworkSettings.delete_sp_profile_v2, + + - Paths used are + delete /dna/intent/api/v2/sp-profile/{spProfileName}, + +""" + +EXAMPLES = r""" +- name: Delete by name + cisco.dnac.sp_profile_delete_v2: + 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}}" + spProfileName: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/plugins/modules/tag.py b/plugins/modules/tag.py index 53d6cb7e7d..7630c2e614 100644 --- a/plugins/modules/tag.py +++ b/plugins/modules/tag.py @@ -33,7 +33,7 @@ suboptions: items: description: Tag's items. - elements: dict + elements: str type: list name: description: Tag's name. @@ -104,7 +104,7 @@ - memberType: string rules: items: - - {} + - string name: string operation: string value: string @@ -129,8 +129,7 @@ dynamicRules: - memberType: string rules: - items: - - {} + items: string name: string operation: string value: string diff --git a/plugins/modules/tag_info.py b/plugins/modules/tag_info.py index b0888c516e..bc09f0ba5a 100644 --- a/plugins/modules/tag_info.py +++ b/plugins/modules/tag_info.py @@ -40,11 +40,11 @@ offset: description: - Offset query parameter. - type: str + type: int limit: description: - Limit query parameter. - type: str + type: int size: description: - Size query parameter. Size in kilobytes(KB). @@ -107,8 +107,8 @@ additionalInfo_nameSpace: string additionalInfo_attributes: string level: string - offset: string - limit: string + offset: 0 + limit: 0 size: string field: string sortBy: string @@ -149,9 +149,7 @@ "values": [ "string" ], - "items": [ - {} - ], + "items": "string", "operation": "string", "name": "string", "value": "string" diff --git a/plugins/modules/task_info.py b/plugins/modules/task_info.py index 594997d5f4..9b2b19b014 100644 --- a/plugins/modules/task_info.py +++ b/plugins/modules/task_info.py @@ -64,11 +64,11 @@ offset: description: - Offset query parameter. - type: str + type: int limit: description: - Limit query parameter. - type: str + type: int sortBy: description: - SortBy query parameter. Sort results by this field. @@ -123,8 +123,8 @@ isError: string failureReason: string parentId: string - offset: string - limit: string + offset: 0 + limit: 0 sortBy: string order: string register: result diff --git a/plugins/modules/template_preview.py b/plugins/modules/template_preview.py index 9a6fab3356..bcd466a54f 100644 --- a/plugins/modules/template_preview.py +++ b/plugins/modules/template_preview.py @@ -24,8 +24,7 @@ type: dict resourceParams: description: Resource params to render preview. - elements: dict - type: list + type: dict templateId: description: UUID of template to get template preview. type: str @@ -57,8 +56,7 @@ dnac_debug: "{{dnac_debug}}" deviceId: string params: {} - resourceParams: - - {} + resourceParams: {} templateId: string """ diff --git a/plugins/modules/templates_details_info.py b/plugins/modules/templates_details_info.py index 82eeaebe12..d8d2b07046 100644 --- a/plugins/modules/templates_details_info.py +++ b/plugins/modules/templates_details_info.py @@ -143,107 +143,11 @@ type: dict sample: > { - "response": [ + "author": "string", + "composite": true, + "containingTemplates": [ { - "author": "string", "composite": true, - "containingTemplates": [ - { - "composite": true, - "description": "string", - "deviceTypes": [ - { - "productFamily": "string", - "productSeries": "string", - "productType": "string" - } - ], - "id": "string", - "language": "string", - "name": "string", - "projectName": "string", - "rollbackTemplateParams": [ - { - "binding": "string", - "customOrder": 0, - "dataType": "string", - "defaultValue": "string", - "description": "string", - "displayName": "string", - "group": "string", - "id": "string", - "instructionText": "string", - "key": "string", - "notParam": true, - "order": 0, - "paramArray": true, - "parameterName": "string", - "provider": "string", - "range": [ - { - "id": "string", - "maxValue": 0, - "minValue": 0 - } - ], - "required": true, - "selection": { - "defaultSelectedValues": [ - "string" - ], - "id": "string", - "selectionType": "string", - "selectionValues": {} - } - } - ], - "tags": [ - { - "id": "string", - "name": "string" - } - ], - "templateContent": "string", - "templateParams": [ - { - "binding": "string", - "customOrder": 0, - "dataType": "string", - "defaultValue": "string", - "description": "string", - "displayName": "string", - "group": "string", - "id": "string", - "instructionText": "string", - "key": "string", - "notParam": true, - "order": 0, - "paramArray": true, - "parameterName": "string", - "provider": "string", - "range": [ - { - "id": "string", - "maxValue": 0, - "minValue": 0 - } - ], - "required": true, - "selection": { - "defaultSelectedValues": [ - "string" - ], - "id": "string", - "selectionType": "string", - "selectionValues": {} - } - } - ], - "version": "string" - } - ], - "createTime": 0, - "customParamsOrder": true, "description": "string", "deviceTypes": [ { @@ -252,18 +156,10 @@ "productType": "string" } ], - "documentDatabase": true, - "failurePolicy": "string", "id": "string", "language": "string", - "lastUpdateTime": 0, - "latestVersionTime": 0, "name": "string", - "parentTemplateId": "string", - "projectAssociated": true, - "projectId": "string", "projectName": "string", - "rollbackTemplateContent": "string", "rollbackTemplateParams": [ { "binding": "string", @@ -299,9 +195,6 @@ } } ], - "softwareType": "string", - "softwareVariant": "string", - "softwareVersion": "string", "tags": [ { "id": "string", @@ -344,29 +237,126 @@ } } ], - "validationErrors": { - "rollbackTemplateErrors": [ - {} - ], - "templateErrors": [ - {} + "version": "string" + } + ], + "createTime": 0, + "customParamsOrder": true, + "description": "string", + "deviceTypes": [ + { + "productFamily": "string", + "productSeries": "string", + "productType": "string" + } + ], + "failurePolicy": "string", + "id": "string", + "language": "string", + "lastUpdateTime": 0, + "latestVersionTime": 0, + "name": "string", + "parentTemplateId": "string", + "projectAssociated": true, + "projectId": "string", + "projectName": "string", + "rollbackTemplateContent": "string", + "rollbackTemplateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ + { + "id": "string", + "maxValue": 0, + "minValue": 0 + } + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" ], - "templateId": "string", - "templateVersion": "string" - }, - "version": "string", - "versionsInfo": [ + "id": "string", + "selectionType": "string", + "selectionValues": {} + } + } + ], + "softwareType": "string", + "softwareVariant": "string", + "softwareVersion": "string", + "tags": [ + { + "id": "string", + "name": "string" + } + ], + "templateContent": "string", + "templateParams": [ + { + "binding": "string", + "customOrder": 0, + "dataType": "string", + "defaultValue": "string", + "description": "string", + "displayName": "string", + "group": "string", + "id": "string", + "instructionText": "string", + "key": "string", + "notParam": true, + "order": 0, + "paramArray": true, + "parameterName": "string", + "provider": "string", + "range": [ { - "author": "string", - "description": "string", "id": "string", - "version": "string", - "versionComment": "string", - "versionTime": 0 + "maxValue": 0, + "minValue": 0 } - ] + ], + "required": true, + "selection": { + "defaultSelectedValues": [ + "string" + ], + "id": "string", + "selectionType": "string", + "selectionValues": {} + } } ], - "version": "string" + "validationErrors": { + "rollbackTemplateErrors": {}, + "templateErrors": {}, + "templateId": "string", + "templateVersion": "string" + }, + "version": "string", + "versionsInfo": [ + { + "author": "string", + "description": "string", + "id": "string", + "version": "string", + "versionComment": "string", + "versionTime": 0 + } + ] } """ diff --git a/plugins/modules/threat_detail.py b/plugins/modules/threat_detail.py index 110d0415f2..685b60b155 100644 --- a/plugins/modules/threat_detail.py +++ b/plugins/modules/threat_detail.py @@ -44,7 +44,7 @@ elements: str type: list requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/threat_detail_count.py b/plugins/modules/threat_detail_count.py index a329faed7f..fab706a16c 100644 --- a/plugins/modules/threat_detail_count.py +++ b/plugins/modules/threat_detail_count.py @@ -44,7 +44,7 @@ elements: str type: list requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/threat_summary.py b/plugins/modules/threat_summary.py index 66c4613c76..e3f3742bb0 100644 --- a/plugins/modules/threat_summary.py +++ b/plugins/modules/threat_summary.py @@ -35,7 +35,7 @@ elements: str type: list requirements: -- dnacentersdk >= 2.4.9 +- dnacentersdk >= 2.5.5 - python >= 3.5 notes: - SDK Method used are diff --git a/plugins/modules/transit_peer_network_info.py b/plugins/modules/transit_peer_network_info.py index 0f3e053d65..ef9ecac22c 100644 --- a/plugins/modules/transit_peer_network_info.py +++ b/plugins/modules/transit_peer_network_info.py @@ -75,6 +75,8 @@ "deviceManagementIpAddress": "string" } ] - } + }, + "status": "string", + "description": "string" } """ diff --git a/plugins/modules/user.py b/plugins/modules/user.py new file mode 100644 index 0000000000..5bfdc9ced7 --- /dev/null +++ b/plugins/modules/user.py @@ -0,0 +1,112 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: user +short_description: Resource module for User +description: +- Manage operations create and update of the resource User. +- Add a new user for Cisco DNA Center system. +- Update a user for Cisco DNA Center system. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + email: + description: Email. + type: str + firstName: + description: First Name. + type: str + lastName: + description: Last Name. + type: str + password: + description: Password. + type: str + roleList: + description: Role id list. + elements: str + type: list + userId: + description: User Id. + type: str + username: + description: Username. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for User and Roles AddUserAPI + description: Complete reference of the AddUserAPI API. + link: https://developer.cisco.com/docs/dna-center/#!add-user-api +- name: Cisco DNA Center documentation for User and Roles UpdateUserAPI + description: Complete reference of the UpdateUserAPI API. + link: https://developer.cisco.com/docs/dna-center/#!update-user-api +notes: + - SDK Method used are + userand_roles.UserandRoles.add_user_ap_i, + userand_roles.UserandRoles.update_user_ap_i, + + - Paths used are + post /dna/system/api/v1/user, + put /dna/system/api/v1/user, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.user: + 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}}" + state: present + email: string + firstName: string + lastName: string + password: string + roleList: + - string + username: string + +- name: Update all + cisco.dnac.user: + 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}}" + state: present + email: string + firstName: string + lastName: string + roleList: + - string + userId: string + username: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "message": "string", + "userId": "string" + } +""" diff --git a/plugins/modules/user_info.py b/plugins/modules/user_info.py new file mode 100644 index 0000000000..bb25c6659c --- /dev/null +++ b/plugins/modules/user_info.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: user_info +short_description: Information module for User +description: +- Get all User. +- Get all users for the Cisco DNA Center system. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + invokeSource: + description: + - InvokeSource query parameter. The source that invokes this API. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for User and Roles GetUsersAPI + description: Complete reference of the GetUsersAPI API. + link: https://developer.cisco.com/docs/dna-center/#!get-users-api +notes: + - SDK Method used are + userand_roles.UserandRoles.get_users_ap_i, + + - Paths used are + get /dna/system/api/v1/user, + +""" + +EXAMPLES = r""" +- name: Get all User + cisco.dnac.user_info: + 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}}" + invokeSource: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "users": [ + { + "firstName": "string", + "lastName": "string", + "authSource": "string", + "passphraseUpdateTime": "string", + "roleList": [ + "string" + ], + "userId": "string", + "email": "string", + "username": "string" + } + ] + } +""" diff --git a/plugins/modules/users_external_servers_info.py b/plugins/modules/users_external_servers_info.py new file mode 100644 index 0000000000..2360060adb --- /dev/null +++ b/plugins/modules/users_external_servers_info.py @@ -0,0 +1,80 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: users_external_servers_info +short_description: Information module for Users External Servers +description: +- Get all Users External Servers. +- Get external users authentication servers. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + invokeSource: + description: + - InvokeSource query parameter. The source that invokes this API. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for User and Roles GetExternalAuthenticationServersAPI + description: Complete reference of the GetExternalAuthenticationServersAPI API. + link: https://developer.cisco.com/docs/dna-center/#!get-external-authentication-servers-api +notes: + - SDK Method used are + userand_roles.UserandRoles.get_external_authentication_servers_ap_i, + + - Paths used are + get /dna/system/api/v1/users/external-servers, + +""" + +EXAMPLES = r""" +- name: Get all Users External Servers + cisco.dnac.users_external_servers_info: + 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}}" + invokeSource: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "aaa-servers": [ + { + "accountingPort": 0, + "retries": 0, + "protocol": "string", + "socketTimeout": 0, + "serverIp": "string", + "sharedSecret": "string", + "serverId": "string", + "authenticationPort": 0, + "aaaAttribute": "string", + "role": "string" + } + ] + } +""" diff --git a/plugins/modules/wireless_accespoint_configuration.py b/plugins/modules/wireless_accespoint_configuration.py new file mode 100644 index 0000000000..94dee6c5df --- /dev/null +++ b/plugins/modules/wireless_accespoint_configuration.py @@ -0,0 +1,338 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_accespoint_configuration +short_description: Resource module for Wireless Accespoint Configuration +description: +- Manage operation create of the resource Wireless Accespoint Configuration. +- User can configure multiple access points with required options using this intent API. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module +author: Rafael Campos (@racampos) +options: + adminStatus: + description: Configure the access point's admin status. Set this parameter's value + to "true" to enable it and "false" to disable it. + type: bool + apHeight: + description: Configure the height of the access point by setting a value between + 3 and height of the floor. + type: int + apList: + description: Wireless Accespoint Configuration's apList. + elements: dict + suboptions: + apName: + description: The current host name of the access point. + type: str + apNameNew: + description: The modified hostname of the access point. + type: str + macAddress: + description: The ethernet MAC address of the access point. + type: str + type: list + apMode: + description: Configure the access point's mode for local/flexconnect mode, set "0"; + for monitor mode, set "1"; for sniffer mode, set "4"; and for bridge/flex+bridge + mode, set "5". + type: int + configureAdminStatus: + description: To change the access point's admin status, set this parameter's value + to "true". + type: bool + configureApHeight: + description: To change the access point's height, set this parameter's value to + "true". + type: bool + configureApMode: + description: To change the access point's mode, set this parameter's value to "true". + type: bool + configureFailoverPriority: + description: To change the access point's failover priority, set this parameter's + value to "true". + type: bool + configureHAController: + description: To change the access point's HA controller, set this parameter's value + to "true". + type: bool + configureLedBrightnessLevel: + description: To change the access point's LED brightness level, set this parameter's + value to "true". + type: bool + configureLedStatus: + description: To change the access point's LED status, set this parameter's value + to "true". + type: bool + configureLocation: + description: To change the access point's location, set this parameter's value to + "true". + type: bool + failoverPriority: + description: Configure the acess point's failover priority for low, set "1"; for + medium, set "2"; for high, set "3"; and for critical, set "4". + type: int + ledBrightnessLevel: + description: Configure the access point's LED brightness level by setting a value + between 1 and 8. + type: int + ledStatus: + description: Configure the access point's LED status. Set "true" to enable its status + and "false" to disable it. + type: bool + location: + description: Configure the access point's location. + type: str + primaryControllerName: + description: Configure the hostname for an access point's primary controller. + type: str + primaryIpAddress: + description: Wireless Accespoint Configuration's primaryIpAddress. + suboptions: + address: + description: Configure the IP address for an access point's primary controller. + type: str + type: dict + radioConfigurations: + description: Wireless Accespoint Configuration's radioConfigurations. + elements: dict + suboptions: + adminStatus: + description: Configure the admin status on the specified radio for an access + point. Set this parameter's value to "true" to enable it and "false" to disable + it. + type: bool + antennaCableName: + description: Configure the antenna cable name on the specified radio for an + access point. If cable loss needs to be configured, set this parameter's value + to "other". + type: str + antennaDegree: + description: Configure the antenna degree on the specified radio for an access + point. + type: int + antennaElevAngleDegree: + description: Configure the antenna elevation angle on the specified radio for + an access point. + type: int + antennaElevAngleSign: + description: Configure the antenna elevation angle direction on the specified + radio for an access point for up, set "1"; for down, set "-1". + type: int + antennaGain: + description: Configure the antenna gain on the specified radio for an access + point by setting a decimal value (in dBi). + type: int + antennaPatternName: + description: Configure the antenna pattern name on the specified radio for an + access point. If antenna gain needs to be configured, set this parameter's + value to "other". + type: str + cableLoss: + description: Configure the cable loss on the specified radio for an access point + by setting a decimal value (in dBi). + type: int + channelAssignmentMode: + description: Configure the channel assignment mode on the specified radio for + an access point for global mode, set "1"; and for custom mode, set "2". + type: int + channelNumber: + description: Configure the channel number on the specified radio for an access + point. + type: int + channelWidth: + description: Configure the channel width on the specified radio for an access + point for 20 MHz, set "3"; for 40 MHz, set "4"; for 80 MHz, set "5"; and for + 160 MHz, set "6". + type: int + cleanAirSI: + description: Configure CleanAir or Spectrum Intelligence on the specified radio + for an access point. Set this parameter's value to "0" to disable the feature + or "1" to enable it. + type: int + configureAdminStatus: + description: To change the admin status on the specified radio for an access + point, set this parameter's value to "true". + type: bool + configureAntennaCable: + description: To change the antenna cable name on the specified radio for an + access point, set this parameter's value to "true". + type: bool + configureAntennaDegree: + description: To change the antenna degree on the specified radio for an access + point, set this parameter's value to "true". + type: bool + configureAntennaPatternName: + description: To change the antenna pattern name on the specified radio for an + access point, set the value for this parameter to "true". + type: bool + configureChannel: + description: To change the channel on the specified radio for an access point, + set this parameter's value to "true". + type: bool + configureChannelWidth: + description: To change the channel width on the specified radio for an access + point, set this parameter's value to "true". + type: bool + configureCleanAirSI: + description: To enable or disable either CleanAir or Spectrum Intelligence on + the specified radio for an access point, set this parameter's value to "true". + type: bool + configureElevAngleDegree: + description: To change the elevation angle degree on the specified radio for + an access point, set this parameter's value to "true". + type: bool + configurePower: + description: To change the power assignment mode on the specified radio for + an access point, set this parameter's value to "true". + type: bool + configureRadioRoleAssignment: + description: To change the radio role on the specified radio for an access point, + set this parameter's value to "true". + type: bool + powerAssignmentMode: + description: Configure the power assignment mode on the specified radio for + an access point for global mode, set "1"; and for custom mode, set "2". + type: int + powerlevel: + description: Configure the power level on the specified radio for an access + point by setting a value between 1 and 8. + type: int + radioBand: + description: Configure the band on the specified radio for an access point for + 2.4 GHz, set "RADIO24"; for 5 GHz, set "RADIO5". + type: str + radioRoleAssignment: + description: Configure one of the following roles on the specified radio for + an access point "auto", "serving", or "monitor". + type: str + radioType: + description: Configure an access point's radio band for 2.4 GHz, set "1"; for + 5 GHz, set "2"; for XOR, set "3"; and for 6 GHz, set "6". + type: int + type: list + secondaryControllerName: + description: Configure the hostname for an access point's secondary controller. + type: str + secondaryIpAddress: + description: Wireless Accespoint Configuration's secondaryIpAddress. + suboptions: + address: + description: Configure the IP address for an access point's secondary controller. + type: str + type: dict + tertiaryControllerName: + description: Configure the hostname for an access point's tertiary controller. + type: str + tertiaryIpAddress: + description: Wireless Accespoint Configuration's tertiaryIpAddress. + suboptions: + address: + description: Configure the IP address for an access point's tertiary controller. + type: str + type: dict +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless ConfigureAccessPoints + description: Complete reference of the ConfigureAccessPoints API. + link: https://developer.cisco.com/docs/dna-center/#!configure-access-points +notes: + - SDK Method used are + wireless.Wireless.configure_access_points, + + - Paths used are + post /dna/intent/api/v1/wireless/accesspoint-configuration, + +""" + +EXAMPLES = r""" +- name: Create + cisco.dnac.wireless_accespoint_configuration: + 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}}" + adminStatus: true + apHeight: 0 + apList: + - apName: string + apNameNew: string + macAddress: string + apMode: 0 + configureAdminStatus: true + configureApHeight: true + configureApMode: true + configureFailoverPriority: true + configureHAController: true + configureLedBrightnessLevel: true + configureLedStatus: true + configureLocation: true + failoverPriority: 0 + ledBrightnessLevel: 0 + ledStatus: true + location: string + primaryControllerName: string + primaryIpAddress: + address: string + radioConfigurations: + - adminStatus: true + antennaCableName: string + antennaDegree: 0 + antennaElevAngleDegree: 0 + antennaElevAngleSign: 0 + antennaGain: 0 + antennaPatternName: string + cableLoss: 0 + channelAssignmentMode: 0 + channelNumber: 0 + channelWidth: 0 + cleanAirSI: 0 + configureAdminStatus: true + configureAntennaCable: true + configureAntennaDegree: true + configureAntennaPatternName: true + configureChannel: true + configureChannelWidth: true + configureCleanAirSI: true + configureElevAngleDegree: true + configurePower: true + configureRadioRoleAssignment: true + powerAssignmentMode: 0 + powerlevel: 0 + radioBand: string + radioRoleAssignment: string + radioType: 0 + secondaryControllerName: string + secondaryIpAddress: + address: string + tertiaryControllerName: string + tertiaryIpAddress: + address: string + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "response": { + "taskId": "string", + "url": "string" + }, + "version": "string" + } +""" diff --git a/plugins/modules/wireless_accesspoint_configuration_summary_info.py b/plugins/modules/wireless_accesspoint_configuration_summary_info.py new file mode 100644 index 0000000000..3c21308685 --- /dev/null +++ b/plugins/modules/wireless_accesspoint_configuration_summary_info.py @@ -0,0 +1,152 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2021, Cisco Systems +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + +DOCUMENTATION = r""" +--- +module: wireless_accesspoint_configuration_summary_info +short_description: Information module for Wireless Accesspoint Configuration Summary +description: +- Get all Wireless Accesspoint Configuration Summary. +- Users can query the access point configuration information per device using the ethernet MAC address. +version_added: '6.7.0' +extends_documentation_fragment: + - cisco.dnac.module_info +author: Rafael Campos (@racampos) +options: + headers: + description: Additional headers. + type: dict + key: + description: + - Key query parameter. The ethernet MAC address of Access point. + type: str +requirements: +- dnacentersdk >= 2.5.5 +- python >= 3.5 +seealso: +- name: Cisco DNA Center documentation for Wireless GetAccessPointConfiguration + description: Complete reference of the GetAccessPointConfiguration API. + link: https://developer.cisco.com/docs/dna-center/#!get-access-point-configuration +notes: + - SDK Method used are + wireless.Wireless.get_access_point_configuration, + + - Paths used are + get /dna/intent/api/v1/wireless/accesspoint-configuration/summary, + +""" + +EXAMPLES = r""" +- name: Get all Wireless Accesspoint Configuration Summary + cisco.dnac.wireless_accesspoint_configuration_summary_info: + 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}}" + key: string + register: result + +""" + +RETURN = r""" +dnac_response: + description: A dictionary or list with the response returned by the Cisco DNAC Python SDK + returned: always + type: dict + sample: > + { + "instanceUuid": {}, + "instanceId": 0, + "authEntityId": {}, + "displayName": "string", + "authEntityClass": {}, + "instanceTenantId": "string", + "_orderedListOEIndex": 0, + "_orderedListOEAssocName": {}, + "_creationOrderIndex": 0, + "_isBeingChanged": true, + "deployPending": "string", + "instanceCreatedOn": {}, + "instanceUpdatedOn": {}, + "changeLogList": {}, + "instanceOrigin": {}, + "lazyLoadedEntities": {}, + "instanceVersion": 0, + "adminStatus": "string", + "apHeight": 0, + "apMode": "string", + "apName": "string", + "ethMac": "string", + "failoverPriority": "string", + "ledBrightnessLevel": 0, + "ledStatus": "string", + "location": "string", + "macAddress": "string", + "primaryControllerName": "string", + "primaryIpAddress": "string", + "secondaryControllerName": "string", + "secondaryIpAddress": "string", + "tertiaryControllerName": "string", + "tertiaryIpAddress": "string", + "meshDTOs": [ + {} + ], + "radioDTOs": [ + { + "instanceUuid": {}, + "instanceId": 0, + "authEntityId": {}, + "displayName": "string", + "authEntityClass": {}, + "instanceTenantId": "string", + "_orderedListOEIndex": 0, + "_orderedListOEAssocName": {}, + "_creationOrderIndex": 0, + "_isBeingChanged": true, + "deployPending": "string", + "instanceCreatedOn": {}, + "instanceUpdatedOn": {}, + "changeLogList": {}, + "instanceOrigin": {}, + "lazyLoadedEntities": {}, + "instanceVersion": 0, + "adminStatus": "string", + "antennaAngle": 0, + "antennaElevAngle": 0, + "antennaGain": 0, + "antennaPatternName": "string", + "channelAssignmentMode": "string", + "channelNumber": 0, + "channelWidth": "string", + "cleanAirSI": "string", + "ifType": 0, + "ifTypeValue": "string", + "macAddress": "string", + "powerAssignmentMode": "string", + "powerlevel": 0, + "radioBand": {}, + "radioRoleAssignment": {}, + "slotId": 0, + "internalKey": { + "type": "string", + "id": 0, + "longType": "string", + "url": "string" + } + } + ], + "internalKey": { + "type": "string", + "id": 0, + "longType": "string", + "url": "string" + } + } +""" diff --git a/plugins/modules/wireless_dynamic_interface.py b/plugins/modules/wireless_dynamic_interface.py index fa60de9cb6..ea48c79709 100644 --- a/plugins/modules/wireless_dynamic_interface.py +++ b/plugins/modules/wireless_dynamic_interface.py @@ -81,11 +81,13 @@ dnac_response: description: A dictionary or list with the response returned by the Cisco DNAC Python SDK returned: always - type: dict + type: list sample: > - { - "executionId": "string", - "executionUrl": "string", - "message": "string" - } + [ + { + "executionId": "string", + "executionUrl": "string", + "message": "string" + } + ] """ diff --git a/plugins/modules/wireless_enterprise_ssid_info.py b/plugins/modules/wireless_enterprise_ssid_info.py index 8e4a9b52d0..8abacd8329 100644 --- a/plugins/modules/wireless_enterprise_ssid_info.py +++ b/plugins/modules/wireless_enterprise_ssid_info.py @@ -85,7 +85,18 @@ "enableBroadcastSSID": true, "nasOptions": [ "string" - ] + ], + "aaaOverride": true, + "coverageHoleDetectionEnable": true, + "protectedManagementFrame": "string", + "multiPSKSettings": [ + { + "priority": 0, + "passphraseType": "string", + "passphrase": "string" + } + ], + "clientRateLimit": 0 } ], "groupUuid": "string", diff --git a/plugins/modules/wireless_profile.py b/plugins/modules/wireless_profile.py index 33cb7ecbd5..4c696f0d6e 100644 --- a/plugins/modules/wireless_profile.py +++ b/plugins/modules/wireless_profile.py @@ -35,7 +35,7 @@ elements: dict suboptions: enableFabric: - description: True is ssid is fabric else false. + description: True if ssid is fabric else false. type: bool flexConnect: description: Wireless Profile's flexConnect. @@ -44,7 +44,7 @@ description: True if flex connect is enabled else false. type: bool localToVlan: - description: Local To Vlan. + description: Local To Vlan Id. type: int type: dict interfaceName: @@ -53,9 +53,15 @@ name: description: Ssid Name. type: str + policyProfileName: + description: Policy Profile Name. + type: str type: description: Ssid Type(enum Enterprise/Guest). type: str + wlanProfileName: + description: WLAN Profile Name. + type: str type: list type: dict wirelessProfileName: @@ -121,7 +127,9 @@ localToVlan: 0 interfaceName: string name: string + policyProfileName: string type: string + wlanProfileName: string - name: Create cisco.dnac.wireless_profile: @@ -144,7 +152,9 @@ localToVlan: 0 interfaceName: string name: string + policyProfileName: string type: string + wlanProfileName: string """ diff --git a/plugins/modules/wireless_provision_access_point.py b/plugins/modules/wireless_provision_access_point.py index c7913ce8a8..ac12cd58c1 100644 --- a/plugins/modules/wireless_provision_access_point.py +++ b/plugins/modules/wireless_provision_access_point.py @@ -89,11 +89,13 @@ dnac_response: description: A dictionary or list with the response returned by the Cisco DNAC Python SDK returned: always - type: dict + type: list sample: > - { - "executionId": "string", - "executionUrl": "string", - "message": "string" - } + [ + { + "executionId": "string", + "executionUrl": "string", + "message": "string" + } + ] """ diff --git a/plugins/modules/wireless_provision_ssid_create_provision.py b/plugins/modules/wireless_provision_ssid_create_provision.py index 075f65782d..5a7322ea99 100644 --- a/plugins/modules/wireless_provision_ssid_create_provision.py +++ b/plugins/modules/wireless_provision_ssid_create_provision.py @@ -61,8 +61,7 @@ ). type: str radioPolicy: - description: Radio Policy. Allowed values are 'Dual band operation (2.4GHz and - 5GHz)', 'Dual band operation with band select', '5GHz only', '2.4GHz only'. + description: Radio Policy. type: str securityLevel: description: Security Level(For guest SSID OPEN/WEB_AUTH, For Enterprise SSID diff --git a/plugins/modules/wireless_psk_override.py b/plugins/modules/wireless_psk_override.py index 55fc0d215e..0afada7c51 100644 --- a/plugins/modules/wireless_psk_override.py +++ b/plugins/modules/wireless_psk_override.py @@ -29,6 +29,9 @@ ssid: description: Enterprise ssid name(already created/present). type: str + wlanProfileName: + description: WLAN Profile Name. + type: str type: list requirements: - dnacentersdk >= 2.5.5 @@ -60,6 +63,7 @@ - passPhrase: string site: string ssid: string + wlanProfileName: string """