N1 Service Provisioning System 4.1 Reference Guide

Selecting the Output Format of a CLI Command

Because you may want to use the output resulting from CLI commands in various ways, you can adjust the format a CLI command uses to return information. There are two types of CLI output formats:

Standard Output Formats

The CLI supports the following output formats:

Table 4–2 CLI Format Options

Format Option 

Result 

string 

Produces brief output. Use this option for postprocessing 

serialized 

Produces XML serialized text output. Use this option when you want to pass information to another script. 

sink 

Discards output. On UNIX systems, directs output to /dev/null. 

detail 

Formats the output as a table. Includes detailed information. 

If you do not specify an output format, the command uses its default format for the output.

To discover the default output format for a given command, refer to the help information for that command by running the command with -h:


cr_cli –cmd <commandname> –h 

The default output format will be in asterisks at the bottom of the help.

Command-Specific Output Formats

You can also use the -h argument to discover command-specific output formats that are available for a command.Table 4–3 lists command-specific output formats

Table 4–3 Command Output Formats for CLI Command Families

Command Format 

Description 

cdb.detail 

Detailed text output of components 

cmp.detail 

Detailed text output of comparisons 

hdb.detail 

Detailed text output of host data 

net.detail 

Detailed text output of network data 

net.summary 

Summarized output of network data 

pdb.detail 

Detailed text output of plans 

pe.detail 

Detailed output from the running of plans 

rule.detail 

Detailed text output of notification rules 

udb.deep 

Very detailed text output describing users and user groups 

udb.detail 

Detailed text output describing users and user groups 

udb.summary 

Summarized text output describing users and user groups 

Specifying the Output Format

To specify the output format for a CLI command, use the -o argument and list it as the first argument to the command. For example, to select the string output format for the hdb.h.la command, you would run the command:


cr_cli -cmd hdb.h.la -o string -u [user] -p [password]

Note –

The output format you specify must appear after the command itself, but before any other arguments, as shown in this example.