Pcornel
Automation

YANG

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

Back to the Topic

Answer

YANG defines typed, hierarchical configuration, state, RPC and notification schemas used by model-driven interfaces.

Remember

  • Module namespace and revision identify the schema context
  • Container groups nodes; list repeats keyed entries; leaf holds one typed value
  • config true/false separates writable configuration from operational state
  • Schema tree is not the same as instance data; constraints, defaults and augmentations matter.

First checks

  • pyang --version — tool
  • pyang -f tree <model>.yang — model structure
  • Supported models on device (yang-library) — availability

Commands

show platform software yang-management process
Display the state of the YANG management processes used by NETCONF/RESTCONF.

Verify in this order

YANG model → data tree → API payload

Where it usually breaks

A syntactically valid JSON/XML document does not prove it matches the supported YANG schema or writable datastore.

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=782

Confirmation

Confirm action

Continue?