200-901 · Question #292
Refer to the exhibit. Which XML snippet has interface information that conforms to the YANG model? A. B. C. D.
The correct answer is B. <interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface> <name>GigabitEthernet1</name> <admin-status>up</admin-status> <if-index>1</if-index> <statistics> <in-octets>408164820</in-octets> <in-unicast-pkts>728061</in-unicast-pkts> </statistics> </interface> </interfaces-state>. The IETF YANG model for interfaces (RFC 7223 / ietf-interfaces) defines a strict data structure. Key conformance rules: (1) 'name' must be a child XML element of <interface>, not an XML attribute. (2) 'admin-status' must include a value ('up', 'down', or 'testing') - it cannot…
Question
Refer to the exhibit. Which XML snippet has interface information that conforms to the YANG model? A. B. C. D.
Exhibits
Options
- A<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface name="GigabitEthernet1"> <admin-status/> <if-index>1</if-index> <statistics> <in-octets>408164820</in-octets> <in-unicast-pkts>728061</in-unicast-pkts> </statistics> </interface> </interfaces-state>
- B<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface> <name>GigabitEthernet1</name> <admin-status>up</admin-status> <if-index>1</if-index> <statistics> <in-octets>408164820</in-octets> <in-unicast-pkts>728061</in-unicast-pkts> </statistics> </interface> </interfaces-state>
- C<interfaces-state xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces"> <interface> <name>GigabitEthernet1</name> <admin-status>up</admin-status> <if-index>1</if-index> <statistics> <in-octets>408164820</in-octets> <in-unicast-pkts>728061</in-unicast-pkts> </statistics> </interface> </interfaces-state>
How the community answered
(37 responses)- A11% (4)
- B84% (31)
- C5% (2)
Explanation
The IETF YANG model for interfaces (RFC 7223 / ietf-interfaces) defines a strict data structure. Key conformance rules: (1) 'name' must be a child XML element of <interface>, not an XML attribute. (2) 'admin-status' must include a value ('up', 'down', or 'testing') - it cannot be self-closing or empty. Answer A uses 'name' as an XML attribute (name='GigabitEthernet1') and has an empty <admin-status/> - both violations. Answer B correctly uses <name> as a child element and provides a value for <admin-status>up</admin-status>, conforming to the YANG model. Answer C appears identical to B in this rendering but the correct answer is B. Proper YANG-to-XML encoding requires elements, not attributes, for leaf nodes.
Topics
Community Discussion
No community discussion yet for this question.




