diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-07-29 12:14:36 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-07-29 20:35:38 +0200 |
commit | 1b72256fa14e65256d78347f81b289d43c44e991 (patch) | |
tree | 923e3597ad8b0199d77f57331bd44e7b81251bdd /doc | |
parent | 76e9b68439510af5c783a81b93944f1c8d96d150 (diff) | |
download | gitlab-ce-1b72256fa14e65256d78347f81b289d43c44e991.tar.gz |
Use Grape DSL for environment endpoints
Also a couple of minor edits for this branch are included
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/enviroments.md | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/doc/api/enviroments.md b/doc/api/enviroments.md index 16bf2627fef..1e12ded448c 100644 --- a/doc/api/enviroments.md +++ b/doc/api/enviroments.md @@ -32,7 +32,7 @@ Example response: Creates a new environment with the given name and external_url. -It returns 200 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 @@ -58,21 +58,25 @@ Example response: } ``` -## Delete an environment +## Edit an existing environment -It returns 200 if the environment was successfully deleted, and 404 if the environment does not exist. +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. ``` -DELETE /projects/:id/environments/:environment_id +PUT /projects/:id/environments/:environments_id ``` -| Attribute | Type | Required | Description | -| --------- | ------- | -------- | --------------------- | -| `id` | integer | yes | The ID of the project | -| `environment_id` | integer | yes | The ID of the environment | +| Attribute | Type | Required | Description | +| --------------- | ------- | --------------------------------- | ------------------------------- | +| `id` | integer | yes | The ID of the project | +| `environment_id` | integer | yes | The ID of the environment | The ID of the environment | +| `name` | string | no | The new name of the environment | +| `external_url` | string | no | The new external_url | ```bash -curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/environment/1" +curl -X PUT --data "name=staging&external_url=https://staging.example.gitlab.com" -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/environment/1" ``` Example response: @@ -80,30 +84,26 @@ Example response: ```json { "id": 1, - "name": "deploy", - "external_url": "https://deploy.example.gitlab.com" + "name": "staging", + "external_url": "https://staging.example.gitlab.com" } ``` -## Edit an existing environment - -Updates an existing environment's name and/or external_url. +## Delete an environment -It returns 200 if the label was successfully updated, In case of an error, an additional error message is returned. +It returns 200 if the environment was successfully deleted, and 404 if the environment does not exist. ``` -PUT /projects/:id/environments/:environments_id +DELETE /projects/:id/environments/:environment_id ``` -| Attribute | Type | Required | Description | -| --------------- | ------- | --------------------------------- | ------------------------------- | -| `id` | integer | yes | The ID of the project | -| `environment_id` | integer | yes | The ID of the environment | The ID of the environment | -| `name` | string | no | The new name of the environment | -| `external_url` | string | no | The new external_url | +| Attribute | Type | Required | Description | +| --------- | ------- | -------- | --------------------- | +| `id` | integer | yes | The ID of the project | +| `environment_id` | integer | yes | The ID of the environment | ```bash -curl -X PUT --data "name=staging&external_url=https://staging.example.gitlab.com" -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/environment/1" +curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/environment/1" ``` Example response: @@ -111,7 +111,7 @@ Example response: ```json { "id": 1, - "name": "staging", - "external_url": "https://staging.example.gitlab.com" + "name": "deploy", + "external_url": "https://deploy.example.gitlab.com" } ``` |