Integration Builds

These APIs uses the Agent token

Generating an Integration Build

Create/Update from running components

Generate an integration build with a specific build name based on all the components reporting on a specific labId
All the components must be already deployed and reporting to Sealights at the time the API is called.

POST /sl-api/v1/agent-apis/lab-ids/{labId}/integration-build

As the components must be already deployed and reporting to Sealights at the time the API is called, you will not be able to use this for components like UI that come up in the browser only at the time the tests are actually run
To work around this, you can either provide its details in the additionalComponents parameter, or open the UI programmatically just before calling the API

The integration build name and its components must be different otherwise coverage will not be collected for the component

Request details

Request Parameters

Parameter

Description

Parameter Type

Data Type

Parameter

Description

Parameter Type

Data Type

labId

Lab Id

path

string

buildName

Build name

body

string

additionalComponents

additional components to be added to the integration build

body

array of
{
"bsid": "string",
"appName": "string",
"branchName": "string",
"buildName": "string"
}

forceFailedComponents

Force the creation of the integration build even when some of the components failed to be reported to Sealights during their build scan

body

boolean

Request Body

String containing the name of the build (buildName). This build must be a new build name, never reported for this integration build.
additionalComponents Optional information that can be used to provide additional components not alive and reporting to Sealights at the time the API is called.
forceFailedComponents Optional flag that can be used to force the creation of the integration build even when some of the components failed to be reported to Sealights during their build scan. It is important to understand that even though the integration build will be created, it will not be representing the correct deployment and coverage will not be captured for the components that did not report a complete build scan

Response Status Codes

Code

Status

Description

Code

Status

Description

200

OK

Integration build created successfully

400

BAD REQUEST

Integration build name already exists or unresolved components

409

CONFLICT

No running agents were reported from lab

500

 

Internal server error

Request Samples

Sample HTTP request and response

POST /sl-api/v1/agent-apis/lab-ids/{labId}/integration-build HTTP/1.1 Authorization: Bearer {sealights-agent-token} Accept: application/json Content-Type: application/json { "buildName": "{build-name}" "additionalComponents": [ { "bsid": "123456789" }, { "appName": "app1", "branchName": "master", "buildName": "1.1.99" } ] } HTTP/1.1 200 OK Content-Type: application/json { "buildSessionId": "integration-bsid" } HTTP/1.1 400 BAD REQUEST HTTP/1.1 409 CONFLICT

Sample Shell command and response:

curl -X POST "https://$DOMAIN/sl-api/v1/agent-apis/lab-ids/{labId}/integration-build" \ -H "Authorization: Bearer $SEALIGHTS_AGENT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "buildName": "build-name", "additionalComponents": [ {"bsid": "123456789" },{"appName": "app1", "branchName": "master", "buildName": "1.1.99" }]}' 200 OK Content-Type: application/json { "buildSessionId": "integration-bsid" } 400 BAD REQUEST 409 CONFLICT

Sample Powershell command and response:

Cockpit events

You can view events received by Sealights in the cockpit under the Lab Monitor.
The type of events you can see are:

Event type

Type

Description

INTEGRATION_BUILD_CREATED

Info

Integration build created successfully

INTEGRATION_BUILD_MISSING_APPS

Info

Some apps that are already part of the integration build are not currently reporting

INTEGRATION_BUILD_ERROR_ALREADY_EXISTS

Error

Integration build name already exists. buildName must be unique for every new integration build

INTEGRATION_BUILD_ERROR_NO_LIVE_AGENTS

Error

Cannot create new integration build since no live agents detected for the given lab ID

INTEGRATION_BUILD_ERROR_FAILED_TO_CREATE

Error

Failed to create integration build. See description for more details

Spin up the UI programmatically

As mentioned above in the note, as the components must be already deployed and reporting to Sealights at the time the API is called, you will not be able to use this for components like UI that come up in the browser only at the time the tests are actually runTo work around this, you can either provide its details in the additionalComponents parameter, or open the UI programmatically just before calling the API.

Here is sample code to spin up the UI programmatically:

Create/Update from an explicit list of components

Create/update integration build with a specific build session ID (bsid). If the requested bsid does not exist, create it. Otherwise, add components to it.

Request details

Request Parameters

Parameter

Description

Parameter

Description

bsid

Build Session ID

Request Body

Array of build session IDs or component details (app name, branch name, build name).
If both bsid and app-branch-build are supplied, app-branch-build are prioritized.

Response Status Codes

Code

Status

Description

Code

Status

Description

200

OK

Components successfully updated

409

CONFLICT

Some components are invalid

Request Samples

Sample HTTP request and response

Sample Shell command and response:

Automatic Integration Build Creation

You may configure an Integration labId to Automatically create Integration Builds. To do this you must:

Delete Integration Build's Components

Delete components from a specific integration build.

Request Details

Request Parameters

Parameter

Description

Parameter

Description

bsid

Build Session ID

Request Body

Array of build session IDs or component details (app name, branch name, build name).
If both bsid and app-branch-build are supplied, app-branch-build are prioritized.

Response Status Codes

Code

Status

Description

Code

Status

Description

200

OK

Components successfully updated

409

CONFLICT

Some components are invalid

Request Samples

Sample HTTP request and response

Sample Shell command and response:

 

Attach Integration Build to a lab from Multiple environments

Attach integration build to a lab.

Request Details

Request Parameters

Parameter

Description

Required

Parameter

Description

Required

labId

Lab Id

Required

Request Body

Parameter

Description

Required

Parameter

Description

Required

buildName

Integration build name

Required one of buildName or bsid

bsid

Integration build session id

Required one of buildName or bsid

Response Status Codes

Code

Status

Description

Code

Status

Description

204

OK

Components successfully updated

400

BAD REQUEST

One of the following reasons:

  • Missing parameter labId , bsid or buildName

  • LabID provided is not compatible. Attach is allowed only on multi labs

404

NOT FOUND

  • labId '{lab-id}' Not Found

  • There is no build '{build-name}' for lab '{lab-id}'

500

INTERNAL SERVER ERROR

 

Request Samples

Sample HTTP request and response

Sample Shell command and response:

Create integration build lab

Integration build labs are normally created through the UI although they can be created also using the following API:

Request details

Request Body

Parameter

Description

Required

Parameter

Description

Required

appName

Application name

Required

branchName

Release or Environment name

Required

testEnv

If multiple test environments for the same deployment exist, they can be specified separately

 

labAlias

Alias name for the lab

 

cdOnly

If true, the integration build gets created automatically when tests are run against the lab

 

isHidden

Hide the build lab from the UI

 

Response Status Codes

Code

Status

Description

Code

Status

Description

201

OK

Response with labId

400

Bad request

Missing parameters

500

INTERNAL SERVER ERROR

 

Request Samples

Sample HTTP request and response

Sample Shell command and response: