Concepts / Automation and APIs

Automation and APIs

JSON

Also called jq, object, array, key-value, YAML, XML, data serialization, data format

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.

See it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab