06-03-2023 02:40 PM - edited 06-03-2023 02:41 PM
Hello Community,
I am not sure if I am overlooking something but struggling to easily return where a switch was added to via the API. For context, I have added 1800 switches into DNAC. I would like to verify they have been added to the correct hierarchy but not sure how to best go about this.
Solved! Go to Solution.
06-05-2023 01:08 AM
This was a known issue with the /network-device API in the existing DNAC releases. You can use "Get Device Detail", it should provide the location.
06-05-2023 01:08 AM
This was a known issue with the /network-device API in the existing DNAC releases. You can use "Get Device Detail", it should provide the location.
06-05-2023 01:40 PM - edited 06-05-2023 01:41 PM
Thanks bigevilbeard! Much appreciated. I noticed that get_device_detail provides a weird output for switches that are not being managed correctly even though assigned to the correct area/building. Not the end of the world but wondering if you've seen this before. Here's a switch that was added to DNAC but not managed due to credentials not matching the global setting.
When I query the API for this switch, it does not provide the location but the following response:
{'response': {'location': '--', 'timestamp': 1685995080000}}
I am guessing the solution is to fix the switch so it is managed properly but thought I would mention it anyways. I suspect the only option for these would be to proceed with what I mentioned previously. Use api_.sites.get_membership(site_id) then loop through the results to check if the IP exists.
Thanks again for taking to the time to response.
-E
06-05-2023 11:59 PM
Last time i saw this issues all which was returned was 'null', but this was ages back since i last looked at this tbh. Just this problem you first saw stuck in my mind, as stuff does!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide