350-401 ENCOR – Cisco CCIE Enterprise – 6.0 Automation part 3
January 27, 2023

9. Edit the service model YANG model file

In this section we’ll edit the service model. That is the Yang model file. So what I’m going to do, I’ll go to my SNMP folder and then I will go to the Yang. And then with help of my VI editor, I will edit the Yang file. Because in this case, I want to edit this in terms of my SNMP service. So what are the things that I’m going to change into the default program? That obviously those things will be related to my SNMP service. I’m going to apply SNMP service to one of my Cisco device where I have my SNMP template. Then I have my SNMP community string. And over that I have either read, write or read only access. So this access, you can see that it is done via Leaf access in terms of enumeration read only or read write. Then the community string. So I have this Leaf community string defined here.

And the Leaf device, I can check which device I’m going to use from here. Then I have the common SNMP template which will be here. Okay? So doing all these things, I’m going to import one TailF common function as well. So I will import that as well. Let me show you all these things in CLI. Let me go to the CLI. I have my CLI here. So from here I can go to my source and then Yang. Okay, if I do LSLA, you can see this is my Young file. Let me go inside SNMP young. Okay. So here you can see this is my default template. And here I want to add some lines. So let me add all those things. First of all, I want to add, say import the tailiff comment and then prefix is Taylor. Close this. Okay. Then I have this list, snmpt one that’s okay. Key name I want to give my key name is Community string. commest here. That’s okay. So here you can see the browsers. They are open. And then we’ll check where it is closed. It is open means we are writing the common template for my list.

 Inside this list I have Leaf name. So leaf name. Before changing that, let me add info here. Say tailfinfo. And that is my SNMP server, community string. Okay? Now what I want to do with this Leaf, that my Leaf is say Community string. And then the type is obviously the string. So that’s okay. So we are very much done with this particular section from here to here. Now the next section, you can see that. Let me show you the full program here. So we are getting one note here that may replace this with other way of referring the device. So let me change this notes. And what I can do here that I can write my own notes. Change this to Leaf for one Cisco iOS, something like that. We are writing this code for one device. Now, here what I can do. That I can add a leaf. So let me add that and can give television that say pick any one Cisco iOS device. Something like that. So what basically I’m doing here that I am adding an option that you have to pick a device. Then we have the Leaf list device. So let me do one thing here, because I am writing this only for one device. What we can do here, we can remove this line. I don’t want list. I want only one device. So that’s why I added the information. Rest is okay. This is okay. The path is also correct. Then finally we have this note that replace with your own stuff here. So what I can do here, I can add let me scroll down so I can add my Leaf device here. And for that Leaf device, what is the access level? Because finally I have to add the access. Either read, write or read only. So that’s why let’s add those things. So let me delete this line because Leaf access I want to give Enumeration here I can add the info first so you can see the structured programming. That what I am doing. Specify read only or read write access.

Then we can go to the next line. Next line I can add say type enumeration then what is that type? The type is read only or read type. Now finally we can put notes here that this is for Say leaf access. So we come to know that where I’m closing my browsers. Otherwise, if any of these mismatch parentheses will get error while compiling this, okay, this will be say list SNMP template, this one. So let me match it quickly. This one is open, so this is closed here and this is closed here and here. This is closed here. Type enumeration I need to close okay, so you can see that you have to match all the parentheses and I have to go up here and I need to close this. So this is closed here. Leaf axis closed here, then this one and then finally we have the first program.

There is a list t one. So I’m very much done with this program. Let me compile this and let us see if everything is correct. Then without an error it will execute. Otherwise we’ll get the error. Okay? For that. Let me go to one step back here. If I do LS minus la, then you’ll see that I have this make file. Then what I can do here, I can make, say clean. All enter here you can see that I am getting one error. unterminated statement for enum. Okay? So let me go to Yan VI and where I have this error. Let me correct that. So I have to go here and use the semicolon. Go here, use the semicolon then escape. Write that. Then again I will go one skip down and I will exclude this. Okay? So I have again, one error. Here where it is. 21, 27, 35 undefined prefix. Taylor okay, so we’ll do that as well. So these things you have to do while you are doing the programming, you need to improve all these things. I log to the program and I am correcting it. So whatever tail I have, I need to use TailF. Then again, we’ll go to one step down. Again, we will exclude this program. Now it is successful. Okay.

10. Edit the service model XML template file

