Automation · YANG
Containers
Cheat sheet · https://pcornel.dk/topic.php?topic=5630
Answer
A YANG container groups related nodes under one name, such as an interfaces container holding all interface entries, without holding a value itself.
Remember
- Containers group related child nodes.
- They hold no value themselves.
- Presence containers mean something by existing.
First checks
pyang -f tree <module>.yang | grep '+--rw'— containers- Presence containers — meaning
- JSON/XML representation — payload
Verify in this order
container → child nodes
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
YANG → Containers · operational reference
| Layer | YANG → Containers operational reference |
|---|---|
| Runtime/ownership | YANG 1.1 data modeling · the YANG schema defining an interior container node and the server implementation instantiating that schema in configuration/operational datastores |
| Persistent intent | module/revision with container definition, child nodes, presence semantics, constraints and namespace |
| Verification | Inspect the module/revision and container schema, read the exact subtree from a supporting server, apply one valid and one constraint-violating fixture, and compare protocol errors/read-back. |
| Expected interpretation | The client addresses the correct module/schema path, presence semantics and child constraints behave as modeled, invalid data is rejected explicitly, and valid data reads back under the expected container. |
| Recovery boundary | capture schema/module revision and protocol error-path/error-tag, fix the schema path/value or client encoding, then reread the exact subtree from the target datastore |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5630