Automation
Automation (about 20%) tests data formats and APIs, model-driven configuration, scripting, and orchestration tools - the vocabulary and mechanics behind DNA Center and SD-WAN programmability.
Data formats and APIs
- JSON: objects in braces, arrays in brackets, strings in double quotes; no comments. XML uses elements/attributes and namespaces. YANG is a data-modeling language, not a data format.
- REST uses HTTP methods: GET reads, POST creates, PUT replaces, PATCH partially updates, DELETE removes. Common status codes: 200 OK, 201 Created, 204 No Content, 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 500 Server Error.
- NETCONF runs over SSH port 830 and uses XML; RESTCONF runs over HTTPS and can use JSON or XML. Both use YANG models. gNMI/gRPC is common for telemetry.
Tooling
- Python is used for scripts and API calls; requests handles HTTP, json parses payloads. Ansible is agentless and uses YAML playbooks over SSH/API; Puppet and Chef use agents and manifests/recipes; SaltStack uses minions. Git tracks versions and enables collaboration; CI/CD automates test and deployment.
- Cisco DNA Center Intent API and SD-WAN vManage API expose controllers. EEM runs Tcl/applets on-device for event-driven actions.
Worked example
A script must read the description of interface GigabitEthernet1/0/1 from a RESTCONF-capable device. It sends GET to the interface URI with Accept: application/yang-data+json and an authentication token. A 200 response returns a JSON object; the script parses it with json.loads() and reads the description field. If the response is 404, the path or model is wrong; 401 means the token is missing/expired. Reasoning: RESTCONF is HTTP-based, so content negotiation and status codes matter; the YANG path identifies the data.
Traps
- Saying YANG is a data format such as JSON.
- Using GET to change configuration; GET must be safe.
- Forgetting that NETCONF uses SSH/830, not HTTPS.
- Assuming Ansible needs an agent; it is agentless.
- Treating a 204 as an error; it is success with no body.
- Expecting JSON to allow comments.