11-19-2018 08:47 AM - edited 03-01-2019 04:14 AM
Hi everyone, I am trying to build a simple qos service template. Just wondering about passing variables to the template xml from Yang using the choice
module qos {
augment /ncs:services {
list qos {
key vpn-name;
uses ncs:service-data;
ncs:servicepoint "qos";
leaf vpn-name {
type string;
}
// may replace this with other ways of refering to the devices.
leaf-list device {
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}
container perqos {
choice qos-model {
case model1 {
container vpn-trunk {
leaf vlan-id {
type uint16 {
range "1..4096";
}
}
}
}
case model2 {
container vpn-access {
leaf vlan-id {
type uint16 {
range "1..4096";
}
}
}
}
}
}
}
}
My XML template
<class-map>
<name>LAN_{/vpn-name}</name>
<prematch>match-any</prematch>
<match>
<matchRule>vlan {<NEED HELP HERE>/vlan-id}</matchRule>
</match>
</class-map>
How do I reference the vlan-id in a node that is chosen based on the Choice structure? Preferred not to use a script language.
11-19-2018 09:34 AM
11-19-2018 09:41 AM
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