Resource

6 minute readReference

createResource

Creates a new resource. For a proxy resource, proxyHostName and proxyPort arguments refer to the proxying CloudBees CD/RO agent. hostName and port refer to the proxy target.

Arguments

Argument Name Type Description

resourceName

String

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

artifactCacheDirectory

String

Artifact cache directory for this resource.

block

Boolean

True to block on the agent ping before returning.

description

String

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

hostName

String

The domain name or IP address of the server machine corresponding to this resource.

hostType

String

The type of the host.

pools

String

[Deprecated] A list of arbitrary names separated by spaces, indicating the pools with which this resource is associated.

port

Integer

Port number to use when connecting to the agent for this resource; defaults to server default.

proxyCustomization

String

Proxy specific customization data; defaults to none.

proxyHostName

String

The domain name or IP address of the proxy agent machine corresponding to this resource.

proxyPort

Integer

Port number to use when connecting to the proxy agent for this resource; defaults to server default.

proxyProtocol

String

The protocol to use when proxying to this resource; defaults to none.

repositoryNames

String

A newline delimited list of repositories to retrieve artifacts from.

resourceDisabled

Boolean

True means this resource will not be allocated to job steps, regardless of its step limit.

resourcePools

String

A list of arbitrary names separated by comma, indicating the pools with which this resource is associated.

shell

String

Name of the shell program that will execute the command and postprocessor for the step.

stepLimit

Integer

The maximum number of steps that may execute simultaneously using this resource.

trusted

Boolean

True means the agent can speak to all other trusted agents in its zone. An untrusted agent can only speak to gateway agents.

useSSL

Boolean

True means SSL is used for communication.

workspaceName

String

The name of the workspace.

zoneName

String

Name for the zone; must be unique among all zones.

Usage

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

deleteResource

Deletes a resource.

Arguments

Argument Name Type Description

resourceName

String

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

Usage

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

getAvailableResourcesForEnvironment

Retrieve all resources or resource pools that are not dynamic.

Arguments

Argument Name Type Description

includePoolUsage

Boolean

Flag to determine whether or not include the pool usage

objectTypeToReturn

String

Flag to determine whether to return resources or resource pools

Usage

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

getResource

Retrieve a resource by name.

Arguments

Argument Name Type Description

resourceName

String

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

Usage

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

getResources

Retrieve all resources.

Arguments

Usage

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

getResourcesInEnvironmentTemplateTier

Retrieve all resources in an environment template tier.

Arguments

Argument Name Type Description

projectName

String

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

environmentTemplateName

String

The name of the environment template. (Required)

environmentTemplateTierName

String

Name for the environment template tier; must be unique among all tiers for the environment template. (Required)

Usage

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

getResourcesInEnvironmentTier

Return the list of resources in an environment tier.

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)

environmentTierName

String

Name for the environment tier; must be unique among all tiers for the environment. (Required)

Usage

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

getResourcesInPool

Return the list of resources in a pool.

Arguments

Argument Name Type Description

resourcePoolName

String

The name of the resource pool.

jobStepId

String

If non-null, will be used as context object for orderingFilter expansions.

Usage

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

modifyResource

Modifies an existing resource. For a proxy resource, proxyHostName and proxyPort arguments refer to the proxying CloudBees CD/RO agent. hostName and port refer to the proxy target.

Arguments

Argument Name Type Description

resourceName

String

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

artifactCacheDirectory

String

Artifact cache directory for this resource.

block

Boolean

True to block on the agent ping before returning.

description

String

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

hostName

String

The domain name or IP address of the server machine corresponding to this resource.

hostType

String

The type of the host.

newName

String

New name for an existing object that is being renamed.

pools

String

[Deprecated] A list of arbitrary names separated by spaces, indicating the pools with which this resource is associated.

port

Integer

Port number to use when connecting to the agent for this resource; defaults to server default.

proxyCustomization

String

Proxy specific customization data; defaults to none.

proxyHostName

String

The domain name or IP address of the proxy agent machine corresponding to this resource.

proxyPort

Integer

Port number to use when connecting to the proxy agent for this resource; defaults to server default.

proxyProtocol

String

The protocol to use when proxying to this resource; defaults to none.

repositoryNames

String

A newline delimited list of repositories to retrieve artifacts from.

resourceDisabled

Boolean

True means this resource will not be allocated to job steps, regardless of its step limit.

resourcePools

String

A list of arbitrary names separated by comma, indicating the pools with which this resource is associated.

shell

String

Name of the shell program that will execute the command and postprocessor for the step.

stepLimit

Integer

The maximum number of steps that may execute simultaneously using this resource.

trusted

Boolean

True means the agent can speak to all other trusted agents in its zone. An untrusted agent can only speak to gateway agents.

useSSL

Boolean

True means SSL is used for communication.

workspaceName

String

The name of the workspace.

zoneName

String

Name for the zone; must be unique among all zones.

Usage

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

pingAllResources

Ping all resources.

Arguments

Argument Name Type Description

block

Boolean

If true, the operation blocks until all resources have been pinged.

enabledOnly

Boolean

If true, the operation checks only enabled resources.

Usage

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

pingResource

Ping a resource.

Arguments

Argument Name Type Description

resourceName

String

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

Usage

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

removeResourceFromEnvironmentTemplateTier

Removes the given resource from the given environment template tier.

Arguments

Argument Name Type Description

projectName

String

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

environmentTemplateName

String

The name of the environment template. (Required)

environmentTemplateTierName

String

Name for the environment template tier; must be unique among all tiers for the environment template. (Required)

resourceName

String

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

Usage

import com.electriccloud.client.groovy.ElectricFlow import com.electriccloud.client.groovy.models.* ElectricFlow ef = new ElectricFlow() def result = ef.removeResourceFromEnvironmentTemplateTier( projectName: 'test-projectName', environmentTemplateName: 'test-environmentTemplateName', environmentTemplateTierName: 'test-environmentTemplateTierName', resourceName: 'test-resourceName')

removeResourceFromEnvironmentTier

Removes the given resource from the given environment tier.

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)

environmentTierName

String

Name for the environment tier; must be unique among all tiers for the environment. (Required)

resourceName

String

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

Usage

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

removeResourcesFromEnvironmentTier

Removes the given resources from the given environment tier.

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)

environmentTierName

String

Name for the environment tier; must be unique among all tiers for the environment. (Required)

resourceNames

String array

List of resources to remove from the environment tier.

Usage

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

removeResourcesFromPool

Removes the given resources from the given pool.

Arguments

Argument Name Type Description

resourcePoolName

String

Name for the resource pool; must be unique among all resource pools. (Required)

resourceNames

String array

List of resources to add/remove from the pool.

Usage

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

tearDownResource

Used to tear down a dynamic resource that is no longer needed.

Arguments

Argument Name Type Description

resourceName

String

Name for the dynamic resource (Required)

Usage

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