08-27-2025 04:06 AM - edited 08-27-2025 04:07 AM
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
08-27-2025 04:46 AM
@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
08-27-2025 05:44 AM
Hi Enes,
Yes, but whats the api call to add a tag to a device?
08-27-2025 06:17 AM
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?
08-27-2025 06:36 AM
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.
08-27-2025 07:11 AM
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.
08-27-2025 07:29 AM
I don't think that will work, for that i would need a template id, and not a configuration group.
08-27-2025 08:18 AM
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.
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