2012-07-05 13:57:45 +00:00
|
|
|
## List projects
|
|
|
|
|
2012-08-14 16:54:25 +00:00
|
|
|
Get a list of projects owned by the authenticated user.
|
2012-07-05 13:57:45 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
GET /projects
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"id": 3,
|
|
|
|
"name": "rails",
|
|
|
|
"description": null,
|
|
|
|
"default_branch": "master",
|
|
|
|
"owner": {
|
|
|
|
"id": 1,
|
2012-12-10 22:46:31 +00:00
|
|
|
"username": "john_smith",
|
2012-07-05 13:57:45 +00:00
|
|
|
"email": "john@example.com",
|
|
|
|
"name": "John Smith",
|
|
|
|
"blocked": false,
|
|
|
|
"created_at": "2012-05-23T08:00:58Z"
|
|
|
|
},
|
2013-02-19 09:45:49 +00:00
|
|
|
"public": true,
|
2013-01-31 07:11:35 +00:00
|
|
|
"path": "rails",
|
|
|
|
"path_with_namespace": "rails/rails",
|
2012-07-05 13:57:45 +00:00
|
|
|
"issues_enabled": false,
|
|
|
|
"merge_requests_enabled": false,
|
|
|
|
"wall_enabled": true,
|
|
|
|
"wiki_enabled": true,
|
|
|
|
"created_at": "2012-05-23T08:05:02Z"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"id": 5,
|
|
|
|
"name": "gitlab",
|
|
|
|
"description": null,
|
|
|
|
"default_branch": "api",
|
|
|
|
"owner": {
|
|
|
|
"id": 1,
|
2012-12-10 22:46:31 +00:00
|
|
|
"username": "john_smith",
|
2012-07-05 13:57:45 +00:00
|
|
|
"email": "john@example.com",
|
|
|
|
"name": "John Smith",
|
|
|
|
"blocked": false,
|
|
|
|
"created_at": "2012-05-23T08:00:58Z"
|
|
|
|
},
|
2013-02-19 09:45:49 +00:00
|
|
|
"public": true,
|
2013-01-31 07:11:35 +00:00
|
|
|
"path": "gitlab",
|
|
|
|
"path_with_namespace": "randx/gitlab",
|
2012-07-05 13:57:45 +00:00
|
|
|
"issues_enabled": true,
|
|
|
|
"merge_requests_enabled": true,
|
|
|
|
"wall_enabled": true,
|
|
|
|
"wiki_enabled": true,
|
|
|
|
"created_at": "2012-05-30T12:49:20Z"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
|
|
## Single project
|
|
|
|
|
2012-08-14 16:54:25 +00:00
|
|
|
Get a specific project, identified by project ID, which is owned by the authentication user.
|
2012-07-05 13:57:45 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
GET /projects/:id
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-07-05 13:57:45 +00:00
|
|
|
|
2012-08-31 07:25:36 +00:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"id": 5,
|
|
|
|
"name": "gitlab",
|
|
|
|
"description": null,
|
|
|
|
"default_branch": "api",
|
|
|
|
"owner": {
|
|
|
|
"id": 1,
|
2012-12-10 22:46:31 +00:00
|
|
|
"username": "john_smith",
|
2012-08-31 07:25:36 +00:00
|
|
|
"email": "john@example.com",
|
|
|
|
"name": "John Smith",
|
|
|
|
"blocked": false,
|
|
|
|
"created_at": "2012-05-23T08:00:58Z"
|
|
|
|
},
|
2013-02-19 09:45:49 +00:00
|
|
|
"public": true,
|
2013-01-31 07:11:35 +00:00
|
|
|
"path": "gitlab",
|
|
|
|
"path_with_namespace": "randx/gitlab",
|
2012-08-31 07:25:36 +00:00
|
|
|
"issues_enabled": true,
|
|
|
|
"merge_requests_enabled": true,
|
|
|
|
"wall_enabled": true,
|
|
|
|
"wiki_enabled": true,
|
|
|
|
"created_at": "2012-05-30T12:49:20Z"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Create project
|
|
|
|
|
|
|
|
Create new project owned by user
|
|
|
|
|
|
|
|
```
|
|
|
|
POST /projects
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
+ `name` (required) - new project name
|
2012-09-20 12:34:07 +00:00
|
|
|
+ `description` (optional) - short project description
|
2012-09-03 15:00:24 +00:00
|
|
|
+ `default_branch` (optional) - 'master' by default
|
|
|
|
+ `issues_enabled` (optional) - enabled by default
|
|
|
|
+ `wall_enabled` (optional) - enabled by default
|
|
|
|
+ `merge_requests_enabled` (optional) - enabled by default
|
|
|
|
+ `wiki_enabled` (optional) - enabled by default
|
2012-08-31 07:25:36 +00:00
|
|
|
|
2012-08-31 07:27:45 +00:00
|
|
|
Will return created project with status `201 Created` on success, or `404 Not
|
|
|
|
found` on fail.
|
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
## List project team members
|
2012-09-06 20:49:29 +00:00
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
Get a list of project team members.
|
2012-09-06 20:49:29 +00:00
|
|
|
|
|
|
|
```
|
2012-09-21 10:23:17 +00:00
|
|
|
GET /projects/:id/members
|
2012-09-06 20:49:29 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-12-18 18:52:18 +00:00
|
|
|
+ `query` - Query string
|
2012-09-06 20:49:29 +00:00
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
## Get project team member
|
2012-09-06 20:49:29 +00:00
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
Get a project team member.
|
2012-09-05 20:01:03 +00:00
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
```
|
|
|
|
GET /projects/:id/members/:user_id
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
2012-09-05 20:01:03 +00:00
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-09-21 10:23:17 +00:00
|
|
|
+ `user_id` (required) - The ID of a user
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
|
|
|
|
"id": 1,
|
2012-12-10 22:46:31 +00:00
|
|
|
"username": "john_smith",
|
2012-09-21 10:23:17 +00:00
|
|
|
"email": "john@example.com",
|
|
|
|
"name": "John Smith",
|
|
|
|
"blocked": false,
|
|
|
|
"created_at": "2012-05-23T08:00:58Z",
|
|
|
|
"access_level": 40
|
|
|
|
}
|
2012-09-05 20:01:03 +00:00
|
|
|
```
|
2012-09-21 10:23:17 +00:00
|
|
|
|
|
|
|
## Add project team member
|
|
|
|
|
|
|
|
Add a user to a project team.
|
|
|
|
|
|
|
|
```
|
|
|
|
POST /projects/:id/members
|
2012-09-05 20:01:03 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-09-21 10:23:17 +00:00
|
|
|
+ `user_id` (required) - The ID of a user to add
|
|
|
|
+ `access_level` (required) - Project access level
|
2012-09-05 20:01:03 +00:00
|
|
|
|
2012-09-06 20:49:29 +00:00
|
|
|
Will return status `201 Created` on success, or `404 Not found` on fail.
|
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
## Edit project team member
|
2012-09-06 20:49:29 +00:00
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
Update project team member to specified access level.
|
2012-09-06 20:49:29 +00:00
|
|
|
|
|
|
|
```
|
2012-09-21 10:23:17 +00:00
|
|
|
PUT /projects/:id/members/:user_id
|
2012-09-06 20:49:29 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-09-21 10:23:17 +00:00
|
|
|
+ `user_id` (required) - The ID of a team member
|
|
|
|
+ `access_level` (required) - Project access level
|
2012-09-06 20:49:29 +00:00
|
|
|
|
|
|
|
Will return status `200 OK` on success, or `404 Not found` on fail.
|
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
## Remove project team member
|
2012-09-06 20:49:29 +00:00
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
Removes user from project team.
|
2012-09-06 20:49:29 +00:00
|
|
|
|
|
|
|
```
|
2012-09-21 10:23:17 +00:00
|
|
|
DELETE /projects/:id/members/:user_id
|
2012-09-06 20:49:29 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-09-21 10:23:17 +00:00
|
|
|
+ `user_id` (required) - The ID of a team member
|
2012-09-06 20:49:29 +00:00
|
|
|
|
2012-09-21 10:23:17 +00:00
|
|
|
Status code `200` will be returned on success.
|
2012-07-05 13:57:45 +00:00
|
|
|
|
2012-10-12 07:38:15 +00:00
|
|
|
## List project hooks
|
2012-09-08 17:51:12 +00:00
|
|
|
|
2012-10-12 07:38:15 +00:00
|
|
|
Get list for project hooks
|
2012-09-08 17:51:12 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
GET /projects/:id/hooks
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-09-08 17:51:12 +00:00
|
|
|
|
|
|
|
Will return hooks with status `200 OK` on success, or `404 Not found` on fail.
|
|
|
|
|
2012-10-12 07:38:15 +00:00
|
|
|
## Get project hook
|
|
|
|
|
|
|
|
Get hook for project
|
|
|
|
|
|
|
|
```
|
|
|
|
GET /projects/:id/hooks/:hook_id
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-10-12 07:38:15 +00:00
|
|
|
+ `hook_id` (required) - The ID of a project hook
|
|
|
|
|
|
|
|
Will return hook with status `200 OK` on success, or `404 Not found` on fail.
|
|
|
|
|
2012-09-08 17:51:12 +00:00
|
|
|
## Add project hook
|
|
|
|
|
|
|
|
Add hook to project
|
|
|
|
|
|
|
|
```
|
|
|
|
POST /projects/:id/hooks
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-09-08 17:51:12 +00:00
|
|
|
+ `url` (required) - The hook URL
|
|
|
|
|
|
|
|
Will return status `201 Created` on success, or `404 Not found` on fail.
|
|
|
|
|
2012-10-12 07:38:15 +00:00
|
|
|
## Edit project hook
|
|
|
|
|
|
|
|
Edit hook for project
|
|
|
|
|
|
|
|
```
|
|
|
|
PUT /projects/:id/hooks/:hook_id
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-10-12 07:38:15 +00:00
|
|
|
+ `hook_id` (required) - The ID of a project hook
|
|
|
|
+ `url` (required) - The hook URL
|
|
|
|
|
|
|
|
Will return status `201 Created` on success, or `404 Not found` on fail.
|
|
|
|
|
|
|
|
|
2012-09-08 17:51:12 +00:00
|
|
|
## Delete project hook
|
|
|
|
|
|
|
|
Delete hook from project
|
|
|
|
|
|
|
|
```
|
|
|
|
DELETE /projects/:id/hooks
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
2012-12-21 17:47:04 +00:00
|
|
|
+ `id` (required) - The ID of a project
|
2012-09-08 17:51:12 +00:00
|
|
|
+ `hook_id` (required) - The ID of hook to delete
|
|
|
|
|
|
|
|
Will return status `200 OK` on success, or `404 Not found` on fail.
|