Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

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

Authentication - Use Basic Authentication for this API.

POST

There are two implementions for POST. One will complete an Approval Gate using a snapshotId query parameter and the other will complete an Approval Gate using the most recent snapshot since it was not provided. 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 approval gate with the same attributes as the given JSON object.

API URL

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

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 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
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
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
201Approval 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/approval receives the following JSON approval gate object,

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

The "Manager 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
{
   "environmentId": "21015",
   "gateName": "Manager Approval",
   "status" : "APPROVED",
   "notes" : "approved by flexdeploy admin",
   "releaseId": 100013,
   "snapshotId": 62014
}

POST (using query parameter)

This POST service will complete an approval 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
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
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
201Approval 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/approval?snapshotId=11125 receives the following JSON approval gate object,

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

The "Manager 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
{
   "environmentId": "21015",
   "gateName": "Manager Approval",
   "status" : "APPROVED",
   "notes" : "approved by flexdeploy admin",
   "releaseId": 100013,
   "snapshotId": 11125
}
  • No labels