Hook

2 minute readReference

createHook

Creates a hook in a resource template, which can have one or more hooks. A hook stores a reference to a procedure in a CloudBees CD/RO project or plugin project. When a resource template is used to create a resource pool, these procedures are invoked.

Arguments

Argument Name Type Description

hookName

String

Name for the hook; must be unique among all hooks. (Required)

projectName

String

ProjectName of the entity that owns the hook.

procedureName

String

Hook procedure name.

broadcast

Boolean

Broadcast flag.

description

String

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

hookParameters

Hook parameters.

hookType

String

Hook type.

procedurePluginKey

String

Procedure plugin key.

procedureProjectName

String

Procedure project name.

resourceTemplateName

String

Name of the resource template.

Usage

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

deleteHook

Deletes a hook associated with an entity.

Arguments

Argument Name Type Description

hookName

String

Name for the hook; must be unique among all hooks. (Required)

projectName

String

ProjectName of the entity that owns the hook.

resourceTemplateName

String

Name of the resource template.

Usage

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

getHook

Retrieves a hook associated in an entity.

Arguments

Argument Name Type Description

hookName

String

Name for the hook; must be unique among all hooks. (Required)

projectName

String

ProjectName of the entity that owns the hook.

resourceTemplateName

String

Name of the resource template.

Usage

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

getHooks

Retrieves all hooks associated with an entity.

Arguments

Argument Name Type Description

projectName

String

ProjectName of the entity that owns the hook.

resourceTemplateName

String

Name of the resource template.

Usage

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

modifyHook

Modifies an existing hook in a resource template.

Arguments

Argument Name Type Description

hookName

String

Name for the hook; must be unique among all hooks. (Required)

projectName

String

ProjectName of the entity that owns the hook.

procedureName

String

Hook procedure name.

broadcast

Boolean

Broadcast flag.

description

String

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

hookParameters

Hook parameters.

hookType

String

Hook type.

newName

String

The new name for an existing object that is being renamed.

procedurePluginKey

String

Procedure plugin key.

procedureProjectName

String

Procedure project name.

resourceTemplateName

String

Name of the resource template.

Usage

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