Skip to content

Commit

Permalink
Merge pull request #39 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop - argument changes for modules
  • Loading branch information
wastorga authored Feb 2, 2022
2 parents caa4ccb + c9e0e08 commit a473282
Show file tree
Hide file tree
Showing 333 changed files with 2,805 additions and 1,352 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Other versions of this collection have support for previous Cisco DNA Center ver
|--------------------------|------------------------------|-------------------------------|
| 2.1.1 | 3.0.0 | 2.2.5 |
| 2.2.2.3 | 3.2.3 | 2.3.3 |
| 2.2.3.3 | 4.2.0 | 2.4.4 |
| 2.2.3.3 | 5.0.0 | 2.4.5 |

*Notes*:

Expand All @@ -39,7 +39,7 @@ ansible-galaxy collection install cisco.dnac:3.2.3

## Requirements
- Ansible >= 2.9
- [Python DNA Center SDK](https://github.com/cisco-en-programmability/dnacentersdk) v2.4.0 or newer
- [Python DNA Center SDK](https://github.com/cisco-en-programmability/dnacentersdk) v2.4.5 or newer
- Python >= 3.6, as the DNA Center SDK doesn't support Python version 2.x

## Install
Expand Down
13 changes: 12 additions & 1 deletion changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,15 @@ releases:
release_summary: Parameters were added to pnp_device_claim_to_site
minor_changes:
- pnp_device_claim_to_site - Add hostname, imageInfo and configInfo parameters to module.
- Update dnacentersdk requirement from 2.4.0 to 2.4.4
- Update dnacentersdk requirement from 2.4.0 to 2.4.4
5.0.0:
release_date: '2022-02-02'
changes:
release_summary: Parameters added and dropped for modules (service_provider_profile_delete, reserve_ip_subpool_update, network_device, business_sda_wireless_controller_create and business_sda_wireless_controller_delete)
major_changes:
- Update dnacentersdk requirement from 2.4.4 to 2.4.5
- service_provider_profile_delete - Rename argument from 'sp_profile_name' to 'spProfileName'.
- reserve_ip_subpool_update - Removed 'type', 'ipv4GlobalPool', 'ipv4Prefix', 'ipv4PrefixLength', 'ipv4Subnet' and 'ipv4TotalHost' arguments.
- network_device - Removed 'managementIpAddress' arguments.
- business_sda_wireless_controller_create - Removed 'deviceIPAddress' arguments.
- business_sda_wireless_controller_delete - Removed 'deviceName' and 'siteNameHierarchy' arguments.
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: 4.2.0
version: 5.0.0
readme: README.md
authors:
- Rafael Campos <[email protected]>
Expand Down
2 changes: 0 additions & 2 deletions plugins/action/business_sda_wireless_controller_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
argument_spec.update(dict(
deviceName=dict(type="str"),
siteNameHierarchy=dict(type="str"),
deviceIPAddress=dict(type="str"),
))

required_if = []
Expand Down Expand Up @@ -67,7 +66,6 @@ def get_object(self, params):
new_object = dict(
deviceName=params.get("deviceName"),
siteNameHierarchy=params.get("siteNameHierarchy"),
device_ipaddress=params.get("deviceIPAddress"),
)
return new_object

Expand Down
4 changes: 0 additions & 4 deletions plugins/action/business_sda_wireless_controller_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
argument_spec = dnac_argument_spec()
# Add arguments specific for this module
argument_spec.update(dict(
deviceName=dict(type="str"),
siteNameHierarchy=dict(type="str"),
deviceIPAddress=dict(type="str"),
))

Expand Down Expand Up @@ -65,8 +63,6 @@ def _check_argspec(self):

def get_object(self, params):
new_object = dict(
deviceName=params.get("deviceName"),
siteNameHierarchy=params.get("siteNameHierarchy"),
device_ipaddress=params.get("deviceIPAddress"),
)
return new_object
Expand Down
12 changes: 6 additions & 6 deletions plugins/action/network_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
snmpVersion=dict(type="str"),
type=dict(type="str"),
updateMgmtIPaddressList=dict(type="list"),
managementIpAddress=dict(type="str"),
userName=dict(type="str"),
id=dict(type="str"),
cleanConfig=dict(type="bool"),
Expand Down Expand Up @@ -111,7 +110,7 @@ def __init__(self, params, dnac):
def get_all_params(self, name=None, id=None):
new_object_params = {}
new_object_params['hostname'] = self.new_object.get('hostname')
new_object_params['management_ip_address'] = self.new_object.get('managementIpAddress') or \
new_object_params['management_ip_address'] = self.new_object.get('management_ip_address') or \
self.new_object.get('ipAddress')
new_object_params['mac_address'] = self.new_object.get('mac_address')
new_object_params['location_name'] = self.new_object.get('location_name')
Expand Down Expand Up @@ -211,6 +210,7 @@ def update_all_params(self):
new_object_params['type'] = self.new_object.get('type')
new_object_params['updateMgmtIPaddressList'] = self.new_object.get('updateMgmtIPaddressList')
new_object_params['userName'] = self.new_object.get('userName')
new_object_params['id'] = self.new_object.get('id')
return new_object_params

def get_object_by_name(self, name):
Expand All @@ -225,7 +225,7 @@ def get_object_by_name(self, name):
if isinstance(items, dict):
if 'response' in items:
items = items.get('response')
result = get_dict_result(items, 'managementIpAddress', name)
result = get_dict_result(items, 'name', name)
except Exception:
result = None
return result
Expand All @@ -251,7 +251,7 @@ def exists(self):
name_exists = False
prev_obj = None
o_id = self.new_object.get("id")
name = self.new_object.get("managementIpAddress") or \
name = self.new_object.get("name") or \
self.new_object.get('ipAddress')
if isinstance(name, list) and len(name) > 0:
name = name[0]
Expand Down Expand Up @@ -322,7 +322,7 @@ def create(self):

def update(self):
id = self.new_object.get("id")
name = self.new_object.get("managementIpAddress") or \
name = self.new_object.get("name") or \
self.new_object.get('ipAddress')
if isinstance(name, list) and len(name) > 0:
name = name[0]
Expand All @@ -337,7 +337,7 @@ def update(self):

def delete(self):
id = self.new_object.get("id")
name = self.new_object.get("managementIpAddress") or \
name = self.new_object.get("name") or \
self.new_object.get('ipAddress')
if isinstance(name, list) and len(name) > 0:
name = name[0]
Expand Down
16 changes: 2 additions & 14 deletions plugins/action/reserve_ip_subpool_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@
# Add arguments specific for this module
argument_spec.update(dict(
name=dict(type="str"),
type=dict(type="str"),
ipv6AddressSpace=dict(type="bool"),
ipv4GlobalPool=dict(type="str"),
ipv4Prefix=dict(type="bool"),
ipv4PrefixLength=dict(type="int"),
ipv4Subnet=dict(type="str"),
ipv4GateWay=dict(type="str"),
ipv4DhcpServers=dict(type="list"),
ipv4DnsServers=dict(type="list"),
ipv6GlobalPool=dict(type="str"),
Expand All @@ -42,9 +36,9 @@
ipv6GateWay=dict(type="str"),
ipv6DhcpServers=dict(type="list"),
ipv6DnsServers=dict(type="list"),
ipv4TotalHost=dict(type="int"),
ipv6TotalHost=dict(type="int"),
slaacSupport=dict(type="bool"),
ipv4GateWay=dict(type="str"),
siteId=dict(type="str"),
))

Expand Down Expand Up @@ -84,13 +78,7 @@ def _check_argspec(self):
def get_object(self, params):
new_object = dict(
name=params.get("name"),
type=params.get("type"),
ipv6AddressSpace=params.get("ipv6AddressSpace"),
ipv4GlobalPool=params.get("ipv4GlobalPool"),
ipv4Prefix=params.get("ipv4Prefix"),
ipv4PrefixLength=params.get("ipv4PrefixLength"),
ipv4Subnet=params.get("ipv4Subnet"),
ipv4GateWay=params.get("ipv4GateWay"),
ipv4DhcpServers=params.get("ipv4DhcpServers"),
ipv4DnsServers=params.get("ipv4DnsServers"),
ipv6GlobalPool=params.get("ipv6GlobalPool"),
Expand All @@ -100,9 +88,9 @@ def get_object(self, params):
ipv6GateWay=params.get("ipv6GateWay"),
ipv6DhcpServers=params.get("ipv6DhcpServers"),
ipv6DnsServers=params.get("ipv6DnsServers"),
ipv4TotalHost=params.get("ipv4TotalHost"),
ipv6TotalHost=params.get("ipv6TotalHost"),
slaacSupport=params.get("slaacSupport"),
ipv4GateWay=params.get("ipv4GateWay"),
site_id=params.get("siteId"),
)
return new_object
Expand Down
4 changes: 2 additions & 2 deletions plugins/action/service_provider_profile_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
argument_spec = dnac_argument_spec()
# Add arguments specific for this module
argument_spec.update(dict(
sp_profile_name=dict(type="str"),
spProfileName=dict(type="str"),
))

required_if = []
Expand Down Expand Up @@ -63,7 +63,7 @@ def _check_argspec(self):

def get_object(self, params):
new_object = dict(
sp_profile_name=params.get("sp_profile_name"),
sp_profile_name=params.get("spProfileName"),
)
return new_object

Expand Down
9 changes: 6 additions & 3 deletions plugins/modules/app_policy_default_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.4.4
- dnacentersdk == 2.4.5
- python >= 3.5
notes:
- SDK Method used are
application_policy.ApplicationPolicy.get_application_policy_default
- Paths used are get /dna/intent/api/v1/app-policy-default
application_policy.ApplicationPolicy.get_application_policy_default,
- Paths used are
get /dna/intent/api/v1/app-policy-default,
"""

EXAMPLES = r"""
Expand Down
9 changes: 6 additions & 3 deletions plugins/modules/app_policy_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
- PolicyScope query parameter. Policy scope name.
type: str
requirements:
- dnacentersdk >= 2.4.4
- dnacentersdk == 2.4.5
- python >= 3.5
notes:
- SDK Method used are
application_policy.ApplicationPolicy.get_application_policy
- Paths used are get /dna/intent/api/v1/app-policy
application_policy.ApplicationPolicy.get_application_policy,
- Paths used are
get /dna/intent/api/v1/app-policy,
"""

EXAMPLES = r"""
Expand Down
9 changes: 6 additions & 3 deletions plugins/modules/app_policy_intent_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,15 @@
type: dict
type: list
requirements:
- dnacentersdk >= 2.4.4
- dnacentersdk == 2.4.5
- python >= 3.5
notes:
- SDK Method used are
application_policy.ApplicationPolicy.application_policy_intent
- Paths used are post /dna/intent/api/v1/app-policy-intent
application_policy.ApplicationPolicy.application_policy_intent,
- Paths used are
post /dna/intent/api/v1/app-policy-intent,
"""

EXAMPLES = r"""
Expand Down
46 changes: 41 additions & 5 deletions plugins/modules/app_policy_queuing_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
short_description: Resource module for App Policy Queuing Profile
description:
- Manage operations create, update and delete of the resource App Policy Queuing Profile.
- Update existing custom application queuing profile.
- Create new custom application queuing profile.
- Delete existing custom application policy queuing profile by id.
- Update existing custom application queuing profile.
version_added: '4.0.0'
extends_documentation_fragment:
- cisco.dnac.module
Expand Down Expand Up @@ -84,16 +84,19 @@
type: str
type: list
requirements:
- dnacentersdk >= 2.4.4
- dnacentersdk == 2.4.5
- python >= 3.5
notes:
- SDK Method used are
application_policy.ApplicationPolicy.create_application_policy_queuing_profile,
application_policy.ApplicationPolicy.delete_application_policy_queuing_profile,
application_policy.ApplicationPolicy.update_application_policy_queuing_profile,
application_policy.ApplicationPolicy.delete_application_policy_queuing_profile
- Paths used are put /dna/intent/api/v1/app-policy-queuing-profile,
- Paths used are
post /dna/intent/api/v1/app-policy-queuing-profile,
delete /dna/intent/api/v1/app-policy-queuing-profile/{id}
delete /dna/intent/api/v1/app-policy-queuing-profile/{id},
put /dna/intent/api/v1/app-policy-queuing-profile,
"""

EXAMPLES = r"""
Expand All @@ -107,6 +110,25 @@
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
state: present
payload:
- clause:
- instanceId: 1
interfaceSpeedBandwidthClauses:
- instanceId: 1
interfaceSpeed: string
tcBandwidthSettings:
- bandwidthPercentage: 1
instanceId: 1
trafficClass: string
isCommonBetweenAllInterfaceSpeeds: true
tcDscpSettings:
- dscp: string
instanceId: 1
trafficClass: string
type: string
description: string
id: string
name: string
- name: Create
cisco.dnac.app_policy_queuing_profile:
Expand All @@ -118,6 +140,20 @@
dnac_version: "{{dnac_version}}"
dnac_debug: "{{dnac_debug}}"
state: present
payload:
- clause:
- interfaceSpeedBandwidthClauses:
- interfaceSpeed: string
tcBandwidthSettings:
- bandwidthPercentage: 1
trafficClass: string
isCommonBetweenAllInterfaceSpeeds: true
tcDscpSettings:
- dscp: string
trafficClass: string
type: string
description: string
name: string
- name: Delete by id
cisco.dnac.app_policy_queuing_profile:
Expand Down
9 changes: 6 additions & 3 deletions plugins/modules/app_policy_queuing_profile_count_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
description: Additional headers.
type: dict
requirements:
- dnacentersdk >= 2.4.4
- dnacentersdk == 2.4.5
- python >= 3.5
notes:
- SDK Method used are
application_policy.ApplicationPolicy.get_application_policy_queuing_profile_count
- Paths used are get /dna/intent/api/v1/app-policy-queuing-profile-count
application_policy.ApplicationPolicy.get_application_policy_queuing_profile_count,
- Paths used are
get /dna/intent/api/v1/app-policy-queuing-profile-count,
"""

EXAMPLES = r"""
Expand Down
9 changes: 6 additions & 3 deletions plugins/modules/app_policy_queuing_profile_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
- Name query parameter. Queuing profile name.
type: str
requirements:
- dnacentersdk >= 2.4.4
- dnacentersdk == 2.4.5
- python >= 3.5
notes:
- SDK Method used are
application_policy.ApplicationPolicy.get_application_policy_queuing_profile
- Paths used are get /dna/intent/api/v1/app-policy-queuing-profile
application_policy.ApplicationPolicy.get_application_policy_queuing_profile,
- Paths used are
get /dna/intent/api/v1/app-policy-queuing-profile,
"""

EXAMPLES = r"""
Expand Down
Loading

0 comments on commit a473282

Please sign in to comment.