Use it to construct valid instance paths and payloads from modules rather than guessing CLI-to-JSON mappings.
YANG
YANG defines typed, hierarchical configuration, state, RPC and notification schemas used by model-driven interfaces.
YANG model → data tree → API payload
1. Identify module/revision/namespace.
2. Trace container/list keys to the target leaf.
3. Check type and constraints.
4. Confirm config versus state.
5. Validate instance data and server-supported capabilities.
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
show platform software yang-management processShow Commands
Read-only and diagnostic commands for confirming state, narrowing a fault and interpreting the current boundary.
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 Layered verification Verify boundary
YANG — layered verification closure. Close the Topic in layers: local authoritative state → adjacent dependency/peer/backend → effective or programmed state → original workload/request → return path or regression. For every observation record what it supports, what it does not show, and the next discriminating check. A configuration read-back, successful job, established session or healthy status closes only the layer it directly observes.
Step 2 Verification path Verify boundary
To verify YANG, first record module namespace/name/revision, schema node path and datastore/resource identity. Then check the result reported by the tool, and finally read the modeled configuration or operational data exposed by the management system directly and compare it with what you intended.
Also test the cases that usually go wrong: wrong module revision, namespace/path confusion, constraint violations, config/state conflation and treating schema validity as device-evidence of the actual state.
Step 3 Branching troubleshooting Narrow the fault
Path: Automation → YANG. Local intent: YANG reference area for automation architecture, operation and troubleshooting.
Step 4 Where it fails Narrow the fault
Trace a failure along the path it takes: module/schema → parser/validator → datastore mapping → protocol operation → target system → instance-data read-back.
Typical problems with YANG: wrong module revision, namespace/path confusion, constraint violations, config/state conflation and treating schema validity as device-evidence of the actual state.
What to watch: module/revision/namespace identity, schema constraints, config/state nodes and instance-data validation.
Before you retry a change, read the target's current state first, using module namespace/name/revision, schema node path and datastore/resource identity.
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.
Subtopics
Go one level deeper into this subject.
YANG fundamentals: YANG (RFC 7950) models network configuration and state as a tree of containers, lists and leafs, used by NETCONF, RESTCONF and gNMI so tools and devices share one data definition.
Subtopic ModulesA YANG module is a file defining one model with a name, namespace, prefix, revision and the data nodes, RPCs and notifications it provides, often importing other modules.
Subtopic ContainersA YANG container groups related nodes under one name, such as an interfaces container holding all interface entries, without holding a value itself.
Subtopic ListsA YANG list holds multiple entries identified by a key, such as interfaces keyed by name, each entry with the same set of child nodes.
Subtopic LeafsA YANG leaf holds a single value of a defined type, such as an interface's mtu or description, and is the endpoint of the data tree.
Subtopic Leaf ListsA YANG leaf-list holds several values of the same type, such as a list of DNS servers or permitted VLANs, without keys.
Subtopic Data TypesYANG data types define allowed values for leafs, such as string, uint32, boolean, enumeration, ip-address and typedefs with ranges and patterns, so devices can validate input.
Subtopic Configuration DataConfiguration data in YANG is the writable part of a model, marked config true, such as interface descriptions and IP addresses, which NETCONF and RESTCONF can change.
Subtopic Operational DataOperational data in YANG is read-only state, marked config false, such as interface counters or neighbour tables, retrieved with get or RESTCONF GET but not configured.
Subtopic YANG ModelsYANG models come as IETF standard models, OpenConfig vendor-neutral models and vendor native models, such as Cisco-IOS-XE-native.
- Module namespace and revision identify the schema context
- Container groups nodes; list repeats keyed entries; leaf holds one typed value
config true/falseseparates writable configuration from operational state- Schema tree is not the same as instance data; constraints, defaults and augmentations matter.
pyang --version— toolpyang -f tree <model>.yang— model structure- Supported models on device (yang-library) — availability
ReferenceWhat it is1 section · depth on demand
What it is
YANG defines typed, hierarchical configuration, state, RPC and notification schemas used by model-driven interfaces.
ReferenceWhy it matters1 section · depth on demand
When to use it
Use it to construct valid instance paths and payloads from modules rather than guessing CLI-to-JSON mappings.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
YANG is a data modelling language that describes exactly what configuration and operational data a device or service has: names, types, allowed values, hierarchy and constraints. Protocols such as NETCONF, RESTCONF and gNMI carry data that follows these models, so tools can validate data before sending it.
| YANG construct | Meaning |
|---|---|
module | Top-level model, with namespace and revision |
container | Group of related nodes |
list | Repeated entries identified by a key |
leaf / leaf-list | Single value / list of values |
config false | Operational (read-only) data |
augment, deviation | Extend or adjust another model |
Models come from IETF, OpenConfig and vendors (Cisco native). Explore them with pyang -f tree ietf-interfaces.yang or YANG Suite before writing payloads.
Mechanics
Automation → YANG is owned at runtime by the YANG schema/module system, datastore implementation and management protocol consuming the model. Durable intent is versioned YANG modules/revisions with explicit namespace, schema tree, config/state semantics and constraints; stable identity is module namespace/name/revision, schema node path and datastore/resource identity. The consumer-visible target is the modeled configuration or operational data exposed by the management system. The operating invariants are that module/revision identity is explicit, schema constraints are enforced, config versus state semantics are preserved and instance data is independently read back. Follow the chain of components module/schema → parser/validator → datastore mapping → protocol operation → target system → instance-data read-back and record which layer currently owns truth.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle
A fresh noninteractive execution should be reproducible from source-controlled intent plus documented prerequisites, and the release must retain enough identity to tie every result back to module namespace/name/revision, schema node path and datastore/resource identity.
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. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7950 · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
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.
Quick lookup tables
YANG Data Models evidence chain
Configuration, operational state, counters and downstream proof remain separate.
| Boundary | Question | Evidence | Does not prove |
|---|---|---|---|
| Definition | What is configured or intended? | running configuration / controller policy | live operation |
| Local state | Is the feature active at the expected scope? | show platform software yang-management process | remote success |
| Counters | Did controlled traffic or an event reach this stage? | scoped counters/timestamps | complete return path |
| Next boundary | What consumes or transports this state? | module/revision → schema tree → instance path/list keys → typed payload → protocol encoding → server validation | application success |
Deep reference
Healthy vs suspicious evidence
Output interpretation
Capture at minimum module/revision, namespace, schema path, node type, config/state flag, validation/error path and instance value.
For YANG, rely on structured fields and stable IDs (module/revision/namespace identity, schema constraints, config/state nodes and instance-data validation) rather than text formatted for display.