cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
431
Views
0
Helpful
1
Replies

listing all devices using a cross reference in YANG

Alvaro Gutiérrez
Cisco Employee
Cisco Employee

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

1 Reply 1

Jan Lindblad
Cisco Employee
Cisco Employee

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?