DevNet Associate DEVASC 200-901 Official Certification Guide by Adrian Iliesiu (z-lib.org)

(andrew) #1
router3 is in San Jose and has IP 192.168.30.1.
router4 is in London and has IP 192.168.40.1.

JavaScript Object Notation (JSON)


JavaScript Object Notation (JSON) is a data structure
that is derived from the Java programming language, but
it can be used as a portable data structure for any
programming language. It was built to be an easily
readable and standard way for transporting data back
and forth between applications. JSON is heavily used in
web services and is one of the core data formats you need
to know how to use in order to interact with Cisco
infrastructure. The data structure is built around
key/value pairs that simplify mapping of data and its
retrieval. Example 5-2 shows an example of JSON.


Example 5-2 JSON

Click here to view code image


{
"interface": {
"name": "GigabitEthernet1",
"description": "Router Uplink",
"enabled": true,
"ipv4": {
"address": [
{
"ip": "192.168.1.1",
"netmask": "255.255.255.0"
}
]
}
}
}

In Example 5-2, you can see the structure that JSON
provides. interface is the main data object, and you can
see that its value is multiple key/value pairs. This nesting

Free download pdf