diff --git a/plugins/action/network_device_config__info.py b/plugins/action/network_device_config__info.py deleted file mode 100644 index 52a1b32534..0000000000 --- a/plugins/action/network_device_config__info.py +++ /dev/null @@ -1,99 +0,0 @@ -#!/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"), - fileType=dict(type="str"), - createdTime=dict(type="str"), - createdBy=dict(type="str"), - offset=dict(type="float"), - limit=dict(type="float"), - 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"), - file_type=params.get("fileType"), - created_time=params.get("createdTime"), - created_by=params.get("createdBy"), - offset=params.get("offset"), - limit=params.get("limit"), - 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="configuration_archive", - function='get_configuration_archive_details', - 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/network_device_config__info.py b/plugins/modules/network_device_config__info.py deleted file mode 100644 index fa2701582b..0000000000 --- a/plugins/modules/network_device_config__info.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/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_config__info -short_description: Information module for Network Device Config -description: -- Get all Network Device Config. -- > - Returns the historical device configurations running configuration , startup configuration , vlan if applicable by - specified criteria. -version_added: '6.14.0' -extends_documentation_fragment: - - cisco.dnac.module_info -author: Rafael Campos (@racampos) -options: - headers: - description: Additional headers. - type: dict - deviceId: - description: - - > - DeviceId query parameter. Comma separated device id for example - cf35b0a1-407f-412f-b2f4-f0c3156695f9,aaa38191-0c22-4158-befd-779a09d7cec1. If device id is not provided it - will fetch for all devices. - type: str - fileType: - description: - - FileType query parameter. Config File Type can be RUNNINGCONFIG or STARTUPCONFIG. - type: str - createdTime: - description: - - CreatedTime query parameter. Supported with logical filters GT,GTE,LT,LTE & BT time in milliseconds (epoc format). - type: str - createdBy: - description: - - > - CreatedBy query parameter. Comma separated values for createdBy - SCHEDULED, USER, CONFIG_CHANGE_EVENT, - SCHEDULED_FIRST_TIME, DR_CALL_BACK, PRE_DEPLOY. - type: str - offset: - description: - - Offset query parameter. - type: float - limit: - description: - - Limit query parameter. - type: float -requirements: -- dnacentersdk >= 2.4.9 -- python >= 3.5 -seealso: -- name: Cisco DNA Center documentation for Configuration Archive GetConfigurationArchiveDetails - description: Complete reference of the GetConfigurationArchiveDetails API. - link: https://developer.cisco.com/docs/dna-center/#!get-configuration-archive-details -notes: - - SDK Method used are - configuration_archive.ConfigurationArchive.get_configuration_archive_details, - - - Paths used are - get /dna/intent/api/v1/network-device-config, - -""" - -EXAMPLES = r""" -- name: Get all Network Device Config - cisco.dnac.network_device_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}}" - deviceId: string - fileType: string - createdTime: string - createdBy: string - offset: 0 - limit: 0 - 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", - "deviceId": "string", - "versions": [ - { - "files": [ - { - "fileType": "string", - "fileId": "string", - "downloadPath": "string" - } - ], - "createdBy": "string", - "configChangeType": "string", - "syslogConfigEventDto": [ - { - "userName": "string", - "deviceUuid": "string", - "outOfBand": true, - "configMethod": "string", - "terminalName": "string", - "loginIpAddress": "string", - "processName": "string", - "syslogTime": 0 - } - ], - "createdTime": 0, - "startupRunningStatus": "string", - "id": "string", - "tags": [ - "string" - ], - "lastUpdatedTime": 0 - } - ], - "deviceName": "string" - } - ] -"""