300-435 Question 53
Single answerYou are tasked with automating the configuration of a Cisco network device using a YANG data model. Upon analyzing the YANG module tree generated as per RFC8340, you notice the following hierarchy:
module: example-module
+--rw interfaces
+--rw interface*
+--rw name string
+--rw enabled boolean
+--ro system
+--ro hostname string
Based on this module tree, which statement regarding the data model's structure is correct?
- A
The 'interfaces' container holds a list of interfaces, and 'name' is a mandatory key for each interface.
- B
The 'system' container is writable and allows updates to the 'hostname' value.
- C
The 'enabled' leaf under 'interface' is a read-only leaf that represents the interface's operational state.
- D
The 'name' leaf under 'interface' specifies the name of the interface and is a string type.
Show answer and explanation
Correct answer: D
Explanation
The YANG module tree generated per RFC8340 provides a hierarchical representation of the data model. Writable elements are prefixed with 'rw', read-only elements are prefixed with 'ro', and data types are specified for each leaf. Based on the tree provided, the 'name' leaf under 'interface' is a writable string that specifies the interface's name, while the other options misinterpret the nature of the tree or the attributes of the elements.
- A. Incorrect.
This is incorrect. While the 'interfaces' container holds a list of interfaces, the module tree does not indicate that 'name' is a mandatory key. Mandatory keys are typically explicitly marked in the YANG model.
- B. Incorrect.
This is incorrect. The 'system' container is marked as read-only ('ro'), meaning it cannot be written to, and the 'hostname' value is not configurable in this context.
- C. Incorrect.
This is incorrect. The 'enabled' leaf is marked as writable ('rw'), meaning it can be written to and is not a read-only representation of the interface's operational state.
- D. Correct.
This is correct. The 'name' leaf under 'interface' is defined as a string type and represents the name of the interface.