Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
fee26c58
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fee26c58
编写于
8月 25, 2012
作者:
R
randx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move snippets api doc to separate file
上级
d5fcf0f6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
113 addition
and
102 deletion
+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
未找到文件。
app/views/help/api.html.haml
浏览文件 @
fee26c58
...
...
@@ -9,6 +9,8 @@
%a
{
href:
"#README"
}
README
%li
%a
{
href:
"#projects"
}
Projects
%li
%a
{
href:
"#snippets"
}
Snippets
%li
%a
{
href:
"#users"
}
Users
%li
...
...
@@ -34,6 +36,16 @@
%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_title
%i
.icon-file
...
...
doc/api/README.md
浏览文件 @
fee26c58
...
...
@@ -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
)
+
[
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
)
doc/api/projects.md
浏览文件 @
fee26c58
...
...
@@ -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
Get the raw file contents for a file.
...
...
doc/api/snippets.md
0 → 100644
浏览文件 @
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.
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录