Webhooks Management

  • Service Account Management: A service account is a special account object for use with webhooks management.

  • Session Management: A session object is used for webhooks management and runs in the context of a service account.

createServiceAccount

Creates a new ServiceAccount object. Use a service account when creating and managing webhooks sessions.

You must specify a serviceAccountName.

Arguments Descriptions

serviceAccountName

The service account name.

Argument type: String

description

(Optional) Comment text describing this object that is not interpreted at all by CloudBees CD .

Argument type: String

Positional arguments

serviceAccountName

Response

Returns a serviceAccount object.

ec-perl

syntax: $cmdr->createServiceAccount(<serviceAccountName>, {description});

Example

$cmdr->createServiceAccount('test', {description => "This is a description."});

ectool

syntax: ectool createServiceAccount <serviceAccountName> [--description]

Example

ectool createServiceAccount "test" --description "This is a description."

deleteServiceAccount

Deletes a service account.

You must specify the serviceAccountName object to delete.

Arguments Descriptions

serviceAccountName

The service account name to delete.

Argument type: String

Positional arguments

serviceAccountName

Response

None or a status OK message.

ec-perl

syntax: $cmdr->deleteServiceAccount(<service accountName>);

Example

$cmdr->deleteServiceAccount("Test");

ectool

syntax: ectool deleteServiceAccount <serviceAccountName>

Example

ectool deleteServiceAccount "Test"

getServiceAccount

Retrieves a service account by its name.

You must specify the serviceAccountName object to retrieve.

Arguments Descriptions

serviceAccountName

The name of the service account to retrieve.

Argument type: String

Positional arguments

service accountName

Response

Returns a serviceAccount object.

ec-perl

syntax: $cmdr->getServiceAccount(<serviceAccountName>);

Example

$cmdr->getServiceAccount("Test");

ectool

syntax: ectool getServiceAccount <serviceAccountName>

Example

ectool getServiceAccount "Test"

getServiceAccounts

Retrieves all service accounts.

Arguments Descriptions

None

Positional arguments

None

Response

Returns zero or more serviceAccount objects.

ec-perl

syntax: $cmdr->getServiceAccounts();

Example

$cmdr->getServiceAccounts();

ectool

syntax: ectool getServiceAccounts

Example

ectool getServiceAccounts

modifyServiceAccount

You must specify a serviceAccountName.

Arguments Descriptions

serviceAccountName

The service account name to modify.

Argument type: String

description

(Optional) Comment text describing this object that is not interpreted at all by CloudBees CD .

Argument type: String

newName

(Optional) New name for an existing service account that is being renamed.

Argument type: String

Positional arguments

serviceAccountName

Response

Returns a serviceAccount object.

ec-perl

syntax: $cmdr->modifyServiceAccount(<serviceAccountName>, {<optionals>});

Example

$cmdr->modifyServiceAccount("Test", {newName => "NewTest"});

ectool

syntax: ectool modifyServiceAccount <serviceAccountName> [optionals]

Example

ectool modifyServiceAccount "Test" --newName "NewTest"

createSession

Creates a new webhooks session. You must specify a serviceAccountName to use as the managing account for the webhooks session.

Arguments Descriptions

serviceAccountName

The service account name as returned by createServiceAccount . Use getServiceAccounts to get a list of current account names.

Argument type: String

expirationDate

(Optional)

Argument type: Date

timeZone

(Optional) The time zone specified to use for this session (Java-compatible string).

Argument type: TimeZone specification

Positional arguments

serviceAccountName

Response

Returns a session object.

ec-perl

syntax: $cmdr->createSession(<serviceAccountName>, {description});

Example

$cmdr->createSession('test', {description => "This is a description."});

ectool

syntax: ectool createSession <serviceAccountName> [--description]

Example

ectool createSession "test" --description "This is a description."

deleteSession

Deletes a webhooks session. You must specify the sessionID for the session to delete.

Arguments Descriptions

sessionId

The sessionID of the session to delete, as returned by the getSessions command.

Argument type: UUID

Positional arguments

serviceAccountName

Response

None or a status OK message.

ec-perl

syntax: $cmdr->deleteSession(<sessionId>);

Example

$cmdr->deleteSession(4fa765dd-73f1-11e3-b67e-b0a420524153);

ectool

syntax: ectool deleteSession <sessionId>

Example

ectool deleteSession 4fa765dd-73f1-11e3-b67e-b0a420524153

getSessions

Retrieves webhooks sessions managed by the specified service account name. You must specify the serviceAccountName of the webhooks sessions to retrieve.

Arguments Descriptions

serviceAccountName

The managing account for the webhooks sessions to retrieve. This account must have read privilege on the session object.

Argument type: String

Positional arguments

serviceAccountName

Positional arguments

None

Response

Returns zero or more session objects.

ec-perl

syntax: $cmdr->getSessions(<serviceAccountName>);

Example

$cmdr->getSessions("Test");

ectool

syntax: ectool getSessios <serviceAccountName>

Example

ectool getSessions "Test"

modifySession

You must specify a sessionId.

Arguments Descriptions

sessionId

The session ID of the session to modify as returned by the getSessions command.

Argument type: UUID

expirationDate

(Optional)

Argument type: Date

timeZone

(Optional) The time zone specified to use for this session (Java-compatible string).

Argument type: TimeZone specification

Positional arguments

sessionId

Response

Returns the modified session object.

ec-perl

syntax: $cmdr->modifySession(<sessionId>, {<optionals>});

Example

$cmdr->modifySession(4fa765dd-73f1-11e3-b67e-b0a420524153, {expirationDate => "2019-02-02"});

ectool

syntax: ectool modifySession <sessionId> [optionals]

Example

ectool modifySession 4fa765dd-73f1-11e3-b67e-b0a420524153 --expirationDate "2019-02-02"