In this video, we're going to discuss arrest APIs or representational state transfer application programming
interfaces.
A long name, basically short name, rest APIs.
Application programming interfaces allow us to get one application to interact with another application.
As an example, if you want to use the functionality of Google Maps rather than developing your own
mapping system, you can integrate Google Maps with your application, and then you can send queries
to Google Maps using an application and then get responses back from Google Maps.
Rest APIs are used everywhere.
It's really important that you learn the basics of rest APIs for the CCNA exam.
You don't have to learn Python.
You have to have an understanding of a rest APIs and have an understanding of DNA center.
In this video, however, I'm going to show you how you can interact with a Cisco device using a rest
API and a Python script.
So we're going to write a Python script that interacts with the rest API on a Cisco router.
You once again don't need to learn that for the CCNA exam.
You would need to know that for the Cisco dev net exam.
But it's well worth learning the stuff, as I've been saying, for the real world.
If you want to differentiate yourself from others, it's well worth learning.
Rest APIs well worth learning.
Python.
Now I'm going to cover this section differently to other instructors.
Too many of them say connect to this dev net server, but they're using a prebuilt application or prebuilt
information and it's very difficult to replicate what they're doing if you don't download prebuilt stuff
from Cisco Dev Net, some instructors are simply copying the dev net labs.
They're not actually doing their own thing.
So I want to show you this from the ground up.
I want to show you how you can interact with rest APIs without using prebuilt stuff that's been downloaded.
I'm going to show you how to download an application called Postman.
I'm going to show you how you can manually update Postman with IP addresses and other information not
using prebuilt stuff.
So I'm going to show you how you can overcome some issues that you will encounter if you do this manually
rather than using prebuilt stuff.
There's an issue with certificates.
As an example, you have to tell Postman to accept a self sign certificates, otherwise it won't interact
with the devices that are using self signed certificates.
We're going to manually configure IP addresses rather than once again using prebuilt stuff.
But to make it easier for you, I've created this entire PowerPoint presentation.
In this PowerPoint presentation, I've given you the links to Cisco's dev net labs.
So the definite DNA center always on labs.
Your URL is here, here is the username and here's the password.
So you can simply download this PowerPoint presentation and use it all.
The links are here that I'm using.
All the information is within this document as an example.
Here's the API documentation question people often ask is How do I know what APIs to use while there's
an example of the API documentation for DNA center?
There's also a definite lab that you can follow if you want to.
So if you want to go through one of the dev net labs, there is a good example of a dev net lab.
But what I'm going to show you as an example is how to connect to labs and manually.
So we're going to use Postman, which is an application.
I'll show you in a moment how to download.
It allows you very easily to interact with APIs, allows you to do some basic testing and check for
issues.
Really good application for testing APIs.
So I'm going to show you the URL to connect to you.
I'll show you how to bypass the issue with self signed certificates.
You need to turn this off, otherwise you will have problems if you try and connect to some of their
labs.
It's not going to work because you need to turn this off.
Otherwise, Postman by Default rejects the connection.
All the username and password information is within this document, and I'm showing you step by step
what to do.
I'm going to demonstrate it practically using a video, so I'm going to show you how to do this.
But I've also given you this entire PowerPoint presentation so that you can keep this as reference for
later.
I've also included a Python script.
So this is a very basic Python script that allows me to connect to a Cisco router.
In this example, we're going to connect to a Cisco router.
We're going to connect to this router on this port number.
And then we're going to get a list of interfaces from the router using an API.
So I really hope this helps you.
If you follow along in this video, you should get a really good understanding and I'll show you step
by step how to interact with both DNA center as well as with a XY router, in other words, a Cisco
router.
But you can download this PowerPoint presentation and have it as a reference to really help you.
After you've watched these videos six months from today, you might just want to have this as a reference.
Okay.
APIs are used everywhere.
You probably use them all the time without realizing applications.
Talk to other applications using application programming interfaces.
These are becoming more and more important.
It's very difficult for applications to share information using non structured data.
In a separate video, I spoke about JSON and how you need to use JSON formatting to share information
between devices.
Structured data is really important.
Having a structured application programming interface is really important if you want machines talking
to machines.
He has an example.
Notice that a lamp I press a button on my phone, it goes off.
This is a hue lamp.
It has an exposed API.
Now because of APIs, I can once again do this.
Alexa Turn off.
David Office old big lamp.
Okay.
Notice the lamp went off.
Very simple example of an API.
Alexa, turn on David.
Office old, big lamp.
Okay.
Alexa So that's an example of one program, talking to another program.
We've got a hue lamp system, we've got Alexa and they are talking to each other.
And application programming interfaces allow me to do interesting things like that where I can get one
device to interact with another device and do something.
Now you can use SSH to simply SSH to a broader and configure a router.
The problem is when you type show version or show IP interface brief, that data that's displayed is
for human consumption.
In other words, humans will understand the information, but machines will struggle with the information
that's displayed if the show version command is run on different routers Cisco Nexus, Cisco, iOS,
classic, iOS, monolithic iOS versus iSCSI.
The output will be slightly different and machines will struggle with that output.
What you really want is that my application can talk to your application using an exposed and well documented
API.
Now that's the theory.
In reality, APIs change.
In reality, not all devices use the same API.
So if you talk to DNA center, the APIs that it uses will be different to an iOS errata and it can change
from version to version.
That is a frustration of APIs, but long term, hopefully Cisco will standardize the APIs more and more.
This is where the world is going.
We are no longer going to manually configure devices using the CLI.
You're going to have applications interacting with other applications and programming other applications.
So my program will program that program in the same way that an Alexa can be used to interact with many
devices out there.
Okay.
So let's get started with some practical demonstrations.