cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1227
Views
0
Helpful
3
Replies

SDWAN: Best way to construct vManage payload/body...This is for Feature Template

zulfikhar_a
Level 1
Level 1

I did download the postman sd-wan collection & tried to do few operations like:
- login to vManage (/j_security_check)
- Get all Feature Template (/dataservice/template/feature)
This is good but then there are no documents available to Construct the body for a Feature Template. So I tried browser inspector to check the API for the body...But this is crazy.
 
I need some info or doc where I can understand how to construct the body...
 
Thanks in Advance
Zulfi

3 Replies 3

Danny De Ridder
Cisco Employee
Cisco Employee

Hello,

we do have a defect opened for this to enhance the documentation.

https://bst.cloudapps.cisco.com/bugsearch/bug/CSCvr76568

Kind Regards,

Danny.

Thanks for your response. FYI: we are in the deployment phase as we have a Test & Prod setup where we use the Test Setup to try out & then use the same Template to deploy in the Prod setup. The Doc will help in quick deployment.

The API documentation is lacking in many aspects but there is enough info in it to get most of the things done. We've built custom scripts to automate template attachment and a quick overview would be something like this:

 

* get a list of templates from the template/device endpoint, we need the templateIds

* next we need to use the desired template ID to request from vmanage the input variables, this is done with a POST request to the template/device/config/input endpoint using the correct payload. Which is something like this: 

payload = {
"templateId": [list of template IDs], # can be only one, if needed
"deviceIds": [list of device IDs], # the device serial numbers or UUIDs
"isEdited": 'false',
"isMasterEdited": 'false'
}

The data part of that call is a list of dictionaries of key:value for each variable. You can use a that dictionary to build a payload which has the proper values for each variable. In our particular case we extract the site-specific information (such as IPs, hostnames and so on) from our provisioning system and use it to generate the dictionary (or list of dictionaries if you want to apply the template to multiple devices)

* use the template/device/config/attachfeature endpoint with the correct payload to initiate the task. The payload would look something like this:

payload = {
"deviceTemplateList": [
{
"templateId": [a list of template IDs], # or only one
"device": [a list of dictionaries for input variables], # generated by the previous step, can be a list with only one dictionary
"isEdited": 'false',
"isMasterEdited": 'false'
}
]
}

* the attach template API call will have in its result a task ID which you can use to poll the vmanage for the status of your task, at device/action/status. It's the same thing you see in the GUI if you monitor the task.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: