Free CCNA | JSON, XML, & YAML | Day 60 | CCNA 200-301 Complete Course

Jeremy's IT Lab
14 Dec 202128:56

Summary

TLDRIn this informative video, Jeremy introduces data serialization, focusing on JSON as a critical format for exchanging data between applications. He explains JSON's syntax, including its primitive and structured data types, and contrasts it with XML and YAML. The video emphasizes the importance of JSON for CCNA exam preparation and includes a quiz for practice interpreting JSON data, highlighting its human-readability and machine-friendliness.

Takeaways

  • 📚 Data serialization is the process of converting data into a standardized format for storage or transmission between applications.
  • 🔍 JSON (JavaScript Object Notation) is a widely used data serialization format that is both human-readable and machine-readable, standardized in RFC 8259.
  • 📈 JSON supports four primitive data types: string, number, boolean, and null, as well as two structured data types: object and array.
  • 🔑 In JSON, strings are surrounded by double quotes, while boolean values (true or false) and null are written without quotes.
  • 🎯 Whitespace, including spaces and line breaks, is insignificant in JSON, meaning it does not affect the meaning of the data.
  • 🧩 JSON objects are unordered collections of key-value pairs, with keys always being strings and values being any valid JSON data type.
  • 🔎 Arrays in JSON are collections of values separated by commas, enclosed in square brackets, and can contain values of different data types.
  • 🌐 XML (eXtensible Markup Language) is a data serialization language that uses tags similar to HTML and is less human-readable than JSON but still used by REST APIs.
  • 📊 YAML (YAML Ain't Markup Language) is highly human-readable, with significant whitespace and used in tools like Ansible for network automation.
  • 📝 The CCNA exam requires understanding of JSON encoded data, with a focus on interpreting basic JSON-formatted data structures.
  • 🎯 Practice interpreting JSON data is crucial for the CCNA exam, as it is the primary data serialization format covered in the exam syllabus.

Q & A

  • What is the primary purpose of data serialization languages?

    -The primary purpose of data serialization languages is to provide a standardized format for data so that it can be easily communicated between different applications, even if they are written in different programming languages.

  • Why is JSON emphasized more than XML and YAML in the CCNA exam?

    -JSON is emphasized more in the CCNA exam because the exam specifically mentions the need to be able to interpret JSON encoded data, while XML and YAML are not mentioned in the exam topics list.

  • What are the four primitive data types in JSON?

    -The four primitive data types in JSON are string, number, boolean, and null.

  • How is whitespace treated in JSON?

    -In JSON, whitespace is insignificant, meaning that spaces and line breaks do not change the meaning of the data.

  • What is the difference between an object and an array in JSON?

    -An object in JSON is an unordered list of key-value pairs enclosed in curly brackets, while an array is an ordered list of values separated by commas and enclosed in square brackets.

  • What does the term 'nested object' refer to in JSON?

    -A 'nested object' in JSON refers to an object that is used as the value of a key-value pair within another object.

  • How is a boolean value represented in JSON?

    -A boolean value in JSON is represented as 'true' or 'false', written in all lower-case letters, and without quotes.

  • What is the significance of the term 'ExSim' in the context of the video?

    -ExSim is a software by Boson Software that provides practice exams for the CCNA certification. It is mentioned as a resource for additional practice with a bonus question presented at the end of the video.

  • How does JSON differ from XML in terms of human readability?

    -JSON is generally considered more human-readable than XML due to its simpler syntax and the fact that it uses human-readable keys. XML, while still understandable when formatted properly, is more akin to a markup language and can be less intuitive for quick data extraction.

  • What is YAML used for in the context of network automation?

    -YAML, or YAML Ain't Markup Language, is used in network automation tools such as Ansible for defining configuration and orchestration processes. Its human-readable nature and significance of whitespace make it easy for both humans and machines to understand.

  • How does the CCNA exam expect candidates to interact with JSON data?

    -The CCNA exam expects candidates to be able to interpret JSON encoded data, which involves understanding the structure and being able to extract and interpret information from JSON formatted data.

Outlines

00:00

📚 Introduction to Data Serialization and JSON

The video begins with an introduction to Jeremy's IT Lab and the CCNA course, encouraging viewers to subscribe, like, and share the content. The main focus of the video is on data serialization languages, specifically JSON, XML, and YAML. Data serialization is essential for structuring data in a standardized way to facilitate communication between different applications. The video emphasizes the importance of JSON, as it is a key topic in the CCNA exam. It explains that JSON is a human-readable, language-independent format for data interchange and is standardized in RFC 8259. The video also touches on the concept of variables and their role in data serialization.

05:03

📝 JSON Basics and Data Types

This paragraph delves into the fundamentals of JSON, highlighting its derivation from JavaScript and its widespread use in modern programming languages. It explains that JSON data types are categorized into four primitive types (string, number, boolean, null) and two structured types (object, array). The video clarifies that whitespace is insignificant in JSON and provides examples of each data type, including how strings are enclosed in double quotes, numbers are not quoted, booleans are written in lowercase without quotes, and null represents the absence of a value. The structure of JSON objects is also discussed, with key-value pairs formatted as 'key: value' pairs enclosed in curly brackets.

10:09

🔍 Interpreting JSON-Formatted Data

The video continues with a practical approach to interpreting JSON-formatted data. It explains how JSON objects can contain nested objects and arrays, providing examples to illustrate the concept. The importance of understanding JSON's structure is emphasized, especially for the CCNA exam. The video also contrasts JSON with XML and YAML, briefly mentioning their characteristics and uses. XML is described as a markup language used for data serialization, while YAML is noted for its human-readability and significance of whitespace, particularly in network automation tools like Ansible.

15:18

📋 Quiz and Practice with JSON Data

The video concludes with a quiz to reinforce the understanding of JSON data types and formatting. It presents a series of questions that challenge the viewer to identify valid JSON data, the significance of whitespace, and the correct formatting of key-value pairs. The quiz also differentiates between JSON, XML, and YAML, focusing on their unique characteristics. A bonus practice question from Boson Software's ExSim is mentioned as a resource for further CCNA exam preparation.

20:23

🎯 Bonus Question from Boson Software’s ExSim

The video ends with a bonus question from Boson Software’s ExSim, a practice exam platform for the CCNA. This additional challenge is intended to further test the viewer's comprehension and application of JSON data interpretation skills, aligning with the exam's expectations.

Mindmap

Keywords

💡Data Serialization

Data serialization is the process of converting data into a standardized format or structure for storage or transmission, allowing for reconstruction by different applications. It enables communication between applications, even those written in different programming languages, by providing a common, understandable format. In the context of the video, JSON, XML, and YAML are discussed as popular data serialization formats.

💡JSON (JavaScript Object Notation)

JSON is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects. It is language-independent and widely used for exchanging data between machines, especially in REST APIs. JSON is derived from JavaScript but is not limited to it, and many modern programming languages can generate and read JSON data. The format is standardized in RFC 8259.

💡XML (Extensible Markup Language)

XML is a markup language that has evolved into a general-purpose data serialization language. It is similar to HTML and uses tags to format text, making it less human-readable than JSON but still manageable when properly formatted. Whitespace in XML is insignificant, and it is also used by REST APIs, although it is not emphasized as much in the CCNA exam as JSON.

💡YAML (YAML Ain't Markup Language)

YAML is a data-serialization language that is highly human-readable and where whitespace is significant, unlike JSON and XML. It uses indentation to denote structure and is often used in configuration files and by automation tools like Ansible. YAML files start with three hyphens, and key-value pairs are represented as key followed by a colon and value.

💡Data Types in JSON

JSON supports several data types, including four primitive types: string, number, boolean, and null; and two structured types: object and array. Strings are text values enclosed in double quotes, numbers are numeric values without quotes, booleans represent true or false, and null represents the absence of any value. Objects are unordered collections of key-value pairs, while arrays are ordered lists of values.

💡Key-Value Pairs

In the context of JSON, key-value pairs are the fundamental units of data representation, where a key is a string that acts as an identifier or name for the data, and the value is the associated data itself. Keys are always strings and must be enclosed in double quotes, while values can be of any valid JSON data type. Key-value pairs are used in both objects and some array elements.

💡REST APIs

REST (Representational State Transfer) APIs are a set of conventions for building and interacting with web services. They rely on stateless, client-server communication and are often used for data exchange in a standardized way. JSON and XML are commonly used data formats in REST APIs due to their ability to represent complex data structures and their language-independence.

💡Whitespace

In the context of JSON and XML, whitespace refers to spaces, tabs, line breaks, and other non-visible characters that separate text elements. In JSON, whitespace is insignificant, meaning it does not affect the meaning of the data. In contrast, XML also treats whitespace as insignificant, but it is often used for readability. However, in YAML, whitespace is significant and affects the structure and interpretation of the data.

💡CCNA (Cisco Certified Network Associate)

CCNA is a certification program from Cisco that validates the skills and knowledge required to install, configure, operate, and troubleshoot medium-sized routed and switched networks. The certification covers a range of topics, including network fundamentals, network access, IP services, security, and automation. The video series aims to provide a free complete course for the CCNA, with a focus on understanding data serialization formats like JSON, which is a key topic in the exam.

💡Practice Exams

Practice exams are mock tests designed to mimic the structure and content of actual certification exams, providing candidates with an opportunity to assess their knowledge and readiness for the real exam. Boson Software's ExSim is mentioned as a source of high-quality practice exams for the CCNA certification, which are recommended for effective exam preparation.

Highlights

The video provides a comprehensive introduction to data serialization, focusing on JSON, XML, and YAML.

JSON is emphasized as it is a critical data serialization format for the CCNA exam.

Data serialization allows for standardized communication of data between different applications.

JSON is derived from JavaScript but is language-independent and widely used across modern programming languages.

Whitespace is insignificant in JSON, meaning spaces and line breaks do not affect the data's meaning.

JSON supports six data types: string, number, boolean, null, object, and array.

An object in JSON is an unordered list of key-value pairs, with keys as strings and values of any valid JSON data type.

Arrays in JSON are series of values separated by commas, without needing to be of the same data type.

XML is a markup language that is now commonly used for data serialization, similar to JSON but generally less human-readable.

YAML is highly human-readable and is significant for its use in network automation tools like Ansible.

YAML's structure requires careful attention to whitespace and indentation, unlike JSON and XML.

The video includes a bonus practice question from Boson Software’s ExSim for the CCNA.

Variables are containers that store values, such as 'interface_name', 'status', 'IP address', and 'netmask'.

JSON's human-readable text format makes it easy for both machines and humans to interpret data objects.

The video explains how REST APIs often use JSON, which is why it's important for CCNA candidates to understand JSON.

The quiz at the end of the video provides practice in interpreting JSON-formatted data, which is crucial for the CCNA exam.

JSON is standardized in RFC 8259, which is recommended reading for a thorough understanding of the format.

The video demonstrates the importance of JSON in facilitating communication between applications written in different programming languages.

Transcripts

play00:01

Welcome to Jeremy’s IT Lab. This is a free, complete course for the CCNA. If you like

play00:07

these videos, please subscribe to follow along with the series. Also, please like and leave

play00:12

a comment, and share the video to help spread this free series of videos. Thanks for your

play00:17

help. In this video we will look at JSON, XML, and YAML. These are known as data serialization

play00:24

languages, or data serialization formats. These allow us to format or structure data

play00:29

in a standardized way so it can be communicated between applications. This is covered in exam

play00:35

topic 6.7, which says you must be able to interpret JSON encoded data. Note that it

play00:41

only mentions JSON, not XML or YAML. So, the majority of this video will focus on JSON,

play00:48

but at the end I will take a bit of time to compare JSON to two other popular data serialization

play00:53

languages, XML and YAML.

play00:55

Here’s what we’ll cover in this video. First I’ll briefly introduce data serialization

play01:01

and why we need it. Then I’ll cover JSON. This will be the main part of this video,

play01:07

and we’ll focus on how to interpret basic JSON-encoded data. Then I’ll briefly introduce

play01:13

XML and YAML, so you can compare and contrast them with JSON. However I won’t spend so

play01:19

much time on those two, since they’re not mentioned in the exam topics list. And make

play01:25

sure to watch until the end of the video for a bonus practice question from Boson Software’s

play01:29

ExSim, the best practice exams for the CCNA.

play01:33

So, let’s take a look at what data serialization is. It is the process of converting data into

play01:40

a standardized format, or structure, that can be stored, for example in a file, or transmitted,

play01:46

for example over a network, and then be reconstructed later, perhaps by a different application.

play01:53

Why is that useful? It allows the data to be communicated between applications in a

play01:58

way both applications can understand. If one application is written in Python, and the

play02:04

other is written in Java, both languages store data differently so they need some standard

play02:09

format to send data between each other. Data serialization languages, for example JSON,

play02:16

allow us to represent variables with text. Now, what is a variable? Here are some examples

play02:22

of variables. Interface name, gigabitethernet1/1. Status, up. IP address, 192.168.1.1. Netmask,

play02:34

255.255.255.0. These are four variables. Basically, variables are containers that store values.

play02:41

For example ‘interface_name’ is a container, and it contains the value ‘gigabitethernet1/1’

play02:47

inside of it. ‘Status’ is another container, and inside there is the value ‘up’. So,

play02:53

let’s see how data exchanges would work without the use of a standard data serialization

play02:58

format. The client, for example an app trying to get information from an SDN controller,

play03:04

sends a GET message. The server, the controller, sends those variables directly to the client

play03:10

without converting them to a standard format like JSON. However, the client doesn’t understand

play03:15

the data it received. The app and the controller are programs written in different languages

play03:20

and they store data differently, they can’t communicate directly.

play03:24

So let’s see how a data serialization language such as JSON fixes that. The client sends

play03:31

a GET request. The requested variables are sent to the API, which converts them to a

play03:36

standard format, JSON, and sends them over the network to the client. Because the variables

play03:42

are in a standard format that both the client and the server understand, the client is able

play03:47

to take those variables and convert them into its own native format. Now, we haven’t looked

play03:53

at any details about how APIs work yet, I will cover them in the next video. So, this

play03:58

process might not be totally clear for you yet, but I’m sure you can see the benefit

play04:02

of having a standard data format like JSON to allow these two programs to share data

play04:07

with each other.

play04:10

Now let’s take a look at JSON. JSON, which stands for JavaScript Object Notation, is

play04:16

an open standard file format and data interchange format, meaning it can be used to store data

play04:22

as files or to send data over a network, that uses human-readable text to store and transmit

play04:27

data objects. So, although it’s used to exchange data between machines, so it must

play04:33

be easily machine-readable of course, it’s also quite human-readable. It’s easy for

play04:38

us to read and understand. It is standardized in RFC 8259, which you can access at this

play04:45

URL. Or just do a google search for RFC 8259. I recommend taking the time to read it. If

play04:52

you’re not used to reading technical documentation like this it might be a bit difficult to understand

play04:57

at first, but it’s the best source to really understand JSON. Anyway, JSON was derived

play05:03

from JavaScript, but it is language-independent and many modern programming languages are

play05:08

able to generate and read JSON data. Note that REST APIs often use JSON, which is why

play05:14

Cisco expects you to learn the basics of JSON for the CCNA exam. In JSON, whitespace is

play05:21

insignificant. What does that mean? Well, I’ll demonstrate with examples later, but

play05:27

basically it means that spaces and linebreaks don’t matter. They don’t change the meaning

play05:31

of the data. In JSON, there are four primitive data types. In the next slide I’ll demonstrate

play05:37

them, but they are string, number, boolean, and null. In addition, there are two structured

play05:43

data types, object and array. Let’s look at these six data types and see how JSON data

play05:49

is actually formatted.

play05:53

First up, the primitive data types. A string is a text value, and it is surrounded by double

play05:58

quotes. Here are some examples of strings. Hello. Notice that it is surrounded by double

play06:04

quotes. This means it is a string, a series of alphanumeric characters. These are all

play06:11

also strings. So, remember that if it’s contained within double quotes, it’s a string,

play06:16

a simple text value. Next, a number is simply a numeric value. It is not surrounded by quotes.

play06:23

So, 5, 100, or any other number. Note that the five in the string examples with the double

play06:29

quotes is a string, a text value, but the 5 down here without double quotes is a number,

play06:35

a numeric value. They are different data types. Next, a boolean is a data type that has only

play06:42

two possible values. Those are true and false. Note that they are written without quotes.

play06:49

In a networking setting, perhaps on an OSPF-enabled interface a variable named ‘passive’ would

play06:55

have the boolean value ‘true’ if the interface is passive, and if the interface isn’t passive

play07:00

the variable would have the boolean value ‘false’. That’s just one example of

play07:05

how boolean values could be used. Note that in the string examples I included “true”

play07:11

with double quotes. That isn’t a boolean value, that’s just the word ‘true’,

play07:15

a series of letters. However when written without double quotes, it is a boolean value.

play07:21

Finally, note that they are written all lower-case, no capital T in true or capital F in false.

play07:28

The final primitive data type is null, which represents the intentional absence of any

play07:33

object value. It’s simply written as null, lower case n u l l, without quotes. This simply

play07:40

means there is no value, it means nothing. Again, in the string examples I included “null”

play07:46

in double quotes. That is a string, because it is contained within double quotes. It does

play07:51

not express a null value, it just means the word ‘null’. Okay, those are the four

play07:56

primitive JSON data types. String, number, boolean, and null.

play08:01

Now let’s go on to the structured data types, there are two. First, an object is an unordered

play08:08

list of key-value pairs, basically variables. Unordered means the order of the variables

play08:14

doesn’t matter. Objects are surrounded by curly brackets. The key, which is basically

play08:20

the name of the variable, the container, must be a string. So, it must use double quotes.

play08:27

Then the value inside of that variable can be any valid JSON data type. A string, number,

play08:33

boolean, null, object, or array. The key and the value are separated by a colon, and if

play08:40

there are multiple key-value pairs in the object, each pair is separated by a comma.

play08:45

Okay, let’s look at some examples to help you visualize it. This is one JSON object.

play08:52

Note the curly bracket at the top indicating the start of the object, and the curly bracket

play08:56

closing it at the bottom. Inside there are five key-value pairs. Before looking at this

play09:03

object in more detail, I want to show you this. This is the exact same object. As I

play09:09

said before, in JSON whitespace is insignificant, it has no meaning. Of course, for humans the

play09:15

one on the left is easier to read, but computers don’t care either way.

play09:21

So, I’ve colored the keys blue and the values red. All of this is one JSON object, but let’s

play09:29

look at the data type of each individual key and value. First, the top one. “interface”

play09:34

in double quotes, that’s the key. Then notice a colon separating the key and the value,

play09:40

which is “gigabitethernet1/1” in double quotes. So, the key and value are both strings,

play09:46

they both have double quotes. Remember that the key must be a string, but the value can

play09:51

be any valid JSON data type. Notice that there is a comma after as well, because if there

play09:57

are multiple key-value pairs in an object, each pair is separated by a comma. Okay, in

play10:03

the next key-value pair under it the key is “is_up”. It’s a string, of course. Notice

play10:09

the colon between the key “is_up” and the value, which is true, written without

play10:13

double quotes. That is a boolean. This probably indicates that the interface status is up,

play10:20

because of the value true for the key “is_up”. Again, notice the comma after this key-value

play10:25

pair, because there is another key-value pair after it. For these next two examples, the

play10:31

values are both strings, because they are contained within double quotes. Notice the

play10:36

standard JSON formatting again. The key is always a string, there is a colon between

play10:41

the key and value, and there is a comma after each key-value pair. Now let’s look at the

play10:47

final pair. What data type is the value 1000? It’s a number, a numeric value not contained

play10:54

in double quotes. And notice that this time there is no comma after the value. That’s

play10:59

because it’s the last key-value pair in this object. Okay, so that’s a basic JSON

play11:05

object with multiple key-value pairs inside.

play11:08

Now, as you can see in the following example, objects are a valid data type for the value

play11:14

of a key-value pair. I’ve colored the curly brackets to make it a bit easier to see, but

play11:19

I want you to pause the video to try to interpret this data. Find the key value pairs. It’s

play11:25

important that you get comfortable reading JSON-formatted data, as it’s clearly stated

play11:30

in the CCNA exam. Okay, so this example is one JSON object, indicated by the red curly

play11:36

brackets at the top and bottom. Inside of this object there are two key-value pairs.

play11:42

Here’s one key-value pair. The key is “device”, a string of course, and the value is an object,

play11:49

indicated by the blue curly brackets. So, we have an object inside of an object. Note

play11:55

that objects within objects are called ‘nested objects’. Now, within that value, the object,

play12:01

there are multiple key-value pairs. “name”:”R1” is a key-value pair, “vendor”:”Cisco”

play12:07

is a key-value pair, and “model”:”1101” is a key-value pair. Now down here we have

play12:13

one more key-value pair, and again the value is an object, indicated by the purple curly

play12:19

brackets. And inside of that object there are again more key-value pairs. I’m keeping

play12:24

this fairly easy to read by using indenting and using line breaks and different colors,

play12:30

but keep in mind that JSON data won’t always look like this. The whitespace is insignificant

play12:35

and only used to make it easier for us to read, but applications themselves don’t

play12:40

need this whitespace.

play12:42

Okay, now there is one more JSON structured data type to look at, and that is the array.

play12:49

An array is a series of values separated by commas. Note that it’s not a series of key-value

play12:55

pairs, that’s an object. It’s just a series of values. And note that the values don’t

play13:01

have to be the same data type. One could be a string, and another a number, for example.

play13:06

So, here I’ve got one JSON object with two key-value pairs, and both of the values are

play13:13

arrays. The first array, the value of the “interfaces” key, lists three interface

play13:19

names, with a comma between each of them. Note that there is no comma after gigabitethernet1/3,

play13:25

because it’s the last value. And then the second array has two values, “Hi” and

play13:30

5. Note that “Hi” is a string and 5 is a number, because it has no double quotes.

play13:37

So, as you can see the values don’t necessarily have to be the same type, although often they

play13:41

will be. If you need to, pause the video now to look at this example and make sure you

play13:47

understand it, as well as the previous examples. Just listening to me talk about JSON won’t

play13:52

help you interpret it if you don’t practice actually looking at and understanding JSON-formatted

play13:57

data.

play13:59

For reference, here is the output of SHOW IP INTERFACE BRIEF, and a version of the same

play14:04

output in JSON. Note that this isn’t actual JSON output from a Cisco device, I just wrote

play14:11

this JSON data myself. The point is that, although SHOW command outputs in the CLI are

play14:16

easy for us humans to read, they aren’t in a format that is easy for computers to

play14:20

understand. JSON, on the other hand, is very easy for computers to understand, and if we

play14:26

format the text properly like this it’s also quite human-readable too. Anyway, pause

play14:32

the video if you want to compare this SHOW command output and the JSON data.

play14:37

Okay, so we’ve looked at all of the six JSON data types. There are four primitive

play14:42

data types: string, number, boolean, and null, and two structured data types: object and

play14:49

array. One more point, note that an object is sometimes called a dictionary. Same thing,

play14:55

just a different name, but you should be aware of it. Okay, that’s all for JSON for now.

play15:00

We’ll take a quick look at XML and YAML, and then in the quiz for today’s video we’ll

play15:05

get lots of practice interpreting JSON data.

play15:09

So, here’s XML. XML was developed as a markup language, but is now used as a general data

play15:17

serialization language. You know what a data serialization language is, but what’s a

play15:21

markup language? Markup languages are used to format text, for example HTML, which you’ve

play15:27

probably heard of, is a markup language. XML is generally less human-readable than JSON,

play15:34

although it’s not so difficult to read. Like JSON, whitespace is insignificant, although

play15:40

you’ll often see it displayed with spaces and line breaks to make it more human-readable.

play15:45

XML is also often used by REST APIs, same as JSON. The general format you need to know

play15:52

is this: the key is tagged like this, with the value in the middle. For example, on Cisco

play15:58

IOS you can use a SHOW command, pipe the command with the FORMAT keyword, and it will display

play16:04

it in XML. I used SHOW IP INTERFACE BRIEF, pipe, FORMAT, and here is the output in XML

play16:12

format. I’ve colored the output to make it easier to see, so I think you can easily

play16:17

see the keys and values. We have two interfaces, each marked with ENTRY tags. Within each entry

play16:24

we have Interface, IP-address, OK, Method, Status, and Protocol keys, and the value is

play16:30

in the middle of those keys. For example, here we have an tag, with a value

play16:35

of GigabitEthernet0/0, and then a forward slash interface tag to close it off.

play16:43

And here you can compare the regular SHOW IP INTERFACE BRIEF output with the XML-formatted

play16:48

output, without any coloring in the XML this time. XML is generally thought to be less

play16:54

human-readable than JSON, but it’s still not so hard to read when formatted like this.

play16:58

So, that’s all I’ll say about XML. If you’re familiar with HTML, it looks quite

play17:04

similar. Remember basic characteristics like the key-value pair format for variables using

play17:11

tags, remember that whitespace is insignificant, and remember that it’s similar to HTML and

play17:17

also used by REST APIs. If you want to take some time to examine this output pause the

play17:22

video, but now I’ll move on.

play17:25

Finally, let’s take a brief look at YAML. The name YAML originally meant Yet Another

play17:32

Markup Language, but to distinguish its purpose as a data-serialization language rather than

play17:37

a markup language, it was repurposed to YAML Aint Markup Language. That’s known as a

play17:44

recursive acronym by the way, when the acronym itself is part of the acronym. YAML is used

play17:50

by the network automation tool Ansible, which we’ll cover in another video. It has all

play17:55

sorts of other uses too, of course, but its use in Ansible is relevant to our current

play17:59

topic, network automation. YAML is very human-readable, and whitespace is significant, unlike JSON

play18:07

and XML. So, indentation is very important. We aren’t free to format the text however

play18:13

we want. YAML files start with three hyphens, and one hyphen is used to indicate a list.

play18:20

Key value pairs are represented as key colon value. There are more rules to YAML, of course,

play18:27

but I’ll leave it there. Here’s an example of YAML. This is the same SHOW IP INTERFACE

play18:32

BRIEF data I showed you in JSON and XML. It looks quite simple compared to JSON and XML.

play18:40

And for comparison, here it is next to JSON. As you can see, both languages are quite human-readable,

play18:46

and they’re also used by applications to communicate data. So, that’s all I’ll

play18:51

say about YAML. You don’t need to know it or XML as much as you need to know JSON, but

play18:56

you should know basic things such as the fact that whitespace is significant in YAML, and

play19:01

that it’s used in Ansible, because we’ll be studying Ansible in a future video.

play19:06

Here’s what we covered in this video. I gave a basic introduction to data serialization

play19:12

and why we need it. Basically, it’s to provide a standard data format so applications can

play19:18

communicate the data with each other. Then I introduced JSON, XML, and YAML, focusing

play19:24

primarily on JSON because it’s the one you really need to know for the CCNA. Now, in

play19:27

today’s quiz I will give more questions than usual so you can practice reading and

play19:34

interpreting JSON data. And make sure to watch until the end of the quiz for a bonus question

play19:40

from Boson Software’s ExSim, the best practice exams for the CCNA. Okay, let’s go to quiz

play19:46

question 1.

play19:49

In which of the following data serialization languages is whitespace significant? Pause

play19:54

the video now to select the best answer.

play19:58

Okay, the answer is B, YAML. In JSON and XML whitespace is not significant, it has no meaning.

play20:08

However in YAML whitespace is significant, so things like indentation are very important.

play20:13

Okay, let’s go to question 2.

play20:17

Which of the following data serialization languages formats key-value pairs like this?

play20:22

Key, value, and then forward slash key. Pause the video now to select the best answer.

play20:30

Okay, the answer is C, XML. XML uses HTML-like tags like this to indicate key-value pairs.

play20:40

Okay, let’s go to question 3.

play20:44

Which of the following is NOT a valid JSON data type? Pause the video now to select the

play20:49

best answer.

play20:53

Okay, the answer is E, key. Although JSON defines key-value pairs, key isn’t actually

play21:01

a data type. All keys must be strings, and string is a valid data type. Okay, let’s

play21:08

go to question 4.

play21:11

Examine the JSON-formatted data. Which of the following statements is true? Pause the

play21:16

video now to select the best answer.

play21:20

Okay, the answer is C, there are too many commas. Here I’ve highlighted the extra

play21:29

comma. A comma is required between separate key-value pairs in an object, but you should

play21:34

not put a comma after the last key-value pair. Okay, let’s go to question 5.

play21:42

Examine the JSON-formatted data. Which of the following statements is true? Pause the

play21:47

video now to select the best answer.

play21:51

Okay, the answer is B, the value of “ip_interfaces” is an array. Now, within that array there

play22:00

are multiple objects, but as these square brackets indicate, the value itself is an

play22:05

array, that’s the JSON data type. Okay, let’s go to question 6.

play22:12

Which of the following is an example of valid JSON-formatted data? Pause the video now to

play22:18

select the best answer.

play22:21

Okay, the answer is D. Let me point out the errors in the others. In A, there is a comma

play22:30

after the “interfaces” key. It should be a colon. In B, there is a colon after this

play22:36

value 5. A colon should only be used between the key and value of a key-value pair, it

play22:42

is not valid here. And in C, there is a missing comma between gigabitethernet1/1 and gigabitethernet1/2.

play22:51

If multiple values are listed in an array, there must be a comma between each of them.

play22:56

There are no problems with D, it is valid JSON data. Okay, let’s go to question 7.

play23:05

Examine the JSON-formatted data. Which of the following statements is true? Pause the

play23:10

video now to select the best answer.

play23:14

Okay, the answer is A, the value of “is_up” is a boolean. I’ve highlighted it here.

play23:23

It’s true, written without double quotes, so it is a boolean value. Booleans can be

play23:28

true or false, and they are written without quotes. Okay, let’s go to question 8.

play23:36

Examine the JSON-formatted data. Which of the following statements is true? Pause the

play23:41

video now to select the best answer.

play23:46

Okay, the answer is D, it is valid JSON data. No comma or curly brackets are missing, and

play23:54

whitespace is insignificant in JSON, so this is validly formatted. We often use indentation

play24:01

and line breaks to make it easier to read, but whitespace like that is unnecessary and

play24:05

doesn’t have any meaning in JSON. Okay, let’s go to question 9.

play24:12

Examine the JSON-formatted data. Which of the following statements is true? I think

play24:17

this question will be a bit more of a challenge. Make sure each opening curly bracket has a

play24:23

closing curly bracket, each opening square bracket has a closing square bracket, each

play24:28

string has double quotes, etc. Pause the video to select the best answer.

play24:35

Okay, the answer is C, a square bracket is missing. The value of the “routes” key

play24:44

is an array, it has an opening square bracket, but in the example on the left there is no

play24:49

closing square bracket for that array. Again, make sure to check carefully that each opening

play24:54

bracket has a closing bracket. Let’s go to question 10.

play25:01

Examine the JSON-formatted data. Which of the following statements is true? Pause the

play25:06

video now to select the best answer.

play25:10

Okay, the answer is A, it is valid JSON data. There are no missing curly brackets or square

play25:19

brackets, and the value of “dhcp4” is a string, not a boolean. Okay, I hope this

play25:25

practice was helpful for you. That’s all for the quiz. Now let’s take a look at a

play25:29

bonus question from Boson Software’s ExSim for CCNA.

Rate This

5.0 / 5 (0 votes)

Related Tags
DataSerializationJSONFormatXMLStandardYAMLUsageCCNAPrepITFundamentalsNetworkingDataAPICommunicationDataInterchangeTechnicalTutorial