Use it when configuring, checking or troubleshooting YANG in Network Automation.
YANG · Network Automation
YANG in Network Automation provides the data-model contract that gives structured network configuration and state predictable paths, types, constraints and module identities.
1. YANG models describe config and state.
2. Native vendor models are most complete; OpenConfig/IETF are portable.
3. Explore with pyang/YANG Suite.
4. Check device versions.
5. Validate payloads against models.
YANG model → data structure → API payloads
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 Operational evidence path Verify boundary
automation intent → YANG module/revision/features → schema path/types/constraints → encoded instance data → protocol/server support → resource state → network acceptance
Healthy evidence: module revision, namespace, features and schema path are explicit, instance data validates and device/network read-back matches intent.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: automation binds to a similarly named node in the wrong module, ignores deviations/features or assumes schema validity equals operational validity.
Step 3 Common mistakes Narrow the fault
- Model revision mismatch.
Step 4 Where it fails Narrow the fault
Where YANG usually goes wrong: module/revision/namespace identity, schema constraints, config/state nodes and instance-data validation.
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.
- YANG module exists ≠ target implements the required revision or feature.
- Schema-valid data ≠ operationally safe intent.
- Same leaf name ≠ same semantics across different namespaces/modules.
- Model support ≠ every device exposes identical data completeness.
pyang -f tree <module>.yang | head— model tree- Device-supported models (capabilities/yang-library) — what's available
- Native vs OpenConfig vs IETF models — choice
ReferenceWhat it is1 section · depth on demand
Core model
Separate model/module identity and revision, schema path/type validation, server capability support, encoded instance data and real operational semantics.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
YANG establishes a data-model contract, but it does not show device support, semantic safety or network correctness on its own.
In depth
In network automation, YANG models define the structure of the data you send and receive. Choosing between native vendor models and vendor-neutral models (OpenConfig, IETF) decides how portable your automation is.
| Model family | Trade-off |
|---|---|
| Vendor native (Cisco-IOS-XE-native) | Full feature coverage, vendor-specific |
| OpenConfig | Multi-vendor, fewer features |
| IETF | Standard basics (interfaces, IP) |
pyang -f tree Cisco-IOS-XE-native.yang | less
Generate payloads from data with libraries or templates, and validate them against the model before sending.
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 Network Automation > YANG. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7950 · confidence 94%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 Network Automation proof-boundary map
Fast intent/scope, management-operation, device-state and network-acceptance boundaries for YANG.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Intent / scope | Source revision and exact targets are explicit | Stale inventory, hidden selector or wrong variables change scope |
| Management operation | Transport/model/payload and per-device response are traceable | Auth/capability/parser differences hide partial or wrong execution |
| Device state | Effective and persistent state are read back | Accepted config/API result is mistaken for convergence |
| Network proof | Original control/data-plane or service test passes | Automation summary substitutes for actual network acceptance |
Deep reference
Healthy vs suspicious evidence
Output interpretation
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.