Skip to content

Commit

Permalink
Merge pull request #167 from cisco-en-programmability/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
bvargasre authored Aug 19, 2024
2 parents a4be1b2 + 8bd3927 commit 5f7051b
Show file tree
Hide file tree
Showing 88 changed files with 881 additions and 853 deletions.
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [2.7.3] - 2024-08-19
- Refactor error message construction in ApiError class
- Injection for requests.Session
### Fixed
- Fixed a problem when exporting the environment variable verify
- Update offset and limit parameter type to support int and str value
- `accept_cisco_ise_server_certificate_for_cisco_ise_server_integration` accept empty payload {} to retry
- Update memberToTags from list to object in `updates_tag_membership`
- Update offset and limit parameter type to support int and str value

## [2.7.2] - 2024-08-09
- Update User-Agent header in RestSession
- Update requirements:
Expand Down Expand Up @@ -515,4 +525,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[2.7.0]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.6.11...v2.7.0
[2.7.1]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.0...v2.7.1
[2.7.2]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.1...v2.7.2
[Unreleased]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.2...develop
[2.7.3]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.2...v2.7.3
[Unreleased]: https://github.com/cisco-en-programmability/dnacentersdk/compare/v2.7.3...develop
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ The following table shows the supported versions.
* - 2.3.5.3
- 2.6.11
* - 2.3.7.6
- 2.7.2
- 2.7.3



