diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-06 13:19:23 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-06 13:19:23 +0300 |
commit | 68d146b4a692357354e25d0c0f93edf861b37e8c (patch) | |
tree | e2dc8505f4f61c302037cceee093f11c3205ec6e /doc/api | |
parent | b05600f28b39b3bf8f469ca7b293117c65217762 (diff) | |
download | gitlab-ce-68d146b4a692357354e25d0c0f93edf861b37e8c.tar.gz |
Improve api docs
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/deploy_keys.md | 87 | ||||
-rw-r--r-- | doc/api/project_snippets.md (renamed from doc/api/snippets.md) | 0 | ||||
-rw-r--r-- | doc/api/projects.md | 123 |
3 files changed, 87 insertions, 123 deletions
diff --git a/doc/api/deploy_keys.md b/doc/api/deploy_keys.md new file mode 100644 index 00000000000..5a394094fe6 --- /dev/null +++ b/doc/api/deploy_keys.md @@ -0,0 +1,87 @@ +## Deploy Keys + +### List deploy keys + +Get a list of a project's deploy keys. + +``` +GET /projects/:id/keys +``` + +Parameters: + ++ `id` (required) - The ID of the project + +```json +[ + { + "id": 1, + "title" : "Public key" + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4 + 596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4 + soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", + }, + { + "id": 3, + "title" : "Another Public key" + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4 + 596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4 + soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" + } +] +``` + + +### Single deploy key + +Get a single key. + +``` +GET /projects/:id/keys/:key_id +``` + +Parameters: + ++ `id` (required) - The ID of the project ++ `key_id` (required) - The ID of the deploy key + +```json +{ + "id": 1, + "title" : "Public key" + "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4 + 596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4 + soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" +} +``` + + +### Add deploy key + +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 + +``` +POST /projects/:id/keys +``` + +Parameters: + ++ `id` (required) - The ID of the project ++ `title` (required) - New deploy key's title ++ `key` (required) - New deploy key + + +### Delete deploy key + +Delete a deploy key from a project + +``` +DELETE /projects/:id/keys/:key_id +``` + +Parameters: + ++ `id` (required) - The ID of the project ++ `key_id` (required) - The ID of the deploy key + diff --git a/doc/api/snippets.md b/doc/api/project_snippets.md index 04ea367d518..04ea367d518 100644 --- a/doc/api/snippets.md +++ b/doc/api/project_snippets.md diff --git a/doc/api/projects.md b/doc/api/projects.md index d3d15ab4e02..7818d8071e4 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -381,126 +381,3 @@ Parameters: + `id` (required) - The ID of the project. + `branch` (required) - The name of the branch. - -### List tags - -Lists all tags of a project. - -``` -GET /projects/:id/repository/tags -``` - -Parameters: - -+ `id` (required) - The ID of the project - - -### List commits - -Lists all commits with pagination. If the optional `ref_name` name is not given the commits of -the default branch (usually master) are returned. - -``` -GET /projects/:id/repository/commits -``` - -Parameters: - -+ `id` (required) - The Id of the project -+ `ref_name` (optional) - The name of a repository branch or tag -+ `page` (optional) - The page of commits to return (`0` default) -+ `per_page` (optional) - The number of commits per page (`20` default) - -Returns values: - -+ `200 Ok` on success and a list with commits -+ `404 Not Found` if project with id or the branch with `ref_name` not found - - - -## Deploy Keys - -### List deploy keys - -Get a list of a project's deploy keys. - -``` -GET /projects/:id/keys -``` - -Parameters: - -+ `id` (required) - The ID of the project - -```json -[ - { - "id": 1, - "title" : "Public key" - "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4 - 596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4 - soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", - }, - { - "id": 3, - "title" : "Another Public key" - "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4 - 596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4 - soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" - } -] -``` - - -### Single deploy key - -Get a single key. - -``` -GET /projects/:id/keys/:key_id -``` - -Parameters: - -+ `id` (required) - The ID of the project -+ `key_id` (required) - The ID of the deploy key - -```json -{ - "id": 1, - "title" : "Public key" - "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4 - 596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4 - soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=" -} -``` - - -### Add deploy key - -Creates a new deploy key for a project. - -``` -POST /projects/:id/keys -``` - -Parameters: - -+ `id` (required) - The ID of the project -+ `title` (required) - New deploy key's title -+ `key` (required) - New deploy key - - -### Delete deploy key - -Delete a deploy key from a project - -``` -DELETE /projects/:id/keys/:key_id -``` - -Parameters: - -+ `id` (required) - The ID of the project -+ `key_id` (required) - The ID of the deploy key - |