Automate APIs and Protocols
Domain 2, Automate APIs and Protocols, tests whether you can drive a device or controller over HTTP, NETCONF or gNMI without a GUI: the right verb, the status code that comes back, correct authentication, and what an edit actually does to existing configuration.
HTTP and REST semantics
GET is safe and idempotent; PUT replaces the target resource wholesale; PATCH merges the supplied leaves; POST creates or triggers an action and is not idempotent; DELETE removes. Know the codes: 200 OK, 201 Created, 204 No Content, 400 malformed body, 401 missing or expired credentials, 403 authenticated but not permitted, 404 no such resource, 405 wrong verb, 409 conflict, 429 rate limited, 500 server error. RESTCONF addresses the YANG tree directly, for example /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1, with application/yang-data+json in both Accept and Content-Type.
NETCONF
NETCONF runs over SSH on TCP 830, opens with a <hello> capability exchange, and frames messages with ]]>]]>. Operations include <get>, <get-config>, <edit-config>, <copy-config>, <lock> and <commit>. Inside <edit-config> the operation attribute (merge, replace, create, delete, remove) overrides default-operation, whose default is merge, not replace. Against the candidate datastore nothing applies until <commit>.
gNMI
gNMI is a gRPC service exposing Capabilities, Get, Set and Subscribe. Subscribe supports once, poll and stream modes, the last with on-change or sample-interval triggers, which is why gNMI is the usual transport for model-driven telemetry.
Authentication patterns
Basic auth is base64, not encryption, so it belongs only over TLS. Controllers add their own schemes: DNA Center issues a token for the X-Auth-Token header, Meraki expects X-Cisco-Meraki-API-Key, and vManage uses a session cookie.
Worked example
You must change one interface description on IOS XE through RESTCONF without disturbing its IP address. Send PATCH /restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1 with Content-Type: application/yang-data+json and body {"ietf-interfaces:interface": {"name": "GigabitEthernet1", "description": "Uplink to core"}}. Reasoning: PATCH merges the named leaves and leaves addressing untouched, while PUT would replace the whole list entry and could strip it. The key in the URL must match the key in the body, and every ancestor node must already exist or the server answers 400.
Traps
- Defaulting
edit-configto replace when the NETCONF default is merge. - Sending a PATCH without an accurate Content-Type, which yields 415 or 400.
- Treating 429 as fatal instead of backing off, since retrying is expected.
- Expecting candidate-datastore edits to take effect before commit.