YANG
Cheat sheet · https://pcornel.dk/topic.php?topic=5594
Answer
YANG in Network Automation provides the data-model contract that gives structured network configuration and state predictable paths, types, constraints and module identities.
Remember
- 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.
First checks
pyang -f tree <module>.yang | head— model tree- Device-supported models (capabilities/yang-library) — what's available
- Native vs OpenConfig vs IETF models — choice
Verify in this order
YANG model → data structure → API payloads
Where it usually breaks
YANG establishes a data-model contract; it does not prove device support, semantic safety or network correctness on its own.
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
YANG Network Automation proof-boundary map
| 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 |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5594