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
>>> 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
>>> 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
>>> help(deployer.diagnostics.getLatest())
deployer.everyone – return the everyone group
>>> help(deployer.everyone())
deployer.exit – exit the command-line interface
>>> exit
>>> deployer.exit
deployer.self – obtain the current user
>>> help(deployer.self())
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
>>> 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.