summaryrefslogtreecommitdiff
path: root/doc/api/enviroments.md
diff options
context:
space:
mode:
authorToon Claes <toon@gitlab.com>2017-02-28 14:55:21 +0100
committerToon Claes <toon@gitlab.com>2017-02-28 15:34:38 +0100
commit8c569e21d5224128e28fcc2392dc4777f9b839c2 (patch)
treef54d755279e81d49a4db6828aa1dfaaa054de1a1 /doc/api/enviroments.md
parent54f6357ba3d7f31bdb0009a041e48c3a6be8e2ff (diff)
downloadgitlab-ce-8c569e21d5224128e28fcc2392dc4777f9b839c2.tar.gz
Add endpoint to stop an environment through the API.
Diffstat (limited to 'doc/api/enviroments.md')
-rw-r--r--doc/api/enviroments.md34
1 files changed, 31 insertions, 3 deletions
diff --git a/doc/api/enviroments.md b/doc/api/enviroments.md
index e510f723e26..61677569254 100644
--- a/doc/api/enviroments.md
+++ b/doc/api/enviroments.md
@@ -33,7 +33,7 @@ Example response:
Creates a new environment with the given name and external_url.
-It returns 201 if the environment was successfully created, 400 for wrong parameters.
+It returns `201` if the environment was successfully created, `400` for wrong parameters.
```
POST /projects/:id/environment
@@ -64,7 +64,7 @@ Example response:
Updates an existing environment's name and/or external_url.
-It returns 200 if the environment was successfully updated. In case of an error, a status code 400 is returned.
+It returns `200` if the environment was successfully updated. In case of an error, a status code `400` is returned.
```
PUT /projects/:id/environments/:environments_id
@@ -94,7 +94,7 @@ Example response:
## Delete an environment
-It returns 200 if the environment was successfully deleted, and 404 if the environment does not exist.
+It returns `200` if the environment was successfully deleted, and `404` if the environment does not exist.
```
DELETE /projects/:id/environments/:environment_id
@@ -108,3 +108,31 @@ DELETE /projects/:id/environments/:environment_id
```bash
curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/environments/1"
```
+
+## Stop an environment
+
+It returns `200` if the environment was successfully stopped, and `404` if the environment does not exist.
+
+```
+POST /projects/:id/environments/:environment_id/stop
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ------- | -------- | --------------------- |
+| `id` | integer | yes | The ID of the project |
+| `environment_id` | integer | yes | The ID of the environment |
+
+```bash
+curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/environments/1/stop"
+```
+
+Example response:
+
+```json
+{
+ "id": 1,
+ "name": "deploy",
+ "slug": "deploy",
+ "external_url": "https://deploy.example.gitlab.com"
+}
+```