Appendix A. Automated Administration Scripts

Table of Contents

A.1. Parsing vda Commands that Result in Jobs
A.2. Parsing vda Command Output
A.3. Parsing vda-center Command Output

The vda and vda-center commands can be used in scripts for automated administration.

Reading the Return Code

The vda and vda-center commands return the following exit codes:

Waiting for a Job to Finish

Some vda subcommands return immediately but start an action in the background, known as a job.

The vda job-wait command enables you to wait for a specific job to be completed before the next command is performed.

# vda job-wait --help
Wait until the job ends

Usage:
 vda job-wait [-t timeout | --timeout=timeout] job
 -?, --help                Print this help list
Options:
 -t timeout, --timeout=timeout 
                           Timeout in seconds to wait
Operand:
*job                     The id of the job
'*' denotes mandatory parameters.

Parsing the Output of the Command Line

A number of the vda and vda-center subcommands support a parsable option so that the output is formatted for easy parsing as a list of lines of colon-separated (':') fields.

The syntax of the option is:

-x, --parseable Display output suitable for programmatic parsing.

The following sections describe the format of output for the subcommands that support the parsable option.