06-28-2017 03:01 AM - edited 03-01-2019 03:54 AM
Hi,
Given the following YANG model:
list site {
key id;
leaf id {
type string;
}
leaf internal-vpn-id {
type leafref {
path "/vpn/internal-vpn-id";
}
}
container access {
leaf poi-id {
type leafref {
path "deref(../../internal-vpn-id)/../poi/poi-id";
}
}
}
}
list vpn {
key internal-vpn-id;
leaf internal-vpn-id {
type string;
}
list poi {
key poi-id;
leaf poi-id {
type string;
}
list interface {
key "device interface-id";
leaf device {
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
leaf interface-id {
type string;
}
}
}
}
container selection {
leaf site-select {
type leafref {
path "/site/id";
}
}
leaf device-select {
type leafref {
path "/vpn/poi/interface/device";
}
}
}
I´d like to be able to filter out and only display under the container "selection" all the devices that are inside a particular site and VPN and PoI. As you see from above, a Site references to a VPN and within a VPN there are multiple PoIs and inside a PoI many devices. So what I want to see it´s just all the devices that belongs to a Site and PoI that are stored in the VPN container. What would be the best way to get that information? Thanks in advance
Regards
Álvaro
06-28-2017 04:35 AM
In the model you provided, everything is modeled as configuration data. Is that really what you're after?
When you say that "I'd like to be able to filter out and only display ...", what is the usage context? Would you like to maintain an operational data table which lists the devices for all possible sites, vpns and pols? Or are you envisioning an action an operator could trigger when supplying a specific site, vpn, pol?
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