Skip to content

Commit

Permalink
Merge branch 'main' into credentials_module
Browse files Browse the repository at this point in the history
  • Loading branch information
Kandarimegha authored Jan 8, 2025
2 parents d774031 + 806330a commit 1a54796
Show file tree
Hide file tree
Showing 1,428 changed files with 93,353 additions and 1,630 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ The following table shows the supported versions.
| 2.3.3.0 | 6.6.4 | 2.5.5 |
| 2.3.5.3 | 6.13.3 | 2.6.11 |
| 2.3.7.6 | 6.24.0 | 2.7.4 |
| 2.3.7.6 | ^6.25.0 | ^2.7.5 |
| 2.3.7.6 | 6.25.0 | 2.7.5 |
| 2.3.7.9 | ^6.27.0 | ^2.8.0 |

If your Ansible collection is older please consider updating it first.

Expand Down
265 changes: 265 additions & 0 deletions changelogs/changelog.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion galaxy.yml
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]>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -- coding: utf-8 --
from ansible.plugins.action import ActionBase
from ansible_collections.cisco.dnac.plugins.action.health_score_definitions_count_v1_info import ActionModule
from ansible_collections.cisco.dnac.plugins.action.aaa_services_count_v1_info import ActionModule


class ActionModule2(ActionBase):
Expand Down
103 changes: 103 additions & 0 deletions plugins/action/aaa_services_count_v1_info.py
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -- coding: utf-8 --
from ansible.plugins.action import ActionBase
from ansible_collections.cisco.dnac.plugins.action.event_snmp_config_v1_info import ActionModule
from ansible_collections.cisco.dnac.plugins.action.aaa_services_id_v1_info import ActionModule


class ActionModule2(ActionBase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -- coding: utf-8 --
from ansible.plugins.action import ActionBase
from ansible_collections.cisco.dnac.plugins.action.intent_custom_issue_definitions_v1_info import ActionModule
from ansible_collections.cisco.dnac.plugins.action.aaa_services_id_trend_analytics_v1 import ActionModule


class ActionModule2(ActionBase):
Expand Down
104 changes: 104 additions & 0 deletions plugins/action/aaa_services_id_trend_analytics_v1.py
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
102 changes: 102 additions & 0 deletions plugins/action/aaa_services_id_v1_info.py
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
17 changes: 17 additions & 0 deletions plugins/action/aaa_services_info.py
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)
17 changes: 17 additions & 0 deletions plugins/action/aaa_services_query.py
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)
Loading

0 comments on commit 1a54796

Please sign in to comment.