Additional command-line interface utilities

The command-line interface includes a set of utilities that can help you with various tasks you are performing.

Purpose

This topic provides a listing of utilities you can use with the command-line interface to accomplish the following tasks:

deployer.cliversion – obtain the command-line interface version

You can use the deployer.cliversion function to determine the version of the command-line interface code you are using, as shown in the following example:
>>> deployer.cliversion
This function returns an object with a string representation that is the version of the command-line interface code, as shown in the following example:
1.0.0.0-11703
Note: This object is not a string, but can be converted to a string using the str() command, as shown in the following example:
>>> if str(deployer.cliversion).startswith('1.0.0'):
...     print 'running 1.0.0 deployer CLI'
...
running 1.0.0 deployer CLI

deployer.diagnostics.getLatest ()– download the latest log files

You can use the deployer.diagnostics.getLatest() function as to download the latest diagnostic log files. This function returns a compressed file named trace.zip that contains the latest diagnostic log files to the \deployer.cli\bin directory. For additional help on the user object returned, enter the following command:
>>> help(deployer.diagnostics.getLatest())

deployer.everyone – return the everyone group

You can use the deployer.everyone function to return the everyone group. The deployer.everyone function takes no arguments and returns the Group object for the Everyone group on the IBM® PureApplication® Software. For additional help on the Group object returned, enter the following command:
>>> help(deployer.everyone())

deployer.exit – exit the command-line interface

The deployer.exit function exits the command-line interface. In interactive mode, you can use exit without the deployer prefix to end an interactive PureApplication Software command-line interface session. In interactive mode, enter the following command:
 >>> exit
In batch mode, enter the following command:
>>> deployer.exit

deployer.self – obtain the current user

Use the deployer.self function to return a user object for the current user. The deployer.self function takes no argument and returns the user object corresponding to the user specified when the command-line interface was started. For additional help on the user object returned, enter the following command:
>>> help(deployer.self())
Restriction: The object that is returned by the deployer.self function is read only and cannot be modified.

deployer.version – obtain the PureApplication Software version

You can use the following command to obtain the version of PureApplication Software with which your command-line interface session is communicating:

>>> deployer.version
This function returns the following object:
PureApplication Software at deployer.xyz.com, firmware version x.0.0.0-11703
Note: This object is not a string but you can convert it to a string using str(), as shown in the following example:
   >>> if str(deployer.version).find('1.0.0') >= 0:
   ...     print 'System is version 1.0.0'
   ...
   System is version 1.0.0

deployer.waitFor – order operation processing

You can use the waitFor function to specify the order of function processing. This function is like resource.waitFor(), but it is not tied to a particular resource; it is a generic utility function to periodically check a condition that you supply. The deployer.waitFor function can assist you in writing scripts that must wait for the IBM PureApplication Software to complete a particular action. The deployer.waitFor function periodically evaluates a particular expression until the expression evaluates to a true value or a timeout expires. The function accepts the following arguments:

condition
The condition to wait for. If o is an object that can be called, it is invoked at the start of each interval to determine whether to continue waiting. A true value causes this function to return, a false value causes the function to continue waiting.
maxWait
The maximum wait time, expressed as a number of seconds. Floating point values can be used to indicate fractions of a second. A negative value causes this function to wait indefinitely. If a value is not supplied, the default value is -1.
interval
The interval at which o is evaluated, expressed as a number of seconds. Floating point values can be used to express fractions of a second. The default value is 10 seconds.

The deployer.waitFor returns the value obtained the last time the condition was evaluated.

For more information about working with resource objects, see the Related concepts section.