summaryrefslogtreecommitdiff
path: root/doc/api
diff options
context:
space:
mode:
authorSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-08 10:32:42 +0100
committerSebastian Ziebell <sebastian.ziebell@asquera.de>2013-02-08 10:32:42 +0100
commit8045a81bcf5822f1992442750e1484a93c368229 (patch)
tree94ce2b257f3ba002ac1a0fde70b69b622304810d /doc/api
parent5d8a99f10429168e6471fdd1843f5045a10a84b3 (diff)
parent2f0a75ab77af430f682d67aa9bb865007d832795 (diff)
downloadgitlab-ce-8045a81bcf5822f1992442750e1484a93c368229.tar.gz
Merge branch 'master' into fixes/api
Diffstat (limited to 'doc/api')
-rw-r--r--doc/api/README.md1
-rw-r--r--doc/api/groups.md45
-rw-r--r--doc/api/notes.md13
-rw-r--r--doc/api/projects.md6
-rw-r--r--doc/api/repositories.md89
-rw-r--r--doc/api/users.md43
6 files changed, 194 insertions, 3 deletions
diff --git a/doc/api/README.md b/doc/api/README.md
index 65eec6bec3c..0618db7e369 100644
--- a/doc/api/README.md
+++ b/doc/api/README.md
@@ -32,6 +32,7 @@ When listing resources you can pass the following parameters:
+ [Users](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/users.md)
+ [Session](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/session.md)
+ [Projects](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/projects.md)
++ [Groups](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/groups.md)
+ [Snippets](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/snippets.md)
+ [Repositories](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/repositories.md)
+ [Issues](https://github.com/gitlabhq/gitlabhq/blob/master/doc/api/issues.md)
diff --git a/doc/api/groups.md b/doc/api/groups.md
new file mode 100644
index 00000000000..00a7387c76f
--- /dev/null
+++ b/doc/api/groups.md
@@ -0,0 +1,45 @@
+## List project groups
+
+Get a list of groups. (As user: my groups, as admin: all groups)
+
+```
+GET /groups
+```
+
+```json
+[
+ {
+ "id": 1,
+ "name": "Foobar Group",
+ "path": "foo-bar",
+ "owner_id": 18
+ }
+]
+```
+
+## Details of group
+
+Get all details of a group.
+
+```
+GET /groups/:id
+```
+
+Parameters:
+
++ `id` (required) - The ID of a group
+
+## New group
+
+Create a new project group. Available only for admin
+
+```
+POST /groups
+```
+
+Parameters:
++ `name` (required) - Email
++ `path` - Password
+
+Will return created group with status `201 Created` on success, or `404 Not found` on fail.
+
diff --git a/doc/api/notes.md b/doc/api/notes.md
index 30480d56561..eef4b63fcaf 100644
--- a/doc/api/notes.md
+++ b/doc/api/notes.md
@@ -30,6 +30,19 @@ Parameters:
+ `id` (required) - The ID of a project
+### List merge request notes
+
+Get a list of merge request notes.
+
+```
+GET /projects/:id/merge_requests/:merge_request_id/notes
+```
+
+Parameters:
+
++ `id` (required) - The ID of a project
++ `merge_request_id` (required) - The ID of an merge request
+
### List issue notes
Get a list of issue notes.
diff --git a/doc/api/projects.md b/doc/api/projects.md
index 704671a2b8d..03731427703 100644
--- a/doc/api/projects.md
+++ b/doc/api/projects.md
@@ -22,6 +22,8 @@ GET /projects
"created_at": "2012-05-23T08:00:58Z"
},
"private": true,
+ "path": "rails",
+ "path_with_namespace": "rails/rails",
"issues_enabled": false,
"merge_requests_enabled": false,
"wall_enabled": true,
@@ -42,6 +44,8 @@ GET /projects
"created_at": "2012-05-23T08:00:58Z"
},
"private": true,
+ "path": "gitlab",
+ "path_with_namespace": "randx/gitlab",
"issues_enabled": true,
"merge_requests_enabled": true,
"wall_enabled": true,
@@ -78,6 +82,8 @@ Parameters:
"created_at": "2012-05-23T08:00:58Z"
},
"private": true,
+ "path": "gitlab",
+ "path_with_namespace": "randx/gitlab",
"issues_enabled": true,
"merge_requests_enabled": true,
"wall_enabled": true,
diff --git a/doc/api/repositories.md b/doc/api/repositories.md
index 685797ad78d..bc6ca70aa50 100644
--- a/doc/api/repositories.md
+++ b/doc/api/repositories.md
@@ -33,7 +33,8 @@ Parameters:
},
"authored_date": "2012-06-27T05:51:39-07:00",
"committed_date": "2012-06-28T03:44:20-07:00"
- }
+ },
+ "protected": true
}
]
```
@@ -73,7 +74,88 @@ Parameters:
},
"authored_date": "2012-06-27T05:51:39-07:00",
"committed_date": "2012-06-28T03:44:20-07:00"
- }
+ },
+ "protected": true
+}
+```
+
+## Protect a project repository branch
+
+Protect a single project repository branch.
+
+```
+PUT /projects/:id/repository/branches/:branch/protect
+```
+
+Parameters:
+
++ `id` (required) - The ID of a project
++ `branch` (required) - The name of the branch
+
+```json
+{
+ "name": "master",
+ "commit": {
+ "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
+ "parents": [
+ {
+ "id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
+ }
+ ],
+ "tree": "46e82de44b1061621357f24c05515327f2795a95",
+ "message": "add projects API",
+ "author": {
+ "name": "John Smith",
+ "email": "john@example.com"
+ },
+ "committer": {
+ "name": "John Smith",
+ "email": "john@example.com"
+ },
+ "authored_date": "2012-06-27T05:51:39-07:00",
+ "committed_date": "2012-06-28T03:44:20-07:00"
+ },
+ "protected": true
+}
+```
+
+## Unprotect a project repository branch
+
+Unprotect a single project repository branch.
+
+```
+PUT /projects/:id/repository/branches/:branch/unprotect
+```
+
+Parameters:
+
++ `id` (required) - The ID of a project
++ `branch` (required) - The name of the branch
+
+```json
+{
+ "name": "master",
+ "commit": {
+ "id": "7b5c3cc8be40ee161ae89a06bba6229da1032a0c",
+ "parents": [
+ {
+ "id": "4ad91d3c1144c406e50c7b33bae684bd6837faf8"
+ }
+ ],
+ "tree": "46e82de44b1061621357f24c05515327f2795a95",
+ "message": "add projects API",
+ "author": {
+ "name": "John Smith",
+ "email": "john@example.com"
+ },
+ "committer": {
+ "name": "John Smith",
+ "email": "john@example.com"
+ },
+ "authored_date": "2012-06-27T05:51:39-07:00",
+ "committed_date": "2012-06-28T03:44:20-07:00"
+ },
+ "protected": false
}
```
@@ -110,7 +192,8 @@ Parameters:
},
"authored_date": "2012-05-28T04:42:42-07:00",
"committed_date": "2012-05-28T04:42:42-07:00"
- }
+ },
+ "protected": null
}
]
```
diff --git a/doc/api/users.md b/doc/api/users.md
index 200c0e06e04..b94d7c0f789 100644
--- a/doc/api/users.md
+++ b/doc/api/users.md
@@ -20,6 +20,8 @@ GET /users
"linkedin": "",
"twitter": "",
"dark_scheme": false,
+ "extern_uid": "john.smith",
+ "provider": "provider_name",
"theme_id": 1
},
{
@@ -34,6 +36,8 @@ GET /users
"linkedin": "",
"twitter": "",
"dark_scheme": true,
+ "extern_uid": "jack.smith",
+ "provider": "provider_name",
"theme_id": 1
}
]
@@ -64,6 +68,8 @@ Parameters:
"linkedin": "",
"twitter": "",
"dark_scheme": false,
+ "extern_uid": "john.smith",
+ "provider": "provider_name",
"theme_id": 1
}
```
@@ -84,10 +90,47 @@ Parameters:
+ `linkedin` - Linkedin
+ `twitter` - Twitter account
+ `projects_limit` - Number of projects user can create
++ `extern_uid` - External UID
++ `provider` - External provider name
++ `bio` - User's bio
Will return created user with status `201 Created` on success, or `404 Not
found` on fail.
+## User modification
+Modify user. Available only for admin
+
+```
+PUT /users/:id
+```
+
+Parameters:
++ `email` - Email
++ `username` - Username
++ `name` - Name
++ `password` - Password
++ `skype` - Skype ID
++ `linkedin` - Linkedin
++ `twitter` - Twitter account
++ `projects_limit` - Limit projects wich user can create
++ `extern_uid` - External UID
++ `provider` - External provider name
++ `bio` - User's bio
+
+
+Will return created user with status `200 OK` on success, or `404 Not
+found` on fail.
+
+## User deletion
+Delete user. Available only for admin
+
+```
+DELETE /users/:id
+```
+
+Will return deleted user with status `200 OK` on success, or `404 Not
+found` on fail.
+
## Current user
Get currently authenticated user.