Now we can use standard commands like show interface VLAN 100.
And that shows us standard information like we would get on any other type of device so we can see as
an example demo, please don't touch IP addresses this, but what we could do is we can send that to
JSON.
So let's just use JSON and we get to the Jason information like that.
But it's not very easy to read.
So let's use Jason pretty.
So Jason pretty.
There's our information.
So show interface, VLAN 100, we see the JSON formatting.
Notice the curly braces.
We've got information about this interface.
VLAN 100.
Important to note key value separated by a colon, then a comma key value again comma at the end, double
inverted commas.
Very important.
Lost entry doesn't have a comma at the end.
Data is contained within curly braces.
So this data has these curly braces, table interface has these curly braces, and then we've got the
all encompassing curly braces.
So that's an example practically of JSON formatting versus show interface.
VLAN 100 Standard Command.
This is a format that we as humans would understand.
But this is a format that a machine will understand much better.
So just remember, we want to have standard formatting for machines.
As an example, show IP interface brief here gives us a list of interfaces on the device.
That's human readable format.
But if we say JSON pretty, this gives us the information in JSON formatting.
Show IP interface brief pipe JSON pretty.
Notice there's a big difference here.
We have the square brackets.
So row interface, square bracket scrolling down.
Now the link may be quite slow here.
My internet connection to the dev side is quite slow.
But notice here is the next square bracket.
Here we've got data within curly braces.
Again, notice no comma at the end here, but this has curly braces.
And a comma at the end.
The data within here is key value comma.
Now the reason why we have.
Square brackets is because.
We are using what's called an array.
In this slide, I've kind of summarized it.
Notice that curly braces here, we've got square brackets, and inside here we've got an ordered list
of values.
The reason why we want this is because we've got multiple interfaces.
So we've got interface VLAN 100 and then here we've got interface VLAN 200 and information about those
interfaces.
So rather than just showing information about one interface, so a single object, we've now got an
array of interfaces that we're looking at.
So an array in JSON is an ordered list of values, uses square brackets.
It can store all kinds of data, so it could store things such as strings.
String is like a sentence.
Hello or a word.
Hello.
Whereas a number is something like one or two or 2.1, two, three.
We've also got booleans objects, nulls and it can even store another array with inside of it.
Values must be separated by commas once again.
So notice once again that an object doesn't have those square brackets.
This is the output for show version json.
Pretty important here comma.
Comma.
No comma.
We've got the key value pair separated by a colon.
Make sure that you know this formatting.
I've said that enough times now, I think.
So he has an example once again of show interface VLAN 100.
Again, you can download this PowerPoint slides that you have all this information.
I've given you a few examples of that, but again, it's much easier to see this practically.
And I'm going to take this to the next level now by showing you how to run Python on this Nexus box
and do stuff in Python.
And then I'm going to show you how to access the box remotely using a Python script that I'm going to
run on my local computer and then pull out similar JSON information.
Now.
Again, you don't need to learn the Python scripting for the exam, but it's well worth learning this
for the real world.