Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

PATCH · RESTCONF

Direct answer

RESTCONF PATCH merges the supplied data into the existing resource, changing only the given fields, which is the usual safe way to update configuration.

When to use this

Use this when updating part of a configuration with RESTCONF.

First 30 seconds

1. PATCH merges changes into existing data.

2. Plain PATCH = merge.

3. YANG Patch for ordered multi-edit operations (if supported).

4. Doesn't remove unlisted nodes.

5. Verify.

Operational verification

PATCH partial → merged

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
RESTCONF / YANG HTTP automation
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.

PlatformRESTCONF / YANG HTTP automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when updating part of a configuration with RESTCONF.
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.

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

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 partial update semantics, patch media type, absent-versus-null behavior, target path and verifying untouched fields remain unchanged.

Step 2 Common mistakes Narrow the fault
  • Wrong media type (application/json), causing 415.
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 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
Key points
  • PATCH merges supplied fields.
  • Safest way to change.
  • Returns 204 on success.
Key checks
  • curl -s --cacert ca.pem -u <u>:<p> -X PATCH -H 'Content-Type: application/yang-data+json' -d @partial.json https://<dev>/restconf/data/<path> — merge
  • YANG Patch (application/yang-patch+json) for complex edits — RFC 8072
  • Verify merged result — GET
ReferenceWhy it matters1 section · depth on demand

What it is

PATCH merges the body into the existing resource — the usual way to change a few leaves.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

A RESTCONF PATCH merges the body into the existing resource: listed fields are added or changed, others stay as they are. It is the safest way to make small, targeted changes.

curl -s -u admin:pass -X PATCH -H 'Content-Type: application/yang-data+json' \
  https://10.0.0.1/restconf/data/ietf-interfaces:interfaces/interface=GigabitEthernet2 \
  -d '{"ietf-interfaces:interface": {"name": "GigabitEthernet2", "description": "Uplink to core"}}'

Plain PATCH (merge) cannot delete individual fields; use DELETE for those, or YANG Patch (RFC 8072, application/yang-patch+json) for multiple edits including deletes in one request where the device supports it.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
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 docRESTCONF / YANG HTTP automation current

Authoritative/upstream documentation reviewed for bounded claims in RESTCONF > PATCH. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc8040 · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For partial update semantics, patch media type, absent-versus-null behavior, target path and verifying untouched fields remain unchanged, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?