In this section we are going to edit our XML template file. So for that I need to go inside my template folder and then I have to open my SNMP XML file. Once I open that file, then that file looks like this where I have to define the device. And we have some placeholders here you can see that you can edit these sections. So we will edit these sections but not only the devices and the name of the device, but we need to add what is our configuration template here and those things or those variables will be taken from my Yang model. So I will define those things inside my XML. Because this XML package I am going to run, let me show you that.

 What are the changes I’m going to do in this changes? Here you can see that I need to define. So first of all, what device I’m going to apply this. Then the community say name is community string. Then what is the access? Either it is a read only or read write. So once I will define all these things, then I need to execute this. For that I will go log via maybe Cisco or Juniper style to my NCS and from there I will reload the package and then we’ll check the package. Okay? Before reloading the package, what I have done in my device instances, I have added some devices like Alkalucent and F five load balancer as well. So those instances also will see in the package output. Let me log to the device here I’m inside the template.

 Let me edit the SNMP XML file. Here it is. Now what I’ll do, I’ll remove the placeholders. So let me remove them and then I want to add say device that device name is okay, then inside the config. So let me delete these things also because I’m going to add my configuration here, let me add those configs. First of all, I want to add the SNMP. So here is XML NS, close this go next add the community inside that name and then I have to define the variable. So let me define the variable here that is taken from the Yang model. Then let me close this name. Okay. Then what I have to do here, I have to define say read only when it will read. So give that as well. Say it starts with access and then I have to define the access will be say read only, close the bracket, close the parenthesis. So whatever things related to say programming that whenever you are opening your braces, you have to close it. You have to use all those things here. Then close this as well, otherwise while compiling it will throw an error. Okay? So the same thing I am going to do here, only thing here is the read write and when it starts with access read write, okay? And then this also we can close so far we have done the configuration for the community string. Let’s close this.

 Let me close this community, then let me go and close the SNMP server as well. This is also done. So we are very much done. You can see only three or four lines of code. But you need to understand that these things will be called from the young model. So we have configured this say device, then the device name, then the config, then the access, and then we have closed all the strings. So let me write it now. Next what I want, I want to go to my NCS CLI, let me log in terms of Cisco and from here I need to reload. So I need to reload the package reload and if we get something like successful or two messages for my SNMP XML, that means the configuration is correct.

Obviously the package will reload successfully. And then what? I can do that, I can check that package status. Okay, the package status means the operational status of the package. So give this to one to two minutes. Once it will come back, then we’ll check the result here itself and we’ll check the operational status. You can see here reload result is successful. Now I can check the package packages, say SNMP. I just want to check my operational status as well. Show package packages. And here we have SNMP. That is up. We are very much done with this section.

11. Test the service model

Now we are done with our service model. In this section we’ll implement it over Cisco is and then we’ll verify it. Let me go to my CLI. I logged in as a Cisco CLI. Let me configure it my SNM. Let me check. I have my template. Then what I want, I want community string. Say that is my giga net. Then if I type question mark access it’s asking what access level I have for this I have read, write. Now I can give the device let’s say C zero and we are done. Likewise, I can go to the same template. I can give say net giga access read only device is C zero. Now what I can do here, I can check my let me go to the top first. Now I can check the commit.

 So let’s do that commit and then drive in no capital C zero has a sync from device has been performed. So it is telling that you can sync from. Let me do that, not write this. We’ll do one thing we’ll request to sync from. So let me check the available options. I have yeah, I have sync from option. Let’s wait for a minute. Now it has been synced. What I can do here, I can check the package operational status. So let me do that. Say show package. Okay, let’s go back and let’s do the configuration for my SNMP before doing any commit, let me check this and I want to check commit grayland. Now it is showing this that CLI local node data device device C zero.

You can see all these plus these things that I am adding here. Let me add one extra line here. This time what I want, I want say net giga and then the device access read only. Okay, now I can go to top and again I can verify the drive run. So here we can see that I have iOS SNMP where read and write and read community the template is this. Okay, now what I can do here, let me commit this commit is completed. Now I can go out from here. If I type SNMP, say giga net, we’ll check the sync info in sync. Likewise, the net giga will also in the sync. Let us verify the SNMP t one and SNMP giga net. Okay, then net giga that is also okay.

Now if I exit from here, if I do switch CLI and configure. If I go to the Juniper mode from here, if I check show SNMP t one. Now you can see this in the Juniper mode as well. Let me go back to the Cisco mode. This is the way we can check. Now what I want to do here, let me go back to my NSO and inside NSO, if I go to net same CLIC zero. So if you are in the correct folder, it will give you the output. Yeah. So I am inside c zero. You can see this now from here also if I check show running configuration, say SNMP server. Now we have this expression or this configuration that is we are using in Cisco’s iOS. Okay? So this is also there. You have seen three things here that from NCS admin.

 I can go to Juniper, I can go to Cisco, check those things. Then what I can do, I can go to my NSO, and then from NSO I can go to my Netsim. From there I can go to that device and then I can check in that native Cisco format. Okay, so you can see this much of options and possibilities we have that we can verify. Okay, let me log back to my NCS so I can go to NCS CLI U admin Cisco and from there, if I want to check the metadata so that option is also with me, I can go to C zero and then say iOS. Let me type question mark here. So what I want to do here that I want to check the config first, seems that I’m missing something. And that is the thing.

