01-21-2019 11:44 PM - edited 03-01-2019 04:15 AM
Hi all,
we would like to add some customer fields to device groups such as realm and systems and some others, i assume devices groups has its own yang model some where.
1 is this a valid approach where we just add new leaf's to that yang model
2 where is the file that i would need to edit for device groups
Thanks
Regards
Yale
Solved! Go to Solution.
01-22-2019 12:04 AM
Hi,
You don't actually need to modify the YANG module itself for that.
You should use the augment statement from your own file in order to extend sections of the data model written in other files.
This is a good practice, but some care needs to be taken in order to keep the validity of existing nodes.
You should be able to add a block similar to the one below to your YANG module (haven't tested it):
import tailf-ncs { prefix ncs; } augment /ncs:devices/ncs:device-group { leaf realm { ... } list system { ... } }
Yftach
01-22-2019 12:04 AM
Hi,
You don't actually need to modify the YANG module itself for that.
You should use the augment statement from your own file in order to extend sections of the data model written in other files.
This is a good practice, but some care needs to be taken in order to keep the validity of existing nodes.
You should be able to add a block similar to the one below to your YANG module (haven't tested it):
import tailf-ncs { prefix ncs; } augment /ncs:devices/ncs:device-group { leaf realm { ... } list system { ... } }
Yftach
01-22-2019 12:40 AM
01-22-2019 12:59 AM
It's up to you.
It can be inside a service package that you already have, or inside another dedicated package, or inside some sort of common-library package where you'd keep additional generic stuff (YANG, code, etc.).
It all depends on what makes most sense for your solution.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: