350-901 · Question #41
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. To limit configuration actions in a YANG model based on specific conditions, the 'when' statement is used to define a constraint that must be true for a data node to be valid and configurable.
Question
Options
- Awhen
- Bcase
- Cenumeration
- Dcontains
How the community answered
(26 responses)- A92% (24)
- B4% (1)
- D4% (1)
Why each option
To limit configuration actions in a YANG model based on specific conditions, the 'when' statement is used to define a constraint that must be true for a data node to be valid and configurable.
The 'when' statement in YANG defines a dependency for a data node or statement on the existence or value of another node in the data tree, making the configuration action for that node conditional. If the 'when' condition evaluates to false, the node is effectively not allowed to be present in the configuration.
The 'case' statement is used within a 'choice' statement to define mutually exclusive options, not to limit configuration based on arbitrary conditions.
The 'enumeration' statement defines a specific set of allowed string values for a leaf, which limits the data values but not the configuration action itself based on other data.
'contains' is not a standard YANG keyword that limits configuration actions; it describes a conceptual relationship or part of module structure but not a constraint mechanism.
Concept tested: YANG conditional configuration and constraints
Source: https://www.rfc-editor.org/rfc/rfc7950#section-7.16
Topics
Community Discussion
No community discussion yet for this question.