diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 08:17:02 +0000 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /doc/api/deployments.md | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) | |
download | gitlab-ce-b39512ed755239198a9c294b6a45e65c05900235.tar.gz |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'doc/api/deployments.md')
-rw-r--r-- | doc/api/deployments.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/api/deployments.md b/doc/api/deployments.md index 6831f86e4ea..01fa4e11884 100644 --- a/doc/api/deployments.md +++ b/doc/api/deployments.md @@ -458,6 +458,37 @@ Deployments created by users on GitLab Premium or higher include the `approvals` } ``` +## Delete a specific deployment + +Delete a specific deployment that is not currently the last deployment for an environment or in a `running` state + +```plaintext +DELETE /projects/:id/deployments/:deployment_id +``` + +| Attribute | Type | Required | Description | +|-----------|---------|----------|---------------------| +| `id` | integer/string | yes | The ID or [URL-encoded path of the project](index.md#namespaced-path-encoding) owned by the authenticated user | +| `deployment_id` | integer | yes | The ID of the deployment | + +```shell +curl --request "DELETE" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deployments/1" +``` + +Example responses: + +```json +{ "message": "202 Accepted" } +``` + +```json +{ "message": "400 Cannot destroy running deployment" } +``` + +```json +{ "message": "400 Deployment currently deployed to environment" } +``` + ## List of merge requests associated with a deployment > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35739) in GitLab 12.7. |