Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Lists

Direct answer

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.

When to use this

Use this when YANG lists hold keyed entries.

First 30 seconds

1. Lists are collections keyed by one or more leafs.

2. Key required in each entry.

3. RESTCONF addresses entries with =key.

4. ordered-by user lists keep order.

5. Replace vs merge affects entries.

Operational verification

list[key] → entries

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 YANG lists hold keyed entries.
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.

1 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 Common mistakes Narrow the fault
  • Omitting the key when creating entries.
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
  • Lists hold entries identified by keys.
  • All entries share the same children.
  • Keys appear in RESTCONF URIs.
Key checks
  • pyang -f tree <module>.yang | grep '\[' — lists with keys
  • List key in RESTCONF URL (=key) — addressing
  • ordered-by user — ordering
ReferenceWhy it matters1 section · depth on demand

What it is

A YANG list is a set of entries identified by key leaves (e.g. interface name).

ReferenceImportant terms & boundaries2 sections · depth on demand

How it works

Each list entry is identified by its key leaf (or leaves). Clients address one entry with the key in the path, and devices reject entries with duplicate keys. Unkeyed lists exist only in operational (config false) data.

Example

list interface {
  key "name";
  leaf name { type string; }
  leaf enabled { type boolean; default true; }
}

In RESTCONF the key appears in the URL: /interface=GigabitEthernet1.

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 > Lists. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://www.rfc-editor.org/rfc/rfc7950 · confidence 94%
Confirmation

Confirm action

Continue?