cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
94
Views
2
Helpful
3
Replies

vManage API endpoint to pull Site Name from Network Hierarchy

m.yost
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

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/

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

View solution in original post

3 Replies 3

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.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

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.  

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/

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io