Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
iv
gitlab-ce
Commits
9f095bbb
Commit
9f095bbb
authored
Jan 24, 2016
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'doc_refactor_deploy_keys_api' into 'master'
Refactor deploy_keys API documentation See merge request !2467
parents
82e352d0
cfb0628d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
12 deletions
+62
-12
doc/api/deploy_keys.md
doc/api/deploy_keys.md
+62
-12
No files found.
doc/api/deploy_keys.md
View file @
9f095bbb
...
@@ -8,9 +8,15 @@ Get a list of a project's deploy keys.
...
@@ -8,9 +8,15 @@ Get a list of a project's deploy keys.
GET /projects/:id/keys
GET /projects/:id/keys
```
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
|
`id`
| integer | yes | The ID of the project |
```
bash
curl
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
"https://gitlab.example.com/api/v3/projects/5/keys"
```
-
`id`
(required) - The ID of the project
Example response:
```
json
```
json
[
[
...
@@ -39,8 +45,16 @@ GET /projects/:id/keys/:key_id
...
@@ -39,8 +45,16 @@ GET /projects/:id/keys/:key_id
Parameters:
Parameters:
-
`id`
(required) - The ID of the project
| Attribute | Type | Required | Description |
-
`key_id`
(required) - The ID of the deploy key
| --------- | ---- | -------- | ----------- |
|
`id`
| integer | yes | The ID of the project |
|
`key_id`
| integer | yes | The ID of the deploy key |
```
bash
curl
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
"https://gitlab.example.com/api/v3/projects/5/keys/11"
```
Example response:
```
json
```
json
{
{
...
@@ -54,17 +68,34 @@ Parameters:
...
@@ -54,17 +68,34 @@ Parameters:
## Add deploy key
## Add deploy key
Creates a new deploy key for a project.
Creates a new deploy key for a project.
If deploy key already exists in another project - it will be joined to project but only if original one was is accessible by same user
If the deploy key already exists in another project, it will be joined to current
project only if original one was is accessible by the same user.
```
```
POST /projects/:id/keys
POST /projects/:id/keys
```
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
|
`id`
| integer | yes | The ID of the project |
|
`title`
| string | yes | New deploy key's title |
|
`key`
| string | yes | New deploy key |
```
bash
curl
-X
POST
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
-H
"Content-Type: application/json"
--data
'{"title": "My deploy key", "key": "ssh-rsa AAAA..."}'
"https://gitlab.example.com/api/v3/projects/5/keys/"
```
-
`id`
(required) - The ID of the project
Example response:
-
`title`
(required) - New deploy key's title
-
`key`
(required) - New deploy key
```
json
{
"key"
:
"ssh-rsa AAAA..."
,
"id"
:
12
,
"title"
:
"My deploy key"
,
"created_at"
:
"2015-08-29T12:44:31.550Z"
}
```
## Delete deploy key
## Delete deploy key
...
@@ -74,7 +105,26 @@ Delete a deploy key from a project
...
@@ -74,7 +105,26 @@ Delete a deploy key from a project
DELETE /projects/:id/keys/:key_id
DELETE /projects/:id/keys/:key_id
```
```
Parameters:
| Attribute | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
|
`id`
| integer | yes | The ID of the project |
|
`key_id`
| integer | yes | The ID of the deploy key |
```
bash
curl
-X
DELETE
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
"https://gitlab.example.com/api/v3/projects/5/keys/13"
```
-
`id`
(required) - The ID of the project
Example response:
-
`key_id`
(required) - The ID of the deploy key
```
json
{
"updated_at"
:
"2015-08-29T12:50:57.259Z"
,
"key"
:
"ssh-rsa AAAA..."
,
"public"
:
false
,
"title"
:
"My deploy key"
,
"user_id"
:
null
,
"created_at"
:
"2015-08-29T12:50:57.259Z"
,
"fingerprint"
:
"6a:33:1f:74:51:c0:39:81:79:ec:7a:31:f8:40:20:43"
,
"id"
:
13
}
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment