Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

YANG

Direct answer

YANG defines typed, hierarchical configuration, state, RPC and notification schemas used by model-driven interfaces.

When to use this

Use it to construct valid instance paths and payloads from modules rather than guessing CLI-to-JSON mappings.

First 30 seconds

1. YANG is a data modelling language for network config and state.

2. Modules, containers, lists, leafs.

3. Used by NETCONF, RESTCONF, gNMI.

4. Native, OpenConfig, IETF models.

5. Validate data against models.

Operational verification

YANG model → data tree → API payload

Evidence · next step

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.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
YANG data modeling
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.

PlatformYANG data modeling · Exact syntax, defaults, scale and output fields vary by platform and IOS / IOS XE release. · Cisco IOS / IOS XE
Key commandshow platform software yang-management process
Scope / prerequisiteUse it to construct valid instance paths and payloads from modules rather than guessing CLI-to-JSON mappings.
Show · 1
What next?3 suggested next steps
Child topics (this level)10
Catalog command links1
Evidence1
On this pageJump to a specific section
Verification

Show Commands

Read-only and diagnostic commands for confirming state, narrowing a fault and interpreting the current boundary.

Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

4 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 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 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.

command output · 1
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic YANG Fundamentals

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 Modules

A 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 Containers

A YANG container groups related nodes under one name, such as an interfaces container holding all interface entries, without holding a value itself.

Subtopic Lists

A 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 Leafs

A 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 Lists

A YANG leaf-list holds several values of the same type, such as a list of DNS servers or permitted VLANs, without keys.

Subtopic Data Types

YANG 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 Data

Configuration 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 Data

Operational 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 Models

YANG models come as IETF standard models, OpenConfig vendor-neutral models and vendor native models, such as Cisco-IOS-XE-native.

Key points
  • Module namespace and revision identify the schema context
  • Container groups nodes; list repeats keyed entries; leaf holds one typed value
  • config true/false separates writable configuration from operational state
  • Schema tree is not the same as instance data; constraints, defaults and augmentations matter.
Key checks
  • pyang --version — tool
  • pyang -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 constructMeaning
moduleTop-level model, with namespace and revision
containerGroup of related nodes
listRepeated entries identified by a key
leaf / leaf-listSingle value / list of values
config falseOperational (read-only) data
augment, deviationExtend 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
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
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 docYANG data modeling current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
YANG modelYANG container list leafOpenConfig native model
Embedded reference data

Quick lookup tables

YANG Data Models evidence chain

Configuration, operational state, counters and downstream proof remain separate.

BoundaryQuestionEvidenceDoes not prove
DefinitionWhat is configured or intended?running configuration / controller policylive operation
Local stateIs the feature active at the expected scope?show platform software yang-management processremote success
CountersDid controlled traffic or an event reach this stage?scoped counters/timestampscomplete return path
Next boundaryWhat consumes or transports this state?module/revision → schema tree → instance path/list keys → typed payload → protocol encoding → server validationapplication success
Depth when you need it

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.

Confirmation

Confirm action

Continue?