Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Modules · YANG

Direct answer

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.

When to use this

Use this when reading a YANG module's namespace, revision, imports and tree.

First 30 seconds

1. Modules are YANG files with namespace, prefix, revision.

2. Import other modules.

3. Device announces supported modules/revisions.

4. Use the device's revision.

5. Store models locally for tooling.

Operational verification

module (namespace, revision) → data definitions

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
YANG 1.1 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 1.1 data modeling · 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 reading a YANG module's namespace, revision, imports and tree.
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.

2 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 revision mismatch, namespace ambiguity, wrong list keys, typedef/union coercion, ignoring must/when constraints and confusing schema existence with instance existence, choosing the cases most relevant to module name/namespace/revision, imports/includes, revision selection and capability exposure to clients.

Step 2 Common mistakes Narrow the fault
  • Using a model revision the device does not support.
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
  • A module has name, namespace, prefix and revision.
  • It imports other modules.
  • It defines nodes, RPCs and notifications.
Key checks
  • pyang -f tree <module>.yang | head — module contents
  • Module revision date — version
  • Imports/includes — dependencies
ReferenceWhy it matters1 section · depth on demand

What it is

A YANG module defines a data model (containers, lists, leaves, RPCs) with a namespace, prefix and revision.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

A YANG module is a self-contained data model file: it has a name, namespace, prefix and revision, and defines containers, lists, leafs, types and RPCs for one area such as interfaces or OSPF. Devices advertise which modules (and revisions) they support.

module example-vlans {
  namespace "urn:example:vlans";
  prefix vl;
  revision 2026-01-10;
  container vlans {
    list vlan {
      key "id";
      leaf id   { type uint16 { range "1..4094"; } }
      leaf name { type string; }
    }
  }
}
pyang -f tree example-vlans.yang

Modules come from IETF/IEEE (vendor-neutral), OpenConfig (operator-driven) and vendors (native models with full feature coverage). Automation often mixes them: standard models where they cover the need, native models for the rest.

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 1.1 data modeling current

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

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

Deep reference

Healthy vs suspicious evidence

Output interpretation

For module name/namespace/revision, imports/includes, revision selection and capability exposure to clients, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?