Pcornel
Automation · Network Automation

RESTCONF

Cheat sheet · https://pcornel.dk/topic.php?topic=5593

Back to the Topic

Answer

RESTCONF is an HTTPS-based API for reading and changing network device configuration and state defined by YANG models, using JSON or XML. This Topic covers using it in network automation workflows; protocol details are in Automation → RESTCONF and security in REST API Security.

Remember

A success response here is not evidence that the API security policy is correct or that the network service works end to end.

First checks

  • curl -s --cacert dev-ca.pem -u <u>:<p> -H 'Accept: application/yang-data+json' https://<dev>/restconf/data/ietf-interfaces:interfaces — GET
  • Root resource discovery (/.well-known/host-meta) — base path
  • Enabled on device (restconf, ip http secure-server) — prerequisites

Verify in this order

target/HTTPS trust → RESTCONF root/resource → authz/model context → HTTP operation/payload → response/error → resource read-back → device/network acceptance

Local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.

Local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return path or regression → explicit Evidence boundary.

Where it usually breaks

RESTCONF proves the modeled HTTP resource transaction, not the complete operational network effect.

Client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload.

RESTCONF Network Automation proof-boundary map

BoundaryHealthy evidenceSuspicious evidence
Intent / scopeSource revision and exact targets are explicitStale inventory, hidden selector or wrong variables change scope
Management operationTransport/model/payload and per-device response are traceableAuth/capability/parser differences hide partial or wrong execution
Device stateEffective and persistent state are read backAccepted config/API result is mistaken for convergence
Network proofOriginal control/data-plane or service test passesAutomation summary substitutes for actual network acceptance

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5593

Confirmation

Confirm action

Continue?