If you are running in Juniper mode, then you have to use some other strings. If you are running in Cisco mode, then you have to use some other strings. Okay? So that is also one thing that we can learn. I want to check the config. That config is iOS SNMP, then it is asking about exec and default. So let me check this. That option is there in the Juniper mode. So you have to type this show device device zero config iOS SNMP server, display service metadata. If you press Enter, then you will see here what is the reference count. Because this time we have created these service model just to refer one into device. So you can see the reference count and the string, all those things.

12. API for vManage

Six four. We have to go and understand the API related to DNS Center and we manage. Now the API related to Vmanage I have already covered. So you can go and check or we can refer the lecture one six four and one six five in the same series. And in the upcoming six five I’m going to cover the API API for Cisco DNA. And we are going to learn more and more about that.

13. Cisco DNA Rest API

Next important topic we have is Restful API related to DNA. Now before coming here, you please complete one six four and one six five where I have explained about the we manage API and those are the lectures. Now coming back to DNA restful API. Here you can see first of all the overall structure of DNA where in bottom you have intentbased infrastructure, where you have the endpoint devices on all It related devices. Correct. Then we have a DNA center. That’s the software that is going to glue the intentbased infrastructure and the Open Platform. Now, when we are talking about Open Platform, that means you can go and integrate with so many different type of open available softwares. Obviously that will increase the Agility and overall that will increase the performance of DNA in terms of when we are using all of the capabilities.

 So obviously the total cost of ownership will get reduced. The overall end to end network optimization plus visibility will get very much improved. Now here you can see that we have integration with the It management tools. Say for example its inflow blocks et cetera. Third party integration is there. We can go and connect with the Sdvan, ACI, security, Steel Watch, those are used inside the security monitoring. But even Steel watch is doing more than that. Even Steel Watch can take the input and send somewhere for further analysis or other rest of as well. But overall we have the integration with other domain, cross domain as well. But where is the intent now intent, you can see an Intent based API.

You can see on the top where you have the business and network intent, where we have the application, policy assurance, plug and play, topology, wireless provisioning, network discovery, software management, et cetera. So the list is long and here we are using the API. At this point of time. We know that when we are using Restful API, obviously we are doing Https call and the methods are say Git is something like show command means you are getting the output or result post if you want to create a new object, put if you want to update object delete means if you want to delete any object. Okay, so the important thing here is to understand that whatever technology we have, either It’s, ACI or SDWAN or DNA, everywhere you’ll find that same type of structure has been used for Restful API. So once you understand the API and the calls, then that is applicable for all the cross network domain or all the other domains where this API Restful API is going to be used. Now again, if we use this approach, overall cost of ownership will reduce, the optimization for network will improve and again we can add or we can have new capabilities in the network. How we can do that I’ll show you, I’ll log into the DNN, I’ll show you, that where you’ll get it. But if it is a new installation, you can go to the software update. So here you can see that we can go to software update and then we can go and install the software update. Here in the bottom you can see that we have the updates. Now, once you do the installation, then you should go and enable the DNS Center Rest API. Once you enable DNS Center Rest API, then you can go to the development toolkit inside development toolkit. You can see now you have the get postponed all those methods.

Suppose if you want to check the health of the network or the health of the devices. So this particular first API get site health. It will give you the health of site return overall health information of all the site. So, once you do this get method means you want to see this is something like show command. If you want to see that health of the network, you can go there, click Run and then it will go behind the scene. This particular API will run and you will get the output. So here in case you can see that you are going to use this Rest API where you have the DNA intent API version one Network Devices. And then you will go and as per the query, you will get the result. Now, while you’re getting the result, if the code is 200, that means successful. Likewise, you have all the codes here.

So for example, 40 three, that means server recognizes the authentication, but client is not authorized to perform the request. Likewise, we have all these success code or the messages success code is 200. But suppose if you are running the API and how could you know that which particular state you are in? So, if you go and check these codes, you’ll come to know that up to which particular point you have any issue related to Rest API. All right, again, so here you can see the module schema for the API and you can go and click Run and you will get the output in the JSON format. But again, you can convert the output as per all right. So let’s stop. And next section I’ll log into DNA and I’ll show you that where you will find this API.

Leave a Reply

How It Works

img
Step 1. Choose Exam
on ExamLabs
Download IT Exams Questions & Answers
img
Step 2. Open Exam with
Avanset Exam Simulator
Press here to download VCE Exam Simulator that simulates real exam environment
img
Step 3. Study
& Pass
IT Exams Anywhere, Anytime!