300-435 Question 51
Select 2A network automation engineer is reviewing a YANG module tree generated per RFC8340 to understand the structure of a device's configuration model. The tree includes the following snippet:
module: example-module
+--rw interfaces
+--rw interface* [name]
+--rw name string
+--rw enabled? boolean
+--rw description? string
Which statement accurately describes the generated YANG module tree?
- A
The 'interfaces' node is a container that holds a list of interfaces.
- B
The 'interface' node is a mandatory single instance within the 'interfaces' container.
- C
The 'name' leaf is a key for the 'interface' list, and it must be unique.
- D
The 'enabled' node is a required boolean leaf within the 'interface' list.
Show answer and explanation
Correct answers: A, C
Explanation
In a YANG module tree generated per RFC8340, the structure and syntax provide explicit information about the nodes. Containers group related data, lists allow multiple entries, and square brackets denote keys for lists. Optional nodes are marked with a question mark ('?'), while required ones are not. Understanding these conventions is critical for interpreting data models accurately.
- A. Correct.
Correct: The 'interfaces' node is a container, as indicated by the '+' prefix, which organizes related nodes. It holds the 'interface' list.
- B. Incorrect.
Incorrect: The 'interface' node is not a single instance; it is a list, as indicated by the '*' suffix, meaning multiple entries can exist.
- C. Correct.
Correct: The 'name' leaf is listed within square brackets, denoting it as a key for the list. Keys must be unique within a list.
- D. Incorrect.
Incorrect: The 'enabled' node is optional, as indicated by the '?' suffix, meaning it is not required in every instance of the 'interface' list.