05-21-2024 12:45 PM
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.
05-24-2024 12:11 AM - edited 05-24-2024 12:13 AM
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
05-24-2024 09:05 AM - edited 05-24-2024 09:06 AM
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.
05-29-2024 12:33 AM
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.
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