I have a yang model with a leafref, which is pointing to a list inside of a other list. Basically something like this:
list some-names
{
key "name";
leaf name
{
type string;
}
list some-other-names
{
key "name";
leaf name
{
type string;
}
}
}
I want to point from outside with a leafref to the some-other-names
list but only the ones with upper name equals to foo.
Unfortunately the leafref has to have a current()
for restriction.
So my current solution is the following but requires a extra leaf which
is total unnecessary for configuration .
leaf foo
{
type string;
deafault "foo";
}
leaf some-leaf-ref
{
type leafref
{
path "/some-names[name = current()/../foo]/some-other-names/name";
}
}
Is there a simpler way than this, which does not need a additional leaf for restricting the name of some-names
to a certain value?
BTW this I already tried but its not a correct path-arg:
leaf some-leaf-ref
{
type leafref
{
path "/some-names[name = 'foo']/some-other-names";
}
}