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

DNA Center Python SDK create_template tag field issues

AdamJZinser
Level 1
Level 1

Attempting to script up some DNA Center interactions to include creating a tag and creating a template. When I attempt to assign the tag to the template via configuration_templates.create_template(id='abc',tags=[{'id': 'efg', 'name': 'xyz'}] I receive no errors but the tag doesn't apply to the template 'tags': []. Have tried with id only, with name only, with both, and via update_template. All end in same result.

3 Replies 3

mfr-6
Spotlight
Spotlight

hi @AdamJZinser 

Have you tried to do the same but creating a request directly REST API instead, to confirm this is not the issue with a data you send?
What SDK version do you use? Could you provide use more code along with outputs?

REST API docs: https://developer.cisco.com/docs/search/?products=Cisco%20Catalyst%20Center

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!

I have not tried with REST API. My hope is to get it working with Python SDK to avoid having to bring additional elements into my code.
Cisco DNA Center Version 2.3.3.7-72328
dnacentersdk 2.6.11


dnac.tag.get_tag(name='aztest')

### following this command I receive task response confirming tag is created. Check DNAC GUI and see tag has been created successfully.

dnac.configuration_templates.create_template('###-###-###-###-###', name='aztest_DayN',description='',tags=[{'id': '###-###-###-###-###', 'name': 'aztest'}],deviceTypes=[{'productFamily': 'Switches and Hubs'}],softwareType='IOS',softwareVariant='XE',softwareVersion='17.09.04a',templateContent='this\n!\nis\n!\nexample')

### following this command I receive task response confirming template is created. Check DNAC GUI and see template has been created successfully - however - the template is not tagged.

Agree, I just wanted to see if the issue is present also when invoking the request to the REST API directly, because it doesn't make sense to pay more attention to SDK if it doesn't work when making a direct request to REST API, since SDK is just a simpler interface to it.

Unfortunately, I can't test it on my own since I don't have Catalyst Center in my env, and the limit of running envs set on devnet sandbox is reached.

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!