cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
245
Views
0
Helpful
7
Replies

vManage API - Get Template Values

_Dustin_
Level 1
Level 1

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}}

 

 

 

 

 

1 Accepted Solution

Accepted Solutions

Torbjørn
Spotlight
Spotlight

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.

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev

View solution in original post

7 Replies 7

Could you use the Bulk API for this? https://developer.cisco.com/docs/sdwan/bulk-api/

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

_Dustin_
Level 1
Level 1

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.

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?

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

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.

@_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.

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

Torbjørn
Spotlight
Spotlight

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.

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev

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.