What is a REST-based API❓ (and why you need to know for the Cisco CCNA)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
there's a lot of excitement and buzz around the idea of network automation and in this video i'd like to answer three questions number one how does automation change the way that we currently and are going to manage networks number two what exactly is this thing called an api and why the heck do i care and then third to kind of reinforce the concept of an api i'd like to chat with you about what is a restful api and give you an example of rest conf so for the discussion of how network automation is going to change the way we manage and work with our networks let's imagine bob the admin right here and he's got four devices a couple routers couple switches life's good and for him to manage those it's manageable and what he'd do is get his pc or his computer and he'd open up his favorite terminal emulator whether it's putty or secure crt and open up a session he would issue his favorite show commands he would make his changes he would save those changes life goes on so he'd manage them one at a time and this is a lot like having a fairly small family and here's what i mean by that if we had a fairly small family and it's night time and our time for bed and the parent says hey uh johnny is your are your teeth brushed is your room clean and making queries finding information and if the answer is no he would give the instructions the parent would perhaps have okay please brush your teeth or please clean your room or whatever it is and then follow up afterwards did that change actually happen so if we had just a few people that'd be okay now if we had hundreds or thousands of people just calling them each out one by one asking questions by another human we wouldn't have enough time it couldn't be done fast enough and so that's where network automation comes in check this out so let's imagine that we have bob again but now we have hundreds of devices and i'll just put hundreds here right so we have hundreds of devices to manage instead of bob trying to manage those all independently what we could do is have some type of a bot a robot like a controller some piece of software that's able to communicate with all those devices check on things in just a split second and then make changes if we need to so bob could talk to the controller like in cisco we have the dna center is an example of a controller so i'll put dnac there and then the controller could go ahead and communicate with all the hundreds or thousands of devices and make very very quick queries and decisions as far as managing all those devices so bob could say i want this to happen and then the controller would go out to all the devices and make it happen now because the controller is a lot faster we might want to give it a special method for communicating with the network devices so instead of using ssh and logging in and show this and show that in config t and change this change that we might want to use some special language between that controller and the network devices and traditionally the method or that that interface between like a controller like a computer and the devices it's managing is referred to as an interface the way that controller talks to those devices and is specifically called ready an a p i an application program interface because it's the interface that that program the controller is using to communicate with those devices and the question may come up well what what api are we going to use the answer is an api a language of love that's agreed to and supported by both the controller and the devices that are being managed they both have to understand and work correctly with that api whatever that is now in the world of apis there's a family a general family called rest apis now rest is an acronym for representational state transfer which basically means that like our analogy of the family where the parent is saying hey bobby or jimmy if i forgot the name was bobby or jimmy um is your room clean and if the answer is no please clean your room well the api it's a restful api could make queries to that device hey router one is this interface up if the answer is no it could say great let's go ahead and change that or i need to change the configuration because both the controller and the device being managed both understand that interface that application program interface that they're using so a restful or rest api is a very popular one now it even goes a step further there's a specific rest based api called rest conf rest conf it's very handy it's a restful api that's used between a controller and networking devices for determining information from that networking device and also pushing information to that networking device if we need to make changes so that would look something like this we'd have this would be a rest conf that would be the api in use between this controller and this networking device now there's yet another problem besides agreeing on what api we're going to use between the controller and the networking device they also have to agree on what's available like do i want to be able to see all the interfaces or change all the interfaces or change other settings and that's all based on a menu now if you and i were going to go into a restaurant and we wanted to know what could we order we would look at the menu and we also have a type of menu when we work with restconf and that menu is called a data model it's also referred to sometimes as a schema and one of the popular data models like a menu that shows us what these two devices can do the controller and the device being managed is referred to as yang y-a-n-g and and yang the acronym yang stands for yet another next generation so when you hear the term of yang think of oh that's like a menu that allows the controller and the device being managed over this rest conf api to know exactly what is able to be seen and changed between the two and i should also point out that within the yang data model idea there's also specific groupings regarding settings based on the device that you're working with so i've got one more element regarding rest conf an example of a rest-based api between a controller and a networking device that i want to share with you and that is what is the protocol that we're going to use between the controller and the actual device being managed and we're going to use what what restconf uses is https just like us going to a secure website and the benefit of using https is that the controller and the device being managed they can leverage some of the built-in commands in https to go ahead and query and get information and also to put or to push information from the controller on the networking device and so there's lots of really great benefits of using https as a transport protocol besides it being secure http has a whole bunch of commands already built in so if the controller needed to create and put something on that device it could if it needed to read like hey bobby is your room clean hey r1 is gig zero zero up or what is the ip address on that interface it could it could do updates and if we wanted to remove data or remove part of a config off of a networking device we could also do a delete and a common way of referring to these four basic functions that are available in a rest comp api is to do crud crud what can the https do again crud what was the answer create read update and delete and if we looked at some of those functions from the actual http commands that were used to do it it would include puts and patch and post and get and delete and the cool thing to implement resconf a restful api to do management between a controller and the networking devices they did not have to write a whole new transport protocol they just leveraged https to get the job done so let's do a recap if we have lots of devices in our network it's very likely we are going to manage those at some point sooner or later with a single or a pair of devices as controllers now the language of love between the application of those controllers and the devices they're managing it's an api that's the method they're going to use to talk with those devices a major class of apis is called a rest api or a restful api and in configuring networking devices an example of a rest-based api is called rest conf resconf uses the yang data model to identify what can be done and managed between the controller and the managed devices and for transport protocols they're going to use https to get the job done so our next step to really drive home the concept of a restful api like resconf is to see it in action and that's exactly what you and i get to do in the next video so i'll catch you in that next video meanwhile happy studies and i'll see you then bye for now [Music] in all your hopes are never
Info
Channel: Keith Barker
Views: 17,106
Rating: 4.9654746 out of 5
Keywords: ccna, cisco, 200-301, Cisco CCNA, Cisco Certification, ogit, Keith Barker, restful api, restful api tutorial, restconf tutorial, restconf cisco
Id: Fl0cD44-Vao
Channel Id: undefined
Length: 8min 44sec (524 seconds)
Published: Sat Jul 04 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.