WEBVTT

00:00:00.400 --> 00:00:04.560
Now I want to move on to data formats. So data formats is an exam objective.

00:00:05.120 --> 00:00:08.800
So we have to have a general idea what a data format is and we're going to have to be able to

00:00:08.800 --> 00:00:14.960
read a certain type of data format for the certification exam. So what is a data format?

00:00:14.960 --> 00:00:21.040
A data format is how the information is presented so that way it can be consumed. So the CLI is a

00:00:21.040 --> 00:00:27.840
data format. JSON is a data format. XML is a data format. YAML is a data format. So what do you use?

00:00:27.840 --> 00:00:32.480
Well, it really depends on who the consumer is. So if a human being is consuming it,

00:00:33.440 --> 00:00:37.120
CLI is pretty good. See, the CLI was created for human consumption.

00:00:38.000 --> 00:00:42.960
But things like JSON, YAML, and XML, they're not really designed for human consumption.

00:00:43.520 --> 00:00:48.240
They were more designed for what? System consumption. So when one system wants to

00:00:48.240 --> 00:00:54.080
talk to another system, it makes sense to use things like JSON, XML, and YAML.

00:00:55.040 --> 00:00:59.680
And when you and I need to consume something from the device, it makes more sense to use the CLI.

00:01:00.640 --> 00:01:07.360
But see, what's even better is for our systems to be able to talk to each other and consume

00:01:07.360 --> 00:01:15.040
information using these formats, but for us to use a web-based interface, graphical user interface

00:01:15.040 --> 00:01:21.600
that can interpret this stuff and make it in a nice presentable format. So that's the idea here.

00:01:22.240 --> 00:01:26.400
So even though we might be using JSON, XML, or YAML between our devices,

00:01:26.400 --> 00:01:30.240
when we want to see that information, it would be better that we had a web-based graphical

00:01:30.240 --> 00:01:37.680
user interface to see that or the CLI. So here are three, the three data formats. And what I

00:01:37.680 --> 00:01:42.800
want you to just get away from this information here is that if you look at them, it's all the

00:01:42.880 --> 00:01:52.640
exact same information, just presented to you, displayed to you in a different way. That's all.

00:01:53.280 --> 00:01:59.440
So if you look at the JSON information versus the XML information versus the YAML information,

00:01:59.440 --> 00:02:05.280
just look at the final few entries, like EtherStats. Look at EtherStats right now. It's

00:02:05.920 --> 00:02:12.720
here. It's here. It's here. But it's just simply formatted in a different way. That's what we're

00:02:12.720 --> 00:02:18.800
talking about. This is all about formatting. Formatting. That's all these are, formats.

00:02:23.840 --> 00:02:27.200
So it's all the same information just displayed in different formats. So

00:02:27.200 --> 00:02:29.280
what do we want to know for the exam? It's JSON.

00:02:30.240 --> 00:02:36.640
JavaScript object notation. Apparently, it's a human-readable data format for applications to

00:02:36.640 --> 00:02:41.360
store, transfer, and read data. Really? Human-readable? All right. It's better than XML.

00:02:43.040 --> 00:02:51.600
But for a newbie, a new person, a noob, that's not easy to read. You know what's easy to read to me?

00:02:51.600 --> 00:02:56.240
If this was presented to me in a web page as a graphical user interface, where all of this was

00:02:56.800 --> 00:03:04.000
nicely presented in a chart form, hey, that would be good for me. Am I a JSON expert? Nope.

00:03:05.360 --> 00:03:09.360
Do I ever really want to be at this point in my life? The answer is no.

00:03:10.640 --> 00:03:14.720
But what I do need to know is how to read it. And that's what I'd like all of you to be able

00:03:14.720 --> 00:03:19.200
to do for the exam. Just read it. Understand what is going on. And if you can do that,

00:03:20.160 --> 00:03:22.880
you're going to do well on the certification exam.

00:03:24.800 --> 00:03:28.720
So this is what I'd like to do. I'd like to just go into my live environment here

00:03:29.680 --> 00:03:36.320
and pull this up, the same thing that we just had on the screen in this notepad file.

00:03:37.440 --> 00:03:42.320
Why? So I can draw on it. That's what I want to do. All right. Let's get over the top.

00:03:44.400 --> 00:03:46.000
I've got to open the program so I can draw on it.

00:03:49.200 --> 00:03:53.680
All right. So here we go.

00:03:57.600 --> 00:04:01.840
So what do we need to learn here? We need to learn that first and foremost,

00:04:03.040 --> 00:04:05.760
you are going to have different

00:04:09.520 --> 00:04:14.960
characters in different positions. And if you can memorize

00:04:15.840 --> 00:04:20.800
where they typically go, what they're used for, you'll be able to answer the JSON questions on

00:04:20.800 --> 00:04:25.440
the exam. So first thing I want to point out to you is that we have a colon.

00:04:30.000 --> 00:04:37.120
And what are colons used for? Colons are used to separate what we call key value pairs.

00:04:38.800 --> 00:04:44.880
So when we're dealing with JSON, we're dealing with key value pairs. So look at this example.

00:04:45.680 --> 00:04:57.200
We have a key value pair. We have a key value pair. Now, if we go down a little bit further,

00:04:57.200 --> 00:05:01.280
this is where things can get a little bit confusing. But you'll notice here we have a key.

00:05:02.800 --> 00:05:08.640
Where is the value? Well, all of this is its value.

00:05:09.120 --> 00:05:11.920
All of it is its value.

00:05:14.320 --> 00:05:26.720
So statistics, key, all of these are values. But then you have key values inside of that.

00:05:28.640 --> 00:05:30.400
You have key values inside of that.

00:05:30.480 --> 00:05:36.480
So don't let that throw you off. It shows up like that on the exam.

00:05:46.480 --> 00:05:54.480
So here, key statistic and value is all of this. Value is all of this. Value is all of this. But

00:05:55.040 --> 00:05:58.720
key value, key value. So the values themselves are also key values

00:05:59.600 --> 00:06:08.960
because of the way it's being structured. But they're key values. Okay. So first was key values.

00:06:09.600 --> 00:06:15.440
And what's something else we want to point out here? Notice how you can have quotation marks.

00:06:16.160 --> 00:06:22.080
Around what? Strings. So words, strings are going to have quotation marks.

00:06:23.920 --> 00:06:32.880
In this case, that is a number. It's a number, an integer. So as a result of that,

00:06:32.880 --> 00:06:36.480
it's not going to have quotation marks. But then you might have a number.

00:06:37.440 --> 00:06:44.880
It's a number, an integer. So as a result of that, it's not going to have quotation marks.

00:06:44.880 --> 00:06:50.240
But then you might be saying, well, wait a second. Why does this number or this number not have

00:06:51.840 --> 00:06:54.880
quotation marks? Because that would be a string in this case. So even though it's a number,

00:06:55.520 --> 00:06:58.320
it's being represented as a string in this case. And that's okay.

00:06:58.320 --> 00:07:10.880
Okay. So quotation marks are fine. I like that. So you see quotation marks in a sample.

00:07:10.880 --> 00:07:17.920
That is JSON. You see key value pairs like that. That is JSON. All right. We have curly braces

00:07:20.240 --> 00:07:26.320
for opening and closing. So open. So therefore, there has to be one that closes somewhere else.

00:07:27.200 --> 00:07:30.240
Like here, you see this one opens. So there's got to be someone,

00:07:32.160 --> 00:07:36.400
there's got to be another one that closes it somewhere else. And look, it opens again.

00:07:38.960 --> 00:07:42.560
And there's got to be one somewhere that closes that one. You can see it's right down here.

00:07:42.640 --> 00:07:46.160
It's right at the bottom, right in there. Right there.

00:07:56.080 --> 00:08:03.280
There it is. Now, what else do I want to point out to you? Let's point out commas.

