diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /doc/api/environments.md | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'doc/api/environments.md')
-rw-r--r-- | doc/api/environments.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/doc/api/environments.md b/doc/api/environments.md index 25690cc099a..aa3697c54ac 100644 --- a/doc/api/environments.md +++ b/doc/api/environments.md @@ -231,6 +231,52 @@ DELETE /projects/:id/environments/:environment_id curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/environments/1" ``` +## Delete multiple stopped review apps + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/296625) in GitLab 14.2. + +It schedules for deletion multiple environments that have already been +[stopped](../ci/environments/index.md#stop-an-environment) and +are [in the review app folder](../ci/review_apps/index.md). +The actual deletion is performed after 1 week from the time of execution. + +```plaintext +DELETE /projects/:id/environments/review_apps +``` + +| 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. | +| `before` | datetime | no | The date before which environments can be deleted. Defaults to 30 days ago. Expected in ISO 8601 format (`YYYY-MM-DDTHH:MM:SSZ`). | +| `limit` | integer | no | Maximum number of environments to delete. Defaults to 100. | +| `dry_run` | boolean | no | Defaults to `true` for safety reasons. It performs a dry run where no actual deletion will be performed. Set to `false` to actually delete the environment. | + +```shell +curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/environments/review_apps" +``` + +Example response: + +```json +{ + "scheduled_entries": [ + { + "id": 387, + "name": "review/023f1bce01229c686a73", + "slug": "review-023f1bce01-3uxznk", + "external_url": null + }, + { + "id": 388, + "name": "review/85d4c26a388348d3c4c0", + "slug": "review-85d4c26a38-5giw1c", + "external_url": null + } + ], + "unprocessable_entries": [] +} +``` + ## Stop an environment It returns `200` if the environment was successfully stopped, and `404` if the environment does not exist. |