YANG Examples

A page that contains YANG examples for various situations.

Leafref and Groupings

A leafref can not have a grouping in its path statement, because the grouping doesn’t appear in the node hierarchy. So, in order to have a leafref to a leaf that is in a grouping, you need to first use the grouping.

Augment and Groupings

It is not possible to augment a grouping, and it is not possible to have a grouping in the path for an augment. You need to first use the grouping, then augment the node that is in the grouping.
Example: In the following example there is one module that has a grouping that contains a container with a “choice” statement. There is a second module that wants to augment the “choice” statement. The resulting tree is provided.