YAML/JSON from YANG Models
Unlock the complete study guide + 1,040 practice questions across 16 full exams.
Bundled into the existing Designing, Deploying and Managing Network Automation Systems premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- Two specifications, one data model
- Four node types, four JSON/YAML shapes
- Leaf values: when a number is a string
- Namespace-qualified names: module in JSON, URI in XML
- Constructing a body from the model
- Reading the 350-901 stem
YANG node type to JSON/YAML construct
| Property | leaf | leaf-list | container | list |
|---|---|---|---|---|
| JSON construct | typed scalar | array of scalars | object { } | array of objects [ { } ] |
| YAML construct | scalar | sequence of scalars | mapping | sequence of mappings |
| Carries | one value | many values | child nodes | many like entries |
| Key leaf required | n/a | no | no | yes |
| Common mis-encoding | 64-bit int as bare number | single value not in an array | wrapped in an array | emitted as one object |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
References
- https://www.rfc-editor.org/rfc/rfc7951
- https://www.rfc-editor.org/rfc/rfc8040
- https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/1715/b_1715_programmability_cg/m_1715_prog_restconf.html
- https://www.rfc-editor.org/rfc/rfc7950
- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/prog/configuration/174/b_174_programmability_cg/restconf_protocol.html
- https://www.rfc-editor.org/rfc/rfc6241
- https://www.rfc-editor.org/rfc/rfc8340