From a862ade55bf68f56734538b40e02e56036f8a1bd Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Tue, 5 Jan 2016 16:36:14 +0100 Subject: Update ./doc/api/ --- doc/api/builds.md | 206 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 doc/api/builds.md (limited to 'doc/api/builds.md') diff --git a/doc/api/builds.md b/doc/api/builds.md new file mode 100644 index 00000000000..b716499dd36 --- /dev/null +++ b/doc/api/builds.md @@ -0,0 +1,206 @@ +# Builds API + +## List project builds + +Get a list of builds in a project. + +``` +GET /projects/:id/builds +``` + +Parameters: + +- `id` (required) - The ID of a project +- `scope` (optional) - The scope of builds to show (one of: `all`, `finished`, `running`; default: `all`) + +```json +[ + { + "commit": { + "committed_at": "2015-12-28T14:34:03.814Z", + "id": 2, + "ref": null, + "sha": "6b053ad388c531c21907f022933e5e81598db388" + }, + "created_at": "2016-01-04T15:41:23.147Z", + "finished_at": null, + "id": 65, + "name": "brakeman", + "ref": "master", + "runner": null, + "stage": "test", + "started_at": null, + "status": "pending" + }, + { + "commit": { + "committed_at": "2015-12-28T14:34:03.814Z", + "id": 2, + "ref": null, + "sha": "6b053ad388c531c21907f022933e5e81598db388" + }, + "created_at": "2016-01-04T15:41:23.046Z", + "finished_at": null, + "id": 64, + "name": "rubocop", + "ref": "master", + "runner": null, + "stage": "test", + "started_at": null, + "status": "pending" + } +] +``` + +## List commit builds + +Get a list of builds for specific commit in a project. + +``` +GET /projects/:id/builds/commit/:sha +``` + +Parameters: + +- `id` (required) - The ID of a project +- `sha` (required) - The SHA id of a commit +- `scope` (optional) - The scope of builds to show (one of: `all`, `finished`, `running`; default: `all`) + + +```json +[ + { + "commit": { + "committed_at": "2015-12-28T14:34:03.814Z", + "id": 2, + "ref": null, + "sha": "6b053ad388c531c21907f022933e5e81598db388" + }, + "created_at": "2016-01-04T15:41:23.147Z", + "finished_at": null, + "id": 65, + "name": "brakeman", + "ref": "master", + "runner": null, + "stage": "test", + "started_at": null, + "status": "pending" + }, + { + "commit": { + "committed_at": "2015-12-28T14:34:03.814Z", + "id": 2, + "ref": null, + "sha": "6b053ad388c531c21907f022933e5e81598db388" + }, + "created_at": "2016-01-04T15:41:23.046Z", + "finished_at": null, + "id": 64, + "name": "rubocop", + "ref": "master", + "runner": null, + "stage": "test", + "started_at": null, + "status": "pending" + } +] +``` + +## Get a single build + +Get a single build of a project + +``` +GET /projects/:id/builds/:build_id +``` + +Parameters: + +- `id` (required) - The ID of a project +- `build_id` (required) - The ID of a build + +```json +{ + "commit": { + "committed_at": "2015-12-28T14:34:03.814Z", + "id": 2, + "ref": null, + "sha": "6b053ad388c531c21907f022933e5e81598db388" + }, + "created_at": "2016-01-04T15:41:23.046Z", + "finished_at": null, + "id": 64, + "name": "rubocop", + "ref": "master", + "runner": null, + "stage": "test", + "started_at": null, + "status": "pending" +} +``` + +## Cancel a build + +Cancel a single build of a project + +``` +POST /projects/:id/builds/:build_id/cancel +``` + +Parameters: + +- `id` (required) - The ID of a project +- `build_id` (required) - The ID of a build + +```json +{ + "commit": { + "committed_at": "2015-12-28T14:34:03.814Z", + "id": 2, + "ref": null, + "sha": "6b053ad388c531c21907f022933e5e81598db388" + }, + "created_at": "2016-01-05T15:33:25.936Z", + "finished_at": "2016-01-05T15:33:47.553Z", + "id": 66, + "name": "rubocop", + "ref": "master", + "runner": null, + "stage": "test", + "started_at": null, + "status": "canceled" +} +``` + +## Retry a build + +Retry a single build of a project + +``` +POST /projects/:id/builds/:build_id/retry +``` + +Parameters: + +- `id` (required) - The ID of a project +- `build_id` (required) - The ID of a build + +```json +{ + "commit": { + "committed_at": "2015-12-28T14:34:03.814Z", + "id": 2, + "ref": null, + "sha": "6b053ad388c531c21907f022933e5e81598db388" + }, + "created_at": "2016-01-05T15:33:25.936Z", + "finished_at": null, + "id": 66, + "name": "rubocop", + "ref": "master", + "runner": null, + "stage": "test", + "started_at": null, + "status": "pending" +} +``` -- cgit v1.2.1 From 549a2fa7873366b52e9ba3caa849073b7b958b73 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Fri, 8 Jan 2016 14:01:31 +0100 Subject: Modify builds scope filtering in builds API --- doc/api/builds.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'doc/api/builds.md') diff --git a/doc/api/builds.md b/doc/api/builds.md index b716499dd36..c52266714d0 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -11,7 +11,7 @@ GET /projects/:id/builds Parameters: - `id` (required) - The ID of a project -- `scope` (optional) - The scope of builds to show (one of: `all`, `finished`, `running`; default: `all`) +- `scope` (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled; if none provided showing all builds) ```json [ @@ -64,8 +64,7 @@ Parameters: - `id` (required) - The ID of a project - `sha` (required) - The SHA id of a commit -- `scope` (optional) - The scope of builds to show (one of: `all`, `finished`, `running`; default: `all`) - +- `scope` (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled; if none provided showing all builds) ```json [ -- cgit v1.2.1 From 4e70f2519bba83d5f9d6fd0bed80e9837e8b5fc5 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Mon, 11 Jan 2016 11:15:04 +0100 Subject: Update ./doc/api/builds.md --- doc/api/builds.md | 301 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 232 insertions(+), 69 deletions(-) (limited to 'doc/api/builds.md') diff --git a/doc/api/builds.md b/doc/api/builds.md index c52266714d0..64efe6bb3b1 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -17,37 +17,97 @@ Parameters: [ { "commit": { - "committed_at": "2015-12-28T14:34:03.814Z", - "id": 2, - "ref": null, - "sha": "6b053ad388c531c21907f022933e5e81598db388" + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." }, - "created_at": "2016-01-04T15:41:23.147Z", - "finished_at": null, - "id": 65, - "name": "brakeman", + "coverage": null, + "created_at": "2015-12-24T15:51:21.802Z", + "download_url": null, + "finished_at": "2015-12-24T17:54:27.895Z", + "id": 7, + "name": "teaspoon", "ref": "master", "runner": null, "stage": "test", - "started_at": null, - "status": "pending" + "started_at": "2015-12-24T17:54:27.722Z", + "status": "failed", + "tag": false, + "user": { + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "bio": null, + "can_create_group": true, + "can_create_project": true, + "color_scheme_id": 2, + "created_at": "2015-12-21T13:14:24.077Z", + "current_sign_in_at": "2016-01-11T09:31:40.472Z", + "email": "admin@example.com", + "id": 1, + "identities": [], + "is_admin": true, + "linkedin": "", + "name": "Administrator", + "projects_limit": 100, + "skype": "", + "state": "active", + "theme_id": 3, + "twitter": "", + "two_factor_enabled": false, + "username": "root", + "web_url": "http://gitlab.dev/u/root", + "website_url": "" + } }, { "commit": { - "committed_at": "2015-12-28T14:34:03.814Z", - "id": 2, - "ref": null, - "sha": "6b053ad388c531c21907f022933e5e81598db388" + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." }, - "created_at": "2016-01-04T15:41:23.046Z", - "finished_at": null, - "id": 64, - "name": "rubocop", + "coverage": null, + "created_at": "2015-12-24T15:51:21.727Z", + "download_url": null, + "finished_at": "2015-12-24T17:54:24.921Z", + "id": 6, + "name": "spinach:other", "ref": "master", "runner": null, "stage": "test", - "started_at": null, - "status": "pending" + "started_at": "2015-12-24T17:54:24.729Z", + "status": "failed", + "tag": false, + "user": { + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "bio": null, + "can_create_group": true, + "can_create_project": true, + "color_scheme_id": 2, + "created_at": "2015-12-21T13:14:24.077Z", + "current_sign_in_at": "2016-01-11T09:31:40.472Z", + "email": "admin@example.com", + "id": 1, + "identities": [], + "is_admin": true, + "linkedin": "", + "name": "Administrator", + "projects_limit": 100, + "skype": "", + "state": "active", + "theme_id": 3, + "twitter": "", + "two_factor_enabled": false, + "username": "root", + "web_url": "http://gitlab.dev/u/root", + "website_url": "" + } } ] ``` @@ -57,7 +117,7 @@ Parameters: Get a list of builds for specific commit in a project. ``` -GET /projects/:id/builds/commit/:sha +GET /projects/:id/repository/commits/:sha/builds ``` Parameters: @@ -67,45 +127,104 @@ Parameters: - `scope` (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled; if none provided showing all builds) ```json -[ - { - "commit": { - "committed_at": "2015-12-28T14:34:03.814Z", - "id": 2, - "ref": null, - "sha": "6b053ad388c531c21907f022933e5e81598db388" + +``` + +## Get a single build +mmit": { + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." }, - "created_at": "2016-01-04T15:41:23.147Z", - "finished_at": null, - "id": 65, + "coverage": null, + "created_at": "2015-12-24T15:51:21.957Z", + "download_url": null, + "finished_at": "2015-12-24T17:54:33.913Z", + "id": 9, "name": "brakeman", "ref": "master", "runner": null, "stage": "test", - "started_at": null, - "status": "pending" + "started_at": "2015-12-24T17:54:33.727Z", + "status": "failed", + "tag": false, + "user": { + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "bio": null, + "can_create_group": true, + "can_create_project": true, + "color_scheme_id": 2, + "created_at": "2015-12-21T13:14:24.077Z", + "current_sign_in_at": "2016-01-11T09:31:40.472Z", + "email": "admin@example.com", + "id": 1, + "identities": [], + "is_admin": true, + "linkedin": "", + "name": "Administrator", + "projects_limit": 100, + "skype": "", + "state": "active", + "theme_id": 3, + "twitter": "", + "two_factor_enabled": false, + "username": "root", + "web_url": "http://gitlab.dev/u/root", + "website_url": "" + } }, { "commit": { - "committed_at": "2015-12-28T14:34:03.814Z", - "id": 2, - "ref": null, - "sha": "6b053ad388c531c21907f022933e5e81598db388" + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." }, - "created_at": "2016-01-04T15:41:23.046Z", - "finished_at": null, - "id": 64, + "coverage": null, + "created_at": "2015-12-24T15:51:21.880Z", + "download_url": null, + "finished_at": "2015-12-24T17:54:31.198Z", + "id": 8, "name": "rubocop", "ref": "master", "runner": null, "stage": "test", - "started_at": null, - "status": "pending" + "started_at": "2015-12-24T17:54:30.733Z", + "status": "failed", + "tag": false, + "user": { + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "bio": null, + "can_create_group": true, + "can_create_project": true, + "color_scheme_id": 2, + "created_at": "2015-12-21T13:14:24.077Z", + "current_sign_in_at": "2016-01-11T09:31:40.472Z", + "email": "admin@example.com", + "id": 1, + "identities": [], + "is_admin": true, + "linkedin": "", + "name": "Administrator", + "projects_limit": 100, + "skype": "", + "state": "active", + "theme_id": 3, + "twitter": "", + "two_factor_enabled": false, + "username": "root", + "web_url": "http://gitlab.dev/u/root", + "website_url": "" + } } ] -``` - -## Get a single build Get a single build of a project @@ -121,20 +240,50 @@ Parameters: ```json { "commit": { - "committed_at": "2015-12-28T14:34:03.814Z", - "id": 2, - "ref": null, - "sha": "6b053ad388c531c21907f022933e5e81598db388" + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." }, - "created_at": "2016-01-04T15:41:23.046Z", - "finished_at": null, - "id": 64, + "coverage": null, + "created_at": "2015-12-24T15:51:21.880Z", + "download_url": null, + "finished_at": "2015-12-24T17:54:31.198Z", + "id": 8, "name": "rubocop", "ref": "master", "runner": null, "stage": "test", - "started_at": null, - "status": "pending" + "started_at": "2015-12-24T17:54:30.733Z", + "status": "failed", + "tag": false, + "user": { + "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", + "bio": null, + "can_create_group": true, + "can_create_project": true, + "color_scheme_id": 2, + "created_at": "2015-12-21T13:14:24.077Z", + "current_sign_in_at": "2016-01-11T09:31:40.472Z", + "email": "admin@example.com", + "id": 1, + "identities": [], + "is_admin": true, + "linkedin": "", + "name": "Administrator", + "projects_limit": 100, + "skype": "", + "state": "active", + "theme_id": 3, + "twitter": "", + "two_factor_enabled": false, + "username": "root", + "web_url": "http://gitlab.dev/u/root", + "website_url": "" + } } ``` @@ -154,20 +303,27 @@ Parameters: ```json { "commit": { - "committed_at": "2015-12-28T14:34:03.814Z", - "id": 2, - "ref": null, - "sha": "6b053ad388c531c21907f022933e5e81598db388" + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." }, - "created_at": "2016-01-05T15:33:25.936Z", - "finished_at": "2016-01-05T15:33:47.553Z", - "id": 66, + "coverage": null, + "created_at": "2016-01-11T10:13:33.506Z", + "download_url": null, + "finished_at": "2016-01-11T10:14:09.526Z", + "id": 69, "name": "rubocop", "ref": "master", "runner": null, "stage": "test", "started_at": null, - "status": "canceled" + "status": "canceled", + "tag": false, + "user": null } ``` @@ -187,19 +343,26 @@ Parameters: ```json { "commit": { - "committed_at": "2015-12-28T14:34:03.814Z", - "id": 2, - "ref": null, - "sha": "6b053ad388c531c21907f022933e5e81598db388" + "author_email": "admin@example.com", + "author_name": "Administrator", + "created_at": "2015-12-24T16:51:14.000+01:00", + "id": "0ff3ae198f8601a285adcf5c0fff204ee6fba5fd", + "message": "Test the CI integration.", + "short_id": "0ff3ae19", + "title": "Test the CI integration." }, - "created_at": "2016-01-05T15:33:25.936Z", + "coverage": null, + "created_at": "2016-01-11T10:13:33.506Z", + "download_url": null, "finished_at": null, - "id": 66, + "id": 69, "name": "rubocop", "ref": "master", "runner": null, "stage": "test", "started_at": null, - "status": "pending" + "status": "pending", + "tag": false, + "user": null } ``` -- cgit v1.2.1 From 470b3a482a06c733665abcf2d92ad4d898b2efe0 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Tue, 12 Jan 2016 11:50:14 +0100 Subject: Fix doc/api/builds.md --- doc/api/builds.md | 60 ++++++++++++++++++------------------------------------- 1 file changed, 19 insertions(+), 41 deletions(-) (limited to 'doc/api/builds.md') diff --git a/doc/api/builds.md b/doc/api/builds.md index 64efe6bb3b1..99ef0882c16 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -127,11 +127,9 @@ Parameters: - `scope` (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled; if none provided showing all builds) ```json - -``` - -## Get a single build -mmit": { +[ + { + "commit": { "author_email": "admin@example.com", "author_name": "Administrator", "created_at": "2015-12-24T16:51:14.000+01:00", @@ -141,41 +139,18 @@ mmit": { "title": "Test the CI integration." }, "coverage": null, - "created_at": "2015-12-24T15:51:21.957Z", + "created_at": "2016-01-11T10:13:33.506Z", "download_url": null, - "finished_at": "2015-12-24T17:54:33.913Z", - "id": 9, - "name": "brakeman", + "finished_at": "2016-01-11T10:14:09.526Z", + "id": 69, + "name": "rubocop", "ref": "master", "runner": null, "stage": "test", - "started_at": "2015-12-24T17:54:33.727Z", - "status": "failed", + "started_at": null, + "status": "canceled", "tag": false, - "user": { - "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", - "bio": null, - "can_create_group": true, - "can_create_project": true, - "color_scheme_id": 2, - "created_at": "2015-12-21T13:14:24.077Z", - "current_sign_in_at": "2016-01-11T09:31:40.472Z", - "email": "admin@example.com", - "id": 1, - "identities": [], - "is_admin": true, - "linkedin": "", - "name": "Administrator", - "projects_limit": 100, - "skype": "", - "state": "active", - "theme_id": 3, - "twitter": "", - "two_factor_enabled": false, - "username": "root", - "web_url": "http://gitlab.dev/u/root", - "website_url": "" - } + "user": null }, { "commit": { @@ -188,15 +163,15 @@ mmit": { "title": "Test the CI integration." }, "coverage": null, - "created_at": "2015-12-24T15:51:21.880Z", + "created_at": "2015-12-24T15:51:21.957Z", "download_url": null, - "finished_at": "2015-12-24T17:54:31.198Z", - "id": 8, - "name": "rubocop", + "finished_at": "2015-12-24T17:54:33.913Z", + "id": 9, + "name": "brakeman", "ref": "master", "runner": null, "stage": "test", - "started_at": "2015-12-24T17:54:30.733Z", + "started_at": "2015-12-24T17:54:33.727Z", "status": "failed", "tag": false, "user": { @@ -206,7 +181,7 @@ mmit": { "can_create_project": true, "color_scheme_id": 2, "created_at": "2015-12-21T13:14:24.077Z", - "current_sign_in_at": "2016-01-11T09:31:40.472Z", + "current_sign_in_at": "2016-01-12T10:30:48.315Z", "email": "admin@example.com", "id": 1, "identities": [], @@ -225,6 +200,9 @@ mmit": { } } ] +``` + +## Get a single build Get a single build of a project -- cgit v1.2.1 From 97338496188add9ec8d192c7e78f6a6040befffa Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Wed, 13 Jan 2016 15:17:59 +0100 Subject: Add some fixes after review --- doc/api/builds.md | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'doc/api/builds.md') diff --git a/doc/api/builds.md b/doc/api/builds.md index 99ef0882c16..06ff89bea00 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -40,23 +40,14 @@ Parameters: "user": { "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "bio": null, - "can_create_group": true, - "can_create_project": true, - "color_scheme_id": 2, "created_at": "2015-12-21T13:14:24.077Z", - "current_sign_in_at": "2016-01-11T09:31:40.472Z", - "email": "admin@example.com", "id": 1, - "identities": [], "is_admin": true, "linkedin": "", "name": "Administrator", - "projects_limit": 100, "skype": "", "state": "active", - "theme_id": 3, "twitter": "", - "two_factor_enabled": false, "username": "root", "web_url": "http://gitlab.dev/u/root", "website_url": "" @@ -87,23 +78,14 @@ Parameters: "user": { "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "bio": null, - "can_create_group": true, - "can_create_project": true, - "color_scheme_id": 2, "created_at": "2015-12-21T13:14:24.077Z", - "current_sign_in_at": "2016-01-11T09:31:40.472Z", - "email": "admin@example.com", "id": 1, - "identities": [], "is_admin": true, "linkedin": "", "name": "Administrator", - "projects_limit": 100, "skype": "", "state": "active", - "theme_id": 3, "twitter": "", - "two_factor_enabled": false, "username": "root", "web_url": "http://gitlab.dev/u/root", "website_url": "" @@ -177,23 +159,14 @@ Parameters: "user": { "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "bio": null, - "can_create_group": true, - "can_create_project": true, - "color_scheme_id": 2, "created_at": "2015-12-21T13:14:24.077Z", - "current_sign_in_at": "2016-01-12T10:30:48.315Z", - "email": "admin@example.com", "id": 1, - "identities": [], "is_admin": true, "linkedin": "", "name": "Administrator", - "projects_limit": 100, "skype": "", "state": "active", - "theme_id": 3, "twitter": "", - "two_factor_enabled": false, "username": "root", "web_url": "http://gitlab.dev/u/root", "website_url": "" @@ -241,23 +214,14 @@ Parameters: "user": { "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "bio": null, - "can_create_group": true, - "can_create_project": true, - "color_scheme_id": 2, "created_at": "2015-12-21T13:14:24.077Z", - "current_sign_in_at": "2016-01-11T09:31:40.472Z", - "email": "admin@example.com", "id": 1, - "identities": [], "is_admin": true, "linkedin": "", "name": "Administrator", - "projects_limit": 100, "skype": "", "state": "active", - "theme_id": 3, "twitter": "", - "two_factor_enabled": false, "username": "root", "web_url": "http://gitlab.dev/u/root", "website_url": "" -- cgit v1.2.1 From 4cdbb2f628620be90de872cf7f5cd591e17c1bd0 Mon Sep 17 00:00:00 2001 From: Tomasz Maczukin Date: Wed, 13 Jan 2016 21:19:18 +0100 Subject: Modify builds API documentation style [ci skip] --- doc/api/builds.md | 82 ++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 66 insertions(+), 16 deletions(-) (limited to 'doc/api/builds.md') diff --git a/doc/api/builds.md b/doc/api/builds.md index 06ff89bea00..ecb50754c88 100644 --- a/doc/api/builds.md +++ b/doc/api/builds.md @@ -8,10 +8,20 @@ Get a list of builds in a project. GET /projects/:id/builds ``` -Parameters: +### Parameters -- `id` (required) - The ID of a project -- `scope` (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled; if none provided showing all builds) +| 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 + +``` +curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds" +``` + +### Example of response ```json [ @@ -102,11 +112,21 @@ Get a list of builds for specific commit in a project. GET /projects/:id/repository/commits/:sha/builds ``` -Parameters: +### Parameters + +| 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 | -- `id` (required) - The ID of a project -- `sha` (required) - The SHA id of a commit -- `scope` (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled; if none provided showing all builds) +### Example of request + +``` +curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/repository/commits/0ff3ae198f8601a285adcf5c0fff204ee6fba5fd/builds" +``` + +### Example of response ```json [ @@ -183,10 +203,20 @@ Get a single build of a project GET /projects/:id/builds/:build_id ``` -Parameters: +### Parameters -- `id` (required) - The ID of a project -- `build_id` (required) - The ID of a build +| Attribute | Type | required | Description | +|-----------|---------|----------|---------------------| +| id | integer | yes | The ID of a project | +| build\_id | integer | yes | The ID of a build | + +### Example of request + +``` +curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/8" +``` + +### Example of response ```json { @@ -237,10 +267,20 @@ Cancel a single build of a project POST /projects/:id/builds/:build_id/cancel ``` -Parameters: +### 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 + +``` +curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/1/cancel" +``` -- `id` (required) - The ID of a project -- `build_id` (required) - The ID of a build +### Example of response ```json { @@ -277,10 +317,20 @@ Retry a single build of a project POST /projects/:id/builds/:build_id/retry ``` -Parameters: +### 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 + +``` +curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/builds/1/retry" +``` -- `id` (required) - The ID of a project -- `build_id` (required) - The ID of a build +### Example of response ```json { -- cgit v1.2.1