Use this when working with writable YANG data.
Configuration Data
1. Configuration data (config true) is writable intent.
2. Stored in datastores.
3. Read with get-config or content=config.
4. Write via edit-config/RESTCONF.
5. Validate before commit.
config nodes → datastore → device behaviour
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
yanglint <model.yang> <data.json>Primary 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 Command read-back and what it shows Verify boundary
Verification for YANG → Configuration Data must distinguish state, not merely report that a command ran. With yanglint <model.yang> <data.json>, known-good means instance data validates against the exact module revision/feature/deviation set expected for the target and a bounded server-side validate/read-back accepts the same intended configuration; known-broken/suspicious means module import/revision mismatch, schema constraint errors, unresolved references or offline-valid data rejected by the target because capabilities/model set differ. yanglint <module.yang> <data-file> shows instance-data conformance to the locally supplied YANG schema set, but it does not show target device capabilities, datastore locks or successful application.
Step 2 Common mistakes Narrow the fault
- Writing to config data that is not supported by the device.
Step 3 Observation-driven branch and next-check logic Narrow the fault
When YANG → Configuration Data fails, reproduce the smallest original case and capture yanglint <model.yang> <data.json> before mutation. Use the observation to choose the next check: if module/schema cannot load, fix revision/import path first; if data violates type/must/reference rules, correct instance semantics; if offline validation passes but server rejects, compare advertised modules/features/deviations and datastore operation semantics.
- config true nodes — configuration
- get-config / GET ?content=config — read config
- edit-config / PUT/PATCH — write config
ReferenceHow it works1 section · depth on demand
How it works
YANG → Configuration Data should be reasoned about as a state pipeline, not as one command outcome. The responsible state is YANG module/schema set, instance-data encoding, datastore context and leaf/list constraints that determine whether configuration data conforms to the intended network data model. YANG-based validation loads the relevant module revisions and evaluates instance data against schema structure, types, must/when constraints and references before it is sent through NETCONF/RESTCONF; meanwhile module feature flags, deviations, vendor augmentations, datastore state and server capabilities are separate things to check. This distinction is especially important because syntactically valid XML/JSON can violate the YANG model, while data that validates against one module revision may be rejected by a device advertising another revision/deviation set.
ReferenceImportant terms & boundaries1 section · depth on demand
Method
YANG configuration data is the config true part of a model — settings you can write — as opposed to config false operational state. Working with it reliably follows a fixed method.
1. Find the configuration path in the model tree (pyang -f tree, YANG Suite).
2. Read the current value with <get-config> or RESTCONF GET (?content=config).
3. Build the payload with the exact namespace, keys and types.
4. Choose the operation: merge, replace or delete (nc:operation / PATCH vs PUT).
5. Apply to candidate or running, validate, commit.
6. Read back and compare with the intended data.
| Mistake | Effect |
|---|---|
| PUT/replace on a parent container | Removes siblings not in payload |
| Wrong namespace prefix | unknown-element |
Writing a config false node | Rejected |
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 YANG > Configuration Data. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7950 · confidence 94%