Pcornel
Automation · Network Automation

YANG

Cheat sheet · https://pcornel.dk/topic.php?topic=5594

Back to the Topic

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

BoundaryHealthy evidenceSuspicious evidence
Intent / scopeSource revision and exact targets are explicitStale inventory, hidden selector or wrong variables change scope
Management operationTransport/model/payload and per-device response are traceableAuth/capability/parser differences hide partial or wrong execution
Device stateEffective and persistent state are read backAccepted config/API result is mistaken for convergence
Network proofOriginal control/data-plane or service test passesAutomation 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

Confirmation

Confirm action

Continue?