This topic describes the ectool
command line interface to script CloudBees CD/RO operations, including access to the Perl API.
Use ectool
The ectool
is a command line interface that provides operational control over the CloudBees CD/RO system. It supports a large collection of commands, each of which translates to a message sent to the CloudBees CD/RO server. For example, ectool getProjects
returns information about all projects defined on the server.
-
ectool --help
displays a summary of all commands and other command-line options. -
ectool --help <command>
returns information about<command>
. For example,ectool --help modifyStep
returns information about themodifyStep
command.For a list of all ectool
commands, refer to Perl API commands overview.
IPV6 Compatibility
As of CloudBees CD/RO version 2024.03, `ectool supports the following IPv6 communications formats:
-
Standalone IPv6 address:,
2001:DB8::
or[2001:DB8::]
-
Combinations of IPv6 address and port: .
[2001:DB8::]:443
.
Sign in
If you use the ectool
outside of a job, you must invoke the ectool login
command to sign in to the CloudBees CD/RO server for all commands except getServerStatus
. After signing in, ectool
saves information about the login session for use in future ectool invocations. If you run ectool
as part of a CloudBees CD/RO job, you do not need to sign in; ectool
uses the login session (and credentials) for that job.
To sign in to a specific server, refer to the example below, which includes the server name, user name, and password.
ectool --server bldg1server login "Ellen Ernst" "ee123"
If your password is not as part of the login command, then you will be prompted to provide it. |
General syntax for ectool command usage:
ectool [global argument] <command> <positional arguments> [named arguments]
Global arguments (optional)
Refer to Common global options for more information.
Character restrictions in arguments
The ectool
CLI does not support any argument value that begins with a --
(double hyphen), because this is reserved as the prefix for argument names.
Pass lists as arguments
Some API commands include arguments that expect a list of values in one of two list forms: value lists and name/value pairs.
-
value list: each value is specified as a separate argument on the command line.
Example:
ectool addUsersToGroup group1 --userNames user1 user2 user3
-
name/value pairs: each pair is specified as a separate argument in the form name=value.
Example:
ectool runProcedure proj1 --procedureName proc1 --actualParameter parm1=value1 parm2=value2
Global environment variables
Global environment variables allow you to invoke ectool commands without specifying global flags, such as --server <serverName>
, at the command line. Like global flags, these environment variables provide the context for evaluating ectool commands. For example, if the command ectool getProperty /myJob/outcome
is run in a job step, then a value of the outcome property for that job step is returned. Global environment variables also provide ectool with a session that includes all user privileges associated with the job.
If the resource is a proxy agent, global environment variables are available in the step’s environment on the proxy target. For more information, refer to Configure agent environment variables.
Variable | Description |
---|---|
|
The default directory location for storing artifacts retrieved with the |
|
A variable whose value is the data directory for an agent. On Windows, this directory is typically |
|
A variable whose value is the base installation directory for an agent. On Windows, this directory is typically |
|
The port number for insecure communication with the CloudBees CD/RO server. |
|
The port number for secure communication with the CloudBees CD/RO server. |
|
The initial delay in milliseconds between retries when doing artifact retrieval using backing off algorithm. The delay default is 100 ms. For more information, refer to Retrieving artifact versions. |
|
The unique identifier for the job containing the current job step. |
|
The unique identifier for this job step. |
|
The Maximum delay in millisecond between retries when doing artifact retrieval using backing off algorithm. The maximum delay between retries defaults to 30000 ms. For more information, refer to Retrieving artifact versions. |
|
The number of retry attempts for failing retrieveArtifactVersions API calls. The default number of retries is three. For more information, refer to Retrieving artifact versions. |
|
(Configurable) The directory for installed plugins. For example, |
|
The port number for normal communication with the CloudBees CD/RO server. |
|
The resource name assigned to the job step. |
|
The hostname or IP address of the CloudBees CD/RO server. |
|
The current job’s CloudBees CD/RO session identifier, which allows ectool to access the CloudBees CD/RO with job associated privileges without an additional login. |
|
Absolute path suitable for accessing the top-level workspace directory for this job on this machine. On a UNIX machine, this has the same value as |
|
This is the name of the workspace on the CloudBees CD/RO server. |
|
The absolute Unix path to the workspace directory for this job. |
|
The absolute Windows path to the workspace directory for this job. Path begins with the drive letter. |
|
The absolute Windows UNC path to the workspace directory for this job. |
Common global options
Global arguments can be used alone or in conjunction with other commands. These arguments are used to control communication with the server.
Global Arguments | Description | ||
---|---|---|---|
|
Display an online version of |
||
|
Display the |
||
|
The CloudBees CD/RO server address. The default is the
Do not use in a step context: steps running In a step context, the Perl API proxy server requests through the step’s agent. If the agent does not recognize the provided server-name, it rejects the request. Generally, the issue is that the server publicizes its name as a fully-qualified domain name and the Perl API issues requests with a simple-name for the server. This can happen if the step explicitly states which server it is connecting to. Fix your steps that invoke |
||
|
HTTP listener port on the CloudBees CD/RO server. Defaults to port 8000. Use with the |
||
|
HTTPS listener port on the CloudBees CD/RO server. Defaults to port 8443. Use with the |
||
|
Use HTTPS to communicate with the CloudBees CD/RO server. Defaults to
|
||
|
An API call waits for a response from the server for a specified amount of time. Timeout for server communication defaults to 180 seconds (3 minutes) if no other time is specified. After the timeout, the API call stops waiting for a response, but the server continues to process the command. You can also use the global CloudBees CD/RO |
||
|
This is a separate timer, independent of the retry flag, and is used to control CloudBees CD/RO automatic error recovery. When the API cannot contact the CloudBees CD/RO server, it keeps trying to contact the server for this length of time. When the API is called from inside a step, it defaults to 24 hours. You can also use the global CloudBees CD/RO |
||
|
Retry the request if it times out based on the "timeout" value. The default is "0" and should rarely need to be changed. |
||
|
Use the session associated with the user. Defaults to the user who last logged in. |
||
|
Specify the service principal name to use for Kerberos. Defaults to |
||
|
Use the current session as the default for subsequent invocations. Defaults to |
||
|
Use the specified encoding for input/output. For example, for |
||
|
Displays session information and the request that would be sent, without communicating with the server. If a subcommand is specified, the server request that would be sent is displayed. This option can also be used to change the default user/server value by specifying the |
||
|
Suppresses printing the result. For example: |
||
|
Suppress printing of advisory messages. By default, advisory messages, including those related to license and use of APIs that are deprecated or in preview mode, are logged on the console when invoked using |
||
|
This option can return the value of a unique element. Because many ectool APIs return an XML result, it is inconvenient to use ectool in shell scripts and makefiles where you might want a piece of the ectool result to incorporate into some other logic. Using the |
||
|
Specifies the response format. Must be one of 'xml' or 'json'. Defaults to 'xml'. For example, you might specify: |
||
|
Force ectool to ignore |
Use ectool to allow web servers to proxy incoming application server requests
You can configure and execute ectool commands to allow the Apache web server to proxy incoming access to the CloudBees CD/RO application server. These requests occur even when server ports (8000/8443) are not available externally.
Outgoing or incoming requests to other CloudBees CD/RO components are not supported. |
Enter the following to modify the server
and securePort
arguments to specify the Apache web server address.
$ ectool --server localhost --securePort 443 login admin changeme <response requestId="1" nodeId="192.168.56.3"> <sessionId>YQELTIOXWK57IRPO</sessionId> <userName>admin</userName> </response> $ ectool getVersions <response requestId="1" nodeId="192.168.56.3"> <serverVersion> <label>build_10.5_154796_2022.05.23_03:10:48</label> <protocolVersion>2.3</protocolVersion> <schemaVersion>108</schemaVersion> <version>10.5.1.154796</version> </serverVersion> </response>