BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
cfb0628d
Commit
cfb0628d
authored
Jan 18, 2016
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor deploy_keys API documentation [ci skip]
parent
835f1961
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
12 deletions
+62
-12
deploy_keys.md
doc/api/deploy_keys.md
+62
-12
No files found.
doc/api/deploy_keys.md
View file @
cfb0628d
...
@@ -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