Command modes
You can use the command-line interface (CLI) to run a single command or a series of commands, either interactively or from a script.
- Single-shot mode
- If you want to run only a single command, specify the csmcli program
and the command that you want to run from the shell prompt, for example:
shell> csmcli lslocation Location Details ================= 1 Boulder 3 Marana 2 Tucson shell> - Interactive mode
- If you want to run several commands, start a CLI session by using
the csmcli program with no parameters or
arguments. Then, enter each command at the
csmcli>shell prompt. For example:shell> csmcli csmcli> rmsess exmp_session Are you sure that you want to remove session exmp_session? [y/n]:y Session exmp_session removed csmcli> exit shell> - Script mode
- If you want to run a set of commands that you defined in a file,
use the csmcli program with the -script parameter.
For example:
shell> csmcli -script ~/bin/containersetup shell>You can add comments to the script file by placing a number sign (#) in the first column. For example:# This script file lists the default storage pool. lspool -l -type defaultThe CLI program recognizes these built-in commands in interactive mode:- setoutput
- Specifies various command-output format options. All settings
that are specified with setoutput remain
in effect during the interactive command session unless reset either
with a command option or with setoutput.
With no options, setoutput displays the
current settings in the default output format. Settings from the setoutput command
do not apply to help pages; help pages are shown in text output only.
Syntax
Parameters and arguments:- -fmt { default | xml | delim | stanza }
- Specifies the format of the output. You can specify one of these values:
- default
- Specifies that the output is displayed in tabular format using spaces as delimiters between columns. This is the default value.
- xml
- Specifies that the output is displayed in XML format.
- delim
- Specifies that output is displayed in a tabular format using commas as delimiters between columns.
- stanza
- Specifies that the output is displayed as one keyword-value pair per line.
- -p { on | off }
- Specifies whether to display one page of text at a time or all text at once.
- on
- Displays one page of text at a time. Pressing any key displays the next page. This is the default value when the command is run in interactive mode.
- off
- Displays all text at once. This is the default value when the command is run in single-shot mode.
- -hdr { on | off }
- Specifies whether to display the table header. You can specify one of these values:
- on
- Displays the table header. This is the default value.
- off
- Hides the table header.
- -r number
- Specifies the number of rows per page to display when the -p parameter is specified. You can specify a value of 1 - 100. The default value is 22.
- -v { on | off }
- Specifies whether to enable verbose mode. You can specify one of these values:
- on
- Enables verbose mode.
- off
- Disables verbose mode. This is the default value.
- help
- Displays a list of commands available from the CLI session.
- exit
- Exits from the CLI session.
- quit
- Exits from the CLI session.
