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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
fee26c58
Commit
fee26c58
authored
Aug 25, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move snippets api doc to separate file
parent
d5fcf0f6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
113 additions
and
102 deletions
+113
-102
app/views/help/api.html.haml
app/views/help/api.html.haml
+12
-0
doc/api/README.md
doc/api/README.md
+1
-0
doc/api/projects.md
doc/api/projects.md
+0
-102
doc/api/snippets.md
doc/api/snippets.md
+100
-0
No files found.
app/views/help/api.html.haml
View file @
fee26c58
...
@@ -9,6 +9,8 @@
...
@@ -9,6 +9,8 @@
%a
{
href:
"#README"
}
README
%a
{
href:
"#README"
}
README
%li
%li
%a
{
href:
"#projects"
}
Projects
%a
{
href:
"#projects"
}
Projects
%li
%a
{
href:
"#snippets"
}
Snippets
%li
%li
%a
{
href:
"#users"
}
Users
%a
{
href:
"#users"
}
Users
%li
%li
...
@@ -34,6 +36,16 @@
...
@@ -34,6 +36,16 @@
%br
%br
.file_holder
#snippets
.file_title
%i
.icon-file
Projects Snippets
.file_content.wiki
=
preserve
do
=
markdown
File
.
read
(
Rails
.
root
.
join
(
"doc"
,
"api"
,
"snippets.md"
))
%br
.file_holder
#users
.file_holder
#users
.file_title
.file_title
%i
.icon-file
%i
.icon-file
...
...
doc/api/README.md
View file @
fee26c58
...
@@ -27,4 +27,5 @@ The API uses JSON to serialize data. You don't need to specify `.json` at the en
...
@@ -27,4 +27,5 @@ The API uses JSON to serialize data. You don't need to specify `.json` at the en
+
[
Users
](
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md
)
+
[
Users
](
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md
)
+
[
Projects
](
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md
)
+
[
Projects
](
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md
)
+
[
Snippets
](
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/snippets.md
)
+
[
Issues
](
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md
)
+
[
Issues
](
https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md
)
doc/api/projects.md
View file @
fee26c58
...
@@ -204,108 +204,6 @@ Parameters:
...
@@ -204,108 +204,6 @@ Parameters:
]
]
```
```
# Project Snippets
## List snippets
Not implemented.
## Single snippet
Get a project snippet.
```
GET /projects/:id/snippets/:snippet_id
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
```
json
{
"id"
:
1
,
"title"
:
"test"
,
"file_name"
:
"add.rb"
,
"author"
:
{
"id"
:
1
,
"email"
:
"john@example.com"
,
"name"
:
"John Smith"
,
"blocked"
:
false
,
"created_at"
:
"2012-05-23T08:00:58Z"
},
"expires_at"
:
null
,
"updated_at"
:
"2012-06-28T10:52:04Z"
,
"created_at"
:
"2012-06-28T10:52:04Z"
}
```
## Snippet content
Get a raw project snippet.
```
GET /projects/:id/snippets/:snippet_id/raw
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
## New snippet
Create a new project snippet.
```
POST /projects/:id/snippets
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`title`
(required) - The title of a snippet
+
`file_name`
(required) - The name of a snippet file
+
`lifetime`
(optional) - The expiration date of a snippet
+
`code`
(required) - The content of a snippet
Will return created snippet with status
`201 Created`
on success, or
`404 Not found`
on fail.
## Edit snippet
Update an existing project snippet.
```
PUT /projects/:id/snippets/:snippet_id
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
+
`title`
(optional) - The title of a snippet
+
`file_name`
(optional) - The name of a snippet file
+
`lifetime`
(optional) - The expiration date of a snippet
+
`code`
(optional) - The content of a snippet
Will return updated snippet with status
`200 OK`
on success, or
`404 Not found`
on fail.
## Delete snippet
Delete existing project snippet.
```
DELETE /projects/:id/snippets/:snippet_id
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
Status code
`200`
will be returned on success.
## Raw blob content
## Raw blob content
Get the raw file contents for a file.
Get the raw file contents for a file.
...
...
doc/api/snippets.md
0 → 100644
View file @
fee26c58
## List snippets
Not implemented.
## Single snippet
Get a project snippet.
```
GET /projects/:id/snippets/:snippet_id
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
```
json
{
"id"
:
1
,
"title"
:
"test"
,
"file_name"
:
"add.rb"
,
"author"
:
{
"id"
:
1
,
"email"
:
"john@example.com"
,
"name"
:
"John Smith"
,
"blocked"
:
false
,
"created_at"
:
"2012-05-23T08:00:58Z"
},
"expires_at"
:
null
,
"updated_at"
:
"2012-06-28T10:52:04Z"
,
"created_at"
:
"2012-06-28T10:52:04Z"
}
```
## Snippet content
Get a raw project snippet.
```
GET /projects/:id/snippets/:snippet_id/raw
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
## New snippet
Create a new project snippet.
```
POST /projects/:id/snippets
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`title`
(required) - The title of a snippet
+
`file_name`
(required) - The name of a snippet file
+
`lifetime`
(optional) - The expiration date of a snippet
+
`code`
(required) - The content of a snippet
Will return created snippet with status
`201 Created`
on success, or
`404 Not found`
on fail.
## Edit snippet
Update an existing project snippet.
```
PUT /projects/:id/snippets/:snippet_id
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
+
`title`
(optional) - The title of a snippet
+
`file_name`
(optional) - The name of a snippet file
+
`lifetime`
(optional) - The expiration date of a snippet
+
`code`
(optional) - The content of a snippet
Will return updated snippet with status
`200 OK`
on success, or
`404 Not found`
on fail.
## Delete snippet
Delete existing project snippet.
```
DELETE /projects/:id/snippets/:snippet_id
```
Parameters:
+
`id`
(required) - The ID or code name of a project
+
`snippet_id`
(required) - The ID of a project's snippet
Status code
`200`
will be returned on success.
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