12-02-2019 09:19 AM - edited 12-02-2019 09:20 AM
Is there a way to get the correct leafref if you know the CLI or are in the CLI configuration path of an element?
If not, what's the proper way to get the correct leafref from a NED configuration element?
Solved! Go to Solution.
12-03-2019 05:45 AM
Hello
If I understand well your questions I see two possibilities
You can try the syntax:
show running-config <cli to your node> | display xpath
it would give you for example:
admin@ncs# show running-config devices device * address | display xpath /devices/device[name='xr-1']/address 127.0.0.1 /devices/device[name='xr-2']/address 127.0.0.1
You can also leverage the devtools to evaluate xpath expression (for example the leafref you want to use) from CLI to see what would be the available values and hence test the validity of your leafref (notice that devtools true is in exec mode not config mode):
admin@ncs# devtools true admin@ncs# conf Entering configuration mode terminal admin@ncs(config)# xpath eval /devices/device/name /devices/device[name='xr-1']/name :: xr-1 /devices/device[name='xr-2']/name :: xr-2
12-03-2019 05:45 AM
Hello
If I understand well your questions I see two possibilities
You can try the syntax:
show running-config <cli to your node> | display xpath
it would give you for example:
admin@ncs# show running-config devices device * address | display xpath /devices/device[name='xr-1']/address 127.0.0.1 /devices/device[name='xr-2']/address 127.0.0.1
You can also leverage the devtools to evaluate xpath expression (for example the leafref you want to use) from CLI to see what would be the available values and hence test the validity of your leafref (notice that devtools true is in exec mode not config mode):
admin@ncs# devtools true admin@ncs# conf Entering configuration mode terminal admin@ncs(config)# xpath eval /devices/device/name /devices/device[name='xr-1']/name :: xr-1 /devices/device[name='xr-2']/name :: xr-2
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