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

How to get service model leafref path from CLI?

MitchMahan
Level 1
Level 1

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?

1 Accepted Solution

Accepted Solutions

gmuloche
Cisco Employee
Cisco Employee

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

 

 

View solution in original post

1 Reply 1

gmuloche
Cisco Employee
Cisco Employee

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