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 |
---|---|---|---|
releaseId | URL | Yes | 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:
Attribute | Type | Required | Description |
---|---|---|---|
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 |
---|---|---|
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 |
---|---|
201 | Approval 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/approval receives the following JSON approval gate object,
{ "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:
{ "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 |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|
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 |
---|---|
201 | Approval 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/approval?snapshotId=11125 receives the following JSON approval gate object,
{ "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:
{ "environmentId": "21015", "gateName": "Manager Approval", "status" : "APPROVED", "notes" : "approved by flexdeploy admin", "releaseId": 100013, "snapshotId": 11125 }