Use this when replacing a resource completely via RESTCONF.
PUT · RESTCONF
RESTCONF PUT creates or fully replaces the target resource with the supplied data, so anything not included is removed. Use it carefully.
1. PUT creates or replaces the target resource.
2. Replaces the whole subtree — missing children are removed.
3. Idempotent.
4. Good for declarative intent.
5. Verify after.
PUT path + full subtree → replaced
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 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as wrong resource URI, PUT/PATCH replacement semantics confusion, stale conditional requests, content-type mismatch and treating 2xx as state convergence, choosing the cases most relevant to replace-or-create semantics for the exact resource, complete representation expectations, conditional requests and post-replacement read-back.
Step 2 Common mistakes Narrow the fault
- PUT with a partial body, deleting other settings.
Step 3 Where it fails Narrow the fault
Common failure classes include wrong resource URI, PUT/PATCH replacement semantics confusion, stale conditional requests, content-type mismatch and treating 2xx as state convergence.
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.
- PUT replaces the whole resource.
- Missing fields are removed.
- Use with care.
curl -s --cacert ca.pem -u <u>:<p> -X PUT -H 'Content-Type: application/yang-data+json' -d @full.json https://<dev>/restconf/data/<path>— replace- Full desired subtree in payload — semantics
- Idempotent — safe retry
ReferenceWhy it matters1 section · depth on demand
What it is
PUT creates or replaces the target resource completely; anything not in the body is removed.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
A RESTCONF PUT creates or replaces the target resource with exactly the body sent. Anything under that resource not in the body is removed, so PUT is idempotent and declarative — and dangerous when aimed too high in the tree.
curl -s -u admin:pass -X PUT -H 'Content-Type: application/yang-data+json' \
https://10.0.0.1/restconf/data/ietf-interfaces:interfaces/interface=Loopback100 \
-d '{"ietf-interfaces:interface": {"name": "Loopback100", "type": "iana-if-type:softwareLoopback", "description": "managed"}}'
Returns 201 if created, 204 if replaced. A PUT on a whole container (e.g. all interfaces) replaces every entry — only do that when the body is the complete intended configuration.
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 RESTCONF > PUT. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc8040 · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For replace-or-create semantics for the exact resource, complete representation expectations, conditional requests and post-replacement read-back, prefer typed fields and stable IDs over human presentation text.