Skip to content

Commit

Permalink
Merge pull request #69 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop v2.5.4
  • Loading branch information
bvargasre authored Aug 12, 2022
2 parents e45ad9a + 96877a0 commit 495bffc
Show file tree
Hide file tree
Showing 4 changed files with 162 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.5.4] - 2022-08-11

### Added
- New function on `fabric_wireless` for v2_3_3_0.
+ `add_ssid_to_ip_pool_mapping`

## [2.5.3] - 2022-08-09

### Fixed
Expand Down Expand Up @@ -345,4 +351,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[2.5.1]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.5.0...v2.5.1
[2.5.2]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.5.1...v2.5.2
[2.5.3]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.5.2...v2.5.3
[Unreleased]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.5.3...master
[2.5.4]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.5.3...v2.5.4
[Unreleased]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.5.4...master
84 changes: 84 additions & 0 deletions dnacentersdk/api/v2_3_3_0/fabric_wireless.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,90 @@ def __init__(self, session, object_factory, request_validator):
self._object_factory = object_factory
self._request_validator = request_validator

def add_ssid_to_ip_pool_mapping(self,
scalableGroupName=None,
siteNameHierarchy=None,
ssidNames=None,
vlanName=None,
headers=None,
payload=None,
active_validation=True,
**request_parameters):
"""Add SSID to IP Pool Mapping. .
Args:
scalableGroupName(string): Fabric Wireless's Scalable Group Name .
siteNameHierarchy(string): Fabric Wireless's Site Name Hierarchy .
ssidNames(list): Fabric Wireless's List of SSIDs (list of strings).
vlanName(string): Fabric Wireless's VLAN Name .
headers(dict): Dictionary of HTTP Headers to send with the Request
.
payload(dict): A JSON serializable Python object to send in the
body of the Request.
active_validation(bool): Enable/Disable payload validation.
Defaults to True.
**request_parameters: Additional request parameters (provides
support for parameters that may be added in the future).
Returns:
list: JSON response. A list of MyDict objects.
Access the object's properties by using the dot notation
or the bracket notation.
Raises:
TypeError: If the parameter types are incorrect.
MalformedRequest: If the request body created is invalid.
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(payload, dict)
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
basestring, may_be_none=False)

_params = {
}
_params.update(request_parameters)
_params = dict_from_items_with_values(_params)

path_params = {
}
_payload = {
'vlanName':
vlanName,
'scalableGroupName':
scalableGroupName,
'ssidNames':
ssidNames,
'siteNameHierarchy':
siteNameHierarchy,
}
_payload.update(payload or {})
_payload = dict_from_items_with_values(_payload)
if active_validation:
self._request_validator('jsd_ad96e712f4525a128368b1bfe3afc21c_v2_3_3_0')\
.validate(_payload)

with_custom_headers = False
_headers = self._session.headers or {}
if headers:
_headers.update(dict_of_str(headers))
with_custom_headers = True

e_url = ('/dna/intent/api/v1/business/sda/hostonboarding/ssid-'
+ 'ippool')
endpoint_full_url = apply_path_params(e_url, path_params)
if with_custom_headers:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload,
headers=_headers)
else:
json_data = self._session.post(endpoint_full_url, params=_params,
json=_payload)

return self._object_factory('bpm_ad96e712f4525a128368b1bfe3afc21c_v2_3_3_0', json_data)

def update_ssid_to_ip_pool_mapping2(self,
scalableGroupName=None,
siteNameHierarchy=None,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# -*- coding: utf-8 -*-
"""Cisco DNA Center AddSSIDToIPPoolMapping data model.
Copyright (c) 2019-2021 Cisco Systems.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""

from __future__ import absolute_import, division, print_function, unicode_literals

import json
from builtins import *

import fastjsonschema

from dnacentersdk.exceptions import MalformedRequest


class JSONSchemaValidatorAd96E712F4525A128368B1Bfe3Afc21C(object):
"""AddSSIDToIPPoolMapping request schema definition."""
def __init__(self):
super(JSONSchemaValidatorAd96E712F4525A128368B1Bfe3Afc21C, self).__init__()
self._validator = fastjsonschema.compile(json.loads(
'''{
"$schema": "http://json-schema.org/draft-04/schema#",
"properties": {
"scalableGroupName": {
"type": "string"
},
"siteNameHierarchy": {
"type": "string"
},
"ssidNames": {
"items": {
"type": "string"
},
"type": "array"
},
"vlanName": {
"type": "string"
}
},
"type": "object"
}'''.replace("\n" + ' ' * 16, '')
))

def validate(self, request):
try:
self._validator(request)
except fastjsonschema.exceptions.JsonSchemaException as e:
raise MalformedRequest(
'{} is invalid. Reason: {}'.format(request, e.message)
)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dnacentersdk"
version = "2.5.3"
version = "2.5.4"
description = "Cisco DNA Center Platform SDK"
authors = ["Jose Bogarin Solano <[email protected]>", "William Astorga <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 495bffc

Please sign in to comment.