12-05-2024 06:29 AM
Can someone please help me identify the correct endpoint/logic to use?
Let's say I have a device template named 'My_Device' and it contains two fields 'Interface' and 'Bandwidth'. What endpoints would I use to query the vManage API for the values of variables when the template was attached to a device?
Currently, I'm doing a GET to the endpoint below but that endpoint takes about a minute to return the data. I'm looking for something faster so that when I iterate over the devices in inventory it doesn't take hours to complete.
https://<vmanage>/dataservice/template/device/config/attachedconfig?deviceId={{this_item.uuid}}
Solved! Go to Solution.
12-05-2024 12:58 PM
I unfortunately don't think there is any more elegant way to do this. I haven't been able to find any other endpoints that return this data.
12-05-2024 06:40 AM
Could you use the Bulk API for this? https://developer.cisco.com/docs/sdwan/bulk-api/
12-05-2024 07:39 AM
That bulk API appears to be more aimed at State and Statistics. I don't see a Data Type Parameter listed that would give me the configured bandwidth on an interface, the running config for manual parsing, or values used in the attached template.
12-05-2024 09:03 AM
I think i got it - You want to parse all devices which have your two items 'Interface' and 'Bandwidth' from a given template/configuration? Are you looking for any sort of information from these like types?
12-05-2024 10:21 AM
What I'm doing now:
1. Hit the device endpoint to get a list of devices
2. For each device pull the entire config (this is the slow part)
3. Extract the settings from the device's running config
What I was hoping was to be able to hit an API endpoint, specify the device ID (and template ID if necessary), and have access to values used in the templates.
12-06-2024 12:35 AM
@_Dustin_ as @Torbjørn noted and I checked the API docs, I don’t think there is a single way to do this in an API call and you would need to either batch your API calls or try parallel processing to speed up retrieval across the multiple devices.
12-05-2024 12:58 PM
I unfortunately don't think there is any more elegant way to do this. I haven't been able to find any other endpoints that return this data.
12-09-2024 06:14 AM
Thank you, @torbjorn , I feared that was the case. I was hoping for an endpoint that would return a key value pair of all the device template values, but I guess that was hoping for too much.
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