Hi Team,
We a have yang model where all common data structures are kept in a yang file, let’s say common.yang with commonContainer as a top level container.
from common.yang file
module common
{
container commonContainer {
...
}
}
We also have symlinks to this common structure in another yang file let’s say featureSepc.yang file
from featureSepciyang
module featureSpec
{
import common
{
prefix COMMON
}
container root
{
**tailf:symlink common {**
** tailf:path "/COMMON:common/COMMON:commonContainer";**
** }**
}
}
We have exposed both source commonContainer xpath and symlinked commonContainer xpaths to customers.
As symlink is being deprecated in latest confd versions, we have chosen to remove symlink ang use augment around the original module.
as shown below.
We have complex data model and approx 100 tables might get affected, so creating and linking leaf by leaf will not be possible for my case,
I’ve considered approches mentioned Tailf:symlink replacement in 7.5.x
Approach1: tailf:link which is not feasible option considering the complexity of our data model
Approach2: pyang --tailf-sanitize option which Inlines the subtree that a ‘tailf:symlink’ points to
with 2nd approach, we would retain both xpaths, but they will become two independant configuration items, is there any way to link both of them without using tailf:link option.
Please let me know if there are any other solutions apart from those I’ve mentioned above, I would like to explore them as well.
One option can be to duplicate your data model (use grouping if possible) and write transformation. Transformation example can be found in examples.confd/intro/10-c_transform. It transforms to different data model. Yours will be transforming to the same data model (probably can be done as simple change of keypath). In case you have many instances in the lists (thousands), transform may have some performance penalty, if you access many instances at the same time (e.g. showing everything).
Thanks Michal for your help.
tailf:tansform seems to be feasible solution for my case even though some additional work is required to handle transaction points.