createProcedure
Creates a new procedure for an existing project.
You must specify projectName
and procedureName
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project that contains this procedure. The name must be unique among all projects. Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. Argument type: String |
credentialName |
(Optional) The name of the credential specified in one of these formats:
Argument type: String |
description |
(Optional) A plain text or HTML description for this object. If using HTML, you must surround your text with Argument type: String |
jobNameTemplate |
(Optional) Template used to determine the default name of jobs launched from a procedure. Argument type: String |
resourceName |
(Optional) The name of the default resource or pool used in steps run by this procedure. Argument type: String |
timeLimit |
(Optional) If no time limit was specified on the calling step, time limits are copied to the calling step from the procedure. If the procedure is called from Argument type: String |
timeLimitUnits |
(Optional) Time limit units are Argument type: TimeLimitUnits |
workspaceName |
(Optional) The name of the default workspace used in steps run by this procedure. Argument type: String |
createStep
Creates a new procedure step.
Fundamentally, CloudBees Flow supports three types of steps:
-
Command Step—The step executes a command or script under the control of a shell program.
-
Subprocedure Step—The step invokes another CloudBees Flow procedure. In this case, the step will not complete until all subprocedure steps have completed.
-
Custom Step
You must specify a projectName
, procedureName
, and stepName
.
Arguments | Descriptions | ||
---|---|---|---|
projectName |
The name of a project that must be unique among all projects. Argument type: String |
||
procedureName |
The name for a procedure that must be unique within the project. Argument type: String |
||
stepName |
Name of the step that must be unique within the procedure. Argument type: String |
||
actualParameters |
(Optional) Specifies the values to pass as parameters to the called procedure. Each parameter value is specified with an Argument type: Map |
||
afterProcedureStep |
(Optional) If specified, the procedure step will be placed after the named procedure step. Argument type: String |
||
alwaysRun |
(Optional) < Boolean flag - If this value is set to Argument type: Boolean |
||
beforeProcedureStep |
(Optional) If specified, the procedure step will be placed before the named procedure step. Argument type: String |
||
broadcast |
(Optional) < Boolean flag - If this value is set to Argument type: Boolean |
||
command |
(Optional) The command to run. This argument is applicable only to command steps. Argument type: String |
||
comment |
(Optional) The script to execute the functions of this step, which are passed to the step’s shell for execution. Argument type: String |
||
commandFile |
(Optional) Contents of the command file is read and stored in the "command" field. This is an alternative argument for
|
||
condition |
(Optional) If empty or non-zero, the step will run. If set to "0", the step is skipped. A useful setting during procedure development or when re-running a job that has already completed some of the steps. Also, this argument is useful for conditional execution of steps based on properties set by earlier steps. Argument type: String |
||
credentialName |
(Optional) The credential to use for impersonation on the agent. Name of the credential in one of these forms:
Argument type: String |
||
description |
(Optional) A plain text or HTML description for this object. If using HTML, you must surround your text with Argument type: String |
||
errorHandling |
(Optional) Determines what happens to the procedure if the step fails:
Argument type: ErrorHandling |
||
exclusive |
(Optional) < Boolean flag - If set to
Argument type: Boolean |
||
exclusiveMode |
(Optional) Use one of the following options:
Argument type: ExclusiveMode |
||
logFileName |
(Optional) A custom log file name produced by running the step. By default, CloudBees Flow assigns a unique name for this file. Argument type: String |
||
parallel |
(Optional) The value for If set, indicates this step should run at the same time as adjacent steps marked to run as parallel also. The default is to Argument type: Boolean |
||
postProcessor |
(Optional) The name of a program to run after a step completes. This program looks at the step output to find errors and warnings. CloudBees Flow includes a customizable program called "postp" for this purpose. The value for Argument type: String |
||
precondition |
(Optional) By default, if the step has no precondition, it will run when scheduled. 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 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. Precondition example: Assume we defined these 4 steps:
Step 1 is an ordinary serial step. Steps 2 and 3 can run in parallel because they depend only on step 1’s completion. Step 4 depends on step 2, but not step 3. You can achieve optimal step execution order with preconditions:
Argument type: String |
||
releaseExclusive |
(Optional) < Boolean flag— This declares whether or not this step will release its resource, which is currently held exclusively. Setting this flag to "true" is the same as setting Argument type: Boolean |
||
releaseMode |
(Optional) Use one of the following options:
Argument type: ReleaseMode |
||
resourceName |
(Optional) Name for the resource that must be unique among all resources. Argument type: String |
||
shell |
(Optional) 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 ( Argument type: String |
||
subprocedure |
(Optional) The name of the nested procedure to call when this step runs. If a subprocedure is specified, do not include the Argument type: String |
||
subproject |
(Optional) If a Argument type: String |
||
timeLimit |
(Optional) The maximum length of time the step is allowed to run. After the time specified, the step will be aborted. The time limit is specified in units that can be hours, minutes, or seconds. Argument type: String |
||
timeLimitUnits |
(Optional) Specify Argument type: TimeLimitUnits |
||
workingDirectory |
(Optional) The CloudBees Flow agent sets this directory as the “current working directory,” when running the command contained in the step. If no working directory is specified in the step, CloudBees Flow uses the directory it created for the job in the CloudBees Flow workspace as the working directory. If running a step on a proxy resource, this directory must exist on the proxy target. Argument type: String |
||
workspaceName |
(Optional) The name of the workspace where the log files for this step will be stored. Argument type: String |
ec-perl
syntax: $<object>->createStep(<projectName>, <procedureName>, <stepName>, {<optionals>});
Specifying most arguments to the Perl createStep
API is fairly intuitive. Similar to any other API, key-value pairs are specified in a hash argument for all optional parameters. However, specifying actual parameters is a little different because they are not arbitrary key-values characterizing the step. Actual parameters are key-values characterizing actual parameters to the step. See the following createStep
request in XML:
<createStep>
` <projectName>MyProject</projectName>` ` <procedureName>MyProcedure</procedureName>` ` <stepName>Step1</stepName>` ` <actualParameter>` ` <actualParameterName>parm1</actualParameterName>` ` <value>myval</value>` ` </actualParameter>` ` <actualParameter>` ` <actualParameterName>parm2</actualParameterName>` ` <value>val2</value>` ` </actualParameter>` </createStep>
Each actual parameter key-value is under an <actualParameter>
element, which is codified in the optional arguments hash in the Perl API like this:
{… ⇒ …, actualParameter ⇒ [{actualParameterName ⇒ 'parm1', value ⇒ 'myval'}, {actualParameterName ⇒ 'parm2', value ⇒ 'val2'}], … ⇒ …}
In other words, the value of the actualParameter
key in the optional arguments hash is a list of hashes, each representing one actual parameter. If the subprocedure call only takes one actual parameter, the value of the actualParameter
key can be specified as just the hash representing the one parameter:
actualParameter ⇒ {actualParameterName ⇒ 'parm1', value ⇒ 'myval'}
ectool
syntax: ectool createStep <projectName> <procedureName> <stepName> [optionals]
Specifying actual parameters in an ectool call is also different than specifying other arguments. Specify each key-value as an equal-sign delimited value:
ectool createStep … --actualParameter "Delay Time=5" "parm2=val2"
If the parameter name or value contains spaces, quotes are needed.
deleteProcedure
Deletes a procedure, including all steps.
You must specify a projectName
and procedureName
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project that contains this procedure. The name must be unique among all projects. Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. Argument type: String |
deleteStep
Deletes a step from a procedure.
You must specify projectName
, procedureName
, and stepName
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project that contains this procedure. The name must be unique among all projects. Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. Argument type: String |
stepName |
The name of the step that must be unique within the procedure. Argument type: String |
getProcedure
Finds a procedure by its name.
You must specify a projectName
and a procedureName
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project that contains this procedure. The name must be unique among all projects. Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. Argument type: String |
Response
One procedure
element, which includes the procedure ID, name, time created, job name template, owner, resource name, workspace name, project name, and so on.
getProcedures
Retrieves all procedures in a project.
You must specify the projectName
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project that contains this procedure. The name must be unique among all projects. Argument type: String |
getStep
Retrieves a step from a procedure.
You must specify projectName
, procedureName
, and stepName
.
Arguments | Descriptions |
---|---|
projectName |
Name of the project. This name must be unique among all projects. Argument Type: String Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. Argument type: String |
stepName |
The name of the step that must be unique within the procedure. Argument type: String |
getSteps
Retrieves all steps in a procedure.
You must specify the projectName
and procedureName
.
Arguments | Descriptions |
---|---|
projectName |
Name of the project. This name must be unique among all projects. Argument Type: String Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. Argument type: String |
modifyProcedure
Modifies an existing procedure.
You must specify projectName
and procedureName
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project that contains this procedure. The name must be unique among all projects. You must also enter Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. You must also enter Argument type: String |
credentialName |
(Optional) Name of the credential in one of these forms:
Argument type: String |
description |
(Optional) A plain text or HTML description for this object. If using HTML, you must surround your text with Argument type: String |
jobNameTemplate |
(Optional) Job name format for jobs created by running this procedure. Argument type: String |
newName |
(Optional) New name of the procedure. Argument type: String |
resourceName |
(Optional) The name of the default resource where steps belonging to this procedure will run. This name can be a resource pool name. Argument type: String |
timeLimit |
(Optional) If no time limit was specified on the calling step, time limits are copied to the calling step from the procedure. If the procedure is called from Argument type: String |
timeLimitUnits |
(Optional) Time limit units are Argument type: TimeLimitUnits |
workspaceName |
(Optional) The name of the default workspace where job output is stored. Argument type: String |
modifyStep
Modifies an existing step.
You must specify projectName
, procedureName
, and stepName
.
Arguments | Descriptions | ||
---|---|---|---|
projectName |
include::partial$name-for-the-project.adoc[] You must also enter the Argument type: String |
||
procedureName |
The name of the procedure that must be unique within the project. You must also enter Argument type: String |
||
stepName |
The name of the step that must be unique within the procedure. You must also enter 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 |
||
afterProcedureStep |
(Optional) If specified, the procedure step will be placed after the named procedure step.. Argument type: String |
||
alwaysRun |
(Optional) < Boolean flag - If set to Argument type: Boolean |
||
beforeProcedureStep |
(Optional) The procedure step will be placed before the named procedure step if this option is used. Argument type: String |
||
broadcast |
(Optional) < Boolean flag - Argument type: Boolean |
||
clearActualParameters |
(Optional) < Boolean flag - If set to Argument type: Boolean |
||
command |
(Optional) The step command. Argument type: String |
||
commandFile |
(Optional) The contents of the command file is read and stored in the "command" field. This is an alternative argument for
|
||
comment |
(Optional) The script to execute the functions of this step, which are passed to the step’s shell for execution. Argument type: String |
||
condition |
(Optional) If empty or non-zero, the step will run. If set to "0", the step is skipped. A useful setting during procedure development or when re-running a job that has already completed some of the steps. Also, this argument is useful for conditional execution of steps based on properties set by earlier steps. Argument type: String |
||
credentialName |
(Optional) Name of the credential in one of these forms:
Argument type: String |
||
description |
(Optional) A plain text or HTML description for this object. If using HTML, you must surround your text with Argument type: String |
||
errorHandling |
(Optional) Determines what happens to the procedure if the step fails:
Argument type: ErrorHandling |
||
exclusive |
(Optional) < Boolean flag - If set to When you set Argument type: Boolean |
||
exclusiveMode |
(Optional) Use one of the following options:
Argument type: ExclusiveMode |
||
logFileName |
(Optional) A custom log file name produced by running the step. By default, CloudBees Flow assigns a unique name to this file. Argument type: String |
||
newName |
(Optional) New name of the step. Argument type: String |
||
parallel |
(Optional) < Boolean flag — If this argument is set to Argument type: String |
||
postProcessor |
(Optional) This command runs in parallel with the main command for the step. It analyzes the log for the step and collects diagnostic information. Argument type: String |
||
precondition |
(Optional) By default, if the step has no precondition, it will run when scheduled. 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 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. Precondition example: Assume we defined these 4 steps:
Step 1 is an ordinary serial step. Steps 2 and 3 can run in parallel because they depend only on step 1’s completion. Step 4 depends on step 2, but not step 3. You can achieve optimal step execution order with preconditions:
Argument type: String |
||
postProcessor |
(Optional) The name of a program to run (script) after a step completes. This program looks at the step output to find errors and warnings. CloudBees Flow includes a customizable program called "postp" for this purpose. Argument type: String |
||
releaseExclusive |
(Optional) < Boolean flag— This declares whether or not this step will release its resource, which is currently held exclusively. Setting this flag to Argument type: Boolean |
||
releaseMode |
(Optional) Use one of the following options:
Argument type: ReleaseMode |
||
resourceName |
(Optional) The name of the resource used by this step. It must be unique among all resources. Argument type: String |
||
shell |
(Optional) 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 could be any other command line program. The default is to use the standard shell for the platform it runs on. Argument type: String |
||
subprocedure |
(Optional) The name of the nested procedure to call when this step runs. If a subprocedure is specified, do not include the Argument type: String |
||
subproject |
(Optional) If a Argument type: String |
||
timeLimit |
(Optional) The maximum length of time the step is allowed to run. After the time specified, the step will be aborted. Argument type: String |
||
timeLimitUnits |
(Optional) Units for step time limit: Argument type: TimeLimitUnits |
||
workingDirectory |
(Optional) The CloudBees Flow agent sets this directory as the "current working directory," running the command contained in the step. If no working directory is specified in the step, CloudBees Flow uses the directory it created for the job in the CloudBees Flow workspace. Argument type: String |
||
workspaceName |
(Optional) The name of the workspace used by this step. Argument type: String |
moveStep
Moves a step within a procedure.
You must specify projectName
, procedureName
, and stepName
.
Arguments | Descriptions |
---|---|
projectName |
The name of the project that contains this procedure. The name must be unique among all projects. You must also enter Argument type: String |
procedureName |
The name of the procedure that must be unique within the project. You must also enter Argument type: String |
stepName |
The name of the step that must be unique within the procedure. You must also enter Argument type: String |
beforeStep |
(Optional) Moves the step ( Argument type: String |