Pcornel
Browse topics
Options
Recent
Favorites
Networking · Technical reference

RESTCONF (CCNA)

Direct answer

RESTCONF is an HTTPS API for reading and changing YANG-modelled configuration and state on network devices, using JSON or XML. Protocol details and examples are in Automation → RESTCONF.

When to use this

Use it to read or change device configuration from a script over HTTPS, or when a RESTCONF request to a device fails.

First 30 seconds

Enable restconf and HTTPS → GET /restconf/data/<module:path> with Accept yang-data+json → PATCH change → GET to verify → save config.

Operational verification

restconf and ip http secure-server enabled → HTTPS reachable, user with privilege 15 → GET /restconf/data/<module>:<path> with Accept application/yang-data+json → 200 and JSON → PATCH or PUT a change (204) → GET to verify → save the configuration

Failure signatureRESTCONF returns 404 or 400 for a configuration request

GET or PATCH to a RESTCONF URL fails with 404 Not Found or 400 Bad Request.

Possible stored cause: The URL path does not match the YANG module and keys, or the Content-Type/Accept headers are wrong.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Protocol standard + deployed implementation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformProtocol standard
Scope / prerequisiteUse it to read or change device configuration from a script over HTTPS, or when a RESTCONF request to a device fails.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

7 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

GET or PATCH to a RESTCONF URL fails with 404 Not Found or 400 Bad Request.

Step 1 Verification & evidence Verify boundary

GET a known resource, inspect content type/data path, then perform safe PATCH/PUT in sandbox and validate response.

Step 2 NETCONF/RESTCONF operational verification Verify boundary

Configuration transport success is not network-state success. After a NETCONF/RESTCONF change, retrieve intended modeled state/config and independently verify the relevant protocol/service outcome. This keeps API response, device configuration, and operational network state as separate evidence layers.

Step 3 Common failure modes Narrow the fault

Wrong YANG path, namespace/content type, auth, unsupported method or invalid payload.

Step 4 Troubleshooting workflow Narrow the fault

1. Define the exact symptom and affected scope.

2. Verify prerequisite transport/interface state.

3. Collect the most direct protocol/policy evidence.

4. Compare observed state with intended state.

5. Change one cause at a time and verify end to end.

Focus for this topic: Wrong YANG path, namespace/content type, auth, unsupported method or invalid payload.

Step 5 Common mistakes Narrow the fault
  • Wrong media type: RESTCONF needs application/yang-data+json (or +xml).
  • Using PUT (replace) where PATCH (merge) was intended, deleting existing config.
  • Not saving the configuration afterwards.
Step 6 RESTCONF failure layers Narrow the fault

Troubleshoot in layers: transport/TLS → authentication/authorization → HTTP method/status → RESTCONF resource URI → YANG data model → JSON/XML payload → device validation. A 401/403 is not a data-model problem; a 404 may be path/resource related; 4xx validation errors can indicate payload/schema issues.

Step 7 API evidence should end in network-state verification Narrow the fault

Record method, URI, headers, status code and response body. Compare the payload fields against the YANG model, then GET/read back the resource and verify the resulting network behavior with device commands. API transport success is not the same as end-to-end intent success.

Evidence references

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.

observation · 1
Command lookup Jump straight to Cisco syntax
Key points

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

Key checks

show running-config | include restconf|http secure-server → both enabled. show platform software yang-management process → the RESTCONF processes are running. curl -u user:pass -H "Accept: application/yang-data+json" https://<device>/restconf/data/ietf-interfaces:interfaces → 200 with JSON.

ReferenceWhat it is3 sections · depth on demand

Direct Answer

This RESTCONF Topic is the retained Networking/ENCOR entry point. Automation → RESTCONF owns the shared protocol mechanics and operational examples; REST API Security owns the security requirements.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

Concept overview

HTTP-based access to YANG-modeled configuration and operational data.

Key ideas: RESTCONF maps modeled resources into HTTP URIs and structured payloads while using HTTP methods/status codes for operations.

ReferenceWhy it matters1 section · depth on demand

Why it matters

RESTCONF maps modeled resources into HTTP URIs and structured payloads while using HTTP methods/status codes for operations.

ReferenceHow it works2 sections · depth on demand

How it works

Programmability separates data representation/model from transport and authorization. JSON/YAML encode data, YANG describes structured network data, REST/RESTCONF/API calls carry requests, and authentication/authorization control whether an operation is accepted.

RESTCONF layers: HTTP, resource path and YANG model

RESTCONF uses HTTPS/HTTP semantics to access YANG-modeled configuration and operational data. Separate four layers: transport/TLS, authentication/authorization, HTTP method/resource path, and YANG payload/schema validity.

A 401/403 is primarily an identity/authorization signal; a 404 may point to resource/path; 400-series validation errors can indicate payload/model problems. A successful response still needs read-back or operational verification of the intended device state.

ReferenceImportant terms & boundaries4 sections · depth on demand

Important terms and limits

Key terms: endpoint/resource, HTTP method, status code, header, payload, JSON, YANG, RESTCONF, authentication, authorization, idempotency and schema/model.

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.

In depth

RESTCONF: YANG data over HTTPS

RESTCONF gives HTTP-style access to the same YANG-modelled data as NETCONF. RFC 8040 defines it:

  • Discovery: clients find the API root through /.well-known/host-meta, typically /restconf.
  • Data: configuration and state live under {+restconf}/data.
  • Methods: GET reads, POST creates or invokes an operation, PUT creates or replaces, PATCH merges and DELETE removes.
  • Encodings: application/yang-data+json and application/yang-data+xml.
  • Security: TLS is mandatory, and servers must implement ietf-yang-library.

RESTCONF compared with NETCONF (RFC 8040)

RESTCONFNETCONF equivalent
GET<get>, <get-config>
POST<edit-config> with create, or an RPC
PUT<edit-config> with replace or create
PATCH<edit-config> with merge
DELETE<edit-config> with delete (remove isn't supported)

Query parameters (RFC 8040)

ParameterUse
content=config or content=nonconfigConfiguration only or state only
depth=nLimit the levels returned
fields=a;bReturn selected children only
with-defaultsInclude or exclude default values

Errors and their meaning (RFC 8040)

StatusTypical cause
400Invalid request or payload
401No read access (access-denied)
404The resource instance doesn't exist
405Method not allowed on that resource
409The datastore is locked by a NETCONF session (in-use)
R1(config)# restconf
R1(config)# ip http secure-server
dev$ curl -sk -u netadmin:'<password>' https://10.255.1.21/.well-known/host-meta
dev$ curl -sk -u netadmin:'<password>' -H "Accept: application/yang-data+json" \
  "https://10.255.1.21/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1%2F0%2F14?depth=2"
dev$ curl -sk -u netadmin:'<password>' -X PATCH -H "Content-Type: application/yang-data+json" \
  -d '{"ietf-interfaces:interface":{"name":"GigabitEthernet1/0/14","description":"User 2F-114"}}' \
  "https://10.255.1.21/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1%2F0%2F14" -w "%{http_code}\n"
dev$ curl -sk -u netadmin:'<password>' "https://10.255.1.21/restconf/data/ietf-yang-library:modules-state" | head

Encoding list keys

List keys in the URI must be percent-encoded. That is why GigabitEthernet1/0/14 becomes GigabitEthernet1%2F0%2F14. A 404 on an interface that exists is often just an unencoded slash.

Documented example, not captured output.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical examples

Configuration & expected output

Concrete examples are shown only when the stored reference contains an actual configuration or output shape for this Topic.

Configuration example

Cisco IOS XEEnable RESTCONF on IOS XE

Assumptions: Lab device; names, addresses and secrets are examples.

username automation privilege 15 secret <secret>
ip http secure-server
ip http authentication local
restconf

Expected output

Cisco IOS XEcurl -u automation:<secret> -H "Accept: application/yang-data+json" https://<device>/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1

Expected state: 200 with the interface as YANG-modelled JSON.

HTTP/1.1 200 OK
Content-Type: application/yang-data+json

{
  "ietf-interfaces:interface": {
    "name": "GigabitEthernet1",
    "type": "iana-if-type:ethernetCsmacd",
    "enabled": true
  }
}
! Illustrative output, not captured Evidence.
The key `ietf-interfaces:interface` shows which YANG module the data comes from. A 404 here usually means a wrong path or module name; 401 a credential problem; an HTML error page means RESTCONF is not enabled.
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docProtocol standard + deployed implementation RFC 8040

Authoritative/upstream documentation reviewed for bounded claims in Automation and Artificial Intelligence → RESTCONF. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc8040.html · confidence 94%
Terminology layer

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.

Embedded quick reference

Operational notes

Former standalone Cheat Sheet content now lives directly inside the Topic where it belongs.

RESTCONF request reference

Minimal request shape and troubleshooting order

GET https://<device>/restconf/data/<resource>
Accept: application/yang-data+json

Troubleshoot in order: HTTPS/TLS → authentication/authorization → method/URI → content type → YANG path/schema → read-back/operational verification.

Depth when you need it

Deep reference

Design & tradeoffs

ENCOR design tradeoffs

RESTCONF is familiar to web/API workflows but still depends on YANG models and platform capabilities.

Confirmation

Confirm action

Continue?