diff options
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/builds.md | 68 | ||||
-rw-r--r-- | doc/api/merge_requests.md | 188 | ||||
-rw-r--r-- | doc/api/projects.md | 10 |
3 files changed, 209 insertions, 57 deletions
diff --git a/doc/api/builds.md b/doc/api/builds.md index 6e64d096644..4dd4ee8b4bb 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -8,20 +8,16 @@ Get a list of builds in a project. GET /projects/:id/builds ``` -### Parameters - -| Attribute | Type | required | Description | +| Attribute | Type | Required | Description | |-----------|---------|----------|---------------------| -| id | integer | yes | The ID of a project | -| scope | string|array of strings | no | The scope of builds to show, one or array of: `pending`, `running`, `failed`, `success`, `canceled`; showing all builds if none provided | - -### Example of request +| `id` | integer | yes | The ID of a project | +| `scope` | string **or** array of strings | no | The scope of builds to show, one or array of: `pending`, `running`, `failed`, `success`, `canceled`; showing all builds if none provided | ``` curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds" ``` -### Example of response +Example of response ```json [ @@ -112,21 +108,17 @@ Get a list of builds for specific commit in a project. GET /projects/:id/repository/commits/:sha/builds ``` -### Parameters - -| Attribute | Type | required | Description | +| Attribute | Type | Required | Description | |-----------|---------|----------|---------------------| -| id | integer | yes | The ID of a project | -| sha | string | yes | The SHA id of a commit | -| scope | string|array of strings | no | The scope of builds to show, one or array of: `pending`, `running`, `failed`, `success`, `canceled`; showing all builds if none provided | - -### Example of request +| `id` | integer | yes | The ID of a project | +| `sha` | string | yes | The SHA id of a commit | +| `scope` | stringi **or** array of strings | no | The scope of builds to show, one or array of: `pending`, `running`, `failed`, `success`, `canceled`; showing all builds if none provided | ``` curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/repository/commits/0ff3ae198f8601a285adcf5c0fff204ee6fba5fd/builds" ``` -### Example of response +Example of response ```json [ @@ -203,20 +195,16 @@ Get a single build of a project GET /projects/:id/builds/:build_id ``` -### Parameters - -| Attribute | Type | required | Description | -|-----------|---------|----------|---------------------| -| id | integer | yes | The ID of a project | -| build\_id | integer | yes | The ID of a build | - -### Example of request +| Attribute | Type | Required | Description | +|------------|---------|----------|---------------------| +| `id` | integer | yes | The ID of a project | +| `build_id` | integer | yes | The ID of a build | ``` curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/8" ``` -### Example of response +Example of response ```json { @@ -267,20 +255,16 @@ Cancel a single build of a project POST /projects/:id/builds/:build_id/cancel ``` -### Parameters - -| Attribute | Type | required | Description | -|-----------|---------|----------|---------------------| -| id | integer | yes | The ID of a project | -| build\_id | integer | yes | The ID of a build | - -### Example of request +| Attribute | Type | Required | Description | +|------------|---------|----------|---------------------| +| `id` | integer | yes | The ID of a project | +| `build_id` | integer | yes | The ID of a build | ``` curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/1/cancel" ``` -### Example of response +Example of response ```json { @@ -317,20 +301,16 @@ Retry a single build of a project POST /projects/:id/builds/:build_id/retry ``` -### Parameters - -| Attribute | Type | required | Description | -|-----------|---------|----------|---------------------| -| id | integer | yes | The ID of a project | -| build\_id | integer | yes | The ID of a build | - -### Example of request +| Attribute | Type | Required | Description | +|------------|---------|----------|---------------------| +| `id` | integer | yes | The ID of a project | +| `build_id` | integer | yes | The ID of a build | ``` curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/1/retry" ``` -### Example of response +Example of response ```json { diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md index 7e732b9a2b4..009532b50c1 100644 --- a/doc/api/merge_requests.md +++ b/doc/api/merge_requests.md @@ -2,7 +2,7 @@ ## List merge requests -Get all merge requests for this project. +Get all merge requests for this project. The `state` parameter can be used to get only merge requests with a given state (`opened`, `closed`, or `merged`) or all of them (`all`). The pagination parameters `page` and `per_page` can be used to restrict the list of merge requests. @@ -49,8 +49,24 @@ Parameters: "state": "active", "created_at": "2012-04-29T08:46:00Z" }, + "source_project_id": "2", + "target_project_id": "3", + "labels": [ ], "description":"fixed login page css paddings", - "work_in_progress": false + "work_in_progress": false, + "milestone": { + "id": 5, + "iid": 1, + "project_id": 3, + "title": "v2.0", + "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", + "state": "closed", + "created_at": "2015-02-02T19:49:26.013Z", + "updated_at": "2015-02-02T19:49:26.013Z", + "due_date": null + }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged" } ] ``` @@ -95,8 +111,24 @@ Parameters: "state": "active", "created_at": "2012-04-29T08:46:00Z" }, + "source_project_id": "2", + "target_project_id": "3", + "labels": [ ], "description":"fixed login page css paddings", - "work_in_progress": false + "work_in_progress": false, + "milestone": { + "id": 5, + "iid": 1, + "project_id": 3, + "title": "v2.0", + "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", + "state": "closed", + "created_at": "2015-02-02T19:49:26.013Z", + "updated_at": "2015-02-02T19:49:26.013Z", + "due_date": null + }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged" } ``` @@ -156,8 +188,6 @@ Parameters: "iid": 1, "project_id": 4, "title": "Blanditiis beatae suscipit hic assumenda et molestias nisi asperiores repellat et.", - "description": "Qui voluptatibus placeat ipsa alias quasi. Deleniti rem ut sint. Optio velit qui distinctio.", - "work_in_progress": false, "state": "reopened", "created_at": "2015-02-02T19:49:39.159Z", "updated_at": "2015-02-02T20:08:49.959Z", @@ -182,6 +212,8 @@ Parameters: "source_project_id": 4, "target_project_id": 4, "labels": [ ], + "description": "Qui voluptatibus placeat ipsa alias quasi. Deleniti rem ut sint. Optio velit qui distinctio.", + "work_in_progress": false, "milestone": { "id": 5, "iid": 1, @@ -193,6 +225,8 @@ Parameters: "updated_at": "2015-02-02T19:49:26.013Z", "due_date": null }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged", "changes": [ { "old_path": "VERSION", @@ -253,7 +287,24 @@ Parameters: "state": "active", "created_at": "2012-04-29T08:46:00Z" }, - "description":"fixed login page css paddings" + "source_project_id": 4, + "target_project_id": 4, + "labels": [ ], + "description":"fixed login page css paddings", + "work_in_progress": false, + "milestone": { + "id": 5, + "iid": 1, + "project_id": 4, + "title": "v2.0", + "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", + "state": "closed", + "created_at": "2015-02-02T19:49:26.013Z", + "updated_at": "2015-02-02T19:49:26.013Z", + "due_date": null + }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged" } ``` @@ -286,7 +337,6 @@ Parameters: "target_branch": "master", "project_id": 3, "title": "test1", - "description": "description1", "state": "opened", "upvotes": 0, "downvotes": 0, @@ -305,7 +355,25 @@ Parameters: "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" - } + }, + "source_project_id": 4, + "target_project_id": 4, + "labels": [ ], + "description": "description1", + "work_in_progress": false, + "milestone": { + "id": 5, + "iid": 1, + "project_id": 4, + "title": "v2.0", + "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", + "state": "closed", + "created_at": "2015-02-02T19:49:26.013Z", + "updated_at": "2015-02-02T19:49:26.013Z", + "due_date": null + }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged" } ``` @@ -361,7 +429,25 @@ Parameters: "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" - } + }, + "source_project_id": 4, + "target_project_id": 4, + "labels": [ ], + "description":"fixed login page css paddings", + "work_in_progress": false, + "milestone": { + "id": 5, + "iid": 1, + "project_id": 4, + "title": "v2.0", + "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", + "state": "closed", + "created_at": "2015-02-02T19:49:26.013Z", + "updated_at": "2015-02-02T19:49:26.013Z", + "due_date": null + }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged" } ``` @@ -389,7 +475,7 @@ Parameters: "source_branch": "test1", "project_id": 3, "title": "test1", - "state": "merged", + "state": "opened", "upvotes": 0, "downvotes": 0, "author": { @@ -407,10 +493,90 @@ Parameters: "name": "Administrator", "state": "active", "created_at": "2012-04-29T08:46:00Z" - } + }, + "source_project_id": 4, + "target_project_id": 4, + "labels": [ ], + "description":"fixed login page css paddings", + "work_in_progress": false, + "milestone": { + "id": 5, + "iid": 1, + "project_id": 4, + "title": "v2.0", + "description": "Assumenda aut placeat expedita exercitationem labore sunt enim earum.", + "state": "closed", + "created_at": "2015-02-02T19:49:26.013Z", + "updated_at": "2015-02-02T19:49:26.013Z", + "due_date": null + }, + "merge_when_build_succeeds": true, + "merge_status": "can_be_merged" } ``` ## Comments on merge requets Comments are done via the [notes](notes.md) resource. + +## List issues that will close on merge + +Get all the issues that would be closed by merging the provided merge request. + +``` +GET /projects/:id/merge_requests/:merge_request_id/closes_issues +``` + +| Attribute | Type | Required | Description | +| --------- | ---- | -------- | ----------- | +| `id` | integer | yes | The ID of a project | +| `merge_request_id` | integer | yes | The ID of the merge request | + +```bash +curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/projects/76/merge_requests/1/closes_issues +``` + +Example response: + +```json +[ + { + "state" : "opened", + "description" : "Ratione dolores corrupti mollitia soluta quia.", + "author" : { + "state" : "active", + "id" : 18, + "web_url" : "https://gitlab.example.com/u/eileen.lowe", + "name" : "Alexandra Bashirian", + "avatar_url" : null, + "username" : "eileen.lowe" + }, + "milestone" : { + "project_id" : 1, + "description" : "Ducimus nam enim ex consequatur cumque ratione.", + "state" : "closed", + "due_date" : null, + "iid" : 2, + "created_at" : "2016-01-04T15:31:39.996Z", + "title" : "v4.0", + "id" : 17, + "updated_at" : "2016-01-04T15:31:39.996Z" + }, + "project_id" : 1, + "assignee" : { + "state" : "active", + "id" : 1, + "name" : "Administrator", + "web_url" : "https://gitlab.example.com/u/root", + "avatar_url" : null, + "username" : "root" + }, + "updated_at" : "2016-01-04T15:31:51.081Z", + "id" : 76, + "title" : "Consequatur vero maxime deserunt laboriosam est voluptas dolorem.", + "created_at" : "2016-01-04T15:31:51.081Z", + "iid" : 6, + "labels" : [] + }, +] +``` diff --git a/doc/api/projects.md b/doc/api/projects.md index 3f372c955d2..9e9486cd87a 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -80,7 +80,9 @@ Parameters: "avatar_url": "http://example.com/uploads/project/avatar/4/uploads/avatar.png", "shared_runners_enabled": true, "forks_count": 0, - "star_count": 0 + "star_count": 0, + "runners_token": "b8547b1dc37721d05889db52fa2f02", + "public_builds": true }, { "id": 6, @@ -137,7 +139,8 @@ Parameters: "shared_runners_enabled": true, "forks_count": 0, "star_count": 0, - "runners_token": "b8547b1dc37721d05889db52fa2f02" + "runners_token": "b8547b1dc37721d05889db52fa2f02", + "public_builds": true } ] ``` @@ -424,6 +427,7 @@ Parameters: - `public` (optional) - if `true` same as setting visibility_level = 20 - `visibility_level` (optional) - `import_url` (optional) +- `public_builds` (optional) ### Create project for user @@ -446,6 +450,7 @@ Parameters: - `public` (optional) - if `true` same as setting visibility_level = 20 - `visibility_level` (optional) - `import_url` (optional) +- `public_builds` (optional) ### Edit project @@ -469,6 +474,7 @@ Parameters: - `snippets_enabled` (optional) - `public` (optional) - if `true` same as setting visibility_level = 20 - `visibility_level` (optional) +- `public_builds` (optional) On success, method returns 200 with the updated project. If parameters are invalid, 400 is returned. |