The following commands can be used to navigate the MD-CLI hierarchy (context) levels:
pwc
The pwc command displays the present working context with all keyword and variable parameters. The syntax is as follows:
[ex:/configure]
A:admin@node-2# pwc ?
pwc
[path-type] <keyword>
<keyword> - (model-path|gnmi-path|cli-path|json-instance-path)
Alternative format to display the path
[path-type] - Alternative format to display the path
previous - Display previous working context
(ex)[/]
A:admin@node-2# configure
(ex)[/configure]
A:admin@node-2# card 1
(ex)[/configure card 1]
A:admin@node-2# mda 2
*(ex)[/configure card 1 mda 2]
A:admin@node-2# network
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# pwc
Present Working Context:
configure
card 1
mda 2
network
pwc previous
The pwc previous command displays the previous working context.
*[ex:/configure card 1 mda 2 network]
A:admin@node-2# pwc previous
Previous Working Context:
configure
card 1
mda 2
pwc path-type
model-path
This is a YANG-modeled path format that can be used with RESTCONF-based management systems.
gnmi-path
This is a format that can be used with streaming telemetry.
cli-path
This is a single-line version of the MD-CLI command line interface path format; useful for cutting and pasting the path into an MD-CLI command which supports the CLI path as an unnamed parameter input.
json-instance-path
This is a YANG-modeled path format, based on RFC 6020 and RFC 7951, that describes the path to the modeled root, including all list names, list keys, and list key values. This path can be used with the pySROS libraries. For more information, see the 7450 ESS, 7750 SR, 7950 XRS, and VSR System Management Guide, "Python" chapter.
*[ex:/configure card 1 mda 2 network]
A:admin@node-2# pwc model-path
Present Working Context:
/nokia-conf:configure/card=1/mda=2/network
*[ex:/configure card 1 mda 2 network]
A:admin@node-2# pwc gnmi-path
Present Working Context:
/configure/card[slot-number=1]/mda[mda-slot=2]/network
*[ex:/configure router "Base" bgp group "mesh"]
A:admin@node-2# pwc cli-path
Present Working Context:
/configure router "Base" bgp group "mesh"
*[ex:/configure openconfig system telnet-server config]
A:admin@node-2# pwc
Present Working Context:
configure
openconfig
system
telnet-server
config
*[ex:/configure openconfig system telnet-server config]
A:admin@node-2# pwc json-instance-path
Present Working Context:
/openconfig-system:system/telnet-server/config
back
The back command can be used to go back one or more levels. If no parameter value is specified for the number of levels to go back, the default is one level. Using back at the top of the current command tree moves the context to the operational root level. If the number of levels specified is greater than the current depth, the context moves to the operational root. A closing brace (}) can also be used to go back one level.
*[ex:/configure card 1 mda 2 network]
A:admin@node-2# back
*[ex:/configure card 1 mda 2]
A:admin@node-2# back 2
*[ex:/configure]
A:admin@node-2# back 5
*[ex:/]
A:admin@node-2#
top
The top command moves the context to the top of the current command tree without exiting the mode. Use the top command instead of issuing the back command multiple times to move the context to the top of the command tree.
*(ex)[/]
A:admin@node-2# configure
*(ex)[/configure]
A:admin@node-2# card 1
*(ex)[/configure card 1]
A:admin@node-2# mda 2
*(ex)[/configure card 1 mda 2]
A:admin@node-2# network
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# top
*(ex)[/configure]
A:admin@node-2#
exit
The exit command moves the context to the previous context in the current command tree. If the previous context was up one level, the exit command functions similarly to the back command. Using exit all moves the context to the operational root. A slash (/) or CTRL-Z can also be used instead of exit all. Using exit at the operational root has no effect. To log out of the system, the logout command must be used.
*(ex)[/]
A:admin@node-2#
*(ex)[/]
A:admin@node-2# configure card 1 mda 2
*(ex)[/configure card 1 mda 2]
A:admin@node-2# atm
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# exit all
*(ex)[/]
A:admin@node-2# configure card 1 mda 2 network
*(ex)[/configure card 1 mda 2 network]
A:admin@node-2# /
*(ex)[/]
A:admin@node-2#