This blog series covers some of the new API released as part of the APIC-EM 1.3 release of code.
This particular blog covers a new feature in the Plug and Play (PnP) application, configuration templates. Prior to version 1.3, the configuration file was a text file and did not support variables. If you wanted to use a template you needed to use Prime Infrastructure. In APIC-EM 1.3, template support has been added.
This blog looks at both the UI and API required for templates.
For all of these examples I am using a 3650 switch running 3.6.5 code, but you could use versions of 16.3.1 and 3.7.4 (For other platforms such 2960x please see release notes for details).
A template is identical to a standard configuration file, except it has variables embedded in it. Templates use the "velocity" template language, the same as Prime Infrastructure. Variables start with the "$" character. For example there is a "hostname" variable in this example.
enable password xxx
username sdn password 0 xxx
ip http server
ip http secure-server
snmp-server community xxxx RO
line con 0
line vty 0 15
transport input ssh telnet
When you view the template in APIC-EM, there are three views:
Text view: the file above. Variables have a "$" at the start
Form View: just shows the variables.
Preview: Shows the complete configuration with variables filled in.
Templates can be uploaded the same as any other configuration file, through the user interface or the API.
Using the Template – User Interface
Templates are used in PnP rules in exactly the same way as normal configuration files. One extra step is to fill in the variables. In this example I am going to use a pre-defined rule, but templates work with unclaimed devices as well.
NOTE: You do not need a specific suffix on a template file. The controller searches the configuration file for variables, and if they are present, the file is treated as a template.
I then need to select the "Form View" to fill in the variables. This example has only one variable "hostname"
I then need to select "Device Configuration" and scroll down to the bottom of the page to "Add" the Device.
NOTE: I have also configured some stack parameters. These are only required as I am also using a stack of switches.
Now the rule has been added successfully.
Once the switch has been provisioned you will notice the configuration file has changed. This will be the rendered template with all of the variables filled in.
Using the Template – User Interface
In this section I will cover the API that are required to use the template API. I am going to assume you have seen my earlier blogs for a detailed description of using the PnP API.
Here is a summary of the API calls above. NOTE the section in RED is the only difference compared to a standard configuration file.
This blog covered configuration templates for PnP, native in APIC-EM. My next blog will cover some of the new EasyQoS API.
In the meantime, if you would like to learn more about this, you could come hang out with us in The Cisco Devnet DNA Community. We’ll have a continuous stream of blogs like this and you can ask questions and we’ll get you answers. In addition, we have a Github repository where you can get examples related to PnP.
Has anyone been able to get a webhook for an event to successfully post to Microsoft Teams? I have a channel and teams then I am the group owner for. I have installed the team's webhook app on the channel. I have been able to post data to that Channel via...
I have been trying to use the model Cisco-IOS-XE-ospf but i was not able to complete the request, I got the error uri keypath not found" I'm going to add two exaple of url , the Cisco-IOS-XE-ospf-ope models work without any issue but the&nb...
Hi, DNA-C Sandbox issues. Cisco DNA Center AO 184.108.40.206 ; Credentials are not workingCisco DNA Center AO 220.127.116.11 ; A lot of resync errors and whatnotCisco DNA Center Lab 2 ; Cannot reserve resource until March... Could you add more resources? ...
This article shows you how I installed YANG Suite Docker on Windows 10. I had a few challenges and incorporated their fixes into my procedure.
Prereqs for my procedure
Windows Subsystem for Linux (WSL2)
Docker Desktop for Window...
Hi,I have a Cisco 4351 and would like to try running docker on it.It currently has 4GB of RAM and 3GB of Flash.From what I read here (service containers tutorial) we need at least 8GB of RAM and for the flash it says: "Flash must be greater than DRAM". Do...