Expand Down
8 changes: 7 additions & 1 deletion dnacentersdk/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ def __init__(self, username=None,
base_url=None,
single_request_timeout=None,
wait_on_rate_limit=None,
session=None,
verify=None,
version=None,
debug=None,
Expand Down Expand Up @@ -479,6 +480,8 @@ def __init__(self, username=None,
(or DNA_CENTER_VERIFY_STRING) environment variable or
dnacentersdk.config.DEFAULT_VERIFY if the environment
variables are not set.
session(requests.Session): Optionally inject a `requests.Session`
instance to use for HTTP operations.
version(str): Controls which version of DNA_CENTER to use.
Defaults to the DNA_CENTER_VERSION environment variable or
dnacentersdk.config.DEFAULT_VERSION
Expand Down Expand Up @@ -518,7 +521,9 @@ def __init__(self, username=None,
wait_on_rate_limit = dnacenter_environment.get_env_wait_on_rate_limit() or DEFAULT_WAIT_ON_RATE_LIMIT

if verify is None:
verify = dnacenter_environment.get_env_verify() or DEFAULT_VERIFY
verify = dnacenter_environment.get_env_verify()
if verify is None:
verify = DEFAULT_VERIFY

version = version or dnacenter_environment.get_env_version() or DEFAULT_VERSION

Expand Down Expand Up @@ -584,6 +589,7 @@ def get_access_token():
base_url=base_url,
single_request_timeout=single_request_timeout,
wait_on_rate_limit=wait_on_rate_limit,
session=session,
verify=verify,
version=version,
debug=debug,
Expand Down
16 changes: 8 additions & 8 deletions dnacentersdk/api/v2_2_2_3/application_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def get_application_sets(self,
"""Get appllication-sets by offset/limit or by name .
Args:
offset(int): offset query parameter.
limit(int): limit query parameter.
offset(int,str): offset query parameter.
limit(int,str): limit query parameter.
name(str): name query parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
Expand All @@ -91,8 +91,8 @@ def get_application_sets(self,
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(offset, int)
check_type(limit, int)
check_type(offset, (int, str))
check_type(limit, (int, str))
check_type(name, str)
if headers is not None:
if 'X-Auth-Token' in headers:
Expand Down Expand Up @@ -490,8 +490,8 @@ def get_applications(self,
"""Get applications by offset/limit or by name .
Args:
offset(int): offset query parameter. The offset of the first application to be returned .
limit(int): limit query parameter. The maximum number of applications to be returned .
offset(int,str): offset query parameter. The offset of the first application to be returned .
limit(int,str): limit query parameter. The maximum number of applications to be returned .
name(str): name query parameter. Application's name .
headers(dict): Dictionary of HTTP Headers to send with the Request
.
Expand All @@ -509,8 +509,8 @@ def get_applications(self,
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(offset, int)
check_type(limit, int)
check_type(offset, (int, str))
check_type(limit, (int, str))
check_type(name, str)
if headers is not None:
if 'X-Auth-Token' in headers:
Expand Down
8 changes: 4 additions & 4 deletions dnacentersdk/api/v2_2_2_3/applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ def applications(self,
end_time(int): endTime query parameter. Ending epoch time in milliseconds of time window .
application_health(str): applicationHealth query parameter. Application health category (POOR,
FAIR, or GOOD. Optionally use with siteId only) .
offset(int): offset query parameter. The offset of the first application in the returned data
offset(int,str): offset query parameter. The offset of the first application in the returned data
(optionally used with siteId only) .
limit(int): limit query parameter. The max number of application entries in returned data [1, 1000]
limit(int,str): limit query parameter. The max number of application entries in returned data [1, 1000]
(optionally used with siteId only) .
headers(dict): Dictionary of HTTP Headers to send with the Request
.
Expand All @@ -113,8 +113,8 @@ def applications(self,
check_type(start_time, int)
check_type(end_time, int)
check_type(application_health, str)
check_type(offset, int)
check_type(limit, int)
check_type(offset, (int, str))
check_type(limit, (int, str))
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
Expand Down
20 changes: 10 additions & 10 deletions dnacentersdk/api/v2_2_2_3/compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def get_compliance_status_(self,
compliance_status(str): complianceStatus query parameter. Compliance status can be have value
among 'COMPLIANT','NON_COMPLIANT','IN_PROGRESS', 'ERROR' .
device_uuid(str): deviceUuid query parameter. Comma separated deviceUuids .
offset(int): offset query parameter. offset/starting row .
limit(int): limit query parameter. Number of records to be retrieved .
offset(int,str): offset query parameter. offset/starting row .
limit(int,str): limit query parameter. Number of records to be retrieved .
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
Expand Down Expand Up @@ -113,8 +113,8 @@ def get_compliance_status(self,
compliance_status(str): complianceStatus query parameter. Compliance status can be have value
among 'COMPLIANT','NON_COMPLIANT','IN_PROGRESS', 'ERROR' .
device_uuid(str): deviceUuid query parameter. Comma separated deviceUuids .
offset(int): offset query parameter. offset/starting row .
limit(int): limit query parameter. Number of records to be retrieved .
offset(int,str): offset query parameter. offset/starting row .
limit(int,str): limit query parameter. Number of records to be retrieved .
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
Expand All @@ -132,8 +132,8 @@ def get_compliance_status(self,
check_type(headers, dict)
check_type(compliance_status, str)
check_type(device_uuid, str)
check_type(offset, int)
check_type(limit, int)
check_type(offset, (int, str))
check_type(limit, (int, str))
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
Expand Down Expand Up @@ -327,8 +327,8 @@ def get_compliance_detail(self,
'COMPLIANT', 'NON_COMPLIANT', 'IN_PROGRESS', 'NOT_AVAILABLE', 'NOT_APPLICABLE', 'ERROR'
.
device_uuid(str): deviceUuid query parameter. Comma separated deviceUuids .
offset(str): offset query parameter. offset/starting row .
limit(str): limit query parameter. Number of records to be retrieved .
offset(str,int): offset query parameter. offset/starting row .
limit(str,int): limit query parameter. Number of records to be retrieved .
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
Expand All @@ -347,8 +347,8 @@ def get_compliance_detail(self,
check_type(compliance_type, str)
check_type(compliance_status, str)
check_type(device_uuid, str)
check_type(offset, str)
check_type(limit, str)
check_type(offset, (int, str))
check_type(limit, (int, str))
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
Expand Down
16 changes: 8 additions & 8 deletions dnacentersdk/api/v2_2_2_3/device_onboarding_pnp.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ def get_device_list(self,
devices. Pagination and sorting are also supported by this endpoint .
Args:
limit(int): limit query parameter. Limits number of results .
offset(int): offset query parameter. Index of first result .
limit(int,str): limit query parameter. Limits number of results .
offset(int,str): offset query parameter. Index of first result .
sort(str, list, set, tuple): sort query parameter. Comma seperated list of fields to sort on .
sort_order(str): sortOrder query parameter. Sort Order Ascending (asc) or Descending (des) .
serial_number(str, list, set, tuple): serialNumber query parameter. Device Serial Number .
Expand Down Expand Up @@ -234,8 +234,8 @@ def get_device_list(self,
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(limit, int)
check_type(offset, int)
check_type(limit, (int, str))
check_type(offset, (int, str))
check_type(sort, (str, list, set, tuple))
check_type(sort_order, str)
check_type(serial_number, (str, list, set, tuple))
Expand Down Expand Up @@ -1989,8 +1989,8 @@ def get_workflows(self,
50 workflows. Pagination and sorting are also supported by this endpoint .
Args:
limit(int): limit query parameter. Limits number of results .
offset(int): offset query parameter. Index of first result .
limit(int,str): limit query parameter. Limits number of results .
offset(int,str): offset query parameter. Index of first result .
sort(str, list, set, tuple): sort query parameter. Comma seperated lost of fields to sort on .
sort_order(str): sortOrder query parameter. Sort Order Ascending (asc) or Descending (des) .
type(str, list, set, tuple): type query parameter. Workflow Type .
Expand All @@ -2011,8 +2011,8 @@ def get_workflows(self,
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(limit, int)
check_type(offset, int)
check_type(limit, (int, str))
check_type(offset, (int, str))
check_type(sort, (str, list, set, tuple))
check_type(sort_order, str)
check_type(type, (str, list, set, tuple))
Expand Down
8 changes: 4 additions & 4 deletions dnacentersdk/api/v2_2_2_3/device_replacement.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def return_replacement_devices_with_details(self,
sort_by(str): sortBy query parameter. SortBy this field. SortBy is mandatory when order is used.
.
sort_order(str): sortOrder query parameter. Order on displayName[ASC,DESC] .
offset(int): offset query parameter.
limit(int): limit query parameter.
offset(int,str): offset query parameter.
limit(int,str): limit query parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
Expand All @@ -125,8 +125,8 @@ def return_replacement_devices_with_details(self,
check_type(family, (str, list, set, tuple))
check_type(sort_by, str)
check_type(sort_order, str)
check_type(offset, int)
check_type(limit, int)
check_type(offset, (int, str))
check_type(limit, (int, str))
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
Expand Down
48 changes: 24 additions & 24 deletions dnacentersdk/api/v2_2_2_3/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ def devices(self,
health(str): health query parameter. The device overall health (One of POOR, FAIR, GOOD) .
start_time(int): startTime query parameter. UTC epoch time in milliseconds .
end_time(int): endTime query parameter. UTC epoch time in miliseconds .
limit(int): limit query parameter. Max number of device entries in the response (default to 50. Max at
limit(int,str): limit query parameter. Max number of device entries in the response (default to 50. Max at
1000) .
offset(int): offset query parameter. The offset of the first device in the returned data .
offset(int,str): offset query parameter. The offset of the first device in the returned data .
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
Expand All @@ -239,8 +239,8 @@ def devices(self,
check_type(health, str)
check_type(start_time, int)
check_type(end_time, int)
check_type(limit, int)
check_type(offset, int)
check_type(limit, (int, str))
check_type(offset, (int, str))
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
Expand Down Expand Up @@ -292,8 +292,8 @@ def get_all_interfaces(self,
"""Returns all available interfaces. This endpoint can return a maximum of 500 interfaces .
Args:
offset(int): offset query parameter.
limit(int): limit query parameter.
offset(int,str): offset query parameter.
limit(int,str): limit query parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
Expand All @@ -309,8 +309,8 @@ def get_all_interfaces(self,
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(offset, int)
check_type(limit, int)
check_type(offset, (int, str))
check_type(limit, (int, str))
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
Expand Down Expand Up @@ -1461,8 +1461,8 @@ def retrieves_all_network_devices(self,
role(str): role query parameter.
role_source(str): roleSource query parameter.
associated_wlc_ip(str): associatedWlcIp query parameter.
offset(str): offset query parameter.
limit(str): limit query parameter.
offset(str,int): offset query parameter.
limit(str,int): limit query parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
.
**request_parameters: Additional request parameters (provides
Expand Down Expand Up @@ -1498,8 +1498,8 @@ def retrieves_all_network_devices(self,
check_type(role, str)
check_type(role_source, str)
check_type(associated_wlc_ip, str)
check_type(offset, str)
check_type(limit, str)
check_type(offset, (int, str))
check_type(limit, (int, str))
if headers is not None:
if 'X-Auth-Token' in headers:
check_type(headers.get('X-Auth-Token'),
Expand Down Expand Up @@ -2078,8 +2078,8 @@ def inventory_insight_device_link_mismatch(self,
Args:
site_id(str): siteId path parameter.
offset(str): offset query parameter. Row Number. Default value is 1 .
limit(str): limit query parameter. Default value is 500 .
offset(str,int): offset query parameter. Row Number. Default value is 1 .
limit(str,int): limit query parameter. Default value is 500 .
category(str): category query parameter. Links mismatch category. Value can be speed-duplex or
vlan. .
sort_by(str): sortBy query parameter. Sort By .
Expand All @@ -2099,8 +2099,8 @@ def inventory_insight_device_link_mismatch(self,
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(offset, str)
check_type(limit, str)
check_type(offset, (int, str))
check_type(limit, (int, str))
check_type(category, str,
may_be_none=False)
check_type(sort_by, str)
Expand Down Expand Up @@ -2161,8 +2161,8 @@ def get_devices_with_snmpv3_des(self,
Args:
site_id(str): siteId path parameter.
offset(str): offset query parameter. Row Number. Default value is 1 .
limit(str): limit query parameter. Default value is 500 .
offset(str,int): offset query parameter. Row Number. Default value is 1 .
limit(str,int): limit query parameter. Default value is 500 .
sort_by(str): sortBy query parameter. Sort By .
order(str): order query parameter.
headers(dict): Dictionary of HTTP Headers to send with the Request
Expand All @@ -2180,8 +2180,8 @@ def get_devices_with_snmpv3_des(self,
ApiError: If the DNA Center cloud returns an error.
"""
check_type(headers, dict)
check_type(offset, str)
check_type(limit, str)
check_type(offset, (int, str))
check_type(limit, (int, str))
check_type(sort_by, str)
check_type(order, str)
check_type(site_id, str,
Expand Down Expand Up @@ -2294,8 +2294,8 @@ def get_modules(self,
Args:
device_id(str): deviceId query parameter.
limit(str): limit query parameter.
offset(str): offset query parameter.
limit(str,int): limit query parameter.
offset(str,int): offset query parameter.
name_list(str, list, set, tuple): nameList query parameter.
vendor_equipment_type_list(str, list, set, tuple): vendorEquipmentTypeList query parameter.
part_number_list(str, list, set, tuple): partNumberList query parameter.
Expand All @@ -2317,8 +2317,8 @@ def get_modules(self,
check_type(headers, dict)
check_type(device_id, str,
may_be_none=False)
check_type(limit, str)
check_type(offset, str)
check_type(limit, (int, str))
check_type(offset, (int, str))
check_type(name_list, (str, list, set, tuple))
check_type(vendor_equipment_type_list, (str, list, set, tuple))
check_type(part_number_list, (str, list, set, tuple))
Expand Down
Loading

0 comments on commit 5f7051b

Please sign in to comment.