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

SD-Wan set device tag with configuration groups

racarvalho
Level 1
Level 1

Hi All,

I trying to use the API via python to associate and deploy cat8300, for a customer.

Right now i can already deploy device with a configuration group using the variable excel export from the gui.

My issue now is that some configuration groups are "dual router" and for that i need the devices with a tag "EdgeDevice_01" or "EdgeDevice_02". i cannot associate a device to a dual router confgroup without a tag the association fails:

{"devices": [{"id": "C8K-PAYG-####-###-###"}]}
{"error":{"message":"Failed to add device to config group","code":"CFGRP0009","details":"Failed to add device to config groupPlease add one of the tags: [EdgeDevice_01, EdgeDevice_02] to each device before associating them to the configuration group: CG-HUB-CPD-TAGUS. Failed devices: [C8K-PAYG-####-###-###]","type":"error"}}

Anyone knows how can i add a tag to a device?

Cheers

Ricardo

 

 

 

7 Replies 7

Enes Simnica
Level 5
Level 5

@racarvalho u'll need to use the API call to update the device and add EdgeDevice_01 or EdgeDevice_02. Once the tag is applied, then and only then, u can associate it to the dual-router config group without errors.

New Cisco SD-WAN API Documentation

hope it helps

 

-Enes
CCNP x2 Enterprise
Your Friendly Networking Ninja

more Cisco?!
more Gym?!



If this post solved your problem, kindly mark it as Accepted Solution. Much appreciated!

Hi Enes,

Yes, but whats the api call to add a tag to a device?

It used to be POST /dataservice/system/device/tag with a payload that includes deviceId and the tag name, however i think this endpoint was removed, i do not see this in  Release 20.16

{
"create": [
{
"name": "TAG_NAME",
"tagId": "",
"tagType": "device"
}
]
}

Which version of SD-WAN are you using and what endpoint produced that error?

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

I had seen that in another post, but in my version 20.15.3, it does not exist.

Also that call creates a tag it does not add it to a device.

The tag are created by the configuration group, i only need to know how to attach it to a device.

 

So wonder if POST /template/device/config/attachfeature which when looking at the API YAML the attach feature device template (which includes tags) might work.

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

I don't think that will work, for that i would need a template id, and not a configuration group.

In which case i think the option is to gather the edge devices, and assign a tag based on uuid with /dataservice/system/device/{DEVICE_UUID} and the set the payload = {"tags": new_tags}, i tried a script for this on the devnet sandbox, but it is read only, however based on the 403 reply, it was ok to work, but i dont have auth to confirm this.

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