Use this Topic when designing, reviewing, operating or troubleshooting network automation behavior around RESTCONF. Keep source/target selection, management transaction, device state and independent network acceptance as separate proof boundaries.
RESTCONF · Network Automation
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.
Pin intent and source revision → resolve inventory and exact targets → identify platform/capabilities plus transport/auth context → preserve generated command/RPC/API payload → capture per-device response and partial failures → read back effective/persistent state → verify control-plane/data-plane or service acceptance → archive evidence and test rollback/recovery where relevant.
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.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
target/HTTPS trust → RESTCONF root/resource → authz/model context → HTTP operation/payload → response/error → resource read-back → device/network acceptance
- Record endpoint, TLS identity, RESTCONF root/API context and relevant YANG module revision.
- Confirm HTTP method, resource path, content type and payload semantics before mutation.
- Capture status, headers and error body rather than reducing the result to success/failure.
- Read back the resource and verify resulting network state independently.
Healthy evidence: endpoint trust, resource/model context, operation and response align and subsequent resource plus network verification matches intent.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: wrong resource path or model revision returns plausible data, or HTTP success is treated as evidence of network convergence.
It does not show every adjacent device, protocol dependency, traffic path or future network condition. RESTCONF shows the modeled HTTP resource transaction, not the complete operational network effect.
Next check: Continue from the first step that has not been verified: reproduce the same source revision, inventory selection and target context, preserve the raw management operation and response, then read back effective device state and rerun the original bounded network acceptance test before retrying or widening scope.
Step 3 Branching troubleshooting Narrow the fault
RESTCONF — branching diagnostic path. Concrete boundaries: client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload. IF the prerequisite/input boundary is wrong, THEN stop and repair that prerequisite before interpreting downstream state. ELSE IF input is correct but owner state is transitional or stalled, THEN inspect the state-machine owner, timer/retry/error reason and whether progress changes between samples. ELSE IF local/control state is healthy but the operation still fails, THEN move to effective/programmed state and the next consumer/data path. Finally repeat the original test from the original source and verify return/dependency behavior before closure.
Step 4 Where it fails Narrow the fault
Where RESTCONF usually goes wrong: HTTP/YANG resource identity, media types, method semantics, error-tags and datastore read-back. Do not relabel one layer's failure as another: authentication differs from authorization, selection differs from execution, parsing differs from semantic validation, queueing differs from completion, and controller success differs from consumer-visible convergence. Timeout or connection loss is ambiguous because work may continue after the client stops waiting. Preserve pre-state, exact versioned intent, correlation IDs and the first concrete error. Recovery should repair the earliest failing step, not widen permissions, weaken validation or duplicate the operation to see if it eventually works. Where partial success is possible, enumerate changed and unchanged objects explicitly and define whether compensating rollback is safe. This keeps Network Automation → RESTCONF remediation evidence-driven and prevents stale cache, repeated mutation or a green intermediate status from being mistaken for evidence.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
A success response here is not evidence that the API security policy is correct or that the network service works end to end.
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
ReferenceWhat it is3 sections · depth on demand
Direct Answer
This RESTCONF Topic is the Network Automation workflow entry point. Automation → RESTCONF owns the shared protocol mechanics and operational examples; REST API Security owns the security requirements.
Scope and canonical references
Continue to RESTCONF for YANG resources, methods, paths, response interpretation and read-only protocol examples. Use REST API Security for TLS, credentials, authorization and least privilege. Existing local technical sections, Commands and Evidence are retained for their established context; no canonical identity is redirected or replaced.
Core model
RESTCONF in Network Automation exposes YANG-modeled network configuration and operational resources through HTTP-based resource operations.
Resolve HTTPS trust, RESTCONF root/resource path, YANG media/schema context, authorization, request semantics, response status/body and post-write resource/network state.
- HTTPS connection ≠ RESTCONF resource authorized.
- HTTP success ≠ YANG resource changed as intended.
- Returned JSON/XML ≠ operational data current without datastore/context awareness.
- Resource update ≠ device or path convergence.
ReferenceWhy it matters1 section · depth on demand
How it works in operation
RESTCONF — operational mechanics and state ownership. API automation crosses client serialization/authentication, transport, endpoint routing/validation, policy, request acceptance and often an asynchronous worker/reconciler. HTTP 2xx or a job ID shows acceptance at one step, not that the target resource changed. Completion status still must be followed by target read-back and workload verification. For this Topic, map each observed value to the component that owns it, the transition that changes it, and the next consumer of that state. Keep requested/configured, learned/calculated, effective/programmed and workload-visible states separate. This distinction is what makes the reference useful when a management surface is healthy but the real transaction is not.
ReferenceImportant terms & boundaries6 sections · depth on demand
Official Sources
What this shows and what it does not
RESTCONF shows the modeled HTTP resource transaction, not the complete operational network effect.
API automation crosses client serialization/authentication, transport, endpoint routing/validation, policy, request acceptance and often an asynchronous worker/reconciler. HTTP 2xx or a job ID shows acceptance at one step, not that the target resource changed. Completion status still must be followed by target read-back and workload verification. Trace this Topic using stable identifiers through request accepted → job/task execution → target object change → effective read-back → original workload verification. At each boundary, compare the value that the responsible component actually exposes with the value the next consumer receives; note timers, counters, state transitions and scope such as interface, namespace, VRF, tenant, host, guest, identity, device or resource where applicable. If the upstream state is healthy, move to the next independently observable boundary instead of repeating the same configuration check. Close with Correlate request/job IDs, require terminal success, GET/read the target state independently, confirm the runtime consumed the change, then run the original workload. and state what the evidence does not show.
Proof Boundaries
A success response here is not evidence that the API security policy is correct or that the network service works end to end.
Mechanics
Keep desired state, controller/runtime status and target-observed state as separate facts. A successful parser, accepted request, queued job or green workflow is intermediate evidence only until the owned target state is independently read. Preserve machine-readable identifiers, revisions, timestamps and per-target results so repeated labels or mutable names cannot silently redirect the operation. For Network Automation → RESTCONF, the practical question is whether the exact intended object, revision, principal and state transition were selected and whether another operator can reproduce the decision and independently verify the final consumer-visible state.
Common mistakes
- Wrong media type.
In depth
In network automation workflows, RESTCONF is attractive because any HTTP client can use it: scripts, Ansible's uri module, Postman or a CI job. The typical pattern is read current state, compute the difference, send PATCH or PUT, and read back to verify.
import requests
s = requests.Session(); s.auth = (user, pw)
s.headers.update({"Accept": "application/yang-data+json", "Content-Type": "application/yang-data+json"})
url = "https://r1/restconf/data/Cisco-IOS-XE-native:native/hostname"
if s.get(url, timeout=10).json()["Cisco-IOS-XE-native:hostname"] != "r1-oslo":
s.patch(url, json={"Cisco-IOS-XE-native:hostname": "r1-oslo"}, timeout=10).raise_for_status()
| Choice | Consideration |
|---|---|
| PATCH (merge) | Safe for partial changes |
| PUT (replace) | Removes siblings not in the payload |
| Native vs OpenConfig models | Coverage vs portability |
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Manage Network Automation → RESTCONF as versioned automation. Store the relevant definition/configuration with explicit scope, stable target identity, dependencies, permissions, versions, timeout/retry policy and rollback/disable behavior. Changes to selectors, defaults, schema/API versions, provider/module/runtime versions, retry rules, concurrency, authentication scope or persistence semantics are semantic changes even when syntax still parses. Before promotion, resolve selectors against a bounded inventory and fail closed on ambiguous identity. Separate reusable logic from environment-specific values and keep secrets in the platform's intended secret store; do not copy secret material into examples, logs or audit output. Preserve the previous reviewed intent so rollback is a known transition rather than reconstruction from memory. Keep runtime caches, queues, generated artifacts and logs separate from persistent desired state. Retirement and expiry rules should prevent stale automation from continuing indefinitely.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Network Automation > RESTCONF. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc8040 · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
RESTCONF Network Automation proof-boundary map
Fast intent/scope, management-operation, device-state and network-acceptance boundaries for RESTCONF.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Intent / scope | Source revision and exact targets are explicit | Stale inventory, hidden selector or wrong variables change scope |
| Management operation | Transport/model/payload and per-device response are traceable | Auth/capability/parser differences hide partial or wrong execution |
| Device state | Effective and persistent state are read back | Accepted config/API result is mistaken for convergence |
| Network proof | Original control/data-plane or service test passes | Automation summary substitutes for actual network acceptance |
Network Automation → RESTCONF · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for Network Automation → RESTCONF.
| Layer | Network Automation → RESTCONF operational reference |
|---|---|
| Runtime/ownership | network automation · the automation client/controller, network management/API plane and network device control plane that owns configuration/state |
| Persistent intent | versioned inventory, device identity, desired configuration or state query, transport/API contract and verification policy |
| Topic-specific focus | RESTCONF semantics inside Network Automation: stable identity, versioned intent, state transitions, edge cases, negative cases, and an independent verification boundary; specifically HTTP/YANG resource identity, media types, method semantics, error-tags and datastore read-back. |
| Verification | Run one bounded Network Automation → RESTCONF fixture in a non-production scope. Record controller/client run ID, device stable ID/management address, interface/object identifier and configuration revision; inspect the control-plane/runtime result; then query the network device configuration, operational state and forwarding behavior affected by the automation through an independent read path and compare the observed state with the versioned intent. |
| Expected interpretation | The bounded fixture selects only the intended identity, exercises RESTCONF semantics inside Network Automation: stable identity, versioned intent, state transitions, edge cases, negative cases, and an independent verification boundary; specifically HTTP/YANG resource identity, media types, method semantics, error-tags and datastore read-back, reaches an unambiguous terminal result, preserves any partial-success/error detail, and the independent read-back of the network device configuration, operational state and forwarding behavior affected by the automation matches the reviewed intent without unintended extra change. |
| Recovery boundary | Repair the earliest demonstrated failing layer in inventory/source of truth → client/controller → transport/API → device config/control plane → operational state → forwarding/consumer behavior → read-back; preserve the first error and current target state, then rerun the bounded fixture and independent read-back. |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Output for Network Automation → RESTCONF should let another operator reconstruct selection, decision, execution and final effect. Add timestamps, attempt numbers, definition/schema/runtime versions and correlation identifiers when available. Represent accepted, queued, running, completed and independently verified as distinct states when the technology is asynchronous; do not map every non-error return to success. For collections, fleets or parallel work, retain per-item/per-target results so partial success remains visible. Redact credentials, tokens and sensitive payloads while keeping stable references that allow the authoritative execution record to be retrieved. A summary should state which object was selected, which revision/rule/configuration made the decision, what mutation or no-op occurred, and what independent read-back showed afterward. For RESTCONF semantics inside Network Automation: stable identity, versioned intent, state transitions, edge cases, negative cases, and an independent independent check; specifically HTTP/YANG resource identity, media types, method semantics, error-tags and datastore read-back, prefer typed fields and stable IDs over presentation text. Keep raw protocol/tool diagnostics or durable links to them because normalization can remove the exact error code, path or status needed for diagnosis. The expected-output contract here is authored semantic documentation, not a claim that a real environment produced a specific sample.