Use this when configuring or reading Cisco IOS XE through RESTCONF over HTTPS.
RESTCONF · Cisco Automation
RESTCONF on Cisco IOS XE and NX-OS exposes YANG-modelled configuration and operational data over HTTPS, so you can manage devices with REST calls instead of CLI. Protocol details are in Automation → RESTCONF and security in REST API Security.
Enable restconf and ip http secure-server → authenticate → GET the YANG path to read → PATCH to change → GET again to verify → save config.
Local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
restconfPrimary Commands
Configuration and operational commands for this Topic.
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 Effective-state and workload closure Verify boundary
RESTCONF — layered verification. Correlate request/job IDs, require terminal success, GET/read the target state independently, confirm the runtime consumed the change, then run the original workload. Verify in this order: local authoritative state → adjacent dependency or peer/backend → effective/programmed state → the original workload/request → return path or regression check where relevant. Record what each observation shows and what it cannot show. A command, API or GUI status should close only the layer it directly observes; it does not automatically validate the next dependency or user-visible outcome. For counters, use a controlled test and confirm deltas. For asynchronous work, require terminal state plus target read-back. For policy, verify the actual decision and enforcement point, not only the configured rule.
Step 2 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as platform syntax/model drift, privilege/auth mismatch, partial config, parser success without feature activation, asynchronous convergence and controller cache differing from device state, choosing the cases most relevant to HTTP/YANG resource model, supported methods, encoding, errors and read-back; the protocol is not a generic arbitrary REST API. Capture the exact run/request/message/task identity, versioned definition, selected target IDs and pre-state before mutation. If the operation is asynchronous, follow it to a terminal state and then query the owned target through a read path that does not depend on the write response. If repeatability/idempotency is expected, run the same intent again and show that the second run is a no-op or a bounded re-evaluation rather than duplicate mutation. Verification is insufficient if it only shows that syntax parsed, transport accepted a request, a controller queued work, or a workflow ended. Preserve errors from the earliest failing layer rather than retrying broadly until a later green status hides the original fault.
Step 3 Branching troubleshooting Narrow the fault
RESTCONF — branching failure-boundary diagnosis. Concrete boundaries: client payload/auth → HTTP transport → endpoint validation/policy → request accepted → queued/job execution → target mutation → effective state → consumer workload. Branch A: if the prerequisite/input boundary is wrong, stop there and repair that prerequisite before interpreting downstream state. Branch B: if input is correct but transition/decision state is stalled, inspect the owner of the state machine, its timer/retry/error reason and whether progress changes between two samples. Branch C: if control/management state is healthy but the original operation still fails, move outward to programmed/effective state and the consumer or data path. Branch D: if the original test succeeds only after a change, repeat it from the original source and verify return/dependency behavior before closing. A recent change, log entry or error counter is supporting evidence only when it aligns with the same boundary, object and time window.
Step 4 Where it fails Narrow the fault
A failure at one layer must not be relabeled as another: authentication/authorization differs from target absence, parsing differs from policy/validation rejection, scheduling differs from execution, and controller success differs from consumer-visible convergence. Timeout or connection loss is especially 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 expand permissions, weaken validation or duplicate the operation to see if it eventually works. When partial success is possible, enumerate changed and unchanged objects explicitly and define whether compensating rollback is safe. This keeps Cisco Automation → RESTCONF remediation evidence-driven and prevents a green control-plane status, stale cache or repeated mutation from being mistaken for evidence.
A success response here is not evidence that the API security policy is correct or that the network service works end to end.
show running-config | include restconf|ip http secure— enabledcurl -s --cacert ca.pem -u <u>:<p> https://<dev>/restconf/data/Cisco-IOS-XE-native:native/hostname— test- Valid HTTPS certificate on device — TLS
ReferenceWhat it is2 sections · depth on demand
Direct Answer
This RESTCONF Topic is the Cisco Automation platform 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.
ReferenceWhy it matters1 section · depth on demand
Internals and state
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. Automation evidence ladder: request accepted → job/task succeeded → target object changed → effective runtime state → original workload verified. For this Topic, keep requested/configured state separate from learned or calculated state, programmed/effective runtime state, and the final workload-visible result. The practical reason is diagnostic: a healthy object at one layer can coexist with a failure immediately before or after it. Follow ownership of state, identifiers, timers/counters and the exact consumer context instead of treating a successful management read as end-to-end health. Capture the identities that bind the path together—interface, namespace, process, VM, policy, session, target, device, route, principal or job as applicable—so observations from different layers refer to the same transaction.
ReferenceImportant terms & boundaries5 sections · depth on demand
Official Sources
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
Do not collapse parser/API acceptance, controller completion and target-evidence of the actual state into one green status. This matters because automation can return success while a later reconciler, worker, transport, target subsystem or consumer still fails. The reference should preserve object identity across every layer, distinguish desired state from observed state, and prefer machine-readable IDs/revisions over mutable labels. The linked authority for bounded mechanics is RFC 8040 — RESTCONF Protocol; documentation support is separate from observed lab/production Evidence. For Cisco Automation → RESTCONF, the practical question is not merely whether a tool ran, but whether the exact intended object was selected, the correct semantic contract was applied, and the final state can be reproduced and independently observed.
Common mistakes
- Wrong media type or URL-encoding of keys.
In depth
On Cisco IOS XE, RESTCONF is enabled with restconf plus the HTTPS server, and uses the same YANG models as NETCONF (native Cisco-IOS-XE-native, IETF and OpenConfig). On NX-OS it is enabled with feature restconf; IOS XR focuses on NETCONF and gNMI.
ip http secure-server
ip http authentication local
restconf
username automation privilege 15 secret <secret>
Documented example, not captured output.
| Check | Command/request |
|---|---|
| Service running | show platform software yang-management process |
| API root | GET /restconf |
| Supported models | GET /restconf/data/ietf-yang-library:modules-state |
RESTCONF changes apply to the running configuration; save with copy running-config startup-config or the cisco-ia:save-config RPC.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
Manage Cisco Automation → RESTCONF as versioned automation. Pin or record implementation/schema/API versions when behavior can drift, and keep environment-specific identifiers/secrets outside reusable logic where possible. Before promotion, resolve selectors against a bounded inventory and fail closed on ambiguous identity. Changes to defaults, API/schema versions, scheduler/timezone behavior, parser coercion, runner/controller versions, transport capabilities or trust scope are semantic changes even when syntax still parses. Preserve the previous reviewed intent so rollback is a known transition rather than reconstruction from memory. Keep runtime artifacts, caches, logs and transient execution state separate from persistent intent. Secrets belong in the platform's intended secret store and must not be copied into generated examples, logs or audit output. A fresh noninteractive execution should be reproducible from source-controlled intent plus documented prerequisites, and retirement/expiry rules should prevent stale Cisco Automation → RESTCONF automation from continuing indefinitely.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Configuration & expected output
Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.
Configuration example
Assumptions: Review ownership, target identity, permissions and environment before mutation.
topic: RESTCONF
parent: Cisco Automation
identity: explicit stable IDs
intent: version-controlled
scope: bounded test target
negative_case: required
verify: independent target read-back
authority: RFC 8040 — RESTCONF ProtocolVerification 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 Cisco Automation > RESTCONF. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc8040 · confidence 94%Quick lookup tables
Cisco Automation → RESTCONF · operational reference
Context-specific ownership, verification, output and failure-boundary lookup for Cisco Automation → RESTCONF.
| Layer | Cisco Automation → RESTCONF operational reference |
|---|---|
| Runtime/ownership | RESTCONF / YANG HTTP automation · the automation client/controller communicating with Cisco devices through supported APIs, YANG models or CLI |
| Persistent intent | versioned automation with device inventory, platform/model capability expectations and bounded configuration intent |
| Topic-specific focus | HTTP/YANG resource model, supported methods, encoding, errors and read-back; the protocol is not a generic arbitrary REST API |
| Verification | Run one bounded Cisco Automation → RESTCONF fixture in a non-production scope. Record device ID/management endpoint, platform/version, YANG model/revision or CLI operation, request/run ID; inspect the runtime/control-plane result; then query the selected Cisco device configuration/operational state and forwarding behavior where relevant through an independent read path and compare it with the versioned intent. |
| Expected interpretation | The bounded fixture resolves only the intended identity, exercises HTTP/YANG resource model, supported methods, encoding, errors and read-back; the protocol is not a generic arbitrary REST API, reaches an unambiguous terminal result, and the independent read-back of the selected Cisco device configuration/operational state and forwarding behavior where relevant matches the reviewed intent without unintended extra change. |
| Recovery boundary | Repair the earliest failing layer in inventory/controller → transport/API/CLI → device parser/YANG datastore → control-plane state → forwarding/operational read-back; read current target state before any mutating retry. |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Output for Cisco Automation → RESTCONF should be structured so another operator can reconstruct selection, decision, execution and final effect. Add timestamps, attempt numbers, implementation/schema versions and correlation identifiers when available. Report accepted/queued/running/completed/verified as distinct states when the technology is asynchronous; do not map every non-error return to 'success'. For collections 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/config made the decision, what mutation or no-op occurred, and what independent read-back showed afterward. For HTTP/YANG resource model, supported methods, encoding, errors and read-back; the protocol is not a generic arbitrary REST API, prefer typed fields and stable IDs over human presentation text. Keep raw protocol/tool errors or durable links to them because normalized summaries can remove the exact error class/path needed for diagnosis. The expected-output contract in this release is semantic documentation, not a claim that a real environment produced a particular sample.