WAE CLI Overview
WAE provides a network CLI that is automatically rendered using the data models described by the WAE YANG files. The CLI contains commands for manipulating the network configuration. The CLI is entirely data-model driven. The YANG model(s) define a hierarchy of configuration elements; the CLI follows this tree. The CLI provides various commands for configuring hardware and network connectivity of managed devices.
The CLI supports two modes: operational mode, for monitoring the state of WAE nodes; and configure mode, for changing the state of the network. The prompt indicates which mode the CLI is in. When moving from operational mode to configure mode using the configure command, the prompt is changed from user@wae# to user@wae(config)#. The prompts can be configured using the c-prompt1 and c-prompt2 settings in the wae.conf file.
For example:
admin@wae# configure
Entering configuration mode terminal
admin@wae(config)#
Operational Mode
Operational mode is the initial mode after successful login to the CLI. It is primarily used for viewing the system status, controlling the CLI environment, monitoring and troubleshooting network connectivity, and initiating the configure mode.
The following commands are the base commands available in operational mode. Additional commands are rendered from the loaded YANG files.
<path> <parameters>
Invokes the action found at path using the supplied parameters. This command is auto-generated from the YANG file. For example, given the following action specification in a YANG file:
tailf:action shutdown {
tailf:actionpoint actions;
input {
tailf:constant-leaf flags {
type uint64 {
range "1 .. max";
}
tailf:constant-value 42;
}
leaf timeout {
type xs:duration;
default PT60S;
}
leaf message {
type string;
}
container options {
leaf rebootAfterShutdown {
type boolean;
default false;
}
leaf forceFsckAfterReboot {
type boolean;
default false;
}
leaf powerOffAfterShutdown {
type boolean;
default true;
}
}
}
}
The action can be invoked in the following way:
user@wae> shutdown timeout 10s message reboot options { \
forceFsckAfterReboot true }
Built-in Operational Mode Commands
Command |
Description |
commit (abort | confirm) |
Aborts or confirms a pending confirming commit. A pending confirming commit is aborted if the CLI session is terminated without doing commit confirm. The default is confirm. Example:
|
config (exclusive | terminal) [no-confirm] |
Enters configure mode. The default is terminal.
Example:
|
file list <directory> |
Lists files in a directory. Example:
|
file show <file> |
Displays contents of a file. Example:
|
help <command> |
Displays help text for a command. Example:
|
job stop <job id> |
Stops a specific background job. In the default CLI, the only command that creates background jobs is monitor start. Example:
|
logout session <session ID> |
Logs out a specific user session from WAE. If the user holds the configure exclusive lock, the lock is released. Example:
|
logout user <username> |
Logs out a specific user from WAE. If the user holds the configure exclusive lock, the lock is released. Example:
|
script reload |
Reloads scripts found in the scripts/command directory. New scripts are added. If a script file has been removed, the corresponding CLI command is purged. |
send (all | <user>) <message> |
Displays a message on the screens of all users who are logged in to the device or on a specific screen.
Example:
The oper user sees the following message onscreen:
|
show cli |
Displays CLI properties. Example:
|
show history [<limit>] |
Displays CLI command history. By default the last 100 commands are listed. The size of the history list is configured using the history CLI setting. If a history limit is specified, only the last commands up to that limit are shown. Example:
|
show jobs |
Displays jobs that are currently running in the background. Example:
|
show log <file> |
Displays contents of a log file. Example:
|
show parser dump <command prefix> |
Shows all possible commands that start with the specified command prefix. |
show running-config [ <path filter> [ sort-by <idx> ] ] |
Displays the current configuration. By default the entire configuration is displayed. You can limit what is shown by supplying a path filter. The path filter can be either a path pointing to a specific instance, or if an instance ID is omitted, the part following the omitted instance is treated as a filter. The sort-by argument can be used when the path filter points to a list element with secondary indexes. The name of a secondary index is idx. When used, the table is sorted in the order defined by the secondary index. This lets you control the order in which to display instances. For example, to show the aaa settings for the admin user:
To show all users who have group ID 1000, omit the user ID and instead specify gid 1000:
|
show <path> [ sort-by <idx> ] |
Shows the configuration as a table provided that path leads to a list element and the data can be rendered as a table (that is, the table fits on the screen). You can also force table formatting of a list by using the | tab pipe command. The sort-by argument can be used when the path points to a list element with secondary indexes. The name of a secondary index is idx. When used, the table is sorted in the order defined by the secondary index. This lets you control the order in which to display instances. Example:
|
source <file> |
Runs commands from a specified file as if they had been entered by the user. The autowizard is disabled when executing commands from the file. |
timecmd <command> |
Measures and displays the execution time of a command. Note that timecmd is only available if devtools has been set to true in the CLI session settings. Example:
|
who |
Displays currently logged on users. The current session—the session running the show status command—is marked with an asterisk. Example:
|
Configure Mode
Configure mode can be initiated by entering the configure command in operational mode. All changes to the network configuration are done to a copy of the active configuration. These changes do not take effect until a successful commit or commit confirm command is entered.
The following commands are the base commands available in configure mode. Additional commands are rendered from the loaded YANG files.
<path> [<value>]
Set a parameter. If a new identifier is created and autowizard is enabled, the CLI prompts the user for all mandatory sub-elements of that identifier. This command is auto-generated from the YANG file.
If no <value> is provided, the CLI prompts the user for the value. No echo of the entered value occurs if <path> is an encrypted value of the type MD5DigestString, DESDigestString, DES3CBCEncryptedString, or AESCFB128EncryptedString as documented in the tailf-common.yang data-model.
Built-in Configure Mode Commands
Command |
Description |
||
annotate <statement> <text> |
Associates an annotation with a given configuration. To remove an annotation, leave the text empty. This command is only available when the system has been configured with attributes enabled. |
||
commit (check | and-quit | confirmed |to-startup) [comment <text>] [label <text>] |
Commits the current configuration to running.
|
||
copy <instance path> <new id> |
Makes a copy of an instance. |
||
copy cfg [ merge | overwrite] <src path> to <dest path> |
Copies data from one configuration tree to another. Only data that makes sense at the destination is copied. No error message is generated for data that cannot be copied and the operation can fail completely without any error messages being generated. For example, to create a template from a part of a device config, first configure the device and then copy the config to the template configuration tree. Example:
|
||
copy compare <src path> to <dest path> |
Compares two arbitrary configuration trees. Items that appear only in the source tree are ignored. |
||
delete <path> |
Deletes a data element. |
||
do <command> |
Runs the command in operational mode. |
||
edit <path> |
Edits a sub-element. Missing elements in the path are created. |
||
exit (level | configuration-mode) |
|
||
help <command> |
Shows help text for the command. |
||
hide <hide-group> |
Rehides the elements and actions that belong to the hide groups. No password is required for hiding. This command is hidden and is not shown during command completion. |
||
insert <path> |
Inserts a new element. If the element already exists and has the indexedView option set in the data model, the old element is renamed as element+1 and the new element is inserted in its place. |
||
insert <path>[ first | last | before <key> | after <key>] |
Injects a new element into an ordered list. The element can be added first, last (the default), before, or after another element. |
||
load (merge | override) (terminal | <file>) |
Loads the configuration from a file or terminal.
For example, with the following current configuration:
The shutdown value for the entry GigabitEthernet 0/0/0/0 is deleted. Because the configuration file is just a sequence of commands with comments in between, the configuration file looks like this:
The file can then be used with the command load merge FILENAME to achieve the desired results. |
||
move <path>[ first | last | before <key> | after <key>] |
Moves an existing element to a new position in an ordered list. The element can be moved first, last (the default), before, or after another element. |
||
rename <instance path> <new id> |
Renames an instance. |
||
revert |
Copies the running configuration to the current configuration and removes all uncommitted changes. |
||
rload (merge | override) (terminal | <file>) |
Loads the file relative to the current submode. For example, if a file has a device config, you can enter one device and issue the rload merge/override <file> command to load the config for that device, then enter another device and load the same config file using rload. See also the load command.
|
||
rollback configuration [<number>] [<path>] |
Returns the configuration to a previously committed configuration. You can configure the number of old configurations to store in the wae.conf file. If the configurations to store exceed the threshold, the oldest configuration is removed before creating a new one. The configuration changes are stored in rollback files, where the most recent changes are stored in the file rollbackN with the highest number N. Only the deltas are stored in the rollback files. When rolling back the configuration to rollback N, all changes stored in rollback10001-rollbackN are applied. The optional path argument allows subtrees to be rolled back while the rest of the configuration tree remains unchanged. This command is available only if rollback has been enabled in wae.conf. Example:
|
||
rollback selective [<number>] [<path>] |
Instead of undoing all changes from rollback10001 to rollbackN, you can undo only the changes stored in a specific rollback file. In some cases applying the rollback file might fail, or the configuration might require additional changes in order to be valid. The optional path argument allows subtrees to be rolled back while the rest of the configuration tree remains unchanged. |
||
show full-configuration [<pathfilter> [sort-by <idx>]] |
Shows the current configuration, taking local changes into account. The show command can be limited to a part of the configuration by providing a path filter. The sort-by argument can be given when the path filter points to a list element with secondary indexes. The name of a secondary index is idx. When used, the table is sorted in the order defined by the secondary index, which lets you control the order in which to display instances. |
||
show configuration [<pathfilter>] |
Shows current edits to the configuration. |
||
show configuration merge [<pathfilter> [sort-by <idx>]] |
Shows the current configuration, taking local changes into account. The show command can be limited to a part of the configuration by providing a path filter. The sort-by argument can be given when the path filter points to a list element with secondary indexes. The name of a secondary index is idx. When used, the table is sorted in the order defined by the secondary index, which lets you control the order in which to display instances. |
||
show configuration commit changes [<number> [<path>]] |
Displays edits associated with a commit, identified by the rollback number created for the commit. The changes are displayed as forward changes, as opposed to show configuration rollback changes, which displays the commands for undoing the changes. The optional path argument allows only edits related to a given subtree to be listed. |
||
show configuration commit list [<path>] |
Lists rollback files. The optional path argument allows only rollback files related to a given subtree to be listed. |
||
show configuration rollback listed [<number>] |
Displays the operations required to undo the changes performed in a commit associated with a rollback file. These are the changes that are applied if the configuration is rolled back to that rollback number. |
||
show configuration running [<pathfilter>] |
Displays the running configuration without taking uncommitted changes into account. An optional path filter can be provided to limit what is displayed. |
||
show configuration diff [<pathfilter>] |
Displays uncommitted changes to the running configuration in diff-style, with + and - in front of added and deleted configuration lines. |
||
show parser dump <command prefix> |
Shows all possible commands that start with the command prefix. |
||
tag add <statement> <tag> |
Adds a tag to a configuration statement. This command is available only when the system is configured with attributes enabled. |
||
tag del <statement> <tag> |
Removes a tag from a configuration statement. This command is available only when the system is configured with attributes enabled. |
||
tag clear <statement> |
Removes all tags from a configuration statement. This command is available only when the system is configured with attributes enabled. |
||
timecmd <command> |
Measures and displays the execution time of a command. This command is available only if devtools has been set to true in the CLI session settings. Example:
|
||
top [<command>] |
Exits to the top level of configuration, or executes a command at the top level of the configuration. |
||
unhide <hide-group> |
Unhides all elements and actions that belong to the hide-group. A password might be required. This command is hidden and is not shown during command completion. |
||
validate |
Validates the current configuration. This is the same operation as commit check. |
||
xpath [ctx <path>] (eval | must | when) <expression> |
Evaluates an XPath expression. A context-path can be used as the current context for the evaluation of the expression. If no context-path is given, the current sub-mode is used as the context-path. The pipe command trace can be used to display debug or trace information. This command is available only if devtools has been set to true in the CLI session settings.
|