Release External Gate API

Release External Gate API

This service will approve or reject an External Gate for a pipeline stage execution. 

Authentication - Use Basic Authentication for this API.

POST

There are two implementations for POST. One will complete an External Approval Gate using a snapshotId query parameter and the other will complete an External Approval Gate with no query parameter. The pipeline stage execution from within the pipeline execution is determined by finding the latest execution for the given environmentId and gateName.  An error will be returned if the stage executing in not currently in the gates or if the gateName provided is not pending an approval.

POST (without passing snapshot Id)

This POST service will complete an external gate with the same attributes as the given JSON object.

API URL

http://host:port/flexdeploy/rest/v1/releases/{releaseId}/gate/externalApproval

Note

The authenticated user must be a member of the pipeline role assigned to the gate in order to approve or reject it.

Request

Parameter

Type

Required

Description

Parameter

Type

Required

Description

releaseId

URL

Yes

Path parameter to specific which release will receive approval or rejection

POST will receive an external gate input JSON object and return an external gate JSON object. External gate input JSON objects for the request can have the following attributes:

Attribute

Type

Required

Description

Attribute

Type

Required

Description

changeTicket

String

Yes

The change ticket associated with this external approval gate

environmentId

String

Yes

The Id for the environment the gate is executing in

gateName

String

Yes

The name of the gate to update the status on

releaseId

Long

Yes

The Id of the release

status

String

Yes

The updated status to apply to the gate. Options are [APPROVED, REJECTED]

notes 

String 

No

The approval or rejection notes that the user can defined

Response

Approval gate JSON objects can have the following attributes:

Attribute

Type

Description

Attribute

Type

Description

changeTicket

String

The change ticket associated with this external approval gate

environmentId

String

The Id for the environment the gate is executing in

gateName

String

The name of the gate to update the status on

notes

String

The approval or rejection notes that the user can defined

releaseId

Long

The description of the release

status

String

The updated status to apply to the gate. Options are [APPROVED, REJECTED]

snapshotId

Long

The most recent running snapshot for the release.

Response Codes

HTTP Code

Description

HTTP Code

Description

201

External gate successfully approved or rejected

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

500

Unexpected internal server error

Example

If the POST request sent to http://host:port/flexdeploy/rest/v1/releases/10013/gate/externalApproval receives the following JSON external gate object,

POST JSON
{ "changeTicket": "CHG0030153", "environmentId": "21015", "gateName": "ServiceNow Approval", "notes" : "approved by flexdeploy admin", "status" : "APPROVED" }

The "ServiceNow Approval" gate will become approved if that gate is pending and the status is "APPROVED" in the JSON object.

The following external gate object will then be returned:

POST JSON
{ "changeTicket": "CHG0030153", "environmentId": "21015", "gateName": "ServiceNow Approval", "status" : "APPROVED", "notes" : "approved by flexdeploy admin", "releaseId": 100013, "snapshotId": 62014 }

POST (using query parameter)

This POST service will complete an external gate with the same attributes as the given JSON object.

Note

The authenticated user must be a member of the pipeline role assigned to the gate in order to approve or reject it.

Request

Parameter

Type

Required

Description

Parameter

Type

Required

Description

releaseId

URL

Yes

Path parameter to specific which release will receive approval or rejection

snapshotId

Long

(Query)

No

Query based on the id of a snapshot in the specified release.

POST will receive an approval gate input JSON object and return an approval gate JSON object. Approval gate input JSON objects for the request can have the following attributes:

Attribute

Type

Required

Description

Attribute

Type

Required

Description

changeTicket

String

Yes

The change ticket associated with this external approval gate

environmentId

String

Yes

The Id for the environment the gate is executing in

gateName

String

Yes

The name of the gate to update the status on

releaseId

Long

Yes

The Id of the release

status

String

Yes

The updated status to apply to the gate. Options are [APPROVED, REJECTED]

If you forgot to specify the snapshotId, the api will automatically use the most recent snapshot for the release.

Response

Approval gate JSON objects can have the following attributes:

Attribute

Type

Description

Attribute

Type

Description

changeTicket

String 

The change ticket associated with this external approval gate

environmentId

String

The Id for the environment the gate is executing in

gateName

String

The name of the gate to update the status on

notes

String

The approval or rejection notes that the user defined.

releaseId

Long

The description of the release

status

String

The updated status to apply to the gate. Options are [APPROVED, REJECTED]

snapshotId

Long

The most recent running snapshot for the release.

Response Codes

HTTP Code

Description

HTTP Code

Description

201

External gate successfully approved or rejected

400

Bad request

401

Authentication failure

403

Authorization failure (no access to resource)

500

Unexpected internal server error

Example

If the POST request sent to http://host:port/flexdeploy/rest/v1/releases/10013/gate/externalApproval?snapshotId=11125 receives the following JSON external gate object,

POST JSON
{ "changeTicket": "CHG0030153", "environmentId": "21015", "gateName": "ServiceNow Approval", "notes" : "approved by flexdeploy admin", "status" : "APPROVED" }

The "ServiceNow Approval" gate will become approved if that gate is pending and the status is "APPROVED" in the JSON object.

The following approval gate object will then be returned:

POST JSON
{ "changeTicket": "CHG0030153", "environmentId": "21015", "gateName": "Manager Approval", "status" : "APPROVED", "notes" : "approved by flexdeploy admin", "releaseId": 100013, "snapshotId": 11125 }
The following macros are not currently supported in the footer:
  • style