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 implementions 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
releaseIdURLYes

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:

AttributeTypeRequiredDescription
changeTicketStringYesThe change ticket associated with this external approval gate
environmentIdStringYes

The Id for the environment the gate is executing in

gateNameStringYes

The name of the gate to update the status on

releaseIdLongYesThe Id of the release
statusStringYes

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

notes String NoThe approval or rejection notes that the user can defined

Response

Approval gate JSON objects can have the following attributes:

AttributeTypeDescription
changeTicketStringThe change ticket associated with this external approval gate
environmentIdString

The Id for the environment the gate is executing in

gateNameString

The name of the gate to update the status on

notesStringThe approval or rejection notes that the user can defined
releaseIdLongThe description of the release
statusString

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

snapshotIdLongThe most recent running snapshot for the release.

Response Codes

HTTP CodeDescription
201External gate successfully approved or rejected
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
500Unexpected 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
releaseIdURLYes

Path parameter to specific which release will receive approval or rejection

snapshotId

Long

(Query)

NoQuery 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:

AttributeTypeRequiredDescription
changeTicketStringYesThe change ticket associated with this external approval gate
environmentIdStringYes

The Id for the environment the gate is executing in

gateNameStringYes

The name of the gate to update the status on

releaseIdLongYesThe Id of the release
statusStringYes

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:

AttributeTypeDescription
changeTicketString The change ticket associated with this external approval gate
environmentIdString

The Id for the environment the gate is executing in

gateNameString

The name of the gate to update the status on

notesStringThe approval or rejection notes that the user defined.
releaseIdLongThe description of the release
statusString

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

snapshotIdLongThe most recent running snapshot for the release.

Response Codes

HTTP CodeDescription
201External gate successfully approved or rejected
400Bad request
401Authentication failure
403Authorization failure (no access to resource)
500Unexpected 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