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:10
Welcome, disclaimers, and agenda overview
Chapter 2 Thumbnail
03:18
Template compliance fundamentals and caveats
Chapter 3 Thumbnail
13:45
Compliance demo and interpreting violations
Chapter 4 Thumbnail
17:53
Basic templates and user-defined variables (Velocity syntax)
Chapter 5 Thumbnail
29:58
Conditional logic: model triggers and selective sections
Chapter 6 Thumbnail
37:02
For-each loops: interface ranges, multiple ranges, and stacks
Chapter 7 Thumbnail
47:13
Day 0 vs Day N and system variables overview
Chapter 8 Thumbnail
52:17
Bind-to-source and system variable automation demos
Chapter 9 Thumbnail
01:06:03
EEM scripts: concepts, triggers, and use cases
Chapter 10 Thumbnail
01:09:28
API-driven template deployment: methodology, docs, workflow, demos, and wrap-up

Transcript

Welcome, everyone, once again, to another catalyst center Expert insight series session.00:10Let me make sure ok so really quickly the standard disclaimer once again, and especially important for this session. So, the information this session represents Cisco best practices. However.00:20It is up to you, the customer, the user, the consumer, to implement the information here, in guidance and compliance with, your own.00:39Your own company and organizations, regulatory security and privacy requirements ok so this is 2nd session, part two of center templating. We're doing.00:52Doing scaling automation with Cisco catalyst center templates. So once again I am Sherwin, mr. Template Stephen, and I am joined today by my Colleaguette golf, Fasuk.01:11Right, so, for those of you that attended part one last week, we were, we talked and we talked about making sense of templating. We got into templating one oh one, we discussed how to create a template, projects and templates day day zero versus day n.01:29So we're going to take a much deeper dive day two with actual template examples and then of course, next week is going to conclude with catalyst center integrations and that's gonna round out the amplify series.01:48Alright, so real quickly before we get started, if you have a question, join the Q and A panel, right? And the panelists are standing by to answer your questions. I'm sorry I should have changed that slide to word a little bit. But yeah, you can either go to slido.com and enter that po.02:10Able to scan the QR code or it should have popped up in Webex as well.02:29Okay, and FYI for those of you who did join last week, let me see if I can showcase my new mic. I did get feedback. I heard that my mic gave me some issues last week, so went out and bought a new mic just for this session because I love this topic.02:36So much.02:56Alright, so let's go ahead and get started. So, our agenda for today, since we did have to rush through, I know we ran out of time last session, we rushed through template compliance. We're actually gonna start today with template compliance. We're gonna look at how catalyst center really implements.02:58Compliance and whether or not the config that was pushed is compliant. All right? We're gonna look at two of the main implementations that customers tend to start doing, when they do templating, which is pure CLI, right? Just copy and paste, as well as templates with base.03:18Basic variables, really user defined variables.03:37Look into the actual various options available with user defined variables or just variables in general, right? Bind to look at sorry if there are NO statements, how to apply conditional logic for each loops to generate repetitive configs, right? We're gonna look at bind to source and system variables. So how to re.03:41Cursively use that information that's gathered when a device is onboarded in the actual template itself.04:01Right, we're looking at EEM scripts. So this tool isn't very well known around a lot of around too many customers. I have seen customers use EEM scripts, but the vast majority that I've worked with do not. So we're just gonna take a look, not very, very deep because EEM scripts is very much its own topic.04:09But just how you can use an EEM script in Catalyst Center to add some really powerful functionality.04:27And then last but not least, we're going to round off with golf. He is going to go walk us through API calls and how to integrate outside scripting tools within the catalyst center framework, to add additional layers of automation.04:36Right, so one, one note before we continue with regards to these examples, they are not meant to be exhaustive and show every single capability. They're not meant to be a one size fits all solution that works for every customer and every.04:55The environment. Really what they're meant to be is a primer.05:14To jump start the idea generation process amongst customers and really see, you know, what you can do with templating outside of kind of the basic use cases, right? And so that being said.05:20Feel free to definitely take what take these examples that you see and extrapolate, alter, massage, and really just apply them to your own networking needs. All right, so we're gonna start with template compliance, and so.05:37I, I rounded off last session. I kind of had to hurry. But really how catalyst center template compliance works, it is a difference engine, right? So the template engine takes the output from the template.05:57And it then runs a diff against the running config, right? And of course, any device where the run, where those two don't match will be flagged as non compliant, right? Something to note is that correct configs can also be flagged as a violation.06:14And so it is really up to you to, when you look at the compliance violation to confirm that, hey, this is what I intended to push, right? And you can always acknowledge that particular compliance violation. So for those of you that did not.06:34That wanted a little bit more information with regards to compliance in general. Let me see if I can toss this in the chat. So I'm going to share a link and I seem to have lost my chat window. Here it is, ok. I'm gonna share a link.06:51To one of the previous EIS sessions, the ensuring that we're compliance with Catalyst Center.07:11Right, so if you go ahead and check out that session, it's going to go a lot more into just compliance in general, right? So that being said, right. The other thing to bear in mind with regard regards to the fact that current configs can be flagged as violation.07:19Right, so what we kind of have is a.07:40A balance between template compliance and the rules in template compliance versus the actual iOS XE feature set, right? So what do I mean by that? Let me I'll get back to that. Another thing to bear in mind with regards to template compliance is if you delete the.07:44Template, then that compliance violation will be removed in general, so not acknowledge or existing, but it will be removed because compliance is tied to the network profile and the template is of course tied to network profile. So if you actually delete the template that generated the compliance violation, the compliance violation will be removed.08:03So back to what I was saying about.08:24The iOS XE feature set versus actual template compliance. So a couple things to take into consideration, right? Case sensitivity of commands, right? IOS XE allows you to do uppercase lowercase shorthand. We live by that abbreviated commands, interface range commands. These things are all kind of built in functionalities.08:26Of iOS XE. However.08:46Right, the template engine will render the entire command, right? If you put all caps or or all lowercase, right? And the command doesn't fit that. It's going to render it properly because that's just iOS XE, right? And it will run and it'll push, but bear in mind that.08:50That's going to generate a compliance violation, right? And also, any subcommands, so like an interface command and subcommands interface command or an an abbreviated interface command, subcommands that come after like a description or, you know, switch remote access, they will also show up.09:09As a violation, right? Interface range commands, right? Interface range command, great shorthand, however, you know, from a catalyst center point of view, it's gonna iterate through every single one of those, every single one of those.09:29Interfaces in that range, right? And it's going to show up as violation because of course in the template, the output was just interface range command, overwritten commands, right? If you do a NO shut or a shut and then a NO shut within the same, interface, that'll trigger compliance violation. This one's important.09:46Passwords, any secrets and then encrypted commands. So commands that generate encryption will always show as non compliant.10:05Right, because of the fact that you you'll be putting the password in as clear text, but when it comes out, it is going to come out as encrypted, and that's going to generate an automatic mismatch. Right, EEM self descript self deleting scripts, and I'm actually gonna show an example of this, you know, sometimes you don't want the EEM script to stick around so we.10:15Within the actual script itself, you'll have a command to delete it.10:34Of course, that's going to conflict with the running config because the EEM script text is NO longer there. So just considerations to bear in mind, right? So I actually have an example and I'm gonna show this in the demo, but you can see VLAN generate VLAN 112 that.10:39Perfectly fine, right? VLAN 222 all caps.10:59Right? It's gonna flag as non compliant. It will still run VLAN 333 same thing because the lowercase is the VLAN command is all lowercase. So the capital V is gonna flag, right? If you want to ignore a compliance for a particular command, you do the you wrap it in the start, ignore compliance and then ignore compliance.11:04As I shown here. So you see that's been ignored even though it has capital all caps for VLAN, right? Same thing or interface gig 1017.11:23Right, you can see shortened shorthand, do it on a regular basis if you're a network engineer, but from account center point of view it's gonna flag it, right? Wrapped into start ignore compliance, it goes away. Interface range commands, you can see same thing again.11:33Right, login host, right? Shorthand again, right? And then I have an example here with the, the username, sorry the EIS user, so on and so forth. You can see that was actually supposed to be user two but say same concept. It's going to generate a.11:49It's going to generate a compliance violation because that password ends up as encrypted. Okay, so like I said, in order to bypass the compliance check, you just wrap it in the colon, I'm sorry, the exclamation at ended with the exclamation start at start and at end.12:08Can you wrap the command in between.12:28Let me go back one slide and you see you actually want to wrap the entire command. So e.g. here, you'd wrap VLAN 222 and name in the, you wrap both of those in the tag.12:31Right? And then I did I mentioned this but three.X is coming up three.one.six is generally available. It's not the recommended version yet, but it is generally available. So for those of you who have downloaded it, rules based compliance, and I believe we will be having sessions on that.12:48Coming up, but rules based compliance actually much more aligns with what customers think of when they say compliance, which is, is the command in the running config, right? And if it is, you know, it's compliant versus non compliant, so you can actually.13:07Used between string searches and regular express and regular expressions to build your compliance policy. Okay, so a quick practical demo.13:27Of compliance. So let me go ahead and toss this here. So if you see here, right, and this, this, this, this was in the screenshot I wanted to actually show it, right? So you see right here, right? VLAN 111-011-2222, so on and so forth.13:45Right, I would expect this to be compliant. Don't expect these, you know, you see right here I wrapped the app, the the VLAN 444 in the tag, same thing for 555 right? So once I run this through, my expectation is that.14:04This should be non compliant, this, and this should all be non compliant. These have been ignored. This because of the shorthand, this should ignore, right? And these because of range, logging hosts, you know.14:24This should be ignored, and then down here. So if I go ahead and just run, I'm gonna push this to one of my devices, right? We're gonna provision it to.14:39Well actually 1st and foremost, let me do this. Let me actually, let me show that there is not a compliance violation existing. Hopefully I remember to clear it. All right, let's exit the workflow. All right, so just spot two.14:56My compliance summary, as you can see, there is one current open violation from network profile. Okay, so let me go ahead and.15:13Provision this template. I will run next. Okay I'm gonna skip the preview and deploy, just apply, right? And this of course this device with open violations because this device does have an open compliance violation, that's why you get this warning. You can't ignore all to continue.15:31Right, if you're sure that, you know, the existing compliance violation isn't going to, you know, affect the template is being pushed. All right, so I submit my task, make sure that it is successful.15:51Alright, and of course my machine decides to slow down on me. There we go. All right. Okay, so 01:15, right? Successful. Let me jump to I'm gonna rerun my compliance check. I should now have two open violations.16:17Right, and if I look down here, you can see my compliance test as expected, right? 02:22 03:33 will show up as non compliant gig one oh seven, other interface range commands, right? That are not wrapped in the ignore tags, the logging host.16:37The other logging holes here that is not there and then the username right here alright and so like I said, if you, if you do want to get a little bit more.16:54If you do want to get further down in terms of compliance and our compliance works in catalyst center in general, I did provide a link, I believe there is a second link here. If if one of the panelists can share the correct link, it looks like I had shared the one for the elevate series, so if someone can share the.17:11High series.17:30Link, that would be great, in the chat. Okay, so continuing on to basic templates. So when I say basic templates, it's really pure CLI without programming syntax. It's just really.17:33Copy paste.17:53Simplest simplest form of templating, right? This is the one that most customers that are not very familiar with templating use. But also, you know, if you want to do a quick one off change, if you want, if you have a golden config that you want to, to implement and you're sure of it, and it's just a, a.17:55To copy paste, definitely. And also any changes only needing only a few lines of code. You don't necessarily need anything complex.18:14That'll be your basic template, right? And of course our reworld scenarios, so we're looking at copy paste of switch running config, you know, changing the hostname and face description, static configs, VLANs, username, so on and so forth. Right, so next kind of basic template is our user defined template.18:23Right, so this is really our CLI where we have defined a variable, right? And then of course within the variable, you can set things like a default value, the maximum of characters in there, right? The sensitive value can designate when you designate a sensitive value, literally.18:42Everything is X'd out or starred out, all the way through. So the simulation for the sensitive value, for available sensitive value is start out, even the configuration preview is start out as well. So this is, this is your passwords that you would be, that you would be potentially marked as.19:03Sensitive value, you put it in manually, you mark it as a sensitive value, and there is NO exposure of the true value because by the time it renders, it will render as an actual encrypted password anyway.19:23Alright, so we have our variable types, right? So we have our, within user under the user defined, you can have you can have a string. You can have integer, IP address or MAC address, right? And kind of sound like it is. String is definitely you know just free form text. Integer has to be number.19:40And there are, there are some formats that do require, you know, some syntax that does require a number to be in there, right? And then of course, IP address and MAC address.20:00Right, the best use case for this is, you know, if you have a value that's changing in between, if you have values changing in between devices, so like your VLANs, your svis, the SVI static IPs, if you're, if you're pushing.20:12You know, ten different, if you're pushing it to the same config to ten different devices, right? You might want the VLAN to be especially if the VLAN appears multiple times in config, you know, rather than having to put the VLAN ten VLAN ten VLAN ten, hey, make it a variable.20:30Right, the IP address, you can change the IP address from device to device, the static IP, alright, so a practical demo of the pure CLI template and the user.20:47Find, I have a new format. Hopefully, this comes out smoothly. One of the issues I was having is being able to switch between templates, but this should come out fairly smooth. Bear with me one sec and I am going to.21:07Push both of them or actually all three of them over. Oh, I still need to sign in. All right. So I don't realize it'll time me out, right?21:24There we go. All righty. So let me push push my pure and push my basic again. So while these are loading up, just something to note. So Aaron is on the call. But I.21:46I, as I said last week, I code mostly in velocity. Aaron is the ginger ninja, so to speak.22:06Right. I know, right? So this is my, these will be in in velocity. The concepts translate over to ginger. I do have resources for promise for velocity and ginger. Also these particular templates that I have.22:15I was convinced to get a GitHub so that these templates can be publicly shareable, right? So definitely the link to my GitHub will be will be towards the end. Feel free to take these examples and thank you Alan. I mean, use them and break them and do whatever you.22:35With them because like I said, you know, it's not intellectual property to me, it's just really giving you guys a primer, you know, to see what you can do. So feel free to modify.22:55Of course, usual disclaimer, these are templates so that you can base yourself on them, but do your due diligence and be aware that they may may have.23:05Consequences if you use them incorrectly. Yes. Yes. So please NO NO email saying Sherwin from Cisco and the EIS told me to push a NO shut, you know, across all interfaces on my core switch. We're on record, we're on record. I did not say that.23:20But that being said, so you can see race reload.23:40So you can see, kind of my pure CLI, right? Create create the VLANs, configure the svis and the interfaces, right? Interface gig 1010, you know, configure triple aaa, configure ACL. If I run my simulation.23:45If I run my simulation, there is NO option for that I'm sorry, bear with me 1 s. I believe I signed in in the wrong I don't have the right access. Bear with me. There we go. All right, Murphy's law is in full effect. All righty.24:08There we go. Where is it? So here is my pure CLI, there we go alright take two. So run my simulation. There we go, create my simulation, right? And we'll just do the test.24:36I run it and you can see, hey, everything run runs as expected. Now of course you see the issue here is if I'm pushing the same thing to ten different devices, right, I can't use this template in its form because I would have to push to the 1st device, come in, change the IP address for VLAN one two and 300. If this access port.24:52It is different, change that, push it coming for the 3rd 4th 5th, so on and so forth.25:12Incredibly inefficient and yeah, so it's it's a waste of time, right? But if we take this now and the changeable values, we turn into variables.25:17Right, so you can see right here, right? So my VLANs are the same, but now my description potentially will change, my management VLAN IP, SAF VLAN IP, data VLAN IP, and my access port down here, right? Really quickly, so for.25:33Specifically for velocity templating. You can see if I put a dollar sign in front of the text, it becomes a variable, but the other format is also to put the text within the curly brackets with the, with the dollar sign in front. When would I use 2nd one? Let's say e.g..25:50I wanted my.26:10Variable to be description, right? With-SVI appended at the end. If I left it as is, right? Even though, dollar signed description is highlighted as in green, from a catalyst center perspective, it's gonna think that this entire thing.26:13Is the actual variable. So that's when I would use the curly brackets. Alright, so now when I run my simulation, right? And let's do, so we do test again. Okay, and so really quickly, you can see, let me run through kind of the variable options.26:31Right, default variable value, if I wanted to. So if I wanted to pre populate like the 1st three octets you can see right here, right? The field name, so you see how man management_VLAN IP, right? Staff VLAN IP data VLAN IP, if I change the field name.26:51Right, you can see the field name is not the, is not the the the name of the variable, right? The, let's see. So my hints, right? So my hint text right here.27:12And then this is additional cover, just so you can see what that looks like. Alright, so for my management IP.27:29Alright, so when I push here, right. So you see right now that's the hint text and then that's the additional right here is what hovers over. So definitely, for the person that is creating the template, make use of those, of those features in order to provide guidance to whoever will be executing the template.27:52So I run a test again.28:12Test and then we'll do ten, 1010, and then we'll do, I'll just do ten. Okay, so you can see now, right? Description test, I have 1921682010101020103010 interface gig 1010.28:14Okay, one of the things I actually like to show, right? Is that, so what if this is not a gigabit, right? 9090 348 uxm's, those front facing interfaces are 2.5, right? 48 P those are gig. Do I need to make a separate.28:35Template one 4 gb interface, one for 2 gb interface? No. What I can do is literally.28:55Make interface speed a variable as well. So what does that look like if I go down to interface speed, you can see now it's a string but I do single select, right? So it becomes a dropdown, and now I put in my key and my values, right? One gig, two, two gig for 2.55 gig ten. So when I.29:01Run my simulation, right? Test 1010, and my default is one gig, but you can see, let's say e.g. I'm running I'm using a 9348 UX UXM.29:21You can see right here, it's 2 gb alright ok if there are NO statements and for each loops. So our if there are NO statements is if we're trying to implement logic.29:39Whether that's condition conditional logic or boolean, right? That's when you can use an if then else statement for velocity or ginger, right? And you can actually nest one if then else statement inside the other or you can nest it within a four each loop, right? Oh, this is.29:58I seem to not have edited this properly so so sorry, I forget about forget about the the common use case I'm sorry I I didn't edit it properly, but our real world scenarios, right?30:18If you have model specific and model agnostic config within the same template, one of the things I've seen customers do is if they have 9394 and 38 fifties that have one template for 9031 template for 9041 template for 3850, and they'd have a 4th template.30:38You know, for, for the general kind of agnostic config that's global, right? Nothing wrong with that, but for the sake of efficiency, it is possible to combine all those into one. If you want granular control of sections within the template, right? Being able to say, hey, if I yes.30:54This template will, this piece will run if I hit NO, it won't run or even within a composite template, right? One of the things with composite templates is as is, each template in the composite template runs. But what if you don't want every single template in there to run, you can implement an if then L statement with a yes NO.31:13Right, and I have examples of that, right? For each loops, right? If you want repetitive configs, right? If you're going through a bunch of interfaces and it's the same config all the way through, that's when you'd use a for each loop, right? And of course a forge loop can be nested within another loop.31:32Or within an if they're now statement, right? So whether or not it's a single single range, multiple range of the interfaces, right? And we saw that the interface range command does trigger a compliance violation, right? But the forage loop will not.31:48Right, and one of the things that's a forage loop, the big advantage of it over two big advantages over the interface range command is one, you can configure across switches in a stack, right? And the other thing is I believe the iOS XE limit for an interface range command is eight.32:05Ranges, that limit does not exist for forage for a forage leap. You can put as many ranges as you want.32:25Okay, so let me load up my demo for those two. Bear with me a sec. All right, let's go ahead and do my.32:32I actually have a few of these loop model trigger, bear with me, and then we have our Yeah I have 20 different examples so bear with me.32:49I want to make sure that I, I have everything there for the team. So let's go ahead and take a look at.33:09Okay, so if you take a look at this, right, so this is the example I was talking about earlier, so you see I have my config for my 9300 9400, my 3850, and then down below I have my triple A and my ACL configs.33:25Right? So you see how I have a response with the hey, you know, if it's a 903I can pick, if it's a 904I can pick for 3850I can pick, right? So those configs will run for the model, but then I still have my.33:41Triple AAA and ACLs that are global. So what does that look like? So really quickly, so you see I have my 30 day 50, but I even have an any other model alright so if I run my simulation.33:58So I have my dropdown, right? My 9300, so we'll do 10:10, right? And when I run it, so you can see I have my VLAN 102 hundred, right? And I have my triple A and my ACL.34:14If I do my 9400, right, so let's change that to 30 and 40. I'm expecting VLANs three, 304 hundred, right? And I'm also expecting the triple AAA and the ACL config, and you can see down here VLANs 304 hundred.34:31Right, as well as the aaa ACL. And then of course if I just do any other model, right, even if these are filled in, right, because it's not a 9394 3850, the only thing I'd expect is my.34:47Triple AAA and my ACL. So that is one way to implement an if then NO statement using templates, right? And a very kind of real world scenario. The other one you can do, so you if you see here, right, I have a I call it a yes NO trigger, so you can look and see I have, right. If I want to split up my template into pieces.35:02Right, so my VLAN port portion, my interface portion, my triple AA portion, my ACL portion, right? And I actually had a customer recently, use this, use this specific use this specific concept offers named ACLs, right?35:22So it looks a little different, but you can see I have right now four different variables instead of one. But now do I want to run my VLAN template if I put yes and yes, and of course I put in.35:41My info here, right? My interface speed, let's say it's 2.5 gig again, but I don't want to run my trip AAA and my ACL. So you see only my VLAN and my SVI template runs versus none of this, but maybe.35:57I want to run my triple aaa, but not my ACLs, only my triple A alright same concept, only my ACLs. Okay, so you see you have very granular control over.36:14The portions of the template, right? So you don't always necessarily have to split, you don't necessarily have to split everything up into multiple templates, right? It is, it is up to you, but for those of you that aren't able to, you know, kind of keep everything and and keep track of a very long template, you can.36:30Definitely implement something like this to be able to, you know, give you that control over the various pieces instead of having to create multiple templates.36:50Right, so my four each loop, right? You can see right here, right? So let's say I'm pushing, you know, the same config across a bunch of access ports, right?37:02If you notice here, my front and ending access port have, instead of string their integer. And the reason behind that is because of the syntax or velocity. These two dots in the middle, I do require them to be integers.37:17Okay, so if I have just one range, looks like if I run a test, right, let's let's do ten gig this time and let's say ten to 48, right? And you can see I can run.37:33Ten through 48, which is great, right? But then, you know, of course, why do people use interface range instead of something like this is, hey, I might have ranges that are broken up, right? I have the solution for you. So I now have a four each loop, but with multiple ranges and you can see I've got.37:48On all the way to nine specifically to say, hey, I'm not limited to eight ranges as you are in the interface range command.38:08Right? And of course, you know, it's just a matter of taking out, if you only want 4III did nine deliberately. If you only want four, it's just a matter of, you know, make sure you follow the syntax, we can, you know, take out the extras that you don't want.38:19So now when I run it, so let's say I have my access port speed will do ten. Ah I did not use the.38:40As gigabit. Okay, I should have done a dropdown, I didn't realized I missed 2 gb. We'll do gigabit ethernet. Okay, so we have, let's say we want to do two through ten, interface 15, interface 17.38:59Right, and we'll do, maybe, 20 to 34, right? So now these are blank. What happens? Nothing. So you can see right here, right? 234, through two through 1015.39:1517.39:3420 through 34. Right, and of course, you know, if you, if whatever range you don't want, you just leave it blank, right? And even if you accidentally put in a number and didn't finish, right? 42, you know, I didn't finish range five, the nature of.39:37This particular syntax, it requires both integers to be there, right? And of course, that's one for each loop, right? Let me.39:55Okay, so this one is an iteration of this one except that I accounted for. So for here, if you left it blank, nothing happened, right? The other way to implement something like that is to account for the zero. It's a little bit more complex because you have to account for the zero.40:16But you can see right here, so I I did smaller ranges, right? But if I put a default value for zero, right? So let's say I did, one through two, right? Five through, let's make sure ten, right? And then.40:36Anything that I don't want I put zero. So I get one through two and five through ten, right? So it's it's another way to implement the same thing. It's just, this is a little bit more complex, right? This one is less complex, less lines, but you can see it can get pretty out there.40:55Here in a single line. Either one works, does the same thing, implements the same thing. You can also have.41:15Multiple for each loops, as you can see here, right? So let's say e.g. I'm pushing a trunk a trunk as well as access. Okay, we're gonna go ahead and we'll just do the text field and we'll do.41:22I wanted to make it cool to have that dropdown, but I didn't realize I didn't finish, so we do 40 gb ethernet, right? And then our access we're gonna do just gig.41:42Gigabit ethernet. Okay, so I have my ranges, they're all integers, and on my, on my, on my GitHub, these, these will be fixed to give the dropdown.41:58I just just just for the sake of making it look nice and, and, you know, having all those features there, but definitely, you know, you can leave it as a free form entry. So when I run my simulation, what am I looking at? Okay, so we've got.42:15Right, 40 gig. So let's say my trunk is one to two, right? So just, just, 40 gig one through two and nothing else, right? And then my range is here, we'll shorten this. So instead of a zero, just leave it blank, one to twelve and then just 15.42:30So when I run it, you see I have my 40 gig 112 gig 101 through twelve, and also 15, right? And then of course, like I had said, right, one of the benefits of using something like this.42:48Versus.43:08Interface range command. Let me go ahead and close some of these out. Versus the interface range command is that I can do stacks, right? So let's say I'm configuring and I actually had a customer that had 9000 lines of code.43:10And I looked at it and I'm like wait, most of this config is just the same thing pushed across eight switch stacks. I was able to shorten it to 2000 lines of code, right? Cause 7000 lines of code were literally just.43:29The same thing pushed across the same pushed across interfaces. All right, so something like this, so you see I have my 1st and ending stack number, right? Okay, I did do that for those. So alright, so let's say I'm doing a.43:45Five switch stack, right? 40 gig, and we're doing a trunk one through two, right? And then we'll do ten through 1516, and then maybe 20 to 25.44:06So you can see I have switch one, switch two, switch three, switch four, switch five in the stack for the trunk, right? And now my access is right Ten through 15, alright, that's it.44:23Switch one through two, switch three, switch four, switch five. And what's and the thing to see here, this is 635 lines of code coming from 30 lines of code, including spaces.44:41Right, and let's say, same thing with my, same thing with my trunk and access interfaces, right? Let's say I'm not pushing the same thing across every switch in the stack. I have, you know, different ranges in the stack as well.45:00Well, I can do something like this to give me those different ranges in the stack. Only the two ranges this time, right? But see once again integer, integer, and if you look, right? Let's say I'm doing, one through.45:16Two and let's do six, six to seven, right? So trunk will do one through three and then we'll do ten through 20.45:3325 and then 30 to 48. So what happens when I run this? So you can see, I get my, where is it? There's my switch one, there's my switch two, there's my switch six, here's my.45:48Switch seven, right? So even across.46:08In the stack, if you're not pushing the same config to every to every switch in the stack, you're able to, right? You're able to with a template like this, implement something like that. Right, sorry I'm I'm kind of browsing fast cause I am looking at the time.46:11Alright, and there we go, switch seven. Alrighty. So hopefully everyone is still with me. Hope everyone's still with me. Hopefully this has been helpful so far. Hopefully some ideas are sparking.46:30Right, in terms of things you can do, thank you Brandon. I I see the thumbs up.46:49Okay, so everything that I've shown Alan yes, everything that I've shown so far can be done in day zero or day end templates, right? Mccally, thank you, right? In day zero or day end templates, right? So you can do either as a brand new fresh out of the box, onboarding.46:53Right or you can do, hey, the device is already in inventory, right? Did I closed my Oh I didn't, right? So you can see here, right? None none of none of these configs are really.47:13Specific to, hey, I need this for this particular device. So it does require you to know, kind of ahead of time, hey, you know, this is a 40 gig interface for that trunk or 25 gig or a hundred gig, right? Because of course if you push the wrong interface speed, it's gonna error out, right? So now.47:29How do we get to.47:49A bind to source and system variables, right? So, system variables, just quick primer, right? Shows device specific information, right? So if you have ever, I'm gonna hopefully this shows real quick, if you've ever looked when a device is going through the onboarding process.47:51In catalyst center, right? Let me see if I can zoom this a little bit. I'm real quick in my OneNote. This is what you it looks like on the back end. Lots and lots of show commands, show CDP neighbors, show VTP status, show access list.48:10You know, show AP summary file system, spanning tree, platform, switch. I gotta show you, you gotta show, everybody gets a show, right? So this information is ingested in, into catalyst center into a backend database.48:30Right, and that's what gives you, you know, when you're able to look at device details and you see things like, you know, the port name and so on and so forth, right? But you can also take that take that information and incorporate it directly into a template.48:46Right? The thing of course being that the device does have to be in inventory because of course brand new fresh out of the box device, that information has not been collected yet, right? So the difference between system variables versus bind to source variables, right? The system variables are, the information is populated directly, right? The bind to source.49:061st variable is.49:26A variable that user that's user created, but it's bound to a system variable, right? Versus system variable, you can't actually call it directly, right? So let me go ahead and show my, oh, well, before.49:27I show my demo. Let me actually show a and this template is available in the GitHub as well, right? Some of what that, that screenshot 1st showed are parameters.49:46Right, that's collected. So as you can see it's a gender template, so you know that I did not create this. This was done by one of my colleagues. All right, but if I run my simulation oh don't worry Aaron, that that's that's that's in my, that's in the resources. Trust me. So if you see right here, right, these.50:02Are the system, the device and the interface system variables that you can use.50:22Right. Some of them, as you can see, are useful just to the system like instance UUID, you know, you know, boot time, not necess, not really necessary, but you can see host name is a system where we can potentially use, right? Mac address or IP address.50:27Right, from a device perspective, from an interface perspective VLAN ID status up, down port name, right? And I'll have examples of these platform ID, right? But I just wanted to show that with this particular, this particular template, which is available.50:45You would be, you can see, not just the actual value, I'm sorry, not just the actual key, right? The system variable, but the actual value as well, right? So e.g. admin status, that that S is capitalized and up down.51:03Has to be all caps versus just status, right? If if something's connected, it's all lowercase and up down is also all lowercase. Okay, and I and I I included, you know, a list of helpful systems.51:19Variables in here.51:39Right, and some of these I do I do have in exact I I do have in my template examples, right? A platform ID series, you know, for interface status, right? Admin status is, you know, whether it's admin disabled or enabled status, anything physically connected.51:40Right descriptions, so on and so forth, right? VLAN ID, right, as well as voice VLAN, right? I'm gonna, I guess I can I can skip this, right? But like cause we we talked about source.52:00Right, it's only oh you only use the information that's gathered in an device discovery process going to be using day end templates, right? So let me actually pull up a couple of practical examples of 1st bind to source as well as system variables, right? So.52:17I'm gonna go ahead and hopefully I'm not giving anyone anyone motion sickness switching back and forth. But one of the things I have noticed is that when I worked with network engineers, just kind of in general is your access ports tend to be kind of, hey, you know, that.52:39One too many range, your trunk ports tend to be very onesie twosie.52:59Right? And so if you wanted to be able to, and especially because a lot of times your access ports across different models will be, you know, gig or two gig, right? Those front facing, I'm sorry, 2.5 gig, but your trunks might vary from model to model, right? While the access might be the same. So to account for that, you can do something like this where it's like, hey.53:04You know, this particular piece right here, you'll put you'll pick the trunk space on the device, but for the access ports, you can do do that general range. Right, so you see here my trunk port is a bind to source variable, right? Multi select.53:23Right, to allow me to do more than one, right? And it's inventory, inventory, interface and port name, right? And then my access port stays the same in terms of the ranges. So if I run this, right, and you see now it's bind to source, it's telling me I have to pick a device that this applies to.53:38Okay, and I did kind of pre select, but you see I have my 40 gig 112, right? And I can actually also use this to say, hey, you know, these are gig links. So make sure down here that it's access speeds of gig. I do ten through 25 and we do.53:56We'll do ten through 25 cause I believe this is a Oh NO the oh so 24 so ten through 24. That's a good way to be able to check right here and stop and see, ok, so I shouldn't be good. This is a 24 port.54:14Alright, so when I, when I run it, you can see I have 40 gig 11211, right? And then my ranges. Why are they not in order? So this was explained to me as the way in which this information is collected and then put the.54:30Into that back end database, it's.54:50Difficult to alphabetize it by name like this. So one thing to be aware of when you are doing, when you are running, either buying to source or logic that's doing a direct call for port names, right? Is that you want to make sure that.54:54There aren't any configs that are dependent, you know, one port is the one port's config is dependent on another because there is a high likelihood that the ports might be pushed randomly. Okay, so just something to something to keep in mind, right? And of course, I have another one for.55:13Or if if you if if you'd like to have both, you know, you pick for both instead of just that range, you can very much do.55:34Have both of these be bind to source variables, right? And you can filter as well. So let's say e.g. I wanted to say filter by port name. So I wanna, and I only want my, my.55:42My gig starts with gig, alright so I want, so for the for the interfaces I pick, I don't want for access, I should only be getting my gig interfaces.55:59Alright, so when I run this, right, we do test, if I look at my 9300, right? So let's say, right. So you see I have all these options for the trunk, but for my access, I only have.56:17My gig interfaces. It's a little bit more, you know, lots lots more clicking versus the other option, but definitely you see how I'm able to, you know, and this is based on device. So, I believe.56:31Are they all 93 hundreds? They are all 93 hundreds. Oh, NO, they're all, they're not all 93 hundreds. Okay, so this PMP switch, right? So, not sure what I think this is a 9600, but you can see my interfaces are different.56:48Right, you can see that my interfaces are different here because it's not the 40 gig and then a bunch of gig. These are ten gig because this is a different model, right? So bind to source as well as direct calls of system variables, you can actually, it will give you the options based on the device. So if I was pushing to both a 9300 and say a 9500.57:06For each device I would have these options to pick from.57:25Alright, so let's apply that we'll do gig zero from one. All right, when I run it, you can see 40 gig 110-21-1110 gig one oh 2116, and then interface gig 101. All right, so that's bind to source.57:29I can also do a direct call from the system, from the system variable.57:48Okay, so as you can see right here, right, and this is where you can see lots of nested for each and if then else statements, right? So for each interface, right, and you see I'm calling port name directly, right? Nice conditional statement here. If it's Bluetooth app gig port channel gig zero, don't do anything.57:56Right, because you don't want to accidentally include them, so make sure to put your exclusions 1st because just like with an ACL, right, it goes from top down, right? So if it matches the 1st thing, it'll stop it it it it goes it if it matches from 1st on down. So the 1st thing that matches gets removed.58:16Right, so if you see right here, right, LCF, right? So for, and this is just for my access ports, right? And so now I have Okay, this is actually slightly wrong.58:37No, it's not, ok. So for all access ports, right? I want to push this for my trunk ports, and you see right here, right? I have interface type, right? Port mode, right?58:55So physical and then we have trunk versus access, right? That, that template I showed with the parameters to show whether or not it's capitalized, right? And so any ten gig trunk, any git trunk, and then all other trunks, and you can see this last one, right? That last F F is to capture everything else. If I put this 1st.59:10Right, this gig and this ten gig, they wouldn't fire because everything would just be trunk. And I'll throw a voice VLAN in there. So let me, so let's see what it looks like for a 9300.59:29All right. So you see lots of there's a gig trunk, ok? Are there any ten gig trunks in there? No, only gig trunks. Okay, let's see what it looks like for that PNP switch. Oh, ok.59:48Only a ten gig trunk. But you see, right? That the ten gig trunk is VLAN three four and 500, and the gig trunk is VLAN 607 hundred. And you see I did not have to.01:00:03Do any picking of what type of device, right? These devices are, are already in inventory, right? And so based on the logic, right, this information has already been collected, it will go ahead and apply the logic. So if you have 1015 20 different devices.01:00:20Right? And this is where we get into this intent, network intent, right? Rather than having to manually kind of, ok, this is an access, this is a trunk, and then I want to, you know, push, I have to go through and push, ok, for the ten gigs, do this, for the gigs, do this, for the 25 gigs, do that.01:00:38Right? Easy doing one switch, much more difficult when you go across, you know, 152-030-4050 switches versus with something like this, right? And the sweat equity does come in at the beginning making sure that my logic is correct. But once you have to set up properly, you can push this across as many switches as you need to.01:00:58Right, and it's not just limited to interface you know name and type. You can also push config. I'm not gonna do the simulation because this is for the raw. This was developed for the, for another switch, but you can see you can't.01:01:18We're gonna actually push based on description because description is one of the things that's collected.01:01:38Right, so you can see right here, right? So if the interface, if the description contains VM Nick versus PNP versus 32 versus 9115, right? And you can also do regex, right? So if it's 9115 for one thing and 9115, you know, 9115 building 9115 AP, 9115.01:01:44Lab, right? And you want to determine between those two, you can do regexing, right? So just showing, not gonna do a simulation, but just showing that you can actually push based on description. And there's nothing stopping you from combining, you know, description along with, you know.01:02:03Port name starts with import mode and physical, right? This is another this is one of my kind of favorite This is one of my my favorite templates here, right? So remember when I did the, the model.01:02:22The trigger?01:02:42Right, and for the model trigger I had the dropdown, right? That showed, hey, is it a 9300 versus 9400, and I had to pick, right? Because switch platform is one of the variables that's collected.01:02:45You can implement the same thing, but now you can push it across 50 devices because the system itself is going to determine, hey, is it a 93, is it a 94, is it a 3850? So real quick, I'm gonna run this simulation. You can see.01:03:04So if I pick the 9300, right, and we do 1010 1010, we do 10102010I like tens, right? So hands when I run it, you can see right here, right? Vlans one on 200 because it's a 9300.01:03:19My PNP is not a 9394 or a 3850. So all I'm expecting is my global config, right?01:03:37In addition, right? You can also do switch stacks, right? If you've ever noticed, right, if you look in a device or we don't have any stacks on here, but if you look in, in the inventory.01:03:54Right, so let me share one quick really quick. Just wanted to give you a time check our time to do this session. Okay this is this is my I didn't get to do my EEM script, but this is this is gonna be the last one ok that thank you thank you for the reminder.01:04:15Right, but this was actually developed in conjunction with another customer that wanted to be able to push, hey, the 1st switch, the 1st interface in every stack. The 1st switch in every stack, I wanted to push.01:04:36The same, they're all uplinks, but I wanted I didn't want to have to check, hey, is this a12345 switch stack? So if it's a, you know, three switch stack, it should be 101-12-1311. So I don't have any switch stacks here.01:04:50But as you can see in the simulation, because this is a single switch, right, it'll just be 1011, right? So if it was three switch stack it'll be 10112131. Okay.01:05:07Thank you for, thank you for the reminder, Aaron. I get very enthusiastic when it comes to templating. EM scripts will probably have to be another session. There's some great stuff on there, but I am going to pass.01:05:23Pass it over to, golf, for the for the APIs. Yes, before, before you pass, right? Can can can you I mean give the brief introduction of the script with the template, right? So you know.01:05:43Golf. Thank you very much.01:06:03That thank you for thank you for giving me that opportunity. Let me go back just brief, there we go. Okay. So EEM scripts are actually part of either iOS or ISXE XR or the.01:06:06Legacy iOS, right? Or NXOS, right? And of course.01:06:26Access to it is dependent on, on licensing and the actual OS. You can confirm the capability by just running show event manager version, right? And so the thing with the just EM scripts in general is.01:06:31You can push either manually or based on an event, right? So you can push a config based on a syslog message, based on a CLI command being run, right? And then you can.01:06:47Based on that actual triggering event, you can take an action, right? Run a CLI message run a CLI command, run a syslog message, send an email, right? And so I, and I won't have a chance to do the demo cause I will.01:07:04I definitely want to respect Golf's time but one of the things that's important though with EM scripts, it does bypass the day and line by line requirement, right? So if there is a scenario where, e.g., you do need to be able to, you know, briefly lose connection. E.g..01:07:23People had a customer who had to do a configure a routed port, right? Routed port you have to run.01:07:43No switchboard. You run NO switchboard and that switch drops, and of course it loses connection to call it center and if it was a standard day and line by line, it would have stopped at that NO switchboard command. But with an EEM script, you are able to account for that.01:07:48Put in a timer.01:08:08Right, to bring that interface back up because the entire EEM script will run right before going on to the next line in the template. Right, so I don't, I I wish I could do the demo. It it's fine golf. I do have the EEM.01:08:09Scripts for bouncing the port. So in case of like say that NO switchboard and also appending CDP neighbor to an existing description. I did have a customer that was looking, they wanted to be able to tell what's on.01:08:29What's connected without having to run show CDP neighbor that ok go now thank you and maybe a potential video are in order for your new git. Yeah, I believe that your CDP idea would be maybe what.01:08:45One of our app one of our attendees is looking for in terms of handles. So.01:09:04Let's move on to golf, shall we? Yes, go ahead golf. My apologies. Yeah, it's ok NO worry. Yep. So I'm in my session I will talk about this deploying template right using the.01:09:12API instead of GUI. So before I dive into the demo, I would like to talk about the methodology or framework or the workflow that I use when I need to develop any automation tools, right? So the 1st step, right? Before I do it.01:09:28Anything before I think about developed the the tool, right? I I need to understand I need to define a use case 1st. So I need to understand what I want to do, what I want to achieve and this is going to solve any issues that I'm.01:09:48I having is if will it be able to increase any productivities or it can save my time or it can do something that we cannot do it with with the with the GUI, with the graphic graphic code to say interface. So if it if if the idea doesn't.01:10:06Have anything I I suggest you to to to use a GUI instead because that is a more effective way to to use use our Cisco product, right? So.01:10:26Unless you want to, to learn from from the from from from the developing this tool, then it, then this is ok, then it's fine. After I got this right I got the idea. The next step is I I will have to map my requirement to the API.01:10:41Necessary API endpoint. So, so from from the requirement, right? I need to understand what what are the API API endpoint it can use. If.01:11:02If if I have the idea and then I go to 2nd step, right? And I cannot find it API endpoint that can, can deliver what what I have in in the 1st step, then, then that project going to be impossible also I have to.01:11:13By the other way to to do it. If if it's possible then I have the complete API workflow in 2nd step, that is what we are going to focus in in this session. The 3rd step is I'm going after I got the API workflow.01:11:32I, I I will develop the application based on using that workflow, I can use any tool, any programming language like Python and playbook or even Cisco workflows, right? In the dashboard, you can use that also, create the the real.01:11:50Application to to to do the to deliver the, the, the 1st use case. And then after I got the application I will need to do the validation and testing because even even if we have the application already it can fix the issue, right?01:12:10But it can also generate the the issue, the new issue also. So we need to think about how this application can, is there any possibility that it will will will create a new issue, right? And and test them again that that.01:12:27That poss possible issues after finish everything you you will get the automation tool, the new automation tool but in this session we focus on 2nd, second step, create the API workflow, ok?01:12:46We know the the so we talk about what what kind of tools or information you can use to to help you create this, right? The 1st the 1st tool is documentation. I know that in the centers we have the very good.01:13:05Api's record document right in in in the GUI, in the in the products itself, you can also test it in the GUI. But I I still recommend you to look into the proper.cisco.com because it have more information, this have guys have sample workflow also, so you don't have.01:13:24Develop your own, you know, test tell the whole process again for 2nd step. If it's have the workflow, you can just look at it and and reuse it in the 1st step, right? It's also have the API reference and also open API specs that I will.01:13:43I I think it's really, really important really very very important resource that you can use. I will explain it later why, ok? And also the code exchange that you can do some research for the existing application that somebody some some friend, Cisco friend or or.01:14:01We have and the project chain, ok? 2nd tool is whether you you know all the API that you need, right? You need to extra them. You can use the APIs recorder in the graphic in the center GUI, right? To to run it to test it but it's.01:14:21It's only I mean, if you do that it's like a manual, you'd have to put everything into into and then click run it many many times, right? You cannot reuse them. So I recommend you to use a tool like API application, API client application e.g. postman or.01:14:42To do this. Use this using this tool, you, you can test any payload, you can save it and then you can have the workflow, the complete work workflow and test it in in in your in your lab anytime.01:15:04Whenever whenever you want, right? Okay, the 3rd tool is when you need to implement the automation tool. If, if it's possible, if it's applicable for you, I recommend you to use Python SDK or any SDK that Cisco have in the developer.cisco.01:15:19It help help you.01:15:39Charter dual development time. So you have the SDK, you don't have to build your own library to interface with centers anymore, right? Another two things that you may have to to have, I mean is it's not some somehow of the knowledge that you you may have to to have.01:15:43Have it when you develop the automation tool for the center is how you going to handle the asynchronous tasks because all the time center is asynchronous, so you you have to have a way that you are comfortable to monitor the tasks and then handle the task when the task is failed.01:16:02It's it's it's it's is there is NO rule for this one so you may have to develop it yourself. 2nd thing is how you will handle the order pattern in into application, right? You will have to do some kind of the order handling.01:16:22So these these are tools and then for to develop the API workflow in the center is start with 222 API process in the very high levels one is authentication. You will have to do authentication with the center 1st to.01:16:41Get the token.01:16:59To use in the subsequent tasks and 2nd step is the intent tasks is actually to talk the group of API that you are going to achieve that your outcome, right? So you need to understand what what this this API workflow that you are going to use and this what and.01:17:01This is what we are going to talk and demo in in our after this slide. I will show you to explore the API in the developer in our document and then come up with the template deployment API workflow using the API workflow API group of API.01:17:21API that I'm going to tell you in in the demo. So go to the demo and then we will come back again to the PowerPoint slide. So from a demo, I would like to show you.01:17:41Oh, can you still let me share my screen again? Your screen is not showing. Yeah. Yep. Thank you. So 1st I I would like to show you the developer.cisco.com 1st into their may not.01:18:01No this before. So in the developer.cisco.com you go to go to networking and go to you will find all the information about here, ok? For the API, you go directly to this docs.01:18:21Here in the tab, right? So in this right I I will point you to some information here in in this right 1st thing you need to understand is this in this webpage this webpair is there, there are all the all information about all.01:18:38Percent version, so you will have to select the version you were using right 1st by click here.01:18:58I'm using this two.three.7.ten so I select this one, ok? From here you can go to authentication 1st understand how how you will going how how how you will going to authenticate with country centers and country centers support basic authentication, so.01:19:04You can find more information here. I will not go into that detail, ok? Because I don't think I will have enough time and then you can go to.01:19:24This getting started guide. This one right this document you will find a sample sample API workflow to hear the information from the center query the inventory information. You will have the way it will tell you how to create the collection to do that.01:19:33Yeah, it can be a really good example. You can do follow the document and you will get something that you can interface with the center, get the information out. And then you you choose check check this from time to time for for API chain lock, right? When you do upgrade the centers, API also.01:19:51Also change so you need to understand you need to maybe before you upgrade you check this so you you see if there are any impact with your already have automation tools that use the API from what maybe five. Some API in that tool maybe.01:20:11That already or maybe sunset. You may need to update API to to make it still working in the newer version like two to seven.ten. Yep, so.01:20:35So you need to check this, right? And then you can click this guys with a guy here. It will give you some idea about the life cycle. I I just want you to focus on these two things deeply created.01:20:47API that are obsoleted will there will be removed from from from the from the that API that have sunset.01:21:06In the header when you when you when you find this API in the API documentation if if it's possible you you you should not use it because it's going to be the prepared soon.01:21:20In the later version, right? So, so if it's if it's not possible, you may have to use it if it's only API that you need to, you can use for for to achieve something that you want, but if it's not that.01:21:39Cares, you should not use it. There will be another API that can be can do the same, ok? So you just need to to to find to search for that API in the, in the document. The other information in this guide, right, is the sample workflow, right? Like the command runner work.01:21:52It will give you the the detailed workflow so you don't have to do the step two that I'm going to talk about to create the API workflow for you. But it's, it doesn't have everything so including the template right you don't see the deployed template here. So I'm going to to show you.01:22:12And then you can go to API left friend here in the API left friend, right? 1st thing.01:22:33You see this, right? This is open API document. You can download it. Why is this important because right now we have AI, you can do AI why you can do whiteboarding, right? But AI is always have it, right? It's it's it's.01:22:40Nobody that actually doesn't know. So.01:23:00So this is a very good result that you can use with your AI. You load this document to your AI and ask them to create your the function to interface with the current center based on some tell you that use the information in this.01:23:02In it.01:23:22Open API spec, consider all this respond payload respond request payload and everything that here in the document, right? And create me the function. The AI will will will will give you the core that you.01:23:23You can use use it and you can test them. So this this one is very, very useful and then you can go to the API here.01:23:43These are all the APIs that support in this version. Okay, so 1st I'll go to the authentication API, Authentication API, right? This is the 1st API that we we need to use for the template deployment.01:23:52If the open API authentication API, what you need to know is if required two things, one is the headers content type and another one is authorization header. So content type had to be patient and authorization is all is supported authorization.01:24:08Yes. Yep. I just wanted to give you a time check. We got about 5 min left off. Yes, I know that yes for the authorization right now if we support tool authorization, another one is using the AS encryption.01:24:27But using AS you may have to configure on the center 1st. Go to the Bruno.01:24:47Yeah, this is what I'm going to want to show you. So to build a API workflow, right? What you need to to know is you need to know that that we need authentication and then you need to build to know the intent apps that you want, right? So for the template deployment I know that I'm going to use deploy.01:24:55If you go go back to this documentation when you say deploy template, right?01:25:16It will show you two versions I'm going to use the version two. These two version is most most 89 % is it there is everything the same. The difference is the the response, the response payload. The version two, the response you get is tax ID, the version one.01:25:23You get the deployment ID, and then you you will have to use the tool like to create the create the whole.01:25:44The deployment template deployment API workflow, ok? So from here, right, I I already have have authentication, ok? And after I get I run it to get a token, I use a token here.01:25:53To build the, the, the full API workflow, right? You need to understand what is the dependency, what is the, the, the, the, the other API that you need to add into the workflow to make the complete process. You do you cannot know that because Cisco doesn't have we we have some sample but not.01:26:13For this deploy, deploy template, right? So I use deploy template. I go to the document and know that it doesn't need extra header, it doesn't have.01:26:33Parameter query, right? Is the body, the body here. So I need to understand what inside the body in inside the body, right? It's, is needed some information right? What do you want to put the template for temperature. What it says the 1st boots template is.01:26:44But if the template is already deployed your device it will not push the if this parameter is false, so I give it through so It's have the template ID or ok template ID is this I cannot provide a template ID right that that I know, this is one, one parameter that I cannot.01:27:04Provides the user cannot provide this information. Another one is the another thing is target info target info is this the actually the list of device that we are going to deploy a template? Okay, so I expand this.01:27:24In this packet info, right? What it has is have the device ID or device name. So this is another information that I I, that I I require to to use this API, right? So, so after I know this, right, what I I need to do is I need to find.01:27:39With the API that can give me these two information in 2nd step right from this I add two API, get device.01:27:59To get the device ID and then under the API called get template details to get the template ID. Okay, and when I use data right now I can run this deploy template version two already because I have I have 2222 more device and template ID, so I will.01:28:07Try it here to get every all the information after I I I run it, I get the device ID and template ID here you see that, right? I I can run run this, right? Another parameter in in the target info is a viable parameters use.01:28:28Already told us that we have to tie up whatever, right? The the number of.01:28:48It is here in object, so you you will have to put our variable that you need in that template here. Another variable is a system variable. If you have, if you use a system variable in that template, right? You need this resource parameter parameter resource parameter. In the resource parameter is actually here.01:28:54What is the result you you you need to use so it can hear it that result for for for the system and and I'm going to use the device ID here so I I need this result right there, ok? So these are two two things that you need in the target info other than.01:29:15And device ID. And then after I I I have everything I run it, it gave me the targeting for ok I thought the time before, right? So.01:29:34So after I got this, right, I know that, oh, it doesn't give me the result, actually it's give me the task task ID. I need something to handle this, right? Then it's come the next three API that I need. I I use tasks, get task by ID, API I use get tasks detail.01:29:44By ID and I use this status of template deployment API to get the information about the task. What I do is I get I use this 1st API get task ID to continue the task ID, this high ID and.01:30:04In in the response, right? I have this end end time. The end time I use this end time to identify whether it's or not. Even haven't been finished yet, there will be NO end time in the response. So I in my I I will monitor this end time until there is end time. After I.01:30:20I check the status. If the status success, then my court I can figure my court and and and return the the the the result. But if, if my status failed.01:30:41Then I need something, right? I need to understand why it failed. So I I used that another two API called get task detail by ID to get the deployment ID. It will give me the deployment ID here in the postman, right? One thing I haven't told you yet.01:30:53Is have the the script that you can use like some information and save it into the variable, and then you can reuse is in the other API activity in in your workflow.01:31:13So I grabbed this deployment ID and then I use this status of the the whole information about this deployment process because everything is ok, but if it failed, you will find the reason why why your deployment needs failed here and then you you.01:31:29Can have the report and you can use that to to update your templates or whatever, right? When you use this, get this right you use the postman or the the.01:31:49The good thing is you can reuse this the whole thing anytime you want by run the whole process here. So you can test it whenever you want before you implement it in your application. After I, I got this, I use this in my code, develop it with my.01:32:01Type Python.01:32:21You know, programming language and then I got one application ok so next is because we we don't have much time, right? I I'm going to summarize what I show you here 1st before I go to and 2nd demo. So.01:32:22We know that developed the application using API on the center, we need to we know two things. We we have the high level API using authentication and the intent tasks for the template deployment. We we have this template deployment task, right? To understand the.01:32:43The prerequisite.01:33:02API endpoint or or the the subsequent API endpoint that we need, we need to understand this trading. What is what are our, is there any query parameters? Is there any request payloads? Is there any response payload that need that we need to fetch the.01:33:04To get the information from the center if if if there is that kind of information for the parameter and the and the request payload, right? We we need to identify the the the prerequisite API in point like get device list or get template ID that I.01:33:22Show you. Okay that that is for for the for the prerequisite API endpoint for for for the subsequent API that we need you you check this last one payload. If the last one payload is only the result, then it's if then it's, if.01:33:42It's it's done you don't need any other API to get to do any, any, any task monitor or any, any, any other process. But if if it gives you the tasks like task ID or the ID like the file ID.01:34:01And you need to have another API call to to deal with that task ID and the and the and the and the file ID in the response. So this is how, how you identify and complete your your API API workflow, right? So this is the.01:34:18The API, the whole API work for for the template deployment work for that I show you using bruno. The next step is I'm going to to show you the demo using my Python script right so in this demo, what I'm going to going to do is I have a switch, right?01:34:36The this switch right there is some requirement that I need to, to fix the service configuration if if the switch configuration doesn't have the VLAN ID in the description and this and the VLAN ID in the service port.01:34:58If if it doesn't have have the the the in the description, the same as the ID in the service part. So I I will have I need to, to create the application that can read all the device in my country centers.01:35:17I put the device name here and then around the script to get all the configuration from the device and then after I got all the configuration, the skip will compare the con the interface, description and the interface VLAN. If it's this match, right? It's do nothing. If it's not, if it doesn't match, it will keep.01:35:33That information into somehow the database and then the script will run the template deployment and show you to fix the issue with with with the template that I already have in the country center. So I'm going to run this script.01:35:53Right? Does the template name in the center is named update their action VLAN ok and 1st thing my script do two things. 1st is can do check only and and and it can do deploy a template also. So I will do check only 1st.01:36:09Before I going to do a template deployment. So the 1st step is, is get the device ID, right? Get and then it get the template ID and verify the configuration and because I haven't put them more to deploy the configuration yet, so.01:36:30It's.01:36:50It didn't do anything. So I I resend this mode again to deployment mode. Yep. Almost done, ok. So you do the same thing, get the configuration, check the.01:36:50The device ID, check the template ID and then deploy the template to to the only this part two part three at two device, right? Yeah, you see that it's deployed a template and then get this result. Okay, go back to the, to the device you see that.01:37:10The interface description and is fixed. Okay, so this is some of the use case that we can use to create a more conflict workflow and use the template and API to deploy the template to fix the the issues in the template.01:37:30Right you have the variable, but this variable can be.01:37:51Can be also dynamic variable that support, right? We can use the the script or the API to with the script to, to, to get this value of this dynamic variable and put into the template using the template API.01:37:54Okay then one another thing I want to tell you I almost forgot is the for the template that you you use API to deploy to the device in the country center if you're using GUI, right? Template have to to attach to the profile.01:38:12Right? That is the requirement but for the API we don't have that requirement so you can have the template that doesn't have the doesn't have attached to any profile yet and use them.01:38:29And to deploy the configuration to the device. That's something that is different between the API deployment and the GUI deployment, ok? So I'm going to give it back to yep.01:38:45Hi, I just do that? Yes sir. Thank you. You're on mute Sherwin. How is that? Is that better? Much better. Okay. All right. So for everyone that has stuck with.01:39:02Because I see, I know we're 10 min over and we still have a hundred attendees. So we definitely appreciate it. We love the enthusiasm for the topic. We like that you stuck with us.01:39:22And for the purposes of the recording, I know a lot of people didn't have to leave. I am leaving just for a little bit on here. I'm leaving the links to resources. So we have Catalyst Center catalyst center YouTube channel. Aaron's GitHub GitHub on templating.01:39:35My velocity templates, GitHub, another really good resource is of course of course Keith Balwin's GitHub. Then we have a primer on velocity templating and we also have a ginger templating tutorial in Cisco U by the ginger engine himself, Aaron Dallason.01:39:56So definitely leave it leave it up here for a little bit just so for any viewers who did want to go back and.01:40:14You know, get to these, definitely feel free. Also, if you do want to make arrangements for one on one engagements with the customer success team, definitely reach out to your Cisco account team and they can put you in touch with one of the csss.01:40:23Yeah. One one more thing I haven't had my I the the correction here yet, so I will put it in into so you guys can yeah can download that and and play it yourself.01:40:42Yeah download link that's online Gulf, you could put it in the everyone chat in the webinar and that gets included with the recording. So that'll be there when we post the recording online. So if you've got a link just post in the chat. Yeah, it's through internal. So I, I think I will.01:40:58To use to have NO obligation and liability I think that the next the next plan would be to, for Aaron, Peter Sherwin and myself to encourage golf to put his templates and his work in again.01:41:18I agree. Yes, indeed. And we're already talking on the side about creating future expert insights sessions on APIs and automation completely just a sole session on that. And you'd mentioned before the rule based compliance.01:41:40I'm planning on creating a, a session for that as well in the near future, so those will be upcoming. Okay. And also EM, right? This is this is the the secret, the secret sauce. All right. So don't forget to fill out that survey and let us know what other.01:41:58EIS you'd like to see.01:42:18Yes, and as you as you can saw, as you can see, we do pay attention to those surveys, so definitely for the 91 of you that are still on here, please fill out the survey. When you close, when you exit the session, you'll get the survey, we, that feedback is valuable. I use the feedback.01:42:20From last session to make sure that I had a sp a piece on compliance for this session. So we do, take a look at it. Let's us know how we're doing good. I know one of the feedback is I probably need to cut down on time, but like I said, we incorporate this feedback and definitely as best as possible, try to act on it.01:42:40That being said, it is 02:43 Eastern time. For the 87 of you still left, thank you for sticking with us. We hope that you enjoyed the session. We hope that it was informative, definitely go on to have an absolutely great, wonderful day.01:42:59Thank you. Thank you everyone. Bye bye.01:43:15

About this Video

Author : Cisco Customer Success

Uploaded : July 17, 2026

NetworkingCatalyst Center
AI summary icon

AI summary

Explore how Cisco Catalyst Center scales network automation with Templates. The recording demystifies Template Compliance as a diff engine, shows frequent violations (case sensitivity, interface ranges, encrypted secrets), and applies ignore-compliance tags, plus an overview of Rules Based Compliance. Build pure CLI and user-defined variable Templates (string, integer, IP, MAC, sensitive), add hints, and use if/then/else and for-each loops to produce stack-aware configurations without interface range limits. See Bind to Source and System Variables drive intent-based changes by model and interface type. Learn EEM Scripts for event-driven actions and an API deployment workflow with authentication, IDs, task monitoring, and key differences from GUI.

  • Enable and deploy Templates with variables, conditions, and reusable loops.
  • Activate and tune Template Compliance and Rules Based Compliance policies.
  • Use APIs and EEM Scripts to automate precise, model-aware changes.