Back to index
Summary
Create a job step in an existing job.
|
actionLabelTextStringoptionalThe JSON derived action label text. actualParameterArrayoptionalActual parameters passed to an invoked subprocedure. alwaysRunBooleanoptionalTrue means this step will run even if preceding steps fail in a way that aborts the job. assigneeArrayoptionalA list of assignees who receive the notification. broadcastBooleanoptionalTrue means replicate this step to execute (in parallel) on each of the specified resources (that is, for a pool, run the step on each of the resources in the pool). commandStringoptionalScript to execute the functions of this step; passed to the step's shell for execution. commentStringoptionalScript to execute the functions of this step; passed to the step's shell for execution. conditionStringoptionalA fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a 0 or false is interpreted as FALSE. Any other result string is interpreted as TRUE.credentialNameStringoptionalThe name of the credential to be used for impersonation. credentialArrayoptionalThe list of runtime credentials attached to the job step. emailConfigNameStringoptionalThe name of email configuration. errorHandlingStringoptionalSpecifies error handling for this step. Possible values: "abortJob" , "abortJobNow" , "abortProcedure" , "abortProcedureNow" , "failProcedure" , "ignore" , "retryOnError" exclusiveBooleanoptionalTrue means the resource acquired for this step will be retained for the exclusive use of this job. This means 2 things: first, no other job will be able to use that resource, regardless of its step limit, until this job completes; second, future steps for this job will use the resource in preference to other resources, if this resource meets the needs of the steps and its step limit is not exceeded. exclusiveModeStringoptionalDetermines the mode to use when the step acquires a resource. If set to none , then the default behavior for the step applies. If set to job , then the resource will be retained for the exclusive use of this job. If set to step , then the resource will be retained for the exclusive use of this step and procedure it may call. If set to call , then the resource will be retained for the exclusive use of all steps within the current procedure call.Possible values: "none" , "job" , "step" , "call" externalBooleanoptionalTrue if the step is externally managed (no state machine). instructionStringoptionalInstruction associated with the manual step. jobStepIdUUIDoptionalThe primary key of the job step. jobStepNameStringoptionalThe name for the new step. If omitted, a default name will be generated. logFileNameStringoptionalName of the log file for a step; specified relative to the root directory in the job's workspace. notificationEnabledBooleanoptionalTrue means this email notification is enabled, false otherwise. notificationTemplateStringoptionalEmail notification template for manual step. parallelBooleanoptionalTrue means this step and all adjacent steps with the flag set will run in parallel. parentPathStringoptionalPath to the parent job step. If a parent step is not specified, the current job step is used. postProcessorStringoptionalThis command runs in parallel with the main command for the step; it analyzes the log for the step and collects diagnostic information. preconditionStringoptionalA fixed text or text embedding property references that is evaluated into a logical TRUE or FALSE. An empty string, a 0 or false is interpreted as FALSE. Any other result string is interpreted as TRUE.procedureNameStringoptionalThe name of the procedure that should own the job step. If not specified, myStep.procedure is used.projectNameStringoptionalThe name of the project for procedureName. releaseExclusiveBooleanoptionalTrue means the resource acquired for this step will be no longer be retained for the exclusive use of this job when this step completes. releaseModeStringoptionalDetermines the mode to use when the step releases its resource. If set to none , the default behavior applies. If set to release , then the resource will be available for use by any job. If set to releaseToJob , then the resource will be available for use by any step in this job.Possible values: "none" , "release" , "releaseToJob" resourceNameStringoptionalName for the resource; must be unique among all resources. shellStringoptionalName of the shell program that will execute the command and postprocessor for the step. statusStringoptionalThe starting status for the step. Possible values: "pending" , "runnable" , "scheduled" , "running" , "completed" stepNameStringoptionalThe name of the procedure step that should own the job step. If not specified, myStep is used.subprocedureStringoptionalName of a procedure to invoke during this step. subprojectStringoptionalName of the project containing the procedure to invoke during this step. timeLimitStringoptionalMaximum amount of time the step can execute; abort if it exceeds this time. timeLimitUnitsStringoptionalUnits for step time limit: seconds, minutes, or hours. Possible values: "hours" , "minutes" , "seconds" workingDirectoryStringoptionalWorking directory in which to execute the command for this step. A relative name is interpreted relative to the root directory for the job's workspace. workspaceNameStringoptionalThe name of the workspace. |
Usage
Perl
$cmdr->createJobStep( # optionals );
ectool
ectool createJobStep \ # optionals
Examples
Perl
$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 CloudBees CD/RO server using the batch API. # Create the batch API object my $batch = $cmdr->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
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"