00:08:04.080 --> 00:08:07.840
Commas. So commas are valid as well.

00:08:12.960 --> 00:08:19.680
So what I want you to notice is after every key value pair, we have a comma. You see that?

00:08:19.680 --> 00:08:38.240
When do I not have a comma in the very last key value pair

00:08:40.960 --> 00:08:44.480
before the closing bracket? No comma there.

00:08:45.440 --> 00:08:51.600
So there's a comma after every single key value pair until you get to the last key value pair

00:08:52.720 --> 00:09:00.880
before you close your bracket. So if we look at that, where's the comma? It's after the bracket

00:09:02.640 --> 00:09:04.320
instead of after the key value pair.

00:09:05.200 --> 00:09:11.840
Key value, comma. Key value, comma. Key value, comma. Comma, comma. All right. Key,

00:09:12.400 --> 00:09:18.560
open bracket. Comma, comma, comma, comma, comma. Now I'm going to start singing. All right. No

00:09:18.560 --> 00:09:32.480
comma. It comes after the bracket. All right. So what do I want you to notice?

00:09:34.320 --> 00:09:42.800
This is all that is required to know, folks. Can we have square brackets too? Yeah,

00:09:42.800 --> 00:09:54.480
we can also have square brackets. We can have square brackets for an array. An array.

00:09:54.480 --> 00:10:15.040
A-R-R-A-Y. Array. There you go. Small. Got large there for a second.

00:10:15.040 --> 00:10:26.240
Okay. So this is just something you're going to have to take some time to just memorize the

00:10:33.520 --> 00:10:36.720
I am frozen here, folks. I don't know if you are frozen.

00:10:36.720 --> 00:10:49.280
Let me refresh this. Can everyone hear me okay? Too many commas, I think.

00:11:06.720 --> 00:11:23.120
Yep. It looks like it's frozen. I'm not even getting. Okay, folks.

00:11:26.400 --> 00:11:27.760
I'm going to refresh stream.

00:11:27.760 --> 00:11:36.320
I will refresh stream.

00:11:57.760 --> 00:12:22.320
All right. It's resetting stream now. Okay. Looks like I'm connected.

00:12:27.760 --> 00:12:36.320
Okay.

00:12:50.080 --> 00:12:52.960
Still trying to verify everything on my end.

00:12:57.760 --> 00:13:10.320
Okay. Looking good now. I think we're good. Looks good for me.

00:13:15.440 --> 00:13:24.320
All right. I think we're good. Give everybody a couple more seconds.

00:13:28.080 --> 00:13:40.240
There we go. Yep. We are good to go. There we go. If you can't see me, refresh.

00:13:44.560 --> 00:13:54.080
All right, folks. All right. Where were we here? So the key for the exam is to take the time

00:13:55.040 --> 00:14:07.520
to know what is valid JSON syntax, meaning key values with a colon. If there's anything else

00:14:07.520 --> 00:14:16.080
between them, that's wrong. Curly braces at the start, curly braces at the end. If you open it,

00:14:16.080 --> 00:14:21.200
if you have to create what you see here, curly brace goes there. If they put any other type of

00:14:21.200 --> 00:14:26.400
bracket in that case, it's not right. You might see a square bracket and that would be okay

00:14:26.400 --> 00:14:29.200
because I'm going to show you momentarily where you could use that square bracket.

00:14:30.240 --> 00:14:36.480
Right. So that's fine. Quotations are good, but if they show you something else, but instead of

00:14:36.480 --> 00:14:41.920
quotations, they're using exclamation marks, right, or they're using apostrophes and different

00:14:41.920 --> 00:14:47.600
things like that. Okay. Those are wrong. Those are distractors, right? The goal here is to simply know

00:14:47.600 --> 00:14:52.240
what is valid versus not valid. So I have a secondary example here.

00:14:57.120 --> 00:15:04.880
And let's say I told you brand is Ford, name is Mustang, year is 2001. Attributes are black,

00:15:04.880 --> 00:15:11.600
five liter with a sunroof. How can we display this in JSON formatting? Well, open your bracket

00:15:12.560 --> 00:15:20.960
and then we have key value pairs, brand Ford, name Mustang, year 2020. Attributes,

00:15:20.960 --> 00:15:23.680
look at the square bracket there. So instead of curly, we're using square,

00:15:24.640 --> 00:15:30.880
black, five liter, sunroof. So why square instead of curly? Because notice we don't

00:15:30.880 --> 00:15:37.680
have key value pairs here. So if there were key value pairs here, then we would have curly

00:15:37.680 --> 00:15:42.240
brackets. But since we don't have key value pairs here, then we're just going to go ahead

00:15:42.240 --> 00:15:51.360
and have the square brackets. And then close it off. And notice no comma here at all. Oops,

00:15:51.360 --> 00:15:58.560
need my comma. There you go. My bad. Better save it. So there you go. You have your comment

00:15:58.560 --> 00:16:08.800
at the end. So not at the very last value. So key, and these are all your values. So now you

00:16:08.800 --> 00:16:15.200
put the comma at the end, right there, not there. All right. So and look at this, this exact same

00:16:15.200 --> 00:16:24.800
thing can be written like this. There you go. So that means the same thing. And that's why

00:16:24.800 --> 00:16:28.000
when you first learn about this, if you're looking at it this way, it's like, well, why do

00:16:28.000 --> 00:16:34.800
we do this? Because in reality, that's just this way. So you can understand it. But in reality,

00:16:36.080 --> 00:16:43.760
the devices see it like this. So open it up. Brand is for comma. So these go together.

00:16:44.640 --> 00:16:50.480
These go together. These go together. All of this goes together.

00:16:51.120 --> 00:17:00.320
Black, right? That's the idea behind it. So make sure you can pick out valid versus invalid. So,

00:17:00.880 --> 00:17:10.480
for example, if these commas were semicolons, wrong. If the colons were underscores, wrong.

00:17:11.360 --> 00:17:16.640
If these were square brackets, wrong, right? Pick the one that is accurate.

00:17:20.720 --> 00:17:27.360
Okay, so why no quotes around 2020? Because 2020 is not a string, it's an integer. So because I

00:17:27.360 --> 00:17:34.080
don't put quotes around it, it's an integer, it's a number. So like in this example here,

00:17:34.080 --> 00:17:39.840
it's a number, not a string. This would be a string. That's a string. Even though it's a number,

00:17:39.840 --> 00:17:44.320
it's represented as a string. This one's represented as a string. But this one's

00:17:44.320 --> 00:17:49.920
truly a number, truly a number, truly a number, truly a number, right? If there's no quotes,

00:17:50.000 --> 00:17:56.400
if there's no quotes, it's truly an integer. And so when you're programming, like in Python,

00:17:56.400 --> 00:18:02.240
as an example, integers can be added together, subtracted, multiplied, divided. But if the

00:18:02.240 --> 00:18:06.640
number was a string, you can't do that. You'd have to convert the string to an integer to do

00:18:06.640 --> 00:18:12.640
your math and all that stuff. So this is truly 100% a number, where this is a number as a string.

00:18:13.280 --> 00:18:19.840
So it can't be treated as a number for mathematical calculations. That's why.

00:18:21.280 --> 00:18:25.200
So no quotes around 2020, because I want this to be a real number in this case.

00:18:25.760 --> 00:18:30.480
But if I had quotes around it, then it would be a string. That looks like a number.

00:18:32.240 --> 00:18:37.680
All right, so that's JSON, JavaScript Object Notation. Our goal for the exam is to be able

00:18:37.680 --> 00:18:42.720
to do what? Identify the valid syntax. So they might present four different options for you and

00:18:42.720 --> 00:18:52.160
say which one's valid. Could be as easy as that. Could be as easy as that. All right, so now we

00:18:52.160 --> 00:18:57.680
have to consider the fact that if we're using JSON formatted data, and we are sending that over the

00:18:57.680 --> 00:19:03.920
internet, and how are we doing that, potentially? Oh, well, we'd be using HTTPS with REST API,

00:19:03.920 --> 00:19:10.400
so that's okay. But we also want to make sure that we protect our actual JSON data as well,

00:19:10.400 --> 00:19:16.080
the JSON information. So we have these things called JSON Web Tokens. JSON Web Tokens,

00:19:18.640 --> 00:19:27.360
also called JWTs, JWOT, is a compact, self-contained way to securely transmit

00:19:27.360 --> 00:19:34.160
information between parties as a JSON object. Sent through the URL, post parameter inside an

00:19:34.160 --> 00:19:40.640
HTTP header, and it contains all the needed information that is required in order to do what?

00:19:40.640 --> 00:19:47.920
In order to validate the actual token and validate the information that is being transmitted.

00:19:48.800 --> 00:19:55.760
So I did a little sample here. I went to a website that could create a JSON Web Token for me,

00:19:56.400 --> 00:20:00.160
and so in this case here, I specified my algorithm and token type.

00:20:01.680 --> 00:20:07.440
I made some fake data, and so my fake data was just Encore exam example,

00:20:09.120 --> 00:20:14.960
and then I had to provide a signature. And so the signature using HMAC SHA-256,

00:20:15.520 --> 00:20:19.840
look what I wrote, and I said, I will pass Encore exam. So a little bit of subliminal messaging

00:20:19.840 --> 00:20:26.400
here. What I want to point out to you is that a JSON Web Token, taking the header information,

00:20:26.400 --> 00:20:33.280
your actual data itself that you're trying to protect, and then a signature, in this case, my

00:20:34.160 --> 00:20:39.040
passcode that I have, ultimately ends up creating this right here.

00:20:40.800 --> 00:20:48.000
This. So all of this is this now. And as a result of that, what do we have? This is the header.

00:20:50.320 --> 00:20:55.440
Followed by a period. Followed by what? Our payload.

00:20:57.920 --> 00:21:01.920
Followed by a period. Followed by the signature.

00:21:04.320 --> 00:21:08.560
Header, period, payload, period, signature. Repeat after me.

00:21:08.560 --> 00:21:14.240
Header, period, payload, period, signature.

00:21:19.840 --> 00:21:31.200
So we can use this now for authentication, authorization, and for the information exchange

00:21:31.200 --> 00:21:37.280
to protect our JSON data. Now, do we have something like this for other options like XML? Yes,

00:21:37.280 --> 00:21:41.840
we do. Okay, so I just want to show you this. This is not exam relevant when I'm about to show you,

00:21:41.840 --> 00:21:46.720
but just to show you how all of this information, I was able to produce this.

00:21:47.680 --> 00:21:51.040
If we were using XML, we would have to use something called SAML.

00:21:52.160 --> 00:21:57.840
SAML. And watch how big the SAML token becomes.

00:22:01.440 --> 00:22:13.040
And look, there's a scroll. Okay, that's massive. So JSON web tokens are way less verbose

00:22:13.440 --> 00:22:22.080
than XML. So the JSON web token ends up being smaller, and so it's a really great choice

00:22:23.120 --> 00:22:31.040
for use with HTML. And we can use public-private key pairs and X509 certificate signing as well

00:22:31.040 --> 00:22:41.040
with JWOTS. We have the HMAC algorithm, as we saw earlier, right here. So for the exam,

00:22:41.680 --> 00:22:46.000
you don't have to know how to create these. That's not the point of my demonstration here

00:22:46.000 --> 00:22:50.960
of using this and showing it to you. The point is to realize that we have, you know,

00:22:50.960 --> 00:22:56.800
the ability to take that header, payload, signature, separate them by periods,

00:22:56.800 --> 00:23:03.200
and this is our encoded data, making it, giving us the ability to do the authentication,

00:23:03.200 --> 00:23:06.000
authorization, and safe information exchange that we want to.

00:23:06.000 --> 00:23:08.000
Thank you for your attention.