07-11-2025 07:54 AM
I'm trying to see if there is an API endpoint where I can pull the list of sites from the Network Hierarchy section and potentially the devices under each site. As an alternate method of the data I am trying to pull together, I'm also trying to see where System Location can be pulled from. I can't seem to find either in the apidocs.
Solved! Go to Solution.
07-11-2025 09:08 AM
Ha! yes, i have been there many time. I wondered if i was talking rubbish, so with some hacking. Try this script, the output is in the readme to show you, unsure if this was what you are after in the first request. https://github.com/bigevilbeard/sdwan_device_location/
07-11-2025 08:18 AM
Your investigation is good, there isnt a single API endpoint which would provides a complete site list in the Network Hierarchy section Instead, you would need to use a combo of multiple API calls to reconstruct a site hierarchy and the device relationships.
I would start with /device which will give you the hierarchyNamePath, from this call you will need to parse the paths to get the data per site, to build the structure. Then after this you would need to try the site level bfd APIs like /device/bfd/sites/summary and /details. After this for location try /device/system/info, but this would be per device, to get location i think.
Sounds a lot, but i think the design here (and happy to be 100% wrong, it a Friday after all), is that SDWAN API is "device centric" rather than "site centric", this is why site information is embedded 'within' your device data rather than being a 'first class' resource. In a nutshell, network hiearchy is thus treated as a metadata, rather than a primary org structure.
Hope this helps.
07-11-2025 08:30 AM
Thanks for this. I'll have to poke around some of these to see if I can build that. I had a feel a feeling it was going to take piecing things together. Will have to be next week... I'm exhausted from poking around the apidocs hehe.
07-11-2025 09:08 AM
Ha! yes, i have been there many time. I wondered if i was talking rubbish, so with some hacking. Try this script, the output is in the readme to show you, unsure if this was what you are after in the first request. https://github.com/bigevilbeard/sdwan_device_location/
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