Automation and Programmability
Automation and Programmability
Automation and Programmability checks whether you understand how software manages modern networks: SDN architecture, controller-based networking, APIs and data formats, configuration tools, and model-driven telemetry.
Core rules
- SDN separates the control plane (decisions) from the data plane (forwarding). A controller provides a central view, a northbound API to applications, and a southbound API to devices.
- Northbound interfaces are typically REST/JSON; southbound interfaces include NETCONF, RESTCONF, OpenFlow, SNMP, and CLI. Do not mix the directions.
- REST uses HTTP verbs: GET reads, POST creates, PUT replaces, PATCH modifies, DELETE removes. Status 200 = OK, 201 = created, 400 = bad request, 401 = unauthorized, 404 = not found.
- YANG is a data-modeling language, not a transport. NETCONF carries YANG-encoded XML over SSH; RESTCONF carries JSON or XML over HTTPS.
- Ansible is agentless over SSH and procedural; Puppet and Chef typically use an agent and are declarative. Python with requests or netmiko is common for scripting.
Worked example
A GET to https://controller/api/v1/devices returns 200 with a JSON array. In Python: r = requests.get(url, headers=token); devices = r.json(); names = [d['hostname'] for d in devices]. If the call returns 401, the token is missing or expired - fix authentication before debugging parsing.
Traps
Calling YANG a protocol; confusing northbound with southbound; assuming 404 means the server is down (the resource is missing); and treating Ansible as agent-based.