Domain 1 of 4 · Chapter 3 of 6

Network Automation with RESTCONF

Unlock the complete study guide + 1,040 practice questions across 16 full exams.

Bundled into the existing Designing, Deploying and Managing Network Automation Systems premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • RESTCONF: HTTP verbs over a YANG datastore
  • The URL walks the YANG tree
  • Choosing the verb: POST, PUT, PATCH, DELETE
  • Status codes and ietf-restconf:errors
  • Media types: Content-Type and Accept
  • Building the JSON body: YANG to JSON
  • Exam patterns: valid URLs, verbs, and bodies

RESTCONF verbs mapped to datastore operations

PropertyPOSTPUTPATCHDELETE
Datastore operationCreate childCreate or replaceMerge leavesRemove
IdempotentNoYesNoYes
Target already exists409 (data-exists)ReplacedMerged intoDeleted
Target absentCreated (201)Created (201)404 (no target)404 (no target)
Success code201 Created204 (201 on create)204 No Content204 No Content
Best suited toOne-shot createDeclarative convergenceSurgical leaf editsTeardown

Decision tree

Read, or change it? read GET / HEAD retrieve · 200 OK change Delete the resource? yes DELETE remove · 204 keep it Replace it entirely? replace all PUT idempotent · 204 / 201 partial Does it exist yet? no · create POST 201 · 409 if it exists yes · merge PATCH merge leaves · 204 RESTCONF writes running directly: no candidate / commit any non-2xx carries an error-tag in an ietf-restconf:errors body

Cheat sheet

  • RESTCONF root exposes /data and /operations resources
  • YANG containers and lists map to URL path segments
  • The first node and cross-module nodes carry the module prefix
  • content, depth, and fields query parameters shape retrieval
  • POST creates a new child data resource
  • PUT creates-or-replaces the target and is idempotent
  • PATCH merges partial edits; DELETE removes the resource
  • RESTCONF status codes: 201, 204, 400, 404, 409
  • yang-data+json/+xml are the RFC 8040 media types
  • Content-Type and Accept govern request vs response encoding
  • Errors are returned as ietf-restconf:errors
  • IOS-XE enables RESTCONF over HTTPS/443
  • Native model nests IPv4 under ip/address/primary with mask
  • Native and IETF/OpenConfig models have distinct URIs
  • JSON keys must match YANG leaf names exactly
  • PUT body wraps the target container, module-qualified

Unlock with Premium — includes all practice exams and the complete study guide.

References

  1. https://datatracker.ietf.org/doc/html/rfc8040
  2. https://datatracker.ietf.org/doc/html/rfc7950
  3. https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/1715/b_1715_programmability_cg/m_1715_prog_restconf.html
  4. https://www.rfc-editor.org/rfc/rfc9110
  5. https://datatracker.ietf.org/doc/html/rfc7951
  6. https://datatracker.ietf.org/doc/html/rfc8343