Cisco Customer Success - Video

Scaling Automation with Cisco Catalyst Center Templates (Part 2)

Playback confirmation!

Do you want to resume playing from last left location?

Chapter 1 Thumbnail
00:01
Welcome, disclaimers, and introductions
Chapter 2 Thumbnail
03:16
Housekeeping: Q&A/Slido, feedback, agenda, and resources
Chapter 3 Thumbnail
10:12
Basic templates: CLI and variables (Velocity) with demos
Chapter 4 Thumbnail
15:09
Conditional logic: if/else, model-specific vs. global configs, and yes/no triggers
Chapter 5 Thumbnail
22:17
Loops: for-each for repetitive configs across interfaces, stacks, and chassis
Chapter 6 Thumbnail
30:13
Day-N templates: bind-to-source and system variables with practical examples
Chapter 7 Thumbnail
41:08
System-variable logic: access/trunk handling, description-based rules, model auto-detect
Chapter 8 Thumbnail
47:30
EEM scripts: overview and CDP-driven interface description demo
Chapter 9 Thumbnail
54:16
GitHub resources and advanced EEM use cases (self-delete, routed ports)
Chapter 10 Thumbnail
01:00:05
API-driven template deployment: tools, authentication, workflow, demos, and closing

Transcript

Oh alright, we are going to go ahead and get started.00:01Make sure all my panels are up and running. Okay, it looks like we have 41 participants. I'll go ahead and start some of the intro as the as attendees start to trickle in. Okay so before we.00:18Again, today's sessions wanted to provide our standard disclaimer with regards to the contents of what will be presented here today.00:38So while the topics discussed in this session are considered Cisco best practices, attendees in conjunction with their internal management and networking teams are responsible for implementing any suggestions in accordance with their network design and infrastructure organizational and management needs.00:49And also, responsible for complying with regulatory and privacy requirements that you maybe subject to.01:09That being said, welcome to today's session scaling automation with Cisco Catalyst Center templates, part two. My name is Sharwin, also known as mr. Templates and I am joined today by my colleague.01:22Sitting in the dark. Can can anyone not see my videos? Your background, it's your background let me bear with me. Okay, the background is a little.01:39Let me pick lighter ok so is that better? You can definitely see you now. Okay perfect, just making sure. All righty. So that being said, so my name is Sherwin also known as mr. Templates, and I'm joined by.01:57My colleaguette, also known as Golf, and we will be your presenters for today.02:16So like the topic suggests, this is 2nd part of the two part expert insight series focused on the templating use case within catalyst center. This session will serve as a continuation of last week's session. For those of you who attended last week and came this week, definitely thank you for.02:24You know, thank you for coming. Thank you for keeping up definitely appreciate your presence alrighty? So of course like I said, today's 2nd session in templating and it's actually the 3rd in the overall kind of center amplify.02:43By webinar series. So next week's session, which I believe Golf is actually presenting, will round out to the amplify series with catalyst center integrations.03:04Okay, if you do have questions, feel free to address them to a panel of experts that are standing by. You should have a Q and A panel available in your, in your Webex chat. George I see your question. I don't know quite when the recordings will be available, but they someone should be able to post a link.03:16To that page, and we'll definitely coordinate with our team to confirm that, hey, you know, can we expedite those recordings?03:36For those that didn't miss the session. That being said though, if you do have a Q and A, you should have a Q and A panel available. If it doesn't automatically pop up when you're in the webinar here, there should be a button in the bottom right hand corner of your window that says apps and you can locate the Slido app from within that Q and A tab.03:46Okay, if you do have questions, we do ask that you do use the Q and A tab for questions just because that's where our panel of experts will be, will be looking for the questions is within Slido. So if possible, if, you know.04:05So limit commenting in the chat section if you can, definitely, you know, if you're unable to, to, to get in through Slido, let us know there. But for any questions related to the content, definitely we ask that you use Slido.04:24Okay, so before I actually get started, I definitely wanted to usually the slides at the end, but I wanted to put this at the beginning before people start leaving. Our feedback is very, very important to us as presenters, changes to some of this content has actually made.04:41Based on feedback we've, we've received, right? So either once the event ends or if you leave the event, you will get a survey launch. We we ask, we beg, we plead, definitely take, take a minute or two to complete that survey. Was the session too long? Was the session too short? Was more attention?05:01Needed on a particular topic was less attention needed on a topic. Is there a topic that needs to be its own session? Do you have an idea for a session that you think would be helpful?05:21Definitely, definitely go ahead and put that in the feedback. I myself and as well as golf, welcome constructive feedback constructive criticism. I promise I will not take it personal. If I don't see feedback I think some hey, I'm doing a fantastic job.05:32And I don't need to change anything.05:50You know, and as good as I think i am, I know that's not true, so definitely leave feedback for, you know, with regards to the content so that we can go ahead and follow up, right? I wanted to go ahead and before I actually get into the content to do a quick show.05:52Real quick sir, you will need to open up the slido. So on your screen in the bottom right hand corner, if you can add the audience Q and A, it will not allow me to.06:13And this will directly address the question that just came in on the chat that says I don't have the Slido tab like last week. Okay, so just select the the Slido session that you wanna launch.06:34And I am not seeing these slider Okay, to keep things moving along, we'll just have to use the chat if that's the case. Yep. Okay. My my apologies team looks like.07:01The order of today is, is technical difficulties. Okay, so we'll go ahead and skip the slider. I wanted to go ahead and push but I just I was actually gonna ask about what people use templates for, but that's perfectly fine. I'll just take a, take a look at the agenda for today's.07:20Session. 1st half of the session will be focused on template examples directly within the catalyst center GUI. We'll start by taking a look at pure pure CLI, templates with basic variables. We'll look at if then else statements to apply conditional logic. We look at for each loops to.07:40To generate repetitive configs, bind to source variables and system variables, tackle how to recursively use the information gathered at the device discovery process to now feedback into the template creation and generation process. We'll even take a look at time permitting.08:04EEM scripts, a tool that's not very well known among many customers, and it definitely adds powerful functionality to catalyst center templating. At the back half of today's session, so the 1st four will kind of contribute will constitute the 1st half. We're gonna look at API calls and how to integrate our.08:23Outside scripting tools within the catalyst center framework to add additional layers of automation.08:43So just to note, so the templates I'm showing here today in today's presentation, the examples, they're not meant to be exhaustive and they're not gonna be a one size fits all solution that works for every customer and every environment.08:49They're meant to serve as a primer and jump start that idea generation process and see where the idea behind the example can actually be extrapolated, altered massage, and then applied to your own networking needs. The simulations and demos from today's session will be in catalyst.09:04Center two.3. 7-eleven, which is the latest recommended version of cattle center. I know some of you may have gone to three.two.three. The GUI menus may look a little different, but the steps and the template output results will be the same.09:24One last thing to note, anyone interested in any of these examples presented today? And any other template examples I've created, the link to my GitHub repo repo along with other resources will actually be posted later on in the presentation. So these examples that you're seeing today are on my GitHub as well.09:41As well as quite a few others and it is definitely a work in process. I will keep updating that GitHub, so feel free to bookmark that and take any ideas that you want from that repo.10:00So that being said, let's actually get started with our basic templates, right? So really basic templates are, all intents and purposes just pure CLI without any type of syntax, right? It's really the simplest form of templating.10:12A lot of times I'll see with customers, it's a copy and paste of the switch running config, quick one off changes sometimes, any of your golden configs. All right, so that's kind of like your basic templating. No, NO extra script, NO variables. It's just.10:27A, you know, host name, whatever. Your templates with your user defined variables are your CLI along with whatever variable that you create, right? Within the variables field, you can have multiple types of entry. You can have your free form.10:45Right, which is just free text. The single select, which you'll see provides a dropdown versus your multi select, you're gonna get check boxes that you can use, right? Most people use free form, but there are scenarios and you'll see some examples where you have like a dropdown or your multi select.11:01Okay, so I'm gonna do a practical demo. Hopefully my, we make sure that my browser cooperates with me. Take a look right here, this is practical demo of basic CLI. You can see I've created VLANs one two and 300. I'm creating the svis for it.11:22Static IPs, IP helper addresses, right? Configuring gig 1010 as an access port, member of VLAN 200, voice VLAN 20, panning tree, as you can see some AAA and some ACL settings, right? Of course, this isn't scalable because if I need to push.11:43This to multiple devices, I now have to turn around.12:02If it was this template, I would have to turn around and make the change for the static IPs multiple times. Which brings me now to my variables. So almost the same format that you can see, and I am with I am FYI I forgot to mention I am using velocity templates.12:07Right, so you can see, you know, this is the format we discussed velocity versus Ginger last week, but this is a format I feel most comfortable with, right? Those of you coming from prime, this may look familiar, but you put a dollar sign in front of the text and that denotes a variable in velocity templating.12:27Right, so you see I have my static IP for my management, for staff, and for my data svis, right? One thing that you don't see as common and I I really try to get out there is interface name can actually be a variable as well.12:46If you look at this 1st example, I just have gigabit, but what if, you know, what if you're working with a 4890 300 408P versus a 9348 UXM? You know, the UXM have multi gig ports in there, so you can actually make.13:02Interface name a variable as well. So when I run my stimulation, look at my variables, right? Have my management, my staff, my data VLAN IP, my access port, right? And you see right here.13:18String text field versus string multiplet. And this gives me the capability now to do this dropdown, and these are my key values right here. So when I run my simulation, right, and it's pre populated, but you can see I have 1010 2010 3010.13:37Then, right? And.13:57I'm now able to put my interface name and change it, right? Gig 1010 along with my static IPs there versus now if I was working with a UXM 4800, I'm sorry, 9348 UXM I can now do 2.5 gig.13:59Right, and then if it's a different switch, I can now do eleven. 1111, and when I run it, you can see the result. Okay, so these two constitute, these two demos constitute really the most big.14:19Basic form of catalyst center templating.14:39You know, which is just either a straight copy and paste or throw some basic variables in there So let's take a look at some of the programmatic elements that you can that you can incorporate into your template. This can be done with either velocity or ginger. It's just a matter of.14:43Syntax but the content, the, the, functionality is the same.15:03Alright, so for your if then else statements you can use them to implement either a conditional logic or boolean logic, you know yes, NO or if this condition exists, you know, push this config versus if this other condition exists push this config, right? One thing to note that you can.15:09Can nest if the nels statements within each other or you can even nest it within another for each loop.15:29Right, a couple of real real world scenarios. I like to use it for, model specific versus model agnostic configs. So if you have, say, you know, multiple switch model types instead of having to have.15:37A template for each model type, you can incorporate them into one template with a conditional, and especially if you also have, you know, an overarching global config that is applicable to all those model types, NO need to have a separate template, right? And I actually, I will show that in, in an example what that would look like.15:52Your 4 " loops is where you implement your repetitive configs, the ones that are going across, you know, either the same config for multiple devices potentially or the same config for multiple interfaces.16:14You know, this is, this can be your interface range command, right? But of course, for those of you attended last week, interface range command can flag as a compliance violation and there are limits of interface range commands such as, you know, eight ranges per command and it doesn't survive across switch stacks or.16:29For chassis switches, right? Whereas for your four H loop you can definitively include those and still be able to push those multiple configs, you know, across those interfaces. All right, so really quickly, let's go ahead and.16:49Take a look at what one of those would look like. If you take a quick look here, right? So I like to call this my model trigger template, but as you can see right here, I have configs for a.17:099300, right? And that's gonna push VLANs one and 200. If it's a 9400, it'll push VLANs three and 400. If it's a 3850 it'll push VLANs five and 600, right? But you see under here these are my configs for my all my models, right? So whether for my AAA and my ACL, so whether it's.17:289394 3850.17:48Right or any other models, I expect this to be pushed NO matter what I select, right? So you see my switch model here? Okay I you see my switch model here and I have my, you know, 3850 9300 9400, and then I have my quote unquote any other model.17:51If you look at my test, so let's say I'm pushing my 9300, so I'm going to push maybe 2010 3010 gig 1024, it's fine my switch model. When I run this, I expect VLANs one and 200 as well as the svis, the corresponding svis to be pushed, which.18:13They do VLANs one and 200. Versus if I now pick my 9400, I expect VLANs three and 400 to push. So I make my changes accordingly, right? And you can see right here VLANs three and 400 and download.18:33Here, I still have my AAA and my ACL.18:53Right, my 3850, right? Expectation is VLANs five and 600 to push with their svis along with my triple A and my ACL, so you see my five and 600, my aaa, my ACL.18:58And now one last one, which is any other model. So even if, even if this is filled in according to the logic, I should only be getting my AAA and my ACLs because any other model doesn't fit the 9394 or the 3850, which is what I get. Okay, and don't be hung up. I I use models.19:13As an example because that's the one that came most immediately to mind. But you can definitely use like e.g., you know, building or location, you know, this state versus that state. You can put that in the dropdown. It's just a matter of.19:33A particular parameter that has a specific config, you don't need to spin out into its own template. You can include them in multi, include multiple parameters in a single template and even include a common config amongst them.19:50Right, this other if then else statement implementation, I like to call my yes NO trigger template. All right, so this is more useful when I want granular control over the template. So rather than one single.20:08If then else statement as you see here with multiple or one single statement with multiple if, if then else portions, I now have multiple statements created.20:23All right. So each of these I can now chunk up my template. If I select yes, it should push, else nothing should push. All right, so now I get control over each piece that I want to run. The VLAN, the VLAN config, the SVI config, the AAA config, the ACL config.20:40Right, if you look at this now, if I want to run the VLAN in the SVI, but I don't want to run the AAA, on the ACL, I can put NO there. When I run it, I get my VLAN.21:00And I get my SVI versus don't forget, like I said, these templates are available on my GitHub, right? So for anyone after that wants to, wants to take these and incorporate them, they will be available.21:15Right, so here's my AAA, here's my ACL, and you see I have granular control over the contents of a template, right? This can even be used in the case of a composite template, you know, because one thing with composite templates is that all templates in the composite templates run.21:35Right. The thing is, is that of course, if you want one template to not run but the other one to run, you know, you don't want to have to go in and remove and add every time in the composite, but if you added yes, NO statements like this, within a composite template, you'd be able to control which template in a comp.21:53Positive template ran.22:13Okay, so let's take a look at my forge loop, so I have a basic one and I have a much more advanced one. Alright, so in this case, I'm just trying to configure maybe my access ports, right? I'm trying to push the same config across multiple interfaces.22:17Okay, so for our velocity, and I can speak, I can speak for velocity. Unfortunately I am not as, well versed with ginger. But we do have resources which will be listed later on to kind of have a.22:36A primer two ginger for those of you that are interested and we do have several videos available as well. But specifically for for velocity, you see I have my range one to range two, these two dots in the middle, right? And you say I replicate this, I deliberately did nine ranges instead of eight to show you can go beyond what the interface range command.22:53It does.23:13Alright, so I'm pushing, you know, VLAN 200 voice VLAN some spanning tree. So one thing to be aware of, is you see my variable type is not string, it is now integer, right? Because per my template, once I set this up in this syntax, it is expected.23:14An integer at the start and at the end.23:34So I need to make sure that each of these ranges are set to be integers. Otherwise, when I try to push it'll come up blank. So let's take a quick look at my stimulations. Let's say I'm let's get, you know, let's get risky. We're gonna push ten gig instead of one gig. All right, so we're gonna.23:36Push from ten gig, two to ten. Let's do 15 to 20, just 25, just 27. Let's get risky, just 30.23:57And then I'll do 37 to 48. So you can see I have my ten gig 1022 through 1015 through 20, I have 205I have 207I have 30, and I have 37 to 48.24:15Right, so I can push this instead of an interface range command, right, to get that same functionality.24:35And also not have to worry about a compliance violation, a template compliance violation, right? I can take this for each loop and get, you know, a little bit more complex with it. So if you look here, right, I don't I'm not limited to only one forage loop, I can do multiple forage loops.24:43Right, so let's say I'm I'm trying to push configs for trunk as well as access.25:03Right, so I have my trunk range, I have my access range, and you see how they're nested within each other, but let's say I have stacks, you know, or a chassis switch, right? And I want to be able to push across you know potentially a consecutive stack range or or blade range or.25:07Multiple ranges within that stack or within those within the chassis switch within those blades. Okay, so you see once again I have my I only the two ranges for the stacks, but you see all of them are integer under my trunk interface speed, once again, and any time when you're working with something like this and you.25:28Put in a range and you're not seeing numbers come out, you're just seeing a blank. Double check that each of these.25:47If you're working in velocity, anything that is both ends of these two, dots, make sure that they are set as integer, right? So when I run my simulation, right, so let's say I'm only looking at one.25:55I'm gonna go ahead and delete. I'm only looking at at one switch, but I'm gonna do ten gig one oh one two we get risky, one to two. And then we'll do ten to 2020 to 25, I'm sorry. Ten to 2025 to 3032 to 35.26:15For only one switch. So I have my trunks, ten gig 1112I have my gig, ten through 2025 through 3032 through 35. But let's say e.g., I want to push the same config.26:35Across a chassis switch. Blades in a chassis switch or a switch stack. So let's say I'm gonna go three switch there, three switch stack or three blades. So what does this look like? I still have my ten.26:5211112, but you see now I have 211212 and 311312. Right Corresponding to the three switches in the stack. Same thing for my accesses, right? So I have one oh ten, I have all the way to 305I have two.27:07Ten all the way to 3055 from scrolling too fast, I have 03:10 all the way to 35, right? So it takes this particular template and adds a lot more complexity to it, right? If I wanted to only get access switches, I could have very well just.27:25Left these blank in the trunk, and now when I run it, you see, I only get my access switches but across the same switch stack, right? But let's say I have non consecutive switch stack ranges or blades, right? I have.27:44One to three, but let's say maybe I want six to eight.28:04And I will do trunk here and we'll do 1112. So when I run this, I have my 11 122-121-2313, but if you down here, my 61161271, right? And the same thing, these are the trunks, same thing for the accesses.28:08I just have my gig one, gig two, gig three, gig six, gig seven and gig eight. Okay, and this particular template, I was working with a customer who.28:28They had 9000 lines of code and they needed to shorten it to simplify it. And when I looked at the template I saw that it was this pattern it was just the same config just repeated.28:46You know, across multiple interfaces but across multiple switch stacks as well. We were able to compress that 9000 lines of code to 2000 lines of code. So we eliminated 7000 lines of code with for each loops. And you can even see here.29:01Right, this is what, 37 lines of code, including the comments in the spaces and 37 lines of code results in 1197 lines, including spaces.29:17Okay, so just something to bear in mind if you are in that situation where you do have a lot of repetitive configs and you're trying to push them not just across interface ranges but across multiple switch stacks or blades. Okay.29:33So, that being said, all those examples that you saw, they can be run in a day zero or a day end scenario, right? Day zero mean brand new fresh out of the box going through the plug and play process. Day end it is in inventory, it's assigned to a location.29:53Right, these next set of examples are specifically for day n, right? They are counting on the fact that these devices have been added to inventory, right? Reason being, right? If you've ever, and I'm hopefully this shows up real quickly, if you've ever.30:13Looked on the back end when a device is being added to Catalyst Center inventory.30:33You may actually see something that looks like this, which is a ton of show commands, right? Show interface IP interface brief, IP N bar power in line, show interfaces, show CDP neighbors, show ether channel spanning tree, you know, show this.30:39Show that, show the 3rd, right? So all of this information, right? Is gathered in catalyst center, right? Ingested, and then it's used to pop it populate a backend database, right? So what this means now is now we have information.30:58Directly tied to each device that is in inventory. And one of the, one of the benefits of using catalyst center compared to something like say net brain or SolarWinds is that we're able to take that information on a device by device basis.31:16And actually be able to now use the information gathered directly in its config, and you'll see what some of that looks like. So even here you can see like a device where I've pulled, you know, it shows the VLAN ID and the status.31:33The admin status, MAC address, speed port name, so on and so forth, right? And I can use this information either as a bind to source variable, so it's a variable that I create and then I bind to a system variable or I can do a direct call.31:50On the system variable itself, ok? So really quickly before this is a quick demo I wanted to show, I actually do have a template.32:08That showcases what these values may look like. It is called implicit variable values in my GitHub. It's one of the of very few ginger templates until I get more.32:25Right, in my GitHub, but if you take a look, so quick demo I promised, if I run it, you can actually see the information gathered about this device. Some of it is device specific, right? So role, serial number, SNMP contact, software type.32:42Version.33:02Host name should be somewhere in here, right? Host name, right? And then you also have the interfaces information, right? So you saw the VLAN ID that I showed speed port name, you know, and all of this you can actually now turn around description interfaces. You can turn around and actually use it.33:04In a template, ok? A couple of helpful system variables, right? I I showed that screen, but definitely, you know, host name management IP address for the device, right? Platform ID, a series, right? And so platform ID is.33:23Platform ID is more model specific, right? So 9348 UXM versus series may just say like 9090 300. So you can use either one of those if you want to push configs that is specific to a device. SNMP location, software version, that's in the device basis.33:43Right, on an interface basis, right? You have admin status, right? Versus connected status, right, just status, interface description, type port mode, port name, series, right? VLAN ID, voice VLAN.34:03Speed, ok. One thing that I did note here that that I discovered, and it should be in my github, is that some of these, even though they return numerical values, these values are actually stored as strings.34:22Right, so like e.g. VLAN ID, even though it might say VLAN 200, it's actually stored as a string. So if you wanted to do a mathematical operation on it, like e.g., you know, greater than or less than VLAN 100, you would actually have to parse it as an integer 1st within your code before.34:40You try to, before you're actually able to run that mathematical operation. So just definitely bear that in mind. It's something that that I recently, figured out, you know, when you're trying to, if you, if you see you're trying to run an operation and equals is usually fine, but if you're trying to do greater than.35:00Less than and the results just aren't making sense, right? Even though it's a number, it very well maybe that you need to parse that as an actual integer 1st.35:20In the code before you can do anything, before you can run a mathematical operation on it. Okay, and I I said some of this already, but basically bunch of source and system variables, right? The information was gathered from system from device discovery. It can only be used in day end templates.35:31Right, because of course that information is gathered when that device is added to inventory, right? And then templates are pushed when the device is in inventory, right? A couple of real world scenarios, right? You know, config based on access or trunk VLAN membership interface description.35:49You can even, there's a way to even use a switch that count.36:09Right, alright, so practical example again and hopefully I don't feel like I'm it doesn't feel like I'm rushing, but I definitely wanna, give golf his time to shine.36:13Ah, so in here, right, and this is this is kind of a niche example, but let's say e.g., I'm trying to push, you know, oh, I'm trying to push to a specific trunk port, but I'm pushing to a range of access ports.36:38Right, because a lot of times the access ports tend to be the same across multiple models, you know, gig one, whatever, right? I tried to account for that here, right? So NO matter the model, the access port maybe different, but the trunk port.36:54You know, the, the higher speed ports may differ from model to model. So what I've done is you see this should look familiar, right? My, my ranges for my access ports, but my trunk port, you see I use instead of user defined, it is bind to source. And it's multi select.37:11Right? Cause single select gives me a dropdown multi select gives me checkboxes, right? And my system variable I'm using is inventory, interface port name. So when I run this, you see it's asking me for a device, right? Reason being is that this is my.37:29Bind to source variables bound to interface. Excell Louis excellent question. The system tags are not something that are a system variable. I believe that a request has been submitted to for that to be added.37:48And I see my next question is from Clay, is it possible to set interface configs based on CDP information? Keep that thought in mind. Keep that thought in mind. The short answer is the short answer is NO, even though the information is collected, the secondary short answer is a request has been submitted.38:10The tertiary answer is the fact that there is a template that can do that.38:28And I will show it. Okay so real quick, so you see my trunk port here, so let's say I'm using my 40 gig one one oh one two, but I'm doing, you know, gig ten through 16. And I can actually use this as a check to make sure, hey, ten through 16 is on here.38:34Right, when I run it, so you see I have my 40 gig 1112 and then I have my gig ten through 16, right? The other thing I can do, it doesn't, if I do want both of these to be bind to source.38:53I can do that, right? So you can see right here I have for each trunk port, for each trunk port again, but I added a tad bit of a twist here because if I have both of them as bind to source, I may want to make sure that I don't click the same interface twice.39:09Right? And of course there's nothing limiting you from doing that, but I can add some logic to make sure that if I do accidentally duplicate an interface across these, I will get a note. So if you take a look at this, you see same thing for trunk and access.39:27But when I run my test, so let's say I have my 40 gig 1112 and I, you know, I also want 101 to be my trunk. But I accidentally selected 101 as an access instead of my trunk.39:45Right, but I I do want 1011, and twelve. When I run this, you can see I have my trunks, I have my access, but I have my comment here that, hey, this has already been selected.40:03Right, so now this means that I am able to catch this when I do my config preview or my simulation, and so I'm able to make that change. And just in case especially if the template is long, I don't catch that, this line this line of config will not push because of.40:20The exclamation in front of it ok so those were bind to source variables where I created my own variable and I bound it to a system variable.40:37Like I said, I can also do a direct call on a system variable, right? So if you look right here, right, and this is great for efficiently going through.40:52Going through especially if you have multiple switch stacks, right? Cause what does what does that process look like if you're trying to, you know, push configs say to all of your APs or something like that, right? You have to do the show whatever the command is, I believe it's show interface, right? We have to.41:10Do the command that pulls all the descriptions, look for the one you're going for, right? Then you of course you have to do a interface range command, right, with all the proper ranges, right? And then push the config. And hopefully there's not more than eight ranges, then of course if you have a switched stack or multiple blades in a chassis.41:28That you're pushing to, right? It's time consuming, it's inefficient, and that's just one switch. What happens if you want to do that for 50 switches? Versus with something like this, you're able to apply logic, right? So for each interface, if you look here, if a port name contains Bluetooth app gig port channel gig zero or VLAN.41:47Don't do anything, right? And if if you did want something for port channel, you can actually put a config for hey if it contains port channel, right? But in this case, I don't want it to do anything, but for my physical interfaces that are configured as access, right, I'm gonna push maybe a particular voice VLAN 20 and I'm pushing.42:07Spanning tree, right? But maybe for my trunks, I want.42:27You know, my 40 gig trunks to have one add VLAN three four and five, my ten gig trunks to add six and seven and maybe just trunks that are not ten or 40 gig to just add 809 hundred. So you can see how I'm applying my logic here, something to bear in mind.42:32In this logic works from the top down, right? The same like with ACLs. So it's gonna do the 1st match. That's why trunk is at the end instead of in the beginning.42:52Right, the trunk by itself is at the end because I did this statement 1st, it'll match all the trunks and stop and not try to catch the 40 versus ten. Right, so you can see right here, even though it looks like there's a ton of variables, the only user defined variable is voice VLAN.43:03So I'm doing, right? And this will run based on the actual device, so I'm gonna do the 9300 again. When I run it, you can see right here I have my I have a gig trunk somewhere in here.43:21Right? And then I have my, and you can see right here, right? Because I didn't put any specification on the access ports, whether it's gig or ten gig, it's pushing the same config. If I wanted to I could add conditions for.43:36You know, ten gig access ports versus gig access ports. All right? I look at that result versus something like say for the CSS tour one, right? I have some ten gig trunks here.43:53Right, so you see, I don't have to make any changes. I just add that logic in there and it catches the config, pushes the config based on that information that has been added to that device in inventory, right? So I'm showcasing here, you know, a port name and interface type and port mode.44:09Description is another thing that I can use as well, right? And that that was on the, on the list of, that was that was on the list of system variables, right? So this is of course tailored for my particular.44:31Lab, but you can see right here, run my simulation, right? And this is based on description and you can see I pull based on description. And I can use regex as well as just plain text.44:45Versus look at how different this is to maybe the DSS tour building, right? So this can easily be pushed across, you know, all devices in your network, a hundred devices in your network, right? And you don't have to sign into each one, you just have to the switch.45:02Equity comes where you create your logic, right? You make sure that your logic fits the scenarios properly. And there's nothing stopping you even though this one just had description, I can easily define combine description.45:21With interface type and port mode and any of these other system variables, ok? So this is a slightly different take on that 1st example I showed with the switch model where before you actually had to know, hey, is this a 93, is this a 94.45:34To 3850 and you have to do a dropdown. Same config here, but now I am actually able to use that information that's been gathered at inventory and stored in platform ID to now push that same config, right? So I still have my VLAN one and two, right?45:54And I even made sure to do the access port be one that I choose as a bind to source variable as well. So when I pick 9300, right, ignore the I don't remember if the oh the 9300 is, is 20 is 1010 and 2010.46:14Alright ten, and then let's do 2010. And then I select from that device, hey, I want maybe gig 1016 to be configured. So you can see VLANs one and 200, and I still have my AAA and my ACL.46:32But I don't have to do a dropdown. The template does it automatically based on the information collected. I believe one of these is a, ah, this one is a 3850, right? I didn't make the change for the, for the IP, but you can see because that's a 3850I didn't have to.46:49Select, hey, 3850. Once I selected that device, you can see, hey, VLANs 506 hundred, right? Along with the AAA and the ACL configs.47:08Okay.47:28Let's go ahead and talk EEM scripts, right? So granted EEM scripts is actually its own separate topic and it can take up an entire 90 plus minute session, right? But we'll just look really quickly at maybe implementing EEM scripts as part of catalyst center.47:30Okay, so for those of you that aren't quite familiar with EEM scripts, EEM stands for Embedded Event manager, right? This is built into Catalyst as well as Nexus devices depending on, you know, OS version and licensing, right? To confirm if the device is EM capable, you can always do.47:50The show event manager version, right? And the thing with EEM scripts is you can either run the script manually.48:10We'll do Fernando. You can either run the script manually or you can run it based on an actual event that takes place, right? So whether that's a syslog message, whether that's a CLI command that's been run, right? As a detector and then your action can be a CLI command as well. It can be a syslog message.48:19You can even send an email based on.48:39You know, a, whatever the triggering condition is, whatever that event is, right? One thing with EEM scripts is that it does bypass the day and line by line restriction. We discussed this last week, but day and templates run line by line, day zero templates run all at once.48:43An EEM script does bypass that line by line restriction.49:03Right, so a real practical demo and so to I believe it was it was Clay's point based on EEM, based on CDP information, I do have an EEM script that I developed in conjunction with a customer.49:07Right, so I'll run through the video real quick. So you can see right here this particular device has, so this particular customer wanted CDP information for all interfaces connected to APs, right? So you see there are six.49:23Six in entries in the table, right? Three APs, and then the AP 100 1800 is the sensor. And you can see the existing description, only one has an existing description, right? Connection to border one. So if you look at my EEM script, there are actually two in.49:39One. This EEM script is triggered based on.49:58The CDP neighbor table being updated or I'm sorry when something not updated being added. So an entry being added to the CDP table will trigger this script to run, right? So of course my thought process as well, how do I force.50:03And add to the CDP neighbor, CDP neighbor table, well clear it, right? So which is what 2nd script does, right? So you can see clear a CDP table and one of the things about EEM scripts, you can add a weight. So I'm going to clear the table and wait 60 s. And in that 60 s, right, that table will be.50:22Be populated. The good thing is.50:42Every time an entry is added to that table, this script will run, right? And I even have here itself deletes after everything is done, right? Because I don't necessarily, if I don't want a triggering EEM script to stay on there, because I don't want this to run every time something's added to the CDP, the CDP table.50:44Table I just wanted for this one time, I can actually clear it.51:04And self delete. So what, what does this look like? So, right, preview and deploy, I go ahead and run it. I'm going to the run. So you can see the script runs here, right?51:07And I'm trying to show, so you can see right here, right, I ran clear CDP table, but you can see the triggering six triggering events, update port. So every time I'm waiting 60 s, right? And every time this.51:27An interface an interface gets added to the CDP table, I add, I make this change. Samir yes it is. It is available in my GitHub. All right, so let's take a look at what that ends up looking like.51:46Right, and then at the very last, after that wait, right, you see the clear CDB table runs to finish the rest of the instructions which is self delete, right? So you can actually run multiple EEM scripts at a time, right? Of course it depends on the complexity of the script, and switch CPU and so on.52:01So forth.52:21Right, so if you look right here, my CDP table's populated after the clear, but interestingly enough, you can now see the new description, which is, you know, CDP for the 3850, the 3602 9130 3702, the sensor and the 9300, right? So now as a secondary template I.52:22You can now turn around and say, right? So per the point.52:42Even though CDP neighbor is not an exact system variable, I am able to now use the description system variable to say if the description contains this push this config, and I can even have another EEM script because if I don't want this to stay.52:46Right, I can push another, and it doesn't even have to be an EEM script, just a general template after all this is done, basically saying, hey, if the description contains NO existing description, leave it blank. You know, if it contains.53:04You know, else, you know, and then I can regex not this DESC part after the stars, right? So once again, and sometimes it may require a bit of a change and a mental shift in how you think about.53:23Pushing these configs and how you think about creating these templates because you're going away from just the, hey, configure interfaces gig one through ten to now looking for parameters that they have in common that you can apply, you know, logic to.53:41Okay, I am going to go ahead and hand the ball over to golf so he can go ahead and finish up with the API pushes. So Sherman golf.53:59His computer just blew screened and rebooted. Oh, ok, it is rebooting. Okay, what I will do, what about what I can do is I can go ahead and potentially.54:17Showcase a couple more of these examples or the EEM scripts while I'm waiting. Actually, let me go ahead and do this. So I'm gonna go ahead and share windows timing, of course. I'm gonna go ahead and share my GitHub page.54:35So and I ask about this. So this is this is my this is my GitHub right here. It is a work in progress, definitely it's it's not very polished, bear with me, give me time, you know, but you can see my basic.55:02Variables here. I do have, I have the JSON that you can import as a whole, as well as just a plain text of the actual template. The JSON allows you to be able to pull in the settings for the specific template.55:22Right, ok, so you can see that I have my if the statements, my basic force loops for the people that were asking about the EEM scripts, I actually do have, I have two versions of the EEM script, one that appends the description.55:40Right, and then there's one that actually overwrites the descript, the existing description. I wanted to create two just in case, right? And I even have one for, and this is actually interesting. I had a customer who wanted to be able to push.55:57They wanted to be able to, to configure their ports as routed ports. The problem is when you push a routed port config, the 1st config is NO switch port, which cuts the connection, right? So of course he cuts the connection and that means that the template stops. With an EEM script, you can actually.56:16Make a change in such a way, including, you know, putting a timer to allow that entire script to run to bounce that port and bring it back up. You know, so you can see right here, just looking at the formatting, you know, I have, you know, I bounced two separate ports. I did a shutdown.56:36Waited 20 s, right? And then I brought them back up, right? And I even made sure that it self deleted. And so within, within I mean EM scripts are definitely very powerful can can someone not hear me?56:56I can hear you. Okay. Okay I thought May said, ok. Yeah. So even, you know, the, the things you can do with them within the M script is limitless. I have a couple examples I'll be posting, you know, on here as time permits, including some that allow you to be able to push a config after a device has been rebooted. So for those of you that are doing plug.57:16In play and you're sending a device.57:36To a destination network that has a, you know, totally different networking environment compared to where it was initially configured. You can run an EEM script like this that will allow you to, hey, the last thing you do, you run the EEM script for reload before you power.57:39Recycle it. When it gets to new destination, it power it it connects the power and it'll run that EEM script after the reboot. EM scripts do run locally on the device. Yes.57:59Right, but like like I said in another, in one of the slides before, it is dependent on the version of EEM that you have is dependent on licensing as well as, as OS, right? And bear in mind that because it is a process, it is a process that takes up CPU cycles. The complain.58:17Complexity of the EEM script as well as the triggering events can affect switch performance.58:37You know, so if you run an EEM script for to trigger every time a particular syslog event occurs and that syslog event occurs all the time, be aware of something like that. I see your is is golf back? Okay, Golf you are back. I'm.58:43All right. I'll go ahead and hand it over to go. Josh I do see your question.59:03In terms of get past the PMP issues I was just talking about, I do have a script that does that, definitely reach out to me after or speak with your Cisco representative and they can reach out to me and we can definitely go ahead and look into how that can be resolved.59:07Yeah, May I see your hand but I just wanna definitely want to get golf to let's get golf sorted and please review the questions in chat that I have not had the chance to answer just yet.59:26Okay, definitely. Good to go? He is still having some technical difficulties so well then let me ask you, we had a couple of questions while.59:45Well office is getting sorted. There was someone that was asking if it was possible to set an interface config based on CDP information, which is something that I think you have done.01:00:05Yes, I just showed how to do that. I I showed how to do that. That particular in my GitHub it's right here, the, you can import this JSON directly into catalyst center, right? Or you can just copy the text, but I have one for appending the description, which is what I showed in my video, and I also have one for.01:00:18Overriding the existing description on the interface.01:00:38Excellent. Then, there was a question about using tags as a filter. I answered that as well. So unfortunately cannot be used as a system variable. I believe there is a request out to our dev team.01:00:42To have that because it does make sense and it would be easier to, you know, push a config based on a tag because you can make the tag in the inventory and I'll turn around and dynamically be able to, you know, without necessarily having to touch the template, change the device that the.01:01:01Template can apply to just based on the tag. So it's definitely it's definitely something I've heard before. It's an ask. I'll have to double check to see if it's been pushed to the dev team. If not, I'll I'll create a request for that.01:01:19And just a reminder while we're still waiting for golf, that you can also if ever that's something that you can level you can use the make a wish feature so you'd have to go to that question mark at the very top right of your catalyst center.01:01:35Screen and use the maker wish but of course mr. Template here is at the forefront of the good fight so you will see that this question gets addressed and now.01:01:55Cough, take it away. Yes, thank you. So I'm using Cisco if any issue you cannot hear my voice please let me know, ok?01:02:10Okay, audio is a bit it's a bit choppy, yeah. I think that by say say something?01:02:30Can you hear me? It's it's still still a tablet choppy. I don't know if you need to turn maybe the game down on the mic. Okay.01:02:46Had a bit better.01:03:02Can can can we choppy. It's it's it's still a little choppy. I would say, I'd say let's let's let's go ahead. I don't know if you can, if, if you can adjust the the mic, the the mic volume in the actual.01:03:17So.01:03:37Yeah, we can see you find though. Yeah, in, in Webex maybe if you can change your audio settings to bring the the mic volume down, the input level, I don't know how big a difference that'll make.01:03:38And then if if that's better. That is definitely sorry about that. Yeah. And NO worries once again, take it away. Sorry, I got a problem with my EC.01:04:01Thank you, so in in this second part of the EIS session, I'm gonna talk about how to use template to deploy actually use API to deploy the template on the centers. Before I go deep into that, how to clear the API workflow.01:04:19For the template, right? I would like to to talk about my thought process when I, I need to develop my own application using the center API or any API on any products actually. This is not the software development life cycle. It's just my thought process.01:04:38So, feel free to I mean you know if it's not applicable for you, it's ok but this is what I'm using.01:04:59So when I there there are four steps right in this thoughtful process. The 1st 1st step is I I always ask for the customer use case, I need to understand what is the business outcome and what is the benefit doing this.01:05:061st, so if if there is NO benefit doing this, right? I I will, if we can use GUI to do this efficiently, then we don't need to develop any automation process at all, ok? So after after the the 1st step, 2nd step is.01:05:22I need to map the the requirement. After I got the business requirement I I map it I explained it into the technical requirement and then I map it into the API endpoint. Some requirement you you you can use only one endpoint.01:05:42And develop the application to do that, right? Some, some requirement you may need multiple API API in point and you need to connect them together and make it into the workflow. So this is 2nd step and I I will talk about it in this session.01:05:56Right every focus in this because sometime when you got the requirement you you try to map into the center API endpoint and then we cannot find in point that can deliver that. So, so we don't have to go to the next step step number three to develop Azure.01:06:14Application so you.01:06:34You check 1st, if we can find the API API endpoint to do that, if you cannot do that using the API endpoint, you can consult with our CSS or our account team, and then we will try to make it available in the.01:06:37Next release. Yeah. And the last step is we we after we got the application, we we validate it, we test it in the production not in the production network before we put it into the production because using automation tools.01:06:55We we get benefit right it it do thing fast but it can do things it can we can get the error and it can make something happen in the network also, so better we do validation test before we put it into the production.01:07:12So I will talk about focus on the.01:07:32Step number two, map it map the requirement into the endpoint and make it into the workflow, ok? So before I, I demo how to do this, I want to talk about the tools that you can.01:07:36Use them to develop this, right? It will help you develop the API, develop your application faster. The 1st two is actually the documentation. There are two documentation resources. You can, you can use one is.01:07:57The API swagger in the center portal. I mean in your application, right? In the platform developer toolkit, you find all the API that supported in that version. 2nd document is developer.cisco.com. This is.01:08:14Very useful resource Many people heard.01:08:35Forgo forget about it, forgot about it because you need to log in, right? You it's not like the other centers that you you already use every day. But there are a lot of the result in in in that webpage. You can find a sample code, you can find all the API endpoint in.01:08:39Every version of the centers, you can find the.01:08:58The the such that API endpoint that you you should use some API endpoint, right? Some, some, some action that you want to do, there there maybe more than one API endpoint if if you.01:09:04Get into that situation, go to the developer.cisco.com, you can find what is the endpoint that's going to be sunset, going to be the precared in the future, better not to use them, ok? 2nd tool is the how to how what is what kind of tool that you can use to explore and.01:09:19The 1st two is.01:09:43Again in the center platform, right? In the next, but it is not very scalable if you need to test it multiple times you need to copy and paste the data, right? So I recommend you to to also use this under the two application.01:09:44Either postman or bruno. Is this the API client application that you can automate it same automate it actually but you can after you add the endpoint, you can repeat running endpoint any time with the information that you already populated.01:10:04That in in that application doesn't have to be manual anymore.01:10:24So that is 2nd tool set. The 3rd one is when you do implement implementation, I I don't talk in in this session when you actually do implement it, right? Before you try to create your own library using Python.01:10:29You know, programming language, right? You will create your own library to authenticate the user on the centers meaning at the token, you you can consider using the Python SDK developed by Cisco. The SDK software developer toolkit is actually really.01:10:46Helpful speed, it can speed up your development process because it will take care.01:11:06The authentication process, it will take care of the talking live, it will take care of how to handle the error message from the centers. So these these three tools that keep in mind, you have this, ok?01:11:12Go to the workflow development for for the very high level overview when you develop the API workflow on specifically, there are two steps, right? The 1st step is authentication. 2nd step is we call it intent tasks, intent.01:11:29What what we want to do on the centers there is there is only two steps. The 1st step is authentication, you need to use username and password authenticate and get to talk in 1st.01:11:49From from the centers, talking is valid for 1 h. So if your application is less than 1 h, you don't have to take 2 min any talking life. But if your application is going to land longer than than 1 h, you may have, you need.01:12:01The, the process to to to maintain the, the, the, the token by re authenticate again and get the real, get the get the new talking and use it in your application. After you get a token, you can use that token in in the intent talks. Intent can be anything in in.01:12:20Our session is the.01:12:40Template deployment tasks, ok? So let's go to the demo, how I develop this workflow, ok. So I go start I start with the developer.cisco.com, right? I go to technology, go to networking, go to the centers.01:12:43It will bring you directly to the other centers.01:13:03Document, ok? In this document you find many useful information including code that many people have them upload to the cisco.com. You may use it if it applicable.01:13:07Yeah, for your use cases. So let's go to the center API. In the center API document here is actually have all the API endpoint supported by every version, but you need to select the version that your that is your centers.01:13:23Software version you were using, so for me right I use three.one of six and actually for the template deployment, they are not much different in in each version. So I use the last test one, ok? And from here.01:13:43The 1st section is the, the introduction about the API on the center. If you want to do more research or do more, do more study, you can start start your pro pro project very fast by looking to the authentication step and get.01:14:00Started guide, it will give you the example how to do authentication with the centers, what is the process and how and what is the and you can find a sample python code that you can use to authenticate the 1st API call with the center definitely.01:14:201st API call we have to be authentication API call, right? So to get a lock in and then after that you can go into go to the getting started guide, find 2nd example to to do 2nd API call to curate some information from the center.01:14:38In the get getting started guide, not only you can get the 1st example, but you can understand what what kind of, of the of of of the API that is center can support.01:14:58Right, it's it's categorized into all of this category, ok? And then you can find the API chain lock that you can find each slide for different version of the centers. Then you can go directly to API references in the API references.01:15:13It's you can find all the API endpoint here, but 1st thing before they go directly to the API endpoint I would like to to tell you about this open API document. If you.01:15:33Trying to working with AI create your own application, maybe actually faster during that, right? Instead of just chat with them without any information at all, maybe AI can be originated or you.01:15:48Can download this open open API document, upload into your AI and then work with them.01:16:08And if you think that thought process is working, you can just follow that thought process, start from the use case map to the workflow and then create the the the 1st application by referring this open API document specification.01:16:15With AI when you work with them, ok? In this demo, we will do it manual. The 1st thing right to to do, to, to create our workflow.01:16:35Actually for the API workflow on the on this document, if you go to guys you will you can find many workflow, right? But, but there is NO template deployment workflow here. So you need to create the template deployment workflow ourselves.01:16:51So to do that, I go to the API reference, go to API. The 1st thing, right? I need to do authentication, I go to authentication, API here, get, get the API URL endpoint, and then get the method that I need to use for, for this endpoint, for any any input.01:17:07Right, right? What you need to do is there are five things you need to do. One is what is the method you're going to do with the endpoint. 2nd thing is the URL endpoint. The the 3rd thing is the.01:17:27The, the query parameter, if, if, if that API in point support e.g. the query API endpoint, you can use query parameter to fill the information from the from the current centers. The 4th, the 4th information that you need to know is the.01:17:39Request parameters, there are two things in the request parameters, one is header and one is the payload, right? You can check what is the required parameter for the header, what is the required parameter for the for the payloads, most likely in the payload, right? Some parameter will be mandatory mandatory, some parameter will be optional. So.01:17:59So to develop the new 1st application, I recommend to only focus on the mandatory.01:18:19Parameter 1st to make the 1st API call so you can start with the the full workflow 1st before you deep down into the optional parameters, ok? So I for the authentication API I copy this URL, go to my Bruno.01:18:27On the 1st thing, right? I copied the URL in point here for the authentication, use the correct method for this API, there is NO query parameters so this one is ranked, there are NO payload for the request parameters.01:18:47Does this body is also blank and then I forecast four for the authentication, I forecast.01:19:06On the top on the on the header, the header you have to have the content type equal to application json. And then for this type of application you can go to authentication method here select the basic for the center because center right now is only support basic auten.01:19:14Using the username and password. Put your username and password here and then you can test your 1st API call with the center to get.01:19:34In the in your 1st try, right? You, you don't know how to do this script to copy the token and save it into your environment, environment area is that it fine. You just copy this token and re and use them, use it in in 2nd API call. But when you.01:19:44Of doing this with Bruno or postman is because you can use this script function. You can have the the function to copy the the value from the output and save it to the variable so you can reuse them in, in the next step. So the next step, right? For the template deployment.01:20:03The five days nor.01:20:23Endpoint NO workflow provide as a sample in the document, I need to find what what is the template deployment API endpoint I I should use, right? The the one of the benefit using this developer.cisco.com is because there is this document here. You can use the simple.01:20:25A Simple question to ask this developer.cisco.com E.g., I want to know what is what kind of the.01:20:46What what should I I I do, right? If I want to to to deploy so I start using the deploy template or you can use the natural language like the open AI.01:21:01It provide me to.01:21:22API in point, deploy template version one and deploy template version two let's keep it short, right? Deploy template version one and version two they they do the same thing. So you can use either one of either one of them. The different is deploy template version one, it will.01:21:24For the respond payload, what it have in the response payload is that the deployment ID. So you, you use the deployment ID to do the next step, ok? E.g., if you get the deployment ID, you need to search here again to find what what is I can.01:21:44Used to to monitor the deployment ID if you give you that API point.01:22:04But in in this session I want to talk about I use this version two because version two will give me the task ID as in the in the response payload. Why I I want to show you this because most of the intent tasks in the country centers.01:22:10Is this the right you send the action to the country centers and then just reply back with the task ID. And then you, you use that task ID, monitor it.01:22:30Until it finish and and see if what is the result. So I want I want to to to show you how to do that. So I I use this deploy template version two instead of version one, I got B right I.01:22:45I got the endpoint, I copied into my my second step here. My, my 1st step. But in in this document, right? You will the next step is you just you will find all the information you need for this endpoint. The I want I don't.01:23:01Want to talk about this header anymore because all the header will be the same.01:23:21You need content type with the application JSON and then you, you also need the token in the in the header. For the request body, you can find all the required information here for the template deployment or the information you need. There are some mandatory information.01:23:25That you need, e.g. template ID, you need the template ID for for this API API call, and another information you need is the information in the target info. Target info is actually the devices.01:23:46That you want to deploy the template to and you also need some information about that, right? E.g., when you deploy the template in your GUI, you need the variable value that those variable value will be inside each object, each device object under the target info.01:24:01Right, right. So in the targeting for you need the device ID or device host name. You need to tell the center what is the what what kind of the ID you you want to use to specify the device device so it it can be device host name. If you use the.01:24:21Device host name in the type here, which is mandatory, you need to to to use minute device host name for for for this asset value for this type attribute. If you use device ID, you use device UUID for the.01:24:41For for this type attribute here and then you need to use to select to have the, the, the correspond attribute based on the information that you use in in the type. So e.g., I use UUID, so I I have ID.01:25:00For to identify the device type here in in the target info. The the next information in the target info is actually the variable is optional because some some template you you don't have variable, so this is optional but if your your template have.01:25:19A good has the variable you need parameters.01:25:39Attribute ok in the parameter attributes, it's actually the key value pair of the all the variables inside your template. So if you have three variables you need three key each key will be the variable name and and the viable value is actually the.01:25:43The variable value in the template for for that device, ok? And then if you use this environment that show you almost at the end of his presentation, you also need this resource parameters.01:26:03Okay, object. The resource parameter is the object for the, for the device that you want to buy to tell the center that so the center can query that the information for the system for, from, for that device.01:26:18For for this template deployment, so you need these resource parameters also. So, so go go to my template, go, go back to the Bruno 1st. So here in Bruno alright I copy that.01:26:36Information I can click this assemble body copy the whole thing, remove them, optional attribute, give only the mandatory attribute and then I I will, and then I will try to, to, to, to, to put my input right into each.01:26:52Attribute, some input I I already have e.g. the variable value, I know what the value that I want to put for the on the device, so I I put.01:27:12I know this already I can I can put them, right? The minute device I decide, right? I want to use the ID because the country center always the ID for for the for the API.01:27:23API workflow for other tasks also, so I use the UID instead. And then I, after I feel all the information that I I know, I it will it will it will show me the information that I I don't know, right?01:27:39This information, e.g., the device ID, I I don't know this information. I don't know the template ID because this information is actually inside the database. What I need to know, what I I know from from from this after I.01:27:58I need to find the information I know and I need to find the information I don't know, I can from the information I don't know, I can identify the API endpoint that I need to get this tool information. I can go back to this document again search for search some some keywords.01:28:15Like what the API in point I can get the device ID for the device. If you give me some.01:28:35The list of the possible API points and then I can test it and select one of them to use, right? For the template ID also the same, I I insert in the document. So I after I started in document right I I know that I I I got this through API endpoint as a prerequisite endpoint. Can.01:28:41Devices and get template details. Both API will give me the the 1st API give me the device information including the ID in the device information. 2nd API called template details if you give me the template ID, let me show you.01:29:01After I run it, right, I get I use a filter filter is with my only one device that I want to deploy to and I get this yes. So I get the the the device information and then from the device information and.01:29:21Got the ID and save this ID, right? Copy it or or save it using subscript here into the device ID variable inside this application for the template also after you got the template ID here.01:29:41I copy this, save it into the variables and then I can reuse it in this deploy template API input, and then I I can call this API for the 1st time. After I call it, right? I get the response. Actually the CCS I know that.01:29:59It will give me the response.01:30:19With the task ID. So I know that this is actually the task ID. I need to monitor it. I need to approach it to monitor it and I I let me show you the process I do this, right? How to monitor this, right? I I used another API call.01:30:22Another API endpoint, I I use this get passed by the API endpoint. In in in my app in my area application, I will have the process to to monitor it using why loop right?01:30:40I reminder this letter endpoint 1st. After I call this API endpoint, I will know that in this API endpoint respond payload, it gives me start time, I don't need this, it gives me in point in time, actually in time, right? And it's give me the status of the tasks.01:30:55That I'm I'm deploying.01:31:15Right? So 222 minutes or do to to monitor the the times using from the country center using when when you call the API right on the center what what what you can use to monitor whether the the time is finished.01:31:17Or not is you can use this end time because in time will be only populated or already be in the response if the time is finished. If if the times haven't been finished yet, there will be NO end time, ok? For this is specifically for country center application for for the app.01:31:36Other application there maybe in time or will be in time in the response but but the data here will be empty. So if you want to to have the process that that can work with any application, you can do the condition.01:31:56Like to check endpoint, whether in points in the payload, whether in point have the value or whether employee have the now value. If, if, if it's.01:32:16If it had the value, have the in time, you know that the the ties is finished already. So after you you you check the tie is finished, you can check check whether the tie is finished successfully or not, right? That is 2nd sec, second condition.01:32:28So you can use this status to check the the tasks whether it's time is finished successfully or not. If the task is success is success, you can end your application if the time is not successful or you want to understand more about how the country center deployed, right?01:32:47You you can you can copy this status into your data and then you can call it get task detail by ID. Get task detail by ID will give you more information about the deployment tasks. For the template, it will give you the template id deployment ID.01:33:06The template deployment ID is the ID that you can use.01:33:25In the the 3rd API call to check the the the direct deployment process. This API called endpoints is his name is state out get this temp state out of the template deployment.01:33:32Endpoint. You you can do use the template deployment ID that you get from the get task detail by ID, get it, use it here and then you can get all the detail about how you deploy how how this template deployment tasks.01:33:48Update, right? Including all the configuration that actually pushed through the devices.01:34:08Okay, so after you got all all the endpoint, you can test it multiple time with with this, you can learn it whenever you want, so you don't have to to do this again.01:34:14Right, so this is how I developed the the the API workflow for the center especially for the template deployment. So if you only need the template deployment workflows, you can use this.01:34:32In your application you don't have to try to develop this again, ok? Okay, so I I would like to go back to the PowerPoint slide before I I demo the 2nd demo, ok?01:34:49Hey golf, we are at 6 min over just FYI. Yeah, I know we had some some technical issues, but yeah. Yeah, sorry. So I in in the PowerPoint slide I would like to summarize what I did in in the demo the how how I get the, the, the.01:35:05The URL endpoint workflow, right? So what I, what I need is I know that it's authentication and 2nd step is template deployment tasks. I use the the the the business requirement to identify the API endpoint, the 1st API endpoint that I, I need to use and.01:35:25Then from that, right, I, I, I check the request payload and query payload.01:35:45And and verify what the input I need. I I I I still need that I cannot provide by by myself. Those those inputs I call it system derived input. This input we can get it from the center by identify the the prerequisites. You.01:35:51And from from this this use case we identify this and get impact list like.01:36:11Right to to get ask the prerequisite endpoint to get the template ID and you and the device ID. After I got all this, I can call the the 1st deploy template.01:36:21API call with the centers. After that, I got the respond payloads from the respond payloads, I identify the next step. If it's a task ID, I need the process to monitor the tax ID. What, what I do is I have the process to monitor the using the ID.01:36:37Think.01:36:56API endpoint, if the end time, I know that the process is finished. If it's not finished, right, it's still running. I rerun, I in in that time, maybe 30 s after 30 s I, it run it.01:36:57Under get tasks by ID again to get the information about the task. If if it's still not finished, we wait another 30 s rerun it again until you finish, right? When you finish, we get the in time, right? We get in time, and then we check the status. And if we want.01:37:17To to understand more about how how the department go.01:37:37Work, right? We we use the get task detail by ID and get template deployment information by detail by ID, by template ID. We will get all the information. I want to emphasize this if if if you you you would.01:37:42Need this because not every time you when you deploy using API is successful. It's similar to when you do it with the GUI. So you, you need this detail. So keep keep this in mind and have it in your application so you know everything why why the deployment is failed, ok?01:38:02So go to this is a summary of what I did. Go to the 2nd demo before I I I end my presentation. Okay, I would like to show you the real life application. Actually, I I I have two when I deploy a template. One thing.01:38:22I need to to to add is actually the tip for, for, for the.01:38:42Template deployment using the centers. When you do template deployment using the centers, the template that you have in the center, right? You don't need to to have to buy it with the profile. So this can be ad hoc template. It can be very useful for you because if you don't want to.01:38:48You by which profile you do most mostly you do you you use center is for the assurance, but you also want to get some benefit using the template, right? You don't want you to use network profile. What you can do, you can use this API.01:39:08To to deploy the template because you it doesn't need you to buy the template to the profile let me show you. So, let's go to my centers, go to template half here.01:39:25I have this already update interface template in this update for this update template in the template, right? Update interface VLAN templates, you'll see this, there is NO network profile attached to it.01:39:43So it's, it doesn't attach to any network profile. This is something that you can use API for. I mean, you can use API to deploy template and for the template that not haven't been attached to any profile yet.01:39:59So I use this to, what I I will do with this, right? This template, it will configure the the all the VLAN number under the interface. So so this use case that use case I am going to do is I have the, the, my switch.01:40:15Not here. I have this switch on my switch, right?01:40:34On my switch, I there is one interface that the interface description have I I have the interface VLAN under the description, and I want to make sure that all the interface VLAN actually config under that interface.01:40:52Using the same VLAN ID as in the description. So e.g. this interface one/fourteen, you see this right Description expect VLAN ID is 20. I want to make sure that.01:41:12Switchboard is 20 also, but right now it's not 20. We cannot do this with the template right now with the feature that we support now in the future we may have the feature that can do this but but doing this with the.01:41:27With the automation application, we can do it because we can have the the API call to get the configuration from from the switch 1st extract the interface configuration, compare the description with the current interface ID and then use this template deployment API to.01:41:45Deployed a new interface VLAN number to the templates. I already have this in my.01:42:04In my visual code, I will call this application to check the interface ID 1st, right? So this application will check the.01:42:12From the running configuration. Actually, I also use the API to get the running configuration from from the centers.01:42:33So after you checked right now that this interface VLAN ID is not the expected VLAN ID under the interface description. So I after I know this, I I want to deploy the template, I just put.01:42:39What it will do is it will start the the template deployment process. The workflow that we I show it using Bruno is implemented here.01:43:00Okay deployment on only one device is very fast, less than 10 s if you finish after it finished, right, you can go to the center again, you will send you that this interface have the.01:43:11Update VLAN already. So this is one of the use case that you can use. E.g., that CDP neighbor, if you want to configure the interface description, use based on the CDP neighbor, you can also do this also using this template API. The EA.01:43:29Is another way to do that. So you can have this in mind just two options you can use, right? So this is one of the real write application, actually not only this right interface, we learn is very simple, but you can get into more complicated.01:43:48Use case, make something when you need to update the viable using the dynamic information from from the enrollment, from the device, from the, from the external data consider API.01:44:05Clear the application not is not difficult right now because you we have AI. When when we have AI remember the open API specification, loading into the AI AI you were using it, you were working with, right? And then follow the thought process that I I talk with you.01:44:22In your AI, you will have this application the same like what I did in less than maybe a few days possible. Yes, thank you. Hi, thank you so much and really sorry for for my.01:44:40Yeah. No, NO worries, I mean you can't, you can't predict windows like somebody said. Alrighty. Okay, so that concludes today's session. I'm gonna leave this up for a little bit, but the link to resources, so of course there's the Cisco Catalyst Center youtube.01:44:58The channel.01:45:17We have quite a few githubs here from Aaron Donaldson. He is our other resident template expert at the CSS. He does, he deals more with Ginger, right? There's my GitHub there as well. Keith Baldwin is one of our tmes. He's he has amazing content, but also a primer for velocity.01:45:20To the templating language and then Aaron actually has a ginger templating tutorial on Cisco U if you are interested, I've seen a couple of people in the chat express interest in doing more.01:45:38Kind of one on one engagements and maybe dig a little deeper into, you know, a couple of questions. Feel free to reach out to your Cisco account team and they will be sure to get back in touch with us to set up a session, but for those of you who are interested, make sure to attend next week's session.01:45:50Cisco catalyst center integrations.01:46:10But I will definitely get more of golf. I feel like that session was hacked and it could actually stand on its own. So I would say in the survey, feel free to, you know, suggest nudge nudge, hey, maybe we should have an entire EIS session on APIs. I've been trying to get them to do it hopefully.01:46:13Customers will push them over the edge. But that being said, definitely, please leave this feedback.01:46:32We do apologize, you know, for the technical issues, but as far from a content perspective, the feedback is very important. We make adjustments to the content presentation styles based on this feedback. So that being said, you know, definitely once you've left the session, feel free to provide that.01:46:39U.01:46:59That is it. For those of you that are stuck with us, we really appreciate you staying this long. Once again apologies for the technical issues. We hope that the session was very, very informative for you and that is it going and everyone have a great.01:46:59Let's day.01:47:19

About this Video

Author : Cisco Customer Success

Uploaded : October 16, 2026

NetworkingCatalyst Center
AI summary icon

AI summary

Explore how Cisco Catalyst Center Templates scale automation for Day Zero and Day N. The recording shows building CLI Templates with variables in Velocity or Jinja, adding conditional logic and for each loops, and binding to System Variables from device discovery. See event driven EEM Scripts that update interface descriptions from CDP and orchestrate changes that bypass line by line execution. Learn the API workflow to deploy Templates without Network Profiles: authenticate, submit Intent Tasks, monitor task IDs, and retrieve deployment state using Postman or Bruno and developer.cisco.com. The session delivers demos, reusable GitHub examples, and guidance to compress configs, drive model aware policies, and integrate external data.

  • Accelerate repeatable deployments with conditional logic and for each loops.
  • Increase accuracy using bind to source System Variables and inventory data.
  • Operationalize automation with EEM Scripts and Intent APIs for scale.