A YANG model defines a container system holding the leaf hostname and a list ntp keyed by server-address that also holds the leaf iburst. A teammate hand-writes the JSON instance for one NTP server. Which JSON structure matches the model faithfully?
Select an answer to reveal the explanation.
Short Explanation
You map three YANG pieces at once: a container becomes an object, a leaf becomes a value, and a list becomes an array. It's like nesting dolls, where each list entry keeps its own key inside the shell. That repetition of server-address is the giveaway that you read the model correctly.
Full Explanation
The faithful instance mirrors the YANG tree: the system container is represented by an object, its hostname leaf is a member of that object, and its ntp list is an array inside it. Each array element represents one list entry and includes both the key leaf server-address and the ordinary leaf iburst. A map keyed by server address can be a convenient application-level lookup structure, but it changes the list’s JSON representation and uses the key as a property name rather than representing it as a leaf in the entry. Putting ntp beside system preserves an array and its entry contents, but breaks the modeled parent-child relationship: the list belongs inside the system container. Treating the address solely as an external identifier also loses a required leaf from the serialized list entry; a YANG list key remains part of the instance data even if software can derive or index it elsewhere. Exam caveat: distinguish the conceptual YANG tree from a system’s internal data structures or a custom API transformation, which may use maps or flattening without being faithful YANG JSON. Practical check: trace each node’s parent in the schema, then verify that every list entry is an array element containing all key leaves and the intended non-key leaves.