Automation and APIs
JSON
The text format APIs exchange data in: objects of key: value pairs, arrays, strings, numbers, true, false and null.
{ } holds an object (keys in double quotes, each with a value), [ ] an array (an ordered list).
A value is a string, a number, true/false, null, an object or an array, nested as deep as needed.
jq pretty-prints JSON (jq .) and picks parts out (.interfaces[].name, keys, length,
select(.protocol == "static")). The same data can be written as YAML (structure by indentation, - per list
item: Ansible, many config files) or XML (values between opening and closing tags: NETCONF). An API picks the format
from the request's Accept header and names it in Content-Type.