Commit c5b429f0 authored by Tomasz Maczukin's avatar Tomasz Maczukin

Add mofications to triggers API documentation [ci skip]

parent d8359a4f
# Build triggers # Build triggers
You can read more about [triggering builds through the API](../ci/triggers/README.md).
## List project triggers ## List project triggers
Get a list of project triggers Get a list of project's build triggers.
``` ```
GET /projects/:id/triggers GET /projects/:id/triggers
``` ```
### Parameters
| Attribute | Type | required | Description | | Attribute | Type | required | Description |
|-----------|---------|----------|---------------------| |-----------|---------|----------|---------------------|
| id | integer | yes | The ID of a project | | `id` | integer | yes | The ID of a project |
### Example of request
``` ```
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers" curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers"
``` ```
### Example of response
```json ```json
[ [
{ {
...@@ -43,27 +39,21 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3 ...@@ -43,27 +39,21 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3
## Get trigger details ## Get trigger details
Get details of trigger of a project Get details of project's build trigger.
``` ```
GET /projects/:id/triggers/:token GET /projects/:id/triggers/:token
``` ```
### Parameters
| Attribute | Type | required | Description | | Attribute | Type | required | Description |
|-----------|---------|----------|--------------------------| |-----------|---------|----------|--------------------------|
| id | integer | yes | The ID of a project | | `id` | integer | yes | The ID of a project |
| token | string | yes | The `token` of a project | | `token` | string | yes | The `token` of a trigger |
### Example of request
``` ```
curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers/7b9148c158980bbd9bcea92c17522d" curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers/7b9148c158980bbd9bcea92c17522d"
``` ```
### Example of response
```json ```json
{ {
"created_at": "2015-12-23T16:25:56.760Z", "created_at": "2015-12-23T16:25:56.760Z",
...@@ -76,26 +66,20 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3 ...@@ -76,26 +66,20 @@ curl -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3
## Create a project trigger ## Create a project trigger
Create a trigger for a project Create a build trigger for a project.
``` ```
POST /projects/:id/triggers POST /projects/:id/triggers
``` ```
### Parameters
| Attribute | Type | required | Description | | Attribute | Type | required | Description |
|-----------|---------|----------|--------------------------| |-----------|---------|----------|--------------------------|
| id | integer | yes | The ID of a project | | `id` | integer | yes | The ID of a project |
### Example of request
``` ```
curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers" curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers"
``` ```
### Example of response
```json ```json
{ {
"created_at": "2016-01-07T09:53:58.235Z", "created_at": "2016-01-07T09:53:58.235Z",
...@@ -108,20 +92,16 @@ curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.co ...@@ -108,20 +92,16 @@ curl -X POST -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.co
## Remove a project trigger ## Remove a project trigger
Remove a trigger of a project Remove a project's build trigger.
``` ```
DELETE /projects/:id/triggers/:token DELETE /projects/:id/triggers/:token
``` ```
### Parameters
| Attribute | Type | required | Description | | Attribute | Type | required | Description |
|-----------|---------|----------|--------------------------| |-----------|---------|----------|--------------------------|
| id | integer | yes | The ID of a project | | `id` | integer | yes | The ID of a project |
| token | string | yes | The `token` of a project | | `token` | string | yes | The `token` of a project |
### Example of request
``` ```
curl -X DELETE -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers/7b9148c158980bbd9bcea92c17522d" curl -X DELETE -H "PRIVATE_TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/projects/1/triggers/7b9148c158980bbd9bcea92c17522d"
......
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