11-11-2019 09:06 PM
I am facing issues to use tailf:link. I have one node GigabitEthernet as per below
leaf GigabitEthernet { tailf:info "GigabitEthernet Interface ID"; mandatory true; type leafref { path "deref(../../../Switch)/../ncs:config/cisco-ios-xr:interface/cisco-ios-xr:GigabitEthernet/cisco-ios-xr:id"; } }
I want data of GigabitEthernet node to be used automatically for other node intf-number...
leaf intf-number { tailf:info "GigabitEthernet Interface ID"; mandatory true; type leafref { path "deref(../../../Switch)/../ncs:config/cisco-ios-xr:interface/cisco-ios-xr:GigabitEthernet/cisco-ios-xr:id"; } }
For example, below is required
GigabitEthernet = 0/0/0/0 (Using dropdown of Infterfaces, we select 0/0/0/0)
intf-number = GigabitEthernet (Data in Node GigabitEthernet which is 0/0/0/0 should be assigned to node intf-number automatically)
i tried below code..but its not working.
leaf intf-number { { tailf:link "/ncs:devices/ncs:device[name=current()/../../../Switch]/ncs:config/cisco-ios-xr:interface/GigabitEthernet[id=current()/cisco-ios-xr:id]";
tailf:info "GigabitEthernet Interface ID"; mandatory true; type leafref { path "deref(../../../Switch)/../ncs:config/cisco-ios-xr:interface/cisco-ios-xr:GigabitEthernet/cisco-ios-xr:id"; } }
Someone Please guide. Thanks
Regards,
Bjron Mork
11-15-2019 04:30 AM
What type is cisco-ios-xr:interface? If it's a list, the key needs to be specified.
From tailf_yang_extension(5):
The argument is an XPath absolute location path. If the target lies within lists, all keys must be specified. A key either has a value, or is a reference to a key in the path of the source node, using the function current() as starting point for an
XPath location path. For example:
/a/b[k1='paul'][k2=current()/../k]/c
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