200-901 · Question #75
You are developing a YANG-based policy model to encode the type of entity that is connected to a given interface, such as partner, supplier, customer, or distributor. Which YANG statement limits any…
The correct answer is A. when. The when statement in YANG defines a condition that must be true for the data node to which it applies to be valid or even present.
Question
You are developing a YANG-based policy model to encode the type of entity that is connected to a given interface, such as partner, supplier, customer, or distributor. Which YANG statement limits any configuration action?
Options
- Awhen
- Bcase
- Cenumeration
- Dcontains
How the community answered
(39 responses)- A90% (35)
- B3% (1)
- C5% (2)
- D3% (1)
Why each option
The `when` statement in YANG defines a condition that must be true for the data node to which it applies to be valid or even present.
The `when` statement in YANG is used to define a condition that must be satisfied for a data node to be valid or to exist. This mechanism allows for conditional data modeling, meaning that certain configuration actions or data structures are only allowed or active if the `when` condition evaluates to true, thereby limiting configuration possibilities.
The `case` statement is used within a `choice` statement to define alternative branches of data, not to limit configuration actions based on conditions.
The `enumeration` statement defines a set of allowed named values for a leaf, restricting the possible values but not the configuration action itself based on external conditions.
The `contains` keyword is not a standard YANG statement; it might refer to conceptual containment but not a specific statement for limiting configuration actions.
Concept tested: YANG conditional data modeling
Source: https://datatracker.ietf.org/doc/html/rfc7950#section-7.20.1
Topics
Community Discussion
No community discussion yet for this question.