JSON
JavaScript Object Notation
General information on “JSON”:
- Open-standard data format
- Primary meant for data serialization and presentation = machine-readable
- Two main structures:
- Objects: Known as Dictionary. Unordered collection of key/value pairs.
- Lists: Elements of the same object.
- Objects:
- Curly braces { } enclose name:value comma-separated pairs
- Lists:
- Square brackets [ ] hold comma-separated elements
- Multi-line notation is common
- Whitespace is not significant
“JSON” code example:
{
"ietf-interfaces:interfaces": {
"interface": [
{
"name": "GigabitEthernet1",
"description": "MANAGEMENT INTERFACE - DO NOT TOUCH ME",
"type": "iana-if-type:ethernetCsmacd",
"enabled": true,
"ietf-ip:ipv4": {
"address": [
{
"ip": "10.10.20.48",
"netmask": "255.255.255.0"
}
]
},
"ietf-ip:ipv6": {}
},
]
}
}