Environment

3 minute readReference

createEnvironment

Create a new environment.

Arguments

Argument Name Type Description

projectName

String

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

environmentName

String

The name of the environment. (Required)

applicationName

String

Create environment from the specified application.

applicationProjectName

String

The application’s project name.

description

String

Comment text describing this object that is not interpreted at all by CloudBees CD/RO.

environmentEnabled

Boolean

True to enable the environment.

reservationRequired

Boolean

True to allow run using reservation only

rollingDeployEnabled

Boolean

True to enable support for rolling deploy on this environment.

rollingDeployType

String

The type of rolling deploy type supported by the environment.

serviceName

String

Deprecated: Deprecated due to microservice model changes Create environment from the specified service.

serviceProjectName

String

The service’s project name.

Usage

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

deleteEnvironment

Deletes an environment.

Arguments

Argument Name Type Description

projectName

String

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

environmentName

String

The name of the environment. (Required)

Usage

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

deleteRollingDeployPhase

Deletes a rolling deploy phase associated with an environment

Arguments

Argument Name Type Description

projectName

String

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

rollingDeployPhaseName

String

The name of the rolling deploy phase (Required)

environmentName

String

The name of the environment

Usage

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

getEnvironment

Retrieve an environment by name.

Arguments

Argument Name Type Description

projectName

String

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

environmentName

String

The name of the environment. (Required)

Usage

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

getEnvironmentDeployments

Retrieve a list of applications or services installed on the given environment

Arguments

Argument Name Type Description

projectName

String

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

environmentName

String

The name of the environment. (Required)

Usage

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

getEnvironments

Retrieve all environments in a project.

Arguments

Argument Name Type Description

projectName

String

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

Usage

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

getProvisionedEnvironments

Retrieve provisioned environments

Arguments

Argument Name Type Description

flowRuntimeId

String

The id of the flow runtime

jobId

String

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

stageName

String

The name of the stage

Usage

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

modifyEnvironment

Modify an environment.

Arguments

Argument Name Type Description

projectName

String

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

environmentName

String

The name of the environment. (Required)

description

String

Comment text describing this object that is not interpreted at all by CloudBees CD/RO.

environmentEnabled

Boolean

True to enable the environment.

newName

String

New name for an existing object that is being renamed.

reservationRequired

Boolean

True to allow run using reservation only

rollingDeployEnabled

Boolean

True to enable support for rolling deploy on this environment.

rollingDeployType

String

The type of rolling deploy type supported by the environment.

Usage

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

tearDownEnvironment

Used to get rid of an environment that is no longer needed, and tear down associated dynamic resources.

Arguments

Argument Name Type Description

projectName

String

Name for the project containing the environment (Required)

environmentName

String

The name of the environment (Required)

Usage

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