forked from cisco-en-programmability/dnacenter-ansible
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into credentials_module
- Loading branch information
Showing
1,428 changed files
with
93,353 additions
and
1,630 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
namespace: cisco | ||
name: dnac | ||
version: 6.26.0 | ||
version: 6.27.0 | ||
readme: README.md | ||
authors: | ||
- Rafael Campos <[email protected]> | ||
|
2 changes: 1 addition & 1 deletion
2
...on/health_score_definitions_count_info.py → plugins/action/aaa_services_count_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
#!/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( | ||
startTime=dict(type="float"), | ||
endTime=dict(type="float"), | ||
serverIp=dict(type="str"), | ||
deviceId=dict(type="str"), | ||
deviceName=dict(type="str"), | ||
deviceSiteHierarchy=dict(type="str"), | ||
deviceSiteHierarchyId=dict(type="str"), | ||
deviceSiteId=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( | ||
start_time=params.get("startTime"), | ||
end_time=params.get("endTime"), | ||
server_ip=params.get("serverIp"), | ||
device_id=params.get("deviceId"), | ||
device_name=params.get("deviceName"), | ||
device_site_hierarchy=params.get("deviceSiteHierarchy"), | ||
device_site_hierarchy_id=params.get("deviceSiteHierarchyId"), | ||
device_site_id=params.get("deviceSiteId"), | ||
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='retrieves_the_total_number_of_aaa_services_for_given_parameters_v1', | ||
params=self.get_object(self._task.args), | ||
) | ||
self._result.update(dict(dnac_response=response)) | ||
self._result.update(dnac.exit_json()) | ||
return self._result |
2 changes: 1 addition & 1 deletion
2
plugins/action/event_snmp_config_info.py → plugins/action/aaa_services_id_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...n/intent_custom_issue_definitions_info.py → ...action/aaa_services_id_trend_analytics.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#!/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( | ||
startTime=dict(type="int"), | ||
endTime=dict(type="int"), | ||
trendInterval=dict(type="str"), | ||
groupBy=dict(type="list"), | ||
filters=dict(type="list"), | ||
attributes=dict(type="list"), | ||
aggregateAttributes=dict(type="list"), | ||
page=dict(type="dict"), | ||
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 = 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( | ||
startTime=params.get("startTime"), | ||
endTime=params.get("endTime"), | ||
trendInterval=params.get("trendInterval"), | ||
groupBy=params.get("groupBy"), | ||
filters=params.get("filters"), | ||
attributes=params.get("attributes"), | ||
aggregateAttributes=params.get("aggregateAttributes"), | ||
page=params.get("page"), | ||
id=params.get("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() | ||
|
||
dnac = DNACSDK(params=self._task.args) | ||
|
||
response = dnac.exec( | ||
family="devices", | ||
function='get_trend_analytics_data_for_a_given_aaa_service_matching_the_id_of_the_service_v1', | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"), | ||
startTime=dict(type="float"), | ||
endTime=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( | ||
id=params.get("id"), | ||
start_time=params.get("startTime"), | ||
end_time=params.get("endTime"), | ||
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="devices", | ||
function='retrieves_the_details_of_a_specific_aaa_service_matching_the_id_of_the_service_v1', | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
# -- coding: utf-8 -- | ||
from ansible.plugins.action import ActionBase | ||
from ansible_collections.cisco.dnac.plugins.action.aaa_services_v1_info import ActionModule | ||
|
||
|
||
class ActionModule2(ActionBase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(ActionModule2, self).__init__(*args, **kwargs) | ||
self._supports_async = False | ||
self._supports_check_mode = True | ||
self._result = None | ||
|
||
def run(self, tmp=None, task_vars=None): | ||
module = ActionModule(self._task.args, self._play_context, self._task) | ||
return module.run(tmp, task_vars) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
# -- coding: utf-8 -- | ||
from ansible.plugins.action import ActionBase | ||
from ansible_collections.cisco.dnac.plugins.action.aaa_services_query_v1 import ActionModule | ||
|
||
|
||
class ActionModule2(ActionBase): | ||
|
||
def __init__(self, *args, **kwargs): | ||
super(ActionModule2, self).__init__(*args, **kwargs) | ||
self._supports_async = False | ||
self._supports_check_mode = True | ||
self._result = None | ||
|
||
def run(self, tmp=None, task_vars=None): | ||
module = ActionModule(self._task.args, self._play_context, self._task) | ||
return module.run(tmp, task_vars) |
Oops, something went wrong.