Job

9 minute readReference

abortAllJobs

Abort all running jobs.

Arguments

Argument Name Type Description

force

Boolean

True to force abort the jobs.

reason

String

String added to the job error message.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.abortAllJobs( /* optional arguments */)

abortJob

Abort a running job.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

force

Boolean

Instructs certain API calls to continue, even though doing to might have consequences. For example, if true, for abortJob, alwaysRun steps will be aborted as well; for import, existing objects will be replaced. If true, setDatabaseConfiguration will store the configuration even if it can’t be validated.

reason

String

User-supplied string

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.abortJob( /* optional arguments */)

completeJob

Completes an externally managed job.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

force

Boolean

Instructs certain API calls to continue, even though doing to might have consequences. For example, if true, for abortJob, alwaysRun steps will be aborted as well; for import, existing objects will be replaced. If true, setDatabaseConfiguration will store the configuration even if it can’t be validated.

outcome

String

Overall outcome for a job or step: success, warning, error, or skipped.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.completeJob( /* optional arguments */)

createJob

Create an externally managed job.

Arguments

Argument Name Type Description

destinationProject

String

The project that will own the job.

jobNameTemplate

String

Template used to determine the default name of jobs launched from a procedure.

procedureName

String

The name of the procedure that should 'own' the job step. If not specified, myStep.procedure is used.

projectName

String

The name of the project is destinationProject is not specified.

status

String

The starting status for the job.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.createJob( /* optional arguments */)

deleteJob

Delete a job from the database.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

waitForDeleteToComplete

Boolean

If true, wait for the job to finish deleting before returning from the call.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.deleteJob( /* optional arguments */)

getJobDetails

Retrieve details for a job.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

structureOnly

Boolean

Reduces the amount of information returned by some api calls to minimal structural information.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobDetails( /* optional arguments */)

getJobInfo

Retrieve information about a job, minus step information.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobInfo()

getJobNotes

Retrieve the notes property sheet from a job.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobNotes()

getJobStatus

Returns the status of a job.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobStatus()

getJobSummaries

Returns summary information about jobs.

Arguments

Argument Name Type Description

filters

Filter array

How to filter the results.

includeLastSuccess

Boolean

Whether to include the last successful job, if not otherwise included.

maxFailedSteps

Integer

The maximum number of failed steps to return.

maxJobs

Integer

The maximum number of jobs to return.

maxRunningSteps

Integer

The maximum number of running steps to return.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobSummaries( /* optional arguments */)

getJobSummary

Return a job and its job steps along with only the specific job and job step properties.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

jobProperties

String

A comma-separated list of intrinsic job properties to include in the output.

jobStepProperties

String

A comma-separated list of intrinsic job step properties to include in the output.

orderStepsByIndex

Boolean

Each job step has a step index which defines its relative position within its parent step.Set this to 'true' to return the results in the ascending order of the step index.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobSummary( /* optional arguments */)

getJobs

Retrieve all jobs.

Arguments

Argument Name Type Description

firstResult

Integer

Result pagination: the first row to return.

maxResults

Integer

Result pagination: the number of rows to return.

sortKey

String

How to sort the results.

sortOrder

String

Which order to sort in

status

String

Filter jobs by this status.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobs( /* optional arguments */)

getJobsForSchedule

Retrieves jobs created from a schedule.

Arguments

Argument Name Type Description

projectName

String

The name for the project that must be unique among all projects. (Required)

scheduleName

String

Name for the schedule; must be unique among all schedules for the project. (Required)

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.getJobsForSchedule( projectName: 'test-projectName', scheduleName: 'test-scheduleName')

modifyJob

Modify the status of an externally managed job.

Arguments

Argument Name Type Description

jobId

String

The primary key of the job, or the name of the job.

status

String

The starting status for the job.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.modifyJob( /* optional arguments */)

moveJobs

Move jobs from one project to another

Arguments

Argument Name Type Description

sourceProject

String

Source project for jobs. (Required)

destinationProject

String

Project that will own the jobs. (Required)

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.moveJobs( sourceProject: 'test-sourceProject', destinationProject: 'test-destinationProject')

provisionCluster

Provision cluster.

Arguments

Argument Name Type Description

projectName

String

The name for the project that must be unique among all projects. (Required)

clusters

String array

A list of clusters that belongs to the environment which need to be provisioned.

environmentName

String

Name of the environment which owns this cluster.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.provisionCluster( projectName: 'test-projectName' /* optional arguments */)

provisionEnvironment

Provision environment.

Arguments

Argument Name Type Description

environmentName

String

The name of the environment. (Required)

environmentTemplateName

String

The name of the environment template. (Required)

projectName

String

The name for the project that must be unique among all projects. (Required)

environmentTemplateProjectName

String

Name for the project containing environment template.

keepOnError

Boolean

tear down on error flag

tierResourceCounts

Resource count per environment template tier

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.provisionEnvironment( environmentName: 'test-environmentName', environmentTemplateName: 'test-environmentTemplateName', projectName: 'test-projectName' /* optional arguments */)

provisionResourcePool

Provision resource pool.

Arguments

Argument Name Type Description

projectName

String

The name for the project that must be unique among all projects. (Required)

resourceCount

String

Number of resources to provision (Required)

resourcePoolName

String

Name for the resource pool (Required)

resourceTemplateName

String

Name for the resource template; must be unique among all resource templates. (Required)

keepOnError

Boolean

True to keep resource pool on error (default is false)

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.provisionResourcePool( projectName: 'test-projectName', resourceCount: 'test-resourceCount', resourcePoolName: 'test-resourcePoolName', resourceTemplateName: 'test-resourceTemplateName' /* optional arguments */)

runProcedure

Creates and starts a new job using a procedure directly or a procedure specified indirectly through a schedule. Returns a new job ID.

Arguments

Argument Name Type Description

projectName

String

The name for the project that must be unique among all projects. (Required)

actualParameters

Parameters passed as arguments to the procedure.

credentialName

String

The name of the credential argument.

credentialReferenceParameters

array

List of credential parameters with references to existing credentials as parameter values. If the parameter value is a property reference then the credential would be resolved at runtime.

credentials

Credential array

Credentials to be used in the job.

destinationProject

String

The project that will own the job.

parsedWebhookData

String

JSON with parsed webhook data to be set on a pipeline/release/procedure run.

password

String

Secret value used to identify the account for a particular user.

priority

String

The priority of the job.

procedureName

String

Name for the procedure; must be unique within the project.

scheduleName

String

Name for the schedule; must be unique among all schedules for the project.

userName

String

User name under which you wish to login.

webhookData

String

The webhook data to be set on the pipeline/release/procedure run.

webhookHeaders

String

The webhook headers in JSON format to be set on the pipeline/release/procedure run.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.runProcedure( projectName: 'test-projectName' /* optional arguments */)

runProcess

Run the specified process, return new job id.

Arguments

Argument Name Type Description

applicationName

String

The name of the application that owns the process. (Required)

processName

String

The name of the application process. (Required)

projectName

String

The name for the project that must be unique among all projects. (Required)

actualParameters

Parameters passed as arguments to the process.

credentialReferenceParameters

array

List of credential parameters with references to existing credentials as parameter values. If the parameter value is a property reference then the credential would be resolved at runtime.

credentials

Credential array

Credentials to be used in the job.

destinationProject

String

The project that will own the job.

enforceDependencies

Boolean

If application dependencies are defined for the specified application, enforce them for successful deployment.

environmentName

String

Environment name to create from template.

environmentProjectName

String

The name of the project to which the environment or environment template belongs to.

environmentTemplateName

String

Environment template name.

environmentTemplateProjectName

String

The name of the project to which the environment template belongs to.

environmentTemplateTierMapName

String

Environment template tier map name.

keepOnError

Boolean

True to keep environment on error (default is false)

parsedWebhookData

String

JSON with parsed webhook data to be set on a pipeline/release/procedure run.

priority

String

The priority of the job.

rollingDeployEnabled

Boolean

Perform rolling deployment.

rollingDeployManualStepAssignees

String array

A list of assignees who receive the notification when rolling deploy iteration completes.

rollingDeployManualStepCondition

String

Defines run condition on manual step created during rolling deployment.

rollingDeployPhases

String array

One or more rolling deploy phases to be used for deployment.

scheduleName

String

Name for the schedule; must be unique among all schedules for the project.

smartDeploy

Boolean

Smart deploy — if provided actual param will be overridden

snapshotName

String

Name for the snapshot.

stageArtifacts

Boolean

Stage all artifacts being deployed as part of the application process.

tierMapName

String

The name of the tier map used to determine where to run the process.

tierResourceCounts

Resource count per resource template tier

validate

Boolean

Validate the process and environment.

webhookData

String

The webhook data to be set on the pipeline/release/procedure run.

webhookHeaders

String

The webhook headers in JSON format to be set on the pipeline/release/procedure run.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.runProcess( applicationName: 'test-applicationName', processName: 'test-processName', projectName: 'test-projectName' /* optional arguments */)

runServiceProcess

[DEPRECATED] This API is deprecated. Run a service process

Arguments

Argument Name Type Description

processName

String

The name of the application process. (Required)

projectName

String

The name for the project that must be unique among all projects. (Required)

serviceName

String

Deprecated: Deprecated due to microservice model changes The name of the service that owns the process. (Required)

actualParameters

Parameters passed as arguments to the process.

credentialReferenceParameters

array

List of credential parameters with references to existing credentials as parameter values. If the parameter value is a property reference then the credential would be resolved at runtime.

credentials

Credential array

Credentials to be used in the job.

destinationProject

String

The project that will own the job.

enforceDependencies

Boolean

If application dependencies are defined for the specified application, enforce them for successful deployment.

environmentMapName

String

The name of the Service Environment map used to determine where to run the process.

environmentName

String

Environment name to create from template.

environmentProjectName

String

The name of the project to which the environment or environment template belongs to.

priority

String

The priority of the job.

scheduleName

String

Name for the schedule; must be unique among all schedules for the project.

snapshotName

String

Name for the snapshot.

validate

Boolean

Validate the process and environment.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.runServiceProcess( processName: 'test-processName', projectName: 'test-projectName', serviceName: 'test-serviceName' /* optional arguments */)

setJobName

Sets the name of a running job.

Arguments

Argument Name Type Description

newName

String

The new name for the job. (Required)

jobId

String

The primary key of the job, or the name of the job.

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.setJobName( newName: 'test-newName')

setupWebhook

Run the specified setupWebhook, returns RunProcedureResult.

Arguments

Argument Name Type Description

actualParameters

Parameters passed to the invoked procedure.

applicationName

String

The name of the application

catalogItemName

String

The name of the catalog item

catalogName

String

The name of the catalog

credentials

Credential array

Credentials to be used in the job.

path

String

Property path string.

pipelineName

String

The name of the pipeline

procedureName

String

Name for the procedure; must be unique within the project.

projectName

String

The name for the project that must be unique among all projects.

releaseName

String

The name of the release

triggerName

String

The name of the trigger

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.setupWebhook( /* optional arguments */)