Additional command-line interface utilities
The command-line interface includes a set of utilities to help you perform various tasks.
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 function to determine
the version of the command-line interface code you are using, as shown in the following example:>>> deployer.cliversionThis
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-11703str() 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 CLIdeployer.diagnostics.getLatest ()– download the latest log files
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
>>> help(deployer.everyone())deployer.exit – exit the command-line interface
deployer.exit function exits the command-line interface. In interactive mode, you can use exit without the
deployer prefix to end an interactive command-line interface
session. In interactive mode, enter the following command:
>>> exit>>> deployer.exitdeployer.self – obtain the current user
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())deployer.self function is read only and cannot
be modified.deployer.version – obtain the Cloud Pak System version
You can use the following command to obtain the version of Cloud Pak System with which your command-line interface session is communicating:
>>> deployer.versionThis function returns the following
object:Cloud Pak System at deployer.xyz.com, firmware version x.0.0.0-11703str(),
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
system 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
truevalue causes this function to return, afalsevalue 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.