09-08-2023 01:16 AM
Hi
Is there a doc for the DNAC template system variables? I'm looking for the schemas for these variables:
Thanks
Marcel
09-08-2023 02:35 AM
Hey buddy like these?
${hostname} - Populates with the host name of the device
${site} - Populates with the site of the device
09-08-2023 04:02 AM - edited 09-08-2023 04:03 AM
Hey Stu, yeah plus what I'm most intrested in is the format of the corresponding return values, for example for interface.portName is the output "Gig1/0/1", "G1/0/1" or "GigabitEthernet1/0/1"... ...again, interface.portName is just an example, I'm looking for a doc containing this information for all available system vars. I was not able to find such a doc.
Sure, I can check it on the fly in the template editor for a certain var, but that's a little bit time consuming..
09-08-2023 06:26 AM
@Marcel Zehnder ive not seen one on my travel buddy, but this does not mean there isnt one. I am wondering if you can extract a list of the system variables referenced in the OpenAPI specs by parsing through the JSON file?
from dnacentersdk import DNACenterAPI
dnac = DNACenterAPI(
username="devnetuser",
password="Cisco123!",
base_url="https://sandboxdnac2.cisco.com:443",
version="2.3.5.3",
verify=True)
dnac.authentication.login()
template_api = dnac.system.api.template_programmability
variables = template_api.systems.template_system_variable.get_template_system_variable()
for var in variables['response']:
print(var['name'])
05-15-2024 06:54 AM
Hey @Marcel Zehnder,
Did you find a way or a document? I didn't find a correct way to specify the interface "index".
#if ( __interface[GigabitEthernet0/0].description == "Blabla")
Execute Stuff
#else
Execute else stuff
#end
05-19-2024 06:19 AM
Hi @leonardo_neves nope, I went with try/error...
09-08-2023 08:37 AM
Thanks Stu, I will dig into it.
09-08-2023 08:41 AM
I think i made a boo boo, as the DNAC open.api.json i cannot find...
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