Skip to content

Commit

Permalink
Merge pull request #180 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
chore: Update dnacentersdk requirement to version 2.7.2
  • Loading branch information
bvargasre authored Aug 9, 2024
2 parents 9561c2a + ddf07eb commit 0a344f5
Show file tree
Hide file tree
Showing 487 changed files with 690 additions and 672 deletions.
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ assignees: ''
* [ ] Do you have the latest Ansible collection version?
* [ ] Review the [compatibility matrix](https://github.com/cisco-en-programmability/dnacenter-ansible/tree/main#compatibility-matrix) before opening an issue.

**Name of the module**
Please provide the name of the module used.

**Describe the bug**
A clear and concise description of what the bug is.

Expand All @@ -21,6 +24,11 @@ A clear and concise description of what you expected to happen.
**Screenshots**
Please provide an screenshot of the successful API call with cuRL, Postman, etc.

**Debug**
Enable debugging and add CiscoISE output request and reponse.
* exporting `export DNAC_DEBUG=True`
* playbook `dnac_debug: True`

**Environment (please complete the following information):**
* Cisco DNA Center Version and patch:
* Ansible Version:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ changelogs/.plugin-cache.yaml
playbooks/credentials.yml
playbooks/device_details.template
.DS_Store
test.yml
test.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The following table shows the supported versions.
| 2.2.3.3 | 6.4.0 | 2.4.11 |
| 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.15.0 | ^2.7.1 |
| 2.3.7.6 | ^6.17.1 | ^2.7.2 |

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

Expand Down
260 changes: 133 additions & 127 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.17.0
version: 6.17.1
readme: README.md
authors:
- Rafael Campos <rcampos@altus.cr>
Expand Down
10 changes: 5 additions & 5 deletions plugins/action/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def get_object_by_name(self, name):
# NOTE: Does not have a get by name method or it is in another action
try:
items = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="get_roles_api",
params=self.get_all_params(name=name),
)
Expand All @@ -102,7 +102,7 @@ def get_object_by_id(self, id):
# NOTE: Does not have a get by id method or it is in another action
try:
items = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="get_roles_api",
params=self.get_all_params(id=id),
)
Expand Down Expand Up @@ -156,7 +156,7 @@ def requires_update(self, current_obj):

def create(self):
result = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="add_role_api",
params=self.create_params(),
op_modifies=True,
Expand All @@ -168,7 +168,7 @@ def update(self):
name = self.new_object.get("name")
result = None
result = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="update_role_api",
params=self.update_all_params(),
op_modifies=True,
Expand All @@ -189,7 +189,7 @@ def delete(self):
if id_:
self.new_object.update(dict(role_id=id_))
result = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="delete_role_api",
params=self.delete_by_id_params(),
)
Expand Down
32 changes: 17 additions & 15 deletions plugins/action/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@
userId=dict(type="str"),
))

required_if = [
("state", "present", ["userId"], True),
("state", "absent", ["userId"], True),
]
required_if = []
required_one_of = []
mutually_exclusive = []
required_together = []
Expand All @@ -55,7 +52,7 @@ def __init__(self, params, dnac):
self.new_object = dict(
firstName=params.get("firstName"),
lastName=params.get("lastName"),
username=params.get("username"),
username=(params.get("username")).lower(),
password=params.get("password"),
email=params.get("email"),
roleList=params.get("roleList"),
Expand All @@ -66,7 +63,7 @@ def __init__(self, params, dnac):
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')
self.new_object.get('invoke_source') or 'external'
new_object_params['auth_source'] = self.new_object.get('authSource') or \
self.new_object.get('auth_source')
return new_object_params
Expand Down Expand Up @@ -101,14 +98,16 @@ def get_object_by_name(self, name):
# NOTE: Does not have a get by name method or it is in another action
try:
items = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="get_users_api",
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)
if 'users' in items:
items = items.get('users')
result = get_dict_result(items, 'username', name)
except Exception:
result = None
return result
Expand All @@ -118,14 +117,16 @@ def get_object_by_id(self, id):
# NOTE: Does not have a get by id method or it is in another action
try:
items = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="get_users_api",
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)
if 'users' in items:
items = items.get('users')
result = get_dict_result(items, 'userId', id)
except Exception:
result = None
return result
Expand All @@ -136,7 +137,7 @@ def exists(self):
prev_obj = None
o_id = self.new_object.get("id")
o_id = o_id or self.new_object.get("user_id")
name = self.new_object.get("name")
name = self.new_object.get("username")
if o_id:
prev_obj = self.get_object_by_id(o_id)
id_exists = prev_obj is not None and isinstance(prev_obj, dict)
Expand All @@ -151,6 +152,7 @@ def exists(self):
if _id:
self.new_object.update(dict(id=_id))
self.new_object.update(dict(user_id=_id))
self.new_object.update(dict(userId=_id))
it_exists = prev_obj is not None and isinstance(prev_obj, dict)
return (it_exists, prev_obj)

