abortAllJobs
Aborts all running jobs.
Arguments | Descriptions |
---|---|
force |
(Optional) < Boolean flag— If this is set to Argument type: Boolean |
reason |
(Optional) A string added to the aborted Argument type: String |
abortJob
Aborts a running job.
You must enter a jobId
.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
force |
(Optional) < Boolean flag— If this is set to Argument type: Boolean |
reason |
(Optional) A string added to the aborted Argument type: String |
abortJobStep
Aborts any type of running step, including a command step or subprocedure step.
Aborting a subprocedure step also aborts all steps of the subprocedure. Steps marked "always run" will still run to completion unless the "force" flag is specified.
You must enter a jobStepId
.
Arguments | Descriptions |
---|---|
jobStepId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job step that is assigned automatically when the job step is created. The system also accepts a job step name assigned to the job step by its name template. Argument type: UUID |
force |
(Optional) < Boolean flag— If this is set to 1 or true , the job aborts immediately. A zero value allows jobs to terminate in an orderly way, for example, executing steps marked "always run". Argument type: Boolean |
reason |
(Optional) A string added to the aborted Argument type: String |
deleteJob
Deletes a job from the CloudBees CD/RO database.
You must specify a jobId
.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
waitForDeleteToComplete |
(Optional) < Boolean flag— If this is set to 1 or true , CloudBees CD/RO deletes the jobs after completing it. If the value is Argument type: Boolean |
findJobSteps
Returns a list of job steps from a single job or from a single subprocedure job step. This command is used by the Job Details web page in the CloudBees CD/RO UI. The elements in the list are returned in their natural job order .
You must specify either a jobId
or a jobStepId
, but not both.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
jobStepId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job step that is assigned automatically when the job step is created. The system also accepts a job step name assigned to the job step by its name template. Argument type: UUID |
filters |
A list of zero or more filter criteria definitions used to define objects to find. See the Argument type: Collection |
numObjects |
Argument type: Integer |
selects |
This is an unordered list of property names that specify additional top-level properties to return for each object. See the code example for Argument type: Collection |
ec-perl
syntax: $cmdr->findJobSteps({<optionals>});
getJobDetails
Retrieves complete information about a job, including details from each job step.
You must specify a jobId
.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
structureOnly |
(Optional) < Boolean flag— If this is set to Argument type: Boolean |
getJobInfo
Retrieves all information about a job, except for job step information.
You must specify a jobId
.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
getJobNotes
Retrieves the notes property sheet from a job.
You must specify a jobId
.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
getJobs
Retrieves summary information for a list of jobs. By default, all jobs are returned.
If you use sortKey or sortOrder , you must use both arguments together. You can use firstResult and maxResults together or separately to select a limited sublist of jobs for the result set.
|
Arguments | Descriptions |
---|---|
firstResult |
The first row to return in the results. This is the < index number > 0-based index that identifies the first element returned from filtered, sorted result set. Argument type: Integer |
maxResults |
This number, < result count >, sets the maximum number of returned jobs. Argument type: Integer |
sortKey |
How to sort the results: Argument type: String |
sortOrder |
The order in which to sort the results: Argument type: SortOrder |
status |
Filter jobs by this status: Argument type: String |
ec-perl
syntax: $cmdr->getJobs({<optionals>});
Examples
How do I get the first 10 jobs (index 0-9)?
$cmdr\-> getJobs ({maxResults=>10});
How do I get the next 10 jobs (index 10-19)?
$cmdr\-> getJobs({firstResult=>10, maxResults=>10});
How do I get the most recent job by start time?
$cmdr\-> getJobs({sortKey=>'start', sortOrder=>'descending', maxResults=>1});
ectool
syntax: ectool getJobs [optionals]
getJobsForSchedule
Retrieves jobs started by a specific schedule.
You must specify a projectName
and scheduleName
.
Arguments | Descriptions |
---|---|
projectName |
The name for the project that must be unique among all projects. Argument type: String |
scheduleName |
The name for the schedule that must be unique among all schedules for the project. Argument type: String |
Response
Returns an XML stream containing any number of job
elements. The job
elements contain summary information only.
getJobStatus
Retrieves the status of a job.
You must specify the jobId
.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
Response
Values for status
and outcome
as follows:
Possible values for status
:
pending
—The job is not yet runnable—it is waiting for other steps to complete first. A job should not stay in this state for longer than a few seconds.
runnable
—The job is ready to run, but it is waiting for a resource to become available.
running
—The job is assigned to a resource and is executing the step command.
completed
—The job finished executing.
Possible values for outcome
: The outcome
is accurate only if the job status is "completed."
success
—The job finished successfully.
warning
—The job completed with no errors, but encountered some suspicious conditions.
error
—The job has finished execution with errors.
getJobStepDetails
Retrieves details for a job step. You may never need to use this command. This information is available for all job steps in a job by using the getJobDetails
command. The getJobStepDetails
command can be used to refresh data for a single step if you need an update in real time.
You must specify jobStepId
.
Arguments | Descriptions |
---|---|
jobStepId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job step that is assigned automatically when the job step is created. The system also accepts a job step name assigned to the job step by its name template. Argument type: UUID |
structureOnly |
(Optional) < Boolean flag — < c Argument type: Boolean |
getJobStepStatus
Retrieves the status of a job step.
You must specify the jobStepId
.
Arguments | Descriptions |
---|---|
jobStepId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job step that is assigned automatically when the job step is created. The system also accepts a job step name assigned to the job step by its name template. Argument type: UUID |
Response
A status
tag—for example: <status>completed</status>
Possible values for status
:
pending
—The job step is not yet runnable—it is waiting for other steps to complete first. A job should not stay in this state for longer than a few seconds.
runnable
—The job step is ready to run, but it is waiting for a resource to become available.
running
—The job step is assigned to a resource and is executing the step command.
completed
—The job step finished executing.
getJobSummaries
Retrieves summary information about jobs.
Arguments | Descriptions |
---|---|
filters |
(Optional) Specify filters in a space-separated list: Each element of the filter list is a hash reference containing one filter criterion. You may specify several filter criteria, in which case an object must meet all filter criteria to be included in the result. See the code example below for instructions on forming the list and passing it to the CloudBees CD/RO Perl API. Two types of filters:
Each "property filter" consists of a property name to test and an operator to use for comparison. The property can be either an intrinsic property defined by CloudBees CD/RO or a custom property added by the user. Each operator takes zero, one, or two operands to compare against the desired property. Property filter operators are between (2 operands) contains (1) equals (1) greaterOrEqual (1) greaterThan (1) in (1) lessOrEqual(1) lessThan (1) like (1) notEqual (1) notLike (1) isNotNull (0) isNull (0) A Boolean filter is a Boolean an operator and an array of one or more filters that are operands. Each operand can be either a property filter or a Boolean filter. Boolean operators are: not (1 operand) and (2 or more operands) or (2 or more operands) Argument type: Collection |
includeLastSuccess |
(Optional) < Boolean flag - Argument type: Boolean |
maxFailedSteps |
(Optional) Maximum number of failed steps to return. Argument type: Integer |
maxJobs |
(Optional) Maximum number of jobs to return. Argument type: Integer |
maxRunningSteps |
(Optional) Maximum number of running steps to return. Argument type: Integer |
getJobSummary
Retrieves a job and its job steps with only the specified job and job step properties.
Arguments | Descriptions |
---|---|
jobId |
(Optional) The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
jobProperties |
(Optional) A comma-separated list of intrinsic job properties to include in the output. Argument type: String |
jobStepProperties |
(Optional) A comma-separated list of intrinsic job step properties to include in the output. Argument type: String |
orderStepsByIndex |
(Optional) < Boolean flag - Argument type: Boolean |
Response
A summary of the jobStep with the specified properties.
moveJobs
Moves jobs from one project to another project.
You must specify sourceProject
and destinationProject
.
Arguments | Descriptions |
---|---|
sourceProject |
Name of the project that contains the jobs you want to move. Argument type: String |
destinationProject |
New project that will contain the jobs. Argument type: String |
runProcedure
Creates and starts a new job using a procedure directly or a procedure specified indirectly through a schedule.
Returns a new job ID. Wait until the job completes. If the pollInterval
option is provided, wait until the job completes up to a maximum of timeout
seconds (if also provided). If the scheduleName
option is provided, the parameters provided by that schedule will be used.
runProcedure credentials
—two types of credentials can be passed to runProcedure
:
-
Impersonation credentials
-
Credential parameters
Impersonation credentials
Impersonation credentials are used to set the top level impersonation credential for a job. If specified, the impersonation credential [on the job] is used as the default impersonation credential for all steps in the job.
The impersonation credential can be specified in two ways. If the credentialName
argument is supplied, the job looks for the named credential specified. If the user has execute permission on the specified credential, runProcedure
is allowed to start the job.
If the userName
and password
arguments are supplied, the job creates a transient credential to contain the pair. The transient credential is used by the job and then discarded when the job completes.
Only one of credentialName
or userName
should be specified. If both are specified, only userName
is used. Neither can be specified if the procedure being run already has a credential defined on the procedure or the project.
Credential parameters
If the procedure defines one or more credential parameters, runProcedure
must specify a credential to use for each parameter. The actualParameter
argument identifies the credential name to use for the parameter, and the credential
argument specifies the user name for each defined credential. For each credential specified, ectool
prompts for a password.
For example, for a procedure named proc1
with a single credential parameter named 'param1'
. The following command could be used to pass a transient credential where the user name is 'joe'
and the password is 'plumber'
:
$ectool runProcedure test --procedureName proc1 \ --actualParameter param1=cred1 --credential cred1=joe
Credential reference parameters
If the procedure defines one or more credential reference parameters, that is, a parameter that references a credential from an external credential provider, runProcedure
must specify a credential reference to use for each parameter. The credentialReferenceParameter
argument identifies the reference to the credential name to use for the parameter.
For example, consider a procedure named proc1
with a single credential reference parameter named refparam1
:
$ectool runProcedure test --procedureName proc1 \ --actualParameter param1=cred1 --credentialReferenceParameter cred1=refparam1
Multiple credential references can be specified by having additional name=value pairs after the credentialReferenceParameter
arguments. The same credential reference can be specified as the value for more than one actual parameter.
You must specify a projectName
and either a procedureName
or a scheduleName
.
The pollInterval and timeout arguments are used to control whether runProcedure returns immediately or waits until the job completes. If pollInterval is used and timeout is not used, pollInterval will time out in 60 seconds.
|
Arguments | Descriptions |
---|---|
projectName |
Name of the project. This name must be unique among all projects. Argument Type: String Argument type: String |
actualParameter |
(Optional) Specifies the values to pass as parameters to the called procedure. Each parameter value is specified with an Argument type: Map |
credentialName |
(Optional) |
credentials |
(Optional) Use the following syntax to specify a local credential: Argument type: Collection |
credentialReferenceParameter |
(Optional) Used when the procedure defines one or more credential reference parameters, that is, a parameter that references a credential from an external credential provider.
For local parameters, use Argument type: Map |
destinationProject |
(Optional) This argument is used to specify the name of the destination project. Argument type: String |
password |
(Optional) The password for the user running the procedure. Argument type: String |
pollInterval |
(Optional) This argument requires setting a value in seconds to determine how often ectool queries the CloudBees CD/RO server for job status, but this is not an indefinite activity–set the If this option is not specified, Argument type: Integer |
priority |
(Optional) Priorities take effect when two or more job steps in different jobs are waiting for the same resource. When the resource is available, it will be used by the job step that belongs to the job with the highest priority. If the priority level is the same, the resource will be used by the job step that belongs to the job with the lowest job ID number. If the job steps are in the same job, the resource will be used first by the step with the lowest job step ID number. Priority values are: Argument type: JobPriority |
procedureName |
(Optional) The name for the procedure; must be unique within the project. Argument type: String |
scheduleName |
(Optional) The name for the schedule; must be unique among all schedules for the project. Use this option if you want to use the parameters from an existing specific schedule. Argument type: String |
timeout |
(Optional) This argument requires a value set in seconds . If If Argument type: Integer |
userName |
(Optional) The name of the user who is running the procedure. Argument type: String |
webhookData |
(Internal use, only) Free-form string containing information from a webhook callback. This argument is populated internally by webhook aware plugins, such as ECSCM. Argument Type: String |
ec-perl
syntax: $cmdr->runProcedure(<project name>, {<optionals>});
Example
$cmdr->runProcedure("Sample Project", {procedureName => "Delay", actualParameter => {actualParameterName => "Delay Time", value => 10}}); $xpath = $ec->runProcedure("BSHTest", {procedureName => "FakeMotoBuild", actualParameter => [ {actualParameterName => "builddir", value => $cwd}, {actualParameterName => "board", value => $board}, {actualParameterName => "myview", value => $cwv}, {actualParameterName => "resourcetouse", value => $resourcetouse}, ]});
setJobName
Sets the name of a running job.
You must specify jobId
and newName
.
Notes:
The jobId
can be omitted if the command is run as part of a CloudBees CD/RO step.
A job cannot be renamed after it has completed.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
newName |
New name of the job. Argument type: String |
External Job APIs
CloudBees CD/RO includes a powerful built-in scheduler for both managing execution and real-time reporting for a "running" process. Most CloudBees CD/RO Installations choose to use its built-in scheduler because it is more powerful than most in-house built and other scheduling solutions.
However, there are use cases where an external scheduler may be appropriate, for example, an LSF Grid engine. Often, such systems are quite mature and may have been in use for many years. An organizations reliance on an LSF Grid system can mandate it remain as the driving scheduler. Many schedulers lack the richness in their graphical user interface, which is an area where CloudBees CD/RO excels—especially as it applies to monitoring the status of complex processes and workflows as they progress in real-time through the CloudBees CD/RO system. The CloudBees CD/RO GUI also provides powerful auditing capabilities for reviewing results of complex process runs.
External Job APIs are designed to leverage the CloudBees CD/RO GUI to display results for jobs running on external schedulers. The external scheduler can issue calls through these APIs to provide a representation of this same job within the CloudBees CD/RO Jobs page. CloudBees CD/RO users and the external scheduler can then monitor the complete integrated system through a single interface—the CloudBees CD/RO GUI.
The external system need not be a formal scheduler. In fact, even a simple script might be able to leverage the External Job Step API. For example, a build script could issue API calls at its beginning and end so the build is represented in CloudBees CD/RO as a job.
Using the API does not consume agent resources. The API simply allows for graphical representation of external jobs within CloudBees CD/RO .
completeJob
Completes an externally managed job. Marks the job root step so the job is marked "completed" when all child steps are completed, and updates the runtime for the root step.
You must specify a jobId
.
Arguments | Descriptions | ||
---|---|---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
||
force |
(Optional) < Boolean flag— This arguments determines whether all external steps under the job should be recursively marked "complete".
Argument type: Boolean |
||
outcome |
(Optional) Overall outcome for a job or step:
Argument type: JobOutcome |
completeJobStep
Completes an externally managed job step. Marks the job step "completed" when all child steps are completed and updates the step runtime.
You must specify a jobStepId
.
Arguments | Descriptions | ||
---|---|---|---|
jobStepId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job step that is assigned automatically when the job step is created. The system also accepts a job step name assigned to the job step by its name template. Argument type: UUID |
||
evidence |
(Optional) The reason for marking the job step complete. Argument type: String |
||
exitCode |
(Optional) The exit code of a job step. Argument type: Integer |
||
force |
(Optional) < Boolean flag— If true, all external steps under the job should be recursively marked "complete".
Argument type: Boolean |
||
outcome |
(Optional) Overall outcome for a job or step:
Argument type: JobOutcome |
createJob
Creates an externally managed job that will serve as a container for external job steps.
You must specify projectName
or destinationProject
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project where this job will reside. You must have modify permission on the destination project. Argument type: String |
destinationProject |
If specified, determines the project where the job will reside. You must have modify permission on the destination project. Argument type: String |
jobNameTemplate |
If specified, the job name will be generated by expanding this argument value. The job name is generated by expanding the Argument type: String |
procedureName |
If specified, Argument type: String |
status |
The starting status for the job:
Argument type: JobStatus |
createJobStep
Use this API to add CloudBees CD/RO managed job steps to a running job or job step and to create externally managed steps (if "external" is set).
You must specify the parent job step using either the jobStepId
or parentPath
arguments (COMMANDER_JOBSTEPID ` implicitly sets `jobStepId
). The parent job step status must not be completed
.
External job steps do not participate in error handling processing. When you execute a job that includes a step with the --errorhandling abortProcedureNow argument, this argument is ignored if the step fails. The job then continues running the rest of the steps.
|
Arguments | Descriptions | ||
---|---|---|---|
actualParameter |
Specifies the values to pass as parameters to the called procedure. Each parameter value is specified with an For more information about parameters, see createActualParameter . Argument type: Map |
||
alwaysRun |
If set to 1, indicates this job step will run even if the job is aborted before the job step completes. A useful argument for running a "cleanup" step that should run whether the job step is successful or not. The value for Argument type: Boolean |
||
broadcast |
Use this flag to run the same job step on several resources at the same time. The job step is "broadcast" to all resources listed in the Argument type: Boolean |
||
command |
The command to run. This argument is applicable to command job steps only. Argument type: String |
||
comment |
The script to execute the functions in this step, which are passed to the step’s shell for execution. Argument type: String |
||
condition |
If empty or non-zero, the job step will run. If set to "0", the job step is skipped. A useful setting during procedure development or when re-running a job that has already completed some of the job steps. Also, this argument is useful for conditional execution of steps based on properties set by earlier steps. Argument type: String |
||
credentialName |
The credential to use for impersonation on the agent. Argument type: String |
||
credentials |
Refers to one or more credentials to attach to this job step. These are dynamic credentials, captured when a job is created. Dynamic credentials are stored on the server temporarily until the job completes and then discarded. For more information about credentials, see Credentials and User Impersonation. Argument type: Collection |
||
credentialReferenceParameter |
(Optional) Used when the procedure defines one or more credential reference parameters, that is, a parameter that references a credential from an external credential provider.
For local parameters, use Argument type: Map |
||
description |
A plain text or HTML description for this object. If using HTML, you must surround your text with Argument type: String |
||
errorHandling |
Determines what happens to the procedure if the step fails:
Argument type: ErrorHandling |
||
exclusive |
< Boolean flag - If set to
Argument type: Boolean |
||
exclusiveMode |
Determines the mode to use when the step acquires a resource. Possible modes include:
If you set If you set
While the resource is being held for the exclusive use of the job or the current procedure call, then any subsequent steps that use Argument type: ExclusiveMode |
||
external |
If set, indicates this job step is an external step. CloudBees CD/RO will not schedule or run agent commands for external steps, but instead, represents a step managed outside of CloudBees CD/RO . The typical usage is with an external Job (see The value for external is a < Boolean flag— Argument type: Boolean |
||
jobStepId |
The unique CloudBees CD/RO -generated identifier (UUID) for the parent job step that is assigned automatically when the job step is created. The system also accepts a job step name assigned to the job step by its name template. You can specify Argument type: UUID |
||
jobStepName |
The name of the new dynamic job step to create. Argument type: String |
||
logFileName |
A custom log file name produced by running the job step. By default, CloudBees CD/RO assigns a unique name for this file. Argument type: String |
||
parallel |
< Boolean flag - If set to Argument type: Boolean |
||
parentPath |
The path of the parent job step. This argument determines the parent job for the new You can specify Argument type: String |
||
postProcessor |
The name of a program to run after a job step completes. This program looks at the job step output to find errors and warnings. CloudBees CD/RO includes a customizable program called "postp" for this purpose. The value for Argument type: String |
||
precondition |
The A precondition property allows steps to be created with "pause", which then pauses the procedure. In a paused state, all currently running steps continue, but no additional steps will start. Set this property to make a step wait until one or more dependent conditions are met. When a job step is eligible to transition from pending to runnable, a precondition is evaluated. A precondition is fixed text or text embedding a property reference that is evaluated to TRUE or FALSE. An empty string, a \"0\" or \"false\" is interpreted as FALSE. Any other result string is interpreted as TRUE. The step will block until the precondition is TRUE. Argument type: String For example, assume that we defined these four steps:
You can achieve optimal step execution order with preconditions:
|
||
procedureName |
The name of the procedure for an existing step definition that will be copied to the new job step. Argument type: String |
||
projectName |
The name of the project for an existing step definition that will be copied to the new job step. Argument type: String |
||
releaseExclusive |
< Boolean flag— Declares whether or not this job step will release its resource, which is currently held "exclusively". Setting this flag to "true" is the same as setting Argument type: Boolean |
||
releaseMode |
Use one of the following options:
Argument type: ReleaseMode |
||
resourceName |
Name for the resource; must be unique among all resources. Argument type: String |
||
shell |
Where shell is the name of a program used to execute commands contained in the "command" field. The name of a temporary file containing commands will be appended to the end of this invocation line. Normally, this file is a command shell, but it can be any other command line program. The default is to use the standard shell for the platform it runs on ( Applicable to command steps only. Argument type: String |
||
status |
Argument type: JobStatus |
||
stepName |
Takes the name of an existing step and creates a job step from this definition. It is used in conjunction with If you use You can use any project, procedure, or step as a template. If you do not provide a template, you must set the parameters of the new |
||
subprocedure |
The name of the nested procedure to call when this job step runs. If a subprocedure is specified, do not include the Argument type: String |
||
subproject |
If a Argument type: String |
||
timeLimit |
The maximum length of time the job step is allowed to run. After the time specified, the job step will be aborted. The time limit is specified in units that can be hours, minutes, or seconds. Argument type: String |
||
timeLimitUnits |
Specify Argument type: TimeLimitUnits |
||
workingDirectory |
The CloudBees CD/RO agent sets this directory as the “current working directory,” when running the command contained in the job step. If no working directory is specified in the job step, CloudBees CD/RO uses the directory it created for the job in the CloudBees CD/RO workspace as the working directory.
Argument type: String |
||
workspaceName |
The name of the workspace where the job step log files will be stored. Argument type: String
Argument type: String The syntax for this argument is as follows: ec-perl: ectool: |
ec-perl
syntax: $cmdr->createJobStep({<optionals>});
Examples
$cmdr->createJobStep ({parentPath => "/jobs/123", external => "1"}); $cmdr->createJobStep ({jobStepId => "5da765dd-73f1-11e3-b67e-b0a420524153", external => "1"}); $cmdr->createJobStep ({jobStepId => "5da765dd-73f1-11e3-b67e-b0a420524153", workspaceName => "workspaceA"}); $cmdr->createJobStep ({jobStepId => "5da765dd-73f1-11e3-b67e-b0a420524153", workspaceName => "\$" . "[/myResource/workspaceName]"});
# Create a job step that calls a subprocedure and passes a parameter credential # ‘coolProcedure’ is a procedure within the Default project with one parameter # credential named ‘sshCredentialParameter’. $cmdr->createJobStep( { projectName => 'Default', subprocedure => 'coolProcedure', actualParameter => [ { actualParameterName => 'sshCredentialParameter', value => 'sshCredentialParameter' } ], credential => [ { credentialName => 'sshCredentialParameter', userName => 'sshUser', password => 'super_secure_sshPassword' } ] } ); # Create two parallel job steps and send them to the {PRODUCT} server using the batch API. # Create the batch API object my $batch = $ec->newBatch('parallel'); # Create multiple requests my @reqIds = ( $batch->createJobStep( { parallel => '1', projectName => 'Default', subprocedure => 'coolProcedure', actualParameter => [ { actualParameterName => 'input', value => 'helloWorld' } ], } ), $batch->createJobStep( { parallel => '1', projectName => 'Default', subprocedure => 'coolProcedure', actualParameter => [ { actualParameterName => 'input', value => 'helloWorld' } ], } ), ); # Send off the requests $batch->submit();
ectool
syntax: ectool createJobStep [optionals]
Examples
ectool createJobStep --parentPath /jobs/123 --external 1 ectool createJobStep --jobStepId 5da765dd-73f1-11e3-b67e-b0a420524153 --external 1
ectool createJobStep --parallel 1 --projectName Default --subprocedure
coolProcedure --actualParameter input=helloWorld
ectool createJobStep --jobStepName "Echo-Middle" --workspaceName "workspaceA"
modifyJob
Modifies the status of an externally managed job.
You must specify a jobId
.
Arguments | Descriptions |
---|---|
jobId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
status |
(Optional) This argument determines the current status of the job, and also sets related timing values. Possible values for
Argument type: JobStatus |
modifyJobStep
Transitions an externally managed job step through its lifecycle—pending, runnable, running, or complete—by setting the step’s status
property.
You must specify a jobStepId
.
Arguments | Descriptions |
---|---|
jobStepId |
The unique CloudBees CD/RO -generated identifier (a UUID) for a job step that is assigned automatically when the job step is created. The system also accepts a job step name assigned to the job step by its name template. Argument type: UUID |
status |
(Optional)
Argument type: JobStatus |
waitForJob
Waits until the specified job reaches a given status or the timeout expires.
This command works only with ec-perl.
Arguments | Descriptions |
---|---|
jobId |
The job to wait for. The unique CloudBees CD/RO -generated identifier (a UUID) for a job that is assigned automatically when the job is created. The system also accepts a job name assigned to the job by its name template. Argument type: UUID |
timeout |
(Optional) The number of seconds to wait before giving up on a request. The default is 60 seconds. Argument type: Integer |
finalStatus |
(Optional) The status to wait for. Must be either "running" or "completed" (the default is "completed"). Argument type: String |
ec-perl
syntax: $cmdr->waitForJob(<jobId>, <timeout>, <finalStatus>, {<optionals>});
Examples
Wait for a job until it has a status of completed . This call would wait for 60 seconds, which is the default timeout:
$cmdr->waitForJob("4fa765dd-73f1-11e3-b67e-b0a420524153");
Wait for a job until it has a status of completed . This call would wait for 30 seconds.:
$cmdr->waitForJob("4fa765dd-73f1-11e3-b67e-b0a420524153", 30);
Wait for a job until it has a status of running . This call would wait for 60 seconds, which is the default timeout:
$cmdr->waitForJob("4fa765dd-73f1-11e3-b67e-b0a420524153", undef, "running");