diff options
Diffstat (limited to 'doc/api/enviroments.md')
-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" } ``` |