Navigating contexts in the MD-CLI

Entering contexts

Configuring a container navigates into the context.

Example: First container is log and next is log-events

All containers are marked with a "+".

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

 accounting-policy     + Enter the accounting-policy list instance
 app-route-            + Enter the app-route-notifications context
  notifications
 apply-groups          - Apply a configuration group at this level
 apply-groups-exclude  - Exclude a configuration group at this level
 event-damping         - Allow event damping algorithm to suppress QoS or
                         filter change events
 event-handling        + Enter the event-handling context
 event-trigger         + Enter the event-trigger context
 file                  + Enter the file list instance
 filter                + Enter the filter list instance
 log-events            + Enter the log-events context
 log-id                + Enter the log-id list instance
 route-preference      + Enter the route-preference context
 services-all-events   + Enter the services-all-events context
 snmp-trap-group       + Enter the snmp-trap-group list instance
 syslog                + Enter the syslog list instance
 throttle-rate         + Enter the throttle-rate context

[ex:/configure log]
A:admin@node-2# log-events

[ex:/configure log log-events]
A:admin@node-2#

Example: Same context entered on one line

Alternatively, the same context can be entered on one line:

(ex)[/]
A:admin@node-2# configure log log-events

(ex)[/configure log log-events]
A:admin@node-2#

Example: Container lists are marked with a "+"

Container lists are also marked with a "+" and the context is entered by specifying the key for the list.

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

 accounting-policy     + Enter the accounting-policy list instance
 app-route-            + Enter the app-route-notifications context
  notifications
 apply-groups          - Apply a configuration group at this level
 apply-groups-exclude  - Exclude a configuration group at this level
 event-damping         - Allow event damping algorithm to suppress QoS or
                         filter change events
 event-handling        + Enter the event-handling context
 event-trigger         + Enter the event-trigger context
 file                  + Enter the file list instance
 filter                + Enter the filter list instance
 log-events            + Enter the log-events context
 log-id                + Enter the log-id list instance
 route-preference      + Enter the route-preference context
 services-all-events   + Enter the services-all-events context
 snmp-trap-group       + Enter the snmp-trap-group list instance
 syslog                + Enter the syslog list instance
 throttle-rate         + Enter the throttle-rate context
[ex:/configure log]
A:admin@node-2# log-id ?

 [name] <string>
 <string>  - <1..64 characters>

    Log ID
[ex:/configure log]
A:admin@node-2# log-id "99"

[ex:/configure log log-id "99"]
A:admin@node-2#

Example: Configuring a leaf element

Configuring a leaf element maintains the present working context if there is no explicit opening brace. Entering an explicit opening brace navigates into the specified context.

*[ex:/configure card 1 mda 2]
A:admin@node-2# clock-mode mode ?

 mode <keyword>
 <keyword>  - (adaptive|differential)

    Clock mode

*[ex:/configure card 1 mda 2]
A:admin@node-2# clock-mode mode adaptive

*[ex:/configure card 1 mda 2]
A:admin@node-2# clock-mode { mode adaptive

*[ex:/configure card 1 mda 2 clock-mode]
A:admin@node-2#

Example: Configuring a container

Configuring a container navigates into the context.

[ex:/configure router "Base"]
A:admin@node-2# ?

 aggregates            + Enter the aggregates context
 allow-icmp-redirect   - Allow ICMP redirects on the management interface
 allow-icmp6-redirect  - Allow IPv6 ICMP redirects on the management interface
 apply-groups          - Apply a configuration group at this level
 apply-groups-exclude  - Exclude a configuration group at this level
 autonomous-system     - AS number advertised to peers for this router
 bfd                   + Enter the bfd context
 bgp                   + Enable the bgp context

---snip---

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

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

 add-paths             + Enable the add-paths context
 admin-state           - Administrative state of the BGP instance
 advertise-external    + Enter the advertise-external context
 advertise-inactive    - Advertise inactive BGP routes to peers

---snip---

[ex:/configure router "Base" bgp]
A:admin@node-2# add-paths

*[ex:/configure router "Base" bgp add-paths]
A:admin@node-2#

Configuring an empty container or a list where the only children are keys does not navigate into the context. These elements are displayed with aggregated braces with a space ({ }) on the same line. It is possible to enter the element name with an opening brace; however, no options are available in this context.

Example: Configuring the list element sdp-include

For example, configuring the list element sdp-include with a key of ‟ref_group_name” does not change the existing context.

*[ex:/configure service pw-template "tt"]
A:admin@node-2# sdp-include ref_group_name

*[ex:/configure service pw-template "tt"]
A:admin@node-2# info
    sdp-include "ref_group_name" { }

*[ex:/configure service pw-template "tt"]
A:admin@node-2#

Exiting contexts

The back and top commands are used to navigate contexts, but it is also possible to use closing braces (}) to navigate.

The behavior of an explicit closing brace depends on the contents of the current command line. If the command line contains an explicit opening brace, the closing brace exits to the parent context of the opening brace.

Example

In the following example with an opening brace on the command line, the closing brace exits VPRN 1, and then enters the context of VPRN 2.

(ex)[/]
A:admin@node-2# configure service vprn 1 { interface "intf1" description "vprn-if" } vprn 2

*(ex)[/configure service vprn "2"]
A:admin@node-2#
Example

In the following example without an opening brace on the command line, the first closing brace exits interface "int1", and the second closing brace exits VPRN 1 and enters the VPRN 2 context.

*[ex:/configure service]
A:admin@node-2# vprn 1 interface "int1" description "vprn-if" } } vprn 2

*[ex:/configure service vprn "2"]
A:admin@node-2#