ConfD User Community

How to add to a previously defined container in another yang file


I have a requirement where I have to create a yang file that would add some configurable parameters (leaves, lists) to a container that was defined in another yang file.

Like below:
a.yang has the following:

module a {
    container system {
         container system {
               leaf x {
               leaf y {

I need to create b.yang that would add leaf z to the above system container.



from question is not fully clear if you want to add new leaf z to the container existing in module a or ff you want to have system container in module b that is different from module a (has leaf z).

I suggest you look at yang RFC

augment statement
grouping statement

To see if they can help you with reuse.