diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-08-03 14:45:32 +0200 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-08-03 16:00:22 +0200 |
commit | da3d3ba89c19364ca626eb57380e1e33bd344902 (patch) | |
tree | cb19fd18b71ad25a3886c3b9216dc0da5a771dee /doc | |
parent | e63729d9e70a661fb3fb8cb558716f6a44a52798 (diff) | |
download | gitlab-ce-da3d3ba89c19364ca626eb57380e1e33bd344902.tar.gz |
Endpoints to enable and disable deploy keys
Resolves #20123
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/deploy_keys.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/api/deploy_keys.md b/doc/api/deploy_keys.md index 4e620ccc81a..a0340fd4d37 100644 --- a/doc/api/deploy_keys.md +++ b/doc/api/deploy_keys.md @@ -159,3 +159,52 @@ Example response: "id" : 13 } ``` + +## Enable a deploy key + +Enables a deploy key for a project so this can be used. Returns the enabled key, with a status code 201 when successful. + +``` +curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/deploy_keys/13/enable +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of the project | +| `key_id` | integer | yes | The ID of the deploy key | + +Example response: + +```json +```json +{ + "key" : "ssh-rsa AAAA...", + "id" : 12, + "title" : "My deploy key", + "created_at" : "2015-08-29T12:44:31.550Z" +} +``` + +## Disable a deploy key + +Disable a deploy key for a project. Returns the disabled key. + +``` +curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/5/deploy_keys/13/disable +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of the project | +| `key_id` | integer | yes | The ID of the deploy key | + +Example response: + +```json +{ + "key" : "ssh-rsa AAAA...", + "id" : 12, + "title" : "My deploy key", + "created_at" : "2015-08-29T12:44:31.550Z" +} +``` |