300-435 Question 47
Single answerA network engineer is using YANG Suite to generate an XML instance for a YANG model representing a configuration for an interface. The YANG model specifies 'interface-name' (string), 'enabled' (boolean), and 'mtu' (integer). Which of the following represents a valid XML instance based on this YANG model?
- A
GigabitEthernet0/1 true 1500 - B
GigabitEthernet0/1 true 1500 - C
GigabitEthernet0/1 true text - D
GigabitEthernet0/1 yes 1500
Show answer and explanation
Correct answer: A
Explanation
YANG models define the structure, types, and constraints of data used in network configurations. For an XML instance to be valid, it must strictly adhere to the YANG model's definitions, including element names and data types. The correct XML instance matches the YANG model's requirements: 'interface-name' as a string, 'enabled' as a boolean (true/false), and 'mtu' as an integer.
- A. Correct.
This is the correct XML instance because it adheres to the YANG model: 'interface-name' is a string, 'enabled' is a boolean (true/false), and 'mtu' is an integer.
- B. Incorrect.
This is incorrect because the element 'name' does not match the expected 'interface-name' from the YANG model.
- C. Incorrect.
This is incorrect because the value 'text' for 'mtu' is not an integer, which violates the type defined in the YANG model.
- D. Incorrect.
This is incorrect because the value 'yes' for 'enabled' is not a valid boolean value in the context of XML or YANG (expected values are 'true' or 'false').