Session

3 minute readReference

createSession

[DEPRECATED] This API is deprecated. Creates a session.

Arguments

Argument Name Type Description

expirationDate

String

The date when this session will expire.

serviceAccountName

String

Service account name under for which the webhook session needs to be created for.

timeZone

String

The time zone to use when interpreting expiration date.

Usage

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

createUserAccessToken

Generate personal access token for an authorized user.

Arguments

Argument Name Type Description

description

String

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

expirationDays

Integer

Specify the number of days after which the user access token will expire.

userAccessTokenName

String

The name of the user access token.

Usage

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

deleteSession

[DEPRECATED] This API is deprecated. Deletes a session.

Arguments

Argument Name Type Description

sessionId

String

ID of the session.

Usage

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

getSessions

[DEPRECATED] This API is deprecated. Retrieves all sessions for a service account.

Arguments

Argument Name Type Description

serviceAccountName

String

Service account name under for which the webhook session needs to be created for.

Usage

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

getUserAccessToken

Retrieves user access token.

Arguments

Argument Name Type Description

userAccessTokenName

String

User access token name (Required)

userName

String

User name

Usage

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

getUserAccessTokenSessions

Retrieves user access token sessions.

Arguments

Argument Name Type Description

userAccessTokenName

String

User access token name (Required)

userName

String

User name

Usage

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

getUserAccessTokens

Retrieves user access token.

Arguments

Argument Name Type Description

userName

String

The name of a user for whom tokens should be returned.

Usage

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

login

Login the client with the given credentials.

Arguments

Argument Name Type Description

password

String

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

token

String

User access token.

userName

String

User name under which you wish to login.

Usage

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

loginSso

Sign in to the client with single-sign on (SSO).

Arguments

Argument Name Type Description

code

String

OAuth 2.0 Authorization Code.

samlResponse

String

SAML response.

state

String

OAuth 2.0 state value.

token

String

User access token.

Usage

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

logout

Signs out of the client session.

Arguments

Argument Name Type Description

jwtToken

String

JWT token.

sessionId

String

Session id.

uiLogout

Boolean

If true, server will return URL for redirect to logout from CI.

Usage

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

modifySession

[DEPRECATED] This API is deprecated. Modifies a session.

Arguments

Argument Name Type Description

sessionId

String

ID of the session.

expirationDate

String

The date when this session will expire.

timeZone

String

The time zone to use when interpreting expiration date.

Usage

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

modifyUserAccessToken

Modify user access token details for an authorized user.

Arguments

Argument Name Type Description

description

String

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

newName

String

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

userAccessTokenName

String

The name of the user access token.

Usage

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