Commit 4cdbb2f6 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Modify builds API documentation style [ci skip]

parent 92805119
...@@ -8,10 +8,20 @@ Get a list of builds in a project. ...@@ -8,10 +8,20 @@ Get a list of builds in a project.
GET /projects/:id/builds GET /projects/:id/builds
``` ```
Parameters: ### Parameters
- `id` (required) - The ID of a project | Attribute | Type | required | Description |
- `scope` (optional) - The scope of builds to show (one or array of: pending, running, failed, success, canceled; if none provided showing all builds) |-----------|---------|----------|---------------------|
| 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 ```json
[ [
...@@ -102,11 +112,21 @@ Get a list of builds for specific commit in a project. ...@@ -102,11 +112,21 @@ Get a list of builds for specific commit in a project.
GET /projects/:id/repository/commits/:sha/builds 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 ### Example of request
- `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) ```
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/repository/commits/0ff3ae198f8601a285adcf5c0fff204ee6fba5fd/builds"
```
### Example of response
```json ```json
[ [
...@@ -183,10 +203,20 @@ Get a single build of a project ...@@ -183,10 +203,20 @@ Get a single build of a project
GET /projects/:id/builds/:build_id GET /projects/:id/builds/:build_id
``` ```
Parameters: ### Parameters
- `id` (required) - The ID of a project | Attribute | Type | required | Description |
- `build_id` (required) - The ID of a build |-----------|---------|----------|---------------------|
| 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 ```json
{ {
...@@ -237,10 +267,20 @@ Cancel a single build of a project ...@@ -237,10 +267,20 @@ Cancel a single build of a project
POST /projects/:id/builds/:build_id/cancel 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 ### Example of response
- `build_id` (required) - The ID of a build
```json ```json
{ {
...@@ -277,10 +317,20 @@ Retry a single build of a project ...@@ -277,10 +317,20 @@ Retry a single build of a project
POST /projects/:id/builds/:build_id/retry 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 ### Example of response
- `build_id` (required) - The ID of a build
```json ```json
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment