Table of Contents
Applications use different programming languages. They store variables used in these programs differently. Because all the programming languages use different architecture. For example, C++ uses a style, Java uses another and Python uses a different one. All these programs’ store mechanism is different. There is no standard between them. During REST API operation, if one side REST Client uses different program and the other end REST Server uses the other one, they can not communicate without a third interpreter. Here, Data Serialization Languages are used. By using this language, both end become similar and they can understand eachother. With Data Serialization Languages, in other words, applications gain a standard method for their different variable mechanisms. One of the most popular one used in Network Automation is JSON (JavaScript Object Notation). Here, we will learn JSON, YAML and XML.
So, how is this Data Serialization Language, JSON work between REST Client and REST Server? Let’s check this mechanism step by step
As you can see above, here JSON plays an interpreter role. The five steps process is like below:
Data Serialization Languages are very important for Network Automation. By using these standards as an interpreter, different applications can communicate eachother. There are differetn types of Data Serialization Languages. The most popular one is JSON (JavaScript Object Notation) for Network Automation. But beside JSON, there are two more languages used for this purposes. So, what are these three Data Serialization Languages? These are:
JSON (JavaScript Object Notation) is one of the most popular data modeling language used in Network Automation. Espacially for your network operations and Cisco Certification Studies, this model is important. JSON is a Human-readable language that one can easily understand what it says.
JSON (JavaScript Object Notation) was developed at 2002. Its structure is Map structure and it is a fast data serialization language.
You can find JSON format examples below:
{
Heros: [
{
name: Aragorn,
race: Human,
role: King
}
]
}
Or
{
Routers: [
{
hostname: Backbone-1,
model: CRS-X,
role: Core
}
]
}
XML (eXtensible Markup Language) has originally developed for dynamic web pages. With this language, web pages that has dynamic content can be updated easily. But its properties make it also a good data serialization languge for today’s World. It is a little difficult to read XML file but not too much. As in HTML, beginnign and ending tags are used in XML.
XML (eXtensible Markup Language) was developed at 1996. Its structure is Tree structure and it is slow data serialization language, if we compare with JSON.
You can find XML format examples below:
<Heros>
<Hero>
<name>Aragorn</name>
<race>Human</race>
<role>King</role>
</Hero>
</Heros>
Or
<Routers>
<Router>
<hostname>Backbone-1</hostname>
<model>CRS-X</model>
<role>Core</role>
</Router>
</Routers>
YAML (YAML Ain’t Markup Language) is a data serialization language that has a very funny recursive name. As its name imlies, it isnot a markup language like XML. Instead, it is a data serialiaztion language. If we compare with XML and JSON, YAML is more easy and user friendly. You can easily reas a YAML file.
YAML (YAML Ain’t Markup Language) was developed at 2006. Its structure is Map structure and it is a fast data serialization language.
You can find YAML format examples below:
Heros:
name: Aragorn
race: Human
role: King
Or
Routers:
hostname: Backbone-1
model: CRS-X
role: Core
You can find a comparison table of JSON, YAML and XML below.
Leave a Reply