03-21-2024 11:59 PM - edited 03-22-2024 12:47 AM
How can I use the "instance-identifier" type to reference an instance of a nested list within a YANG data model? For instance, consider a YANG module where there are two lists, "a" and "b", with "b" nested inside "a". Additionally, there is a leaf "c" within "a", and I want to utilize the "instance-identifier" type for leaf "c" to reference an instance of list "b".
Here is yang structure.
list a {
key a-key;
leaf a-key {
type string;
}
list b {
key b-key;
leaf b-key {
type string;
}
}
leaf c {
type instance-identifier;
}
}
When I try to configure it from cli, it doesnt show up the instance of list b.
admin@ncs(config)# a test b btest
admin@ncs(config-b-btest)# exit
admin@ncs(config-a-test)# c /a[a-key=test]/b?
Possible completions:
b <cr>
admin@ncs(config-a-test)# c /a[a-key=test]/b
--------------------------------------^
syntax error: The XPath /a[a-key=test]/b doesn't belong to the restricted subset.
Any pointers on this.
03-22-2024 01:40 AM
03-22-2024 01:53 AM
Hi,
Okay, so are we supposed to give a valid input by manually typing the xpath?
Why dont we get it in tab completion?
If I try to use tab completion, It doesn't even show up the instance of nested list.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide