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
Jérome Perrin
gitlab-ce
Commits
68d146b4
Commit
68d146b4
authored
Jun 06, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve api docs
parent
b05600f2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
125 additions
and
237 deletions
+125
-237
app/controllers/help_controller.rb
app/controllers/help_controller.rb
+11
-0
app/views/help/_api_layout.html.haml
app/views/help/_api_layout.html.haml
+13
-0
app/views/help/api.html.haml
app/views/help/api.html.haml
+13
-114
config/routes.rb
config/routes.rb
+1
-0
doc/api/deploy_keys.md
doc/api/deploy_keys.md
+87
-0
doc/api/project_snippets.md
doc/api/project_snippets.md
+0
-0
doc/api/projects.md
doc/api/projects.md
+0
-123
No files found.
app/controllers/help_controller.rb
View file @
68d146b4
class
HelpController
<
ApplicationController
def
index
end
def
api
@category
=
params
[
:category
]
@category
=
"README"
if
@category
.
blank?
if
File
.
exists?
(
Rails
.
root
.
join
(
'doc'
,
'api'
,
@category
+
'.md'
))
render
'api'
else
not_found!
end
end
end
app/views/help/_api_layout.html.haml
0 → 100644
View file @
68d146b4
.row
.span3
=
link_to
help_path
,
class:
'btn append-bottom-20 btn-small'
do
%i
.icon-angle-left
Back to help
%br
%ul
.nav.nav-pills.nav-stacked
-
%w(README projects project_snippets repositories deploy_keys users session issues milestones notes system_hooks)
.
each
do
|
file
|
%li
{
class:
file
==
@category
?
'active'
:
nil
}
=
link_to
file
.
titleize
,
help_api_file_path
(
file
)
.span9.pull-right
=
yield
app/views/help/api.html.haml
View file @
68d146b4
=
render
layout:
'help/layout'
do
%h3
.page_title
API
=
render
layout:
'help/api_layout'
do
%h3
.page_title
%span
.light
API
%span
\/
=
@category
.
titleize
%br
%ul
.nav.nav-tabs.log-tabs.nav-small-tabs
%li
.active
=
link_to
"README"
,
"#README"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Projects"
,
"#projects"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Snippets"
,
"#snippets"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Repositories"
,
"#repositories"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Users"
,
"#users"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Session"
,
"#session"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Issues"
,
"#issues"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Milestones"
,
"#milestones"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"Notes"
,
"#notes"
,
'data-toggle'
=>
'tab'
%li
=
link_to
"System Hooks"
,
"#system_hooks"
,
'data-toggle'
=>
'tab'
.tab-content
.tab-pane.active
#README
.file_holder
.file_title
%i
.icon-file
README
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"README.md"
))
.tab-pane
#projects
.file_holder
.file_title
%i
.icon-file
Projects
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"projects.md"
))
.tab-pane
#snippets
.file_holder
.file_title
%i
.icon-file
Projects Snippets
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"snippets.md"
))
.tab-pane
#repositories
.file_holder
.file_title
%i
.icon-file
Projects
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"repositories.md"
))
.tab-pane
#users
.file_holder
.file_title
%i
.icon-file
Users
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"users.md"
))
.tab-pane
#session
.file_holder
.file_title
%i
.icon-file
Session
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"session.md"
))
.tab-pane
#issues
.file_holder
.file_title
%i
.icon-file
Issues
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"issues.md"
))
.tab-pane
#milestones
.file_holder
.file_title
%i
.icon-file
Milestones
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"milestones.md"
))
.tab-pane
#notes
.file_holder
.file_title
%i
.icon-file
Notes
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"notes.md"
))
.tab-pane
#system_hooks
.file_holder
.file_title
%i
.icon-file
System Hooks
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"system_hooks.md"
))
.file_holder
.file_title
%i
.icon-file
=
@category
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"
#{
@category
}
.md"
))
config/routes.rb
View file @
68d146b4
...
...
@@ -29,6 +29,7 @@ Gitlab::Application.routes.draw do
#
get
'help'
=>
'help#index'
get
'help/api'
=>
'help#api'
get
'help/api/:category'
=>
'help#api'
,
as:
'help_api_file'
get
'help/markdown'
=>
'help#markdown'
get
'help/permissions'
=>
'help#permissions'
get
'help/public_access'
=>
'help#public_access'
...
...
doc/api/deploy_keys.md
0 → 100644
View file @
68d146b4
## 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
doc/api/snippets.md
→
doc/api/
project_
snippets.md
View file @
68d146b4
File moved
doc/api/projects.md
View file @
68d146b4
...
...
@@ -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
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