Closed ragadegithub closed 1 year ago
@ragadegithub in v2.6.3
parameters were included, try it again and let us know if it works for you.
Thank you @fmunozmiranda. I pulled the latest 2.6.3 code, I do see that the change exists in code as expected. Will post updates once i can run it on a DNAC 2.3.3.x.
Had a successful script execution with DNAC 2.3.3.x and dnacentersdk = 2.6.3 Below code works as expceted add_edgestatus = api.sda.add_edge_device( deviceManagementIpAddress=mgmt_ip, siteNameHierarchy=site_name )
Below code works as expected: device_payload = { "deviceManagementIpAddress": mgmt_ip, "siteNameHierarchy": site_name, } add_edgestatus = api.sda.add_edge_device(payload=device_payload)
Prerequisites
Describe the bug To add edge device to sda, the api implementation in 2.3.3.0 is missing input vars ( which is inconsistent with previous implementations). Must include input vars 'deviceManagementIpAddress' and 'siteNameHierarchy' in 2.2.3.3 method def ---> def add_edge_device(self, deviceManagementIpAddress=None, siteNameHierarchy=None, headers=None, payload=None, active_validation=True, **request_parameters):
in 2.3.3.0 method def --> def add_edge_device(self, headers=None, payload=None, active_validation=True, **request_parameters):
Also 'payload' type set to 'list'. must be 'dict' which matches with expected API 'body' documentation as well as 2.2.3.3 implemenation of the same method Expected behavior
Screenshots [Please provide an screenshot of the successful API call with cuRL, Postman, etc.] links to both implementations from the docs. https://dnacentersdk.readthedocs.io/en/latest/_modules/dnacentersdk/api/v2_3_3_0/sda.html#Sda.add_edge_device https://dnacentersdk.readthedocs.io/en/latest/_modules/dnacentersdk/api/v2_2_3_3/sda.html#Sda.add_edge_device
Environment (please complete the following information):
Additional context Add any other context about the problem here.
Code where the bug is identified:
**above device_payload causes an error. Debug shown below edge_status = None
**dnacentersdk output: 2023-04-22 15:06:10,999::main::-dnac_edge_disvoery::-: add_edge_device - ERROR :: - We were expecting to receive an instance of one of the following types: 'list'or 'None'; but instead we received {'deviceManagementIpAddress': '172.20.1.162', 'siteNameHierarchy': 'Global/United States/JFK'} which is a 'dict'. 2023-04-22 15:06:10,999::main::-dnac_edge_disvoery::-: add_edge_device - ERROR :: - Edge device not added to fabric : {'deviceManagementIpAddress': '172.20.1.162', 'siteNameHierarchy': 'Global/United States/JFK'}