Specifying Paths in MD-CLI Commands

As described in Navigating the MD-CLI Hierarchy Levels , the pwc command displays the present working context. Navigating around the MD-CLI hierarchy changes the present working context. The MD-CLI path format, also known as cli-path, is displayed in the MD-CLI user prompt; for example:

[ex:/configure card 1 mda 1]
A:admin@node-2# pwc
Present Working Context:
  configure
  card 1
  mda 1

For the following commands, an absolute or relative MD-CLI path can be specified to provide path qualified attributes:

Absolute Path

An absolute CLI path is specified using the forward slash (/) as the MD-CLI tree structure from the root.

The following absolute CLI path references a section of the MD-CLI tree under the indicated context:

/configure card 1 mda 1

The following CLI path references a specific leaf in the tree:

/state system oper-name

Relative Path

A relative CLI path specifies the MD-CLI tree structure from the present working context. In the following example, the two info commands display the same information. The first command usage is an absolute path reference and the next usage is a relative path from the present working context (pwc).

[ex:/configure router "Base" bgp]
A:admin@node-2# pwc
Present Working Context:
  configure
  router "Base"
  bgp

[ex:/configure router "Base" bgp]
A:admin@node-2# info /configure router "Base" bgp group "grp1"

[ex:/configure router "Base" bgp]
A:admin@node-2# info group "grp1"

The CLI path is accepted as an unnamed last parameter of the command. The information is displayed for the specified path.

[ex:/configure]
A:admin@node-2# info ?

 info [[from] <keyword>] [[cli-path] <path>]

 [[from] <keyword>]
 <keyword>  - (candidate|running|baseline|intended)

    Source datastore

 [cli-path] <path>
 <path>  - <absolute or relative from pwc>

    Absolute or relative path from present working context

 detail                - Include default and unconfigured values
 full-context          - Show the full context on each line
 inheritance           - Include configuration inherited from configuration
                         groups
 units                 - Include unit types for applicable elements

 Choice: output-format
 flat                 :- Show the context from the pwc on each line
 json                 :- Show the output in indented JSON format
 xml                  :- Show the output in indented XML format

[ex:/configure]
A:admin@node-2# info candidate detail units /configure system
 ## apply-groups
 ## apply-groups-exclude
 ## contact
    name "node-2"
 ## location
    icmp-vse false
    selective-fib false
 ## coordinates
 ## clli-code
    ospf-dynamic-hostnames false

---snip---

A configuration lock from either implicit or explicit configuration mode is required to display paths for a configuration region.

The state branch does not have a lock and can always be specified.

[ex:/configure]
A:admin@node-2# info detail /state system
    oper-name "node-2"
    base-mac-address aa:bb:cc:00:00:00
    platform "7750 SR-12"
    chassis-topology standalone
    crypto-module-version "SRCM 3.1"
 ## fabric-speed
    temperature-status ok
    fp-generation-fp2 false
    fp-generation-fp3 false
    fp-generation-fp4 false
    system-profile none
    active-cpm-slot "A"

The following example shows the use of the info command with a state path from operational mode.

[/]
A:admin@node-2# info /state system
    oper-name "node-2"
    base-mac-address aa:bb:cc:00:00:00
    platform "7750 SR-12"
    chassis-topology standalone
    crypto-module-version "SRCM 3.1"
    temperature-status ok
    fp-generation-fp2 false
    fp-generation-fp3 false
    fp-generation-fp4 false
    system-profile none
    active-cpm-slot "A"

In the next example, to use the info command from a state path to a configuration region, a configuration lock must be established.

[/state system]
A:admin@node-2# info /configure system
                      ^^^^^^^^^
MINOR: MGMT_CORE #2203: Invalid element - currently not allowed

[/state system]
A:admin@node-2# edit-config read-only
INFO: CLI #2066: Entering read-only configuration mode

(ro)[/state system]
A:admin@node-2# info /configure system
    name "node-2"
    management-interface {
        configuration-mode mixed
        snmp {
            admin-state disable
        }

---snip---

The following are examples of the supported commands with a CLI path parameter.

(ex)[/state router "Base" bgp]
A:admin@node-2# info /state router bgp statistics routes-per-family ipv4
    remote-routes 45
    remote-active-routes 6
    backup-routes 0

*(ex)[/state router "Base" bgp]
A:admin@node-2# compare /configure system
-   name "test1"
+   name "test"

(ex)[/configure router "Base" bgp]
A:admin@node-2# discard /configure system

(ex)[/configure router "Base"]
A:admin@node-2# tree bgp group "mesh" add-paths ipv4
+-- receive
+-- send

[/]
A:admin@node-2# admin show configuration /configure router isis interface "system"
    passive true

(ex)[/configure policy-options]
A:admin@node-2# copy policy-statement "mytest" to /configure policy-options policy-statement "my_new_policy"

(ex)[/configure router "Base" bgp]
A:admin@node-2# rename /configure policy-options policy-statement "mytest" to "another_new_policy"