Expand All @@ -174,7 +176,7 @@ def requires_update(self, current_obj):

def create(self):
result = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="add_user_api",
params=self.create_params(),
op_modifies=True,
Expand All @@ -186,7 +188,7 @@ def update(self):
name = self.new_object.get("name")
result = None
result = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="update_user_api",
params=self.update_all_params(),
op_modifies=True,
Expand All @@ -196,7 +198,7 @@ def update(self):
def delete(self):
id = self.new_object.get("id")
id = id or self.new_object.get("user_id")
name = self.new_object.get("name")
name = self.new_object.get("username")
result = None
if not id:
prev_obj_name = self.get_object_by_name(name)
Expand All @@ -207,7 +209,7 @@ def delete(self):
if id_:
self.new_object.update(dict(user_id=id_))
result = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="delete_user_api",
params=self.delete_by_id_params(),
)
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/user_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def run(self, tmp=None, task_vars=None):
dnac = DNACSDK(params=self._task.args)

response = dnac.exec(
family="userand_roles",
family="user_and_roles",
function='get_users_api',
params=self.get_object(self._task.args),
)
Expand Down
4 changes: 2 additions & 2 deletions plugins/action/users_external_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_object_by_name(self, name):
# NOTE: Does not have a get by name method, using get all
try:
items = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="get_external_authentication_setting_api",
params=self.get_all_params(name=name),
)
Expand Down Expand Up @@ -114,7 +114,7 @@ def requires_update(self, current_obj):

def create(self):
result = self.dnac.exec(
family="userand_roles",
family="user_and_roles",
function="manage_external_authentication_setting_api",
params=self.create_params(),
op_modifies=True,
Expand Down
2 changes: 1 addition & 1 deletion plugins/action/users_external_authentication_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def run(self, tmp=None, task_vars=None):
dnac = DNACSDK(params=self._task.args)

response = dnac.exec(
family="userand_roles",
family="user_and_roles",
function='get_external_authentication_setting_api',
params=self.get_object(self._task.args),
)
Expand Down
12 changes: 6 additions & 6 deletions plugins/action/users_external_servers_aaa_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def get_object_by_name(self, name):
# NOTE: Does not have a get by name method, using get all
try:
items = self.dnac.exec(
family="userand_roles",
function="get_a_a_a_attribute_api",
family="user_and_roles",
function="get_aaa_attribute_api",
params=self.get_all_params(name=name),
)
if isinstance(items, dict):
Expand Down Expand Up @@ -118,8 +118,8 @@ def requires_update(self, current_obj):

def create(self):
result = self.dnac.exec(
family="userand_roles",
function="add_and_update_a_a_a_attribute_api",
family="user_and_roles",
function="add_and_update_aaa_attribute_api",
params=self.create_params(),
op_modifies=True,
)
Expand All @@ -130,8 +130,8 @@ def delete(self):
name = self.new_object.get("name")
result = None
result = self.dnac.exec(
family="userand_roles",
function="delete_a_a_a_attribute_api",
family="user_and_roles",
function="delete_aaa_attribute_api",
params=self.delete_all_params(),
)
return result
Expand Down
4 changes: 2 additions & 2 deletions plugins/action/users_external_servers_aaa_attribute_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def run(self, tmp=None, task_vars=None):
dnac = DNACSDK(params=self._task.args)

response = dnac.exec(
family="userand_roles",
function='get_a_a_a_attribute_api',
family="user_and_roles",
function='get_aaa_attribute_api',
params=self.get_object(self._task.args),
)
self._result.update(dict(dnac_response=response))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- Task_id path parameter. Task id information of ap config.
type: str
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Wireless GetAccessPointConfigurationTaskResult
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_default_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyDefault
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- PolicyScope query parameter. Policy scope name.
type: str
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicy
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_intent_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
type: dict
type: list
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy ApplicationPolicyIntent
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_queuing_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplicationPolicyQueuingProfile
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_queuing_profile_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfileCount
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/app_policy_queuing_profile_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- Name query parameter. Queuing profile name.
type: str
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationPolicyQueuingProfile
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/application_policy_application_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplicationSets
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
- ScalableGroupType query parameter. Scalable group type to retrieve, valid value APPLICATION_GROUP.
type: str
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationSetCount
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/application_policy_application_set_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
results, max value 500.
type: float
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy GetApplicationSets2
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/application_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.7.1
- dnacentersdk >= 2.7.2
- python >= 3.5
seealso:
- name: Cisco DNA Center documentation for Application Policy CreateApplicationSet
Expand Down
Loading

0 comments on commit 0a344f5

Please sign in to comment.