RESTCONF (CCNA)
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.
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
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.
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
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 · 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.
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.
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
ReferenceHow it works2 sections · depth on demand
How it works
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
Official Sources
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+jsonandapplication/yang-data+xml. - Security: TLS is mandatory, and servers must implement
ietf-yang-library.
RESTCONF compared with NETCONF (RFC 8040)
| RESTCONF | NETCONF 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)
| Parameter | Use |
|---|---|
content=config or content=nonconfig | Configuration only or state only |
depth=n | Limit the levels returned |
fields=a;b | Return selected children only |
with-defaults | Include or exclude default values |
Errors and their meaning (RFC 8040)
| Status | Typical cause |
|---|---|
| 400 | Invalid request or payload |
| 401 | No read access (access-denied) |
| 404 | The resource instance doesn't exist |
| 405 | Method not allowed on that resource |
| 409 | The 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
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: Lab device; names, addresses and secrets are examples.
username automation privilege 15 secret <secret>
ip http secure-server
ip http authentication local
restconfExpected output
curl -u automation:<secret> -H "Accept: application/yang-data+json" https://<device>/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet1Expected 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.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 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%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.
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