Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
b565ee49
Commit
b565ee49
authored
Mar 05, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update documentation and expose ID
parent
140b51ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
172 additions
and
1 deletion
+172
-1
doc/api/README.md
doc/api/README.md
+1
-1
doc/api/pipeline_triggers.md
doc/api/pipeline_triggers.md
+170
-0
lib/api/entities.rb
lib/api/entities.rb
+1
-0
No files found.
doc/api/README.md
View file @
b565ee49
...
@@ -12,7 +12,6 @@ following locations:
...
@@ -12,7 +12,6 @@ following locations:
-
[
Branches
](
branches.md
)
-
[
Branches
](
branches.md
)
-
[
Broadcast Messages
](
broadcast_messages.md
)
-
[
Broadcast Messages
](
broadcast_messages.md
)
-
[
Builds
](
builds.md
)
-
[
Builds
](
builds.md
)
-
[
Build Triggers
](
build_triggers.md
)
-
[
Build Variables
](
build_variables.md
)
-
[
Build Variables
](
build_variables.md
)
-
[
Commits
](
commits.md
)
-
[
Commits
](
commits.md
)
-
[
Deployments
](
deployments.md
)
-
[
Deployments
](
deployments.md
)
...
@@ -33,6 +32,7 @@ following locations:
...
@@ -33,6 +32,7 @@ following locations:
-
[
Notes
](
notes.md
)
(
comments
)
-
[
Notes
](
notes.md
)
(
comments
)
-
[
Notification settings
](
notification_settings.md
)
-
[
Notification settings
](
notification_settings.md
)
-
[
Pipelines
](
pipelines.md
)
-
[
Pipelines
](
pipelines.md
)
-
[
Pipeline Triggers
](
pipeline_triggers.md
)
-
[
Projects
](
projects.md
)
including setting Webhooks
-
[
Projects
](
projects.md
)
including setting Webhooks
-
[
Project Access Requests
](
access_requests.md
)
-
[
Project Access Requests
](
access_requests.md
)
-
[
Project Members
](
members.md
)
-
[
Project Members
](
members.md
)
...
...
doc/api/
build
_triggers.md
→
doc/api/
pipeline
_triggers.md
View file @
b565ee49
#
Build
triggers
#
Pipeline
triggers
You can read more about
[
triggering
build
s through the API
](
../ci/triggers/README.md
)
.
You can read more about
[
triggering
pipeline
s through the API
](
../ci/triggers/README.md
)
.
## List project triggers
## List project triggers
...
@@ -21,18 +21,14 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/
...
@@ -21,18 +21,14 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/
```
json
```
json
[
[
{
{
"created_at"
:
"2015-12-23T16:24:34.716Z"
,
"id"
:
10
,
"deleted_at"
:
null
,
"description"
:
"my trigger"
,
"last_used"
:
"2016-01-04T15:41:21.986Z"
,
"created_at"
:
"2016-01-07T09:53:58.235Z"
,
"token"
:
"fbdb730c2fbdb095a0862dbd8ab88b"
,
"updated_at"
:
"2015-12-23T16:24:34.716Z"
},
{
"created_at"
:
"2015-12-23T16:25:56.760Z"
,
"deleted_at"
:
null
,
"deleted_at"
:
null
,
"last_used"
:
null
,
"last_used"
:
null
,
"token"
:
"7b9148c158980bbd9bcea92c17522d"
,
"token"
:
"6d056f63e50fe6f8c5f8f4aa10edb7"
,
"updated_at"
:
"2015-12-23T16:25:56.760Z"
"updated_at"
:
"2016-01-07T09:53:58.235Z"
,
"owner"
:
null
}
}
]
]
```
```
...
@@ -42,7 +38,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/
...
@@ -42,7 +38,7 @@ curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/
Get details of project's build trigger.
Get details of project's build trigger.
```
```
GET /projects/:id/triggers/:t
oken
GET /projects/:id/triggers/:t
rigger_id
```
```
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
...
@@ -51,42 +47,108 @@ GET /projects/:id/triggers/:token
...
@@ -51,42 +47,108 @@ GET /projects/:id/triggers/:token
|
`token`
| string | yes | The
`token`
of a trigger |
|
`token`
| string | yes | The
`token`
of a trigger |
```
```
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/triggers/
7b9148c158980bbd9bcea92c17522d
"
curl --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/triggers/
5
"
```
```
```
json
```
json
{
{
"created_at"
:
"2015-12-23T16:25:56.760Z"
,
"id"
:
10
,
"description"
:
"my trigger"
,
"created_at"
:
"2016-01-07T09:53:58.235Z"
,
"deleted_at"
:
null
,
"deleted_at"
:
null
,
"last_used"
:
null
,
"last_used"
:
null
,
"token"
:
"7b9148c158980bbd9bcea92c17522d"
,
"token"
:
"6d056f63e50fe6f8c5f8f4aa10edb7"
,
"updated_at"
:
"2015-12-23T16:25:56.760Z"
"updated_at"
:
"2016-01-07T09:53:58.235Z"
,
"owner"
:
null
}
}
```
```
## Create a project trigger
## Create a project trigger
Create a
build
trigger for a project.
Create a trigger for a project.
```
```
POST /projects/:id/triggers
POST /projects/:id/triggers
```
```
| Attribute | Type | required | Description |
| Attribute | Type | required | Description |
|-----------|---------|----------|--------------------------|
|---------------|---------|----------|--------------------------|
|
`id`
| integer | yes | The ID of a project |
|
`id`
| integer | yes | The ID of a project |
|
`description`
| string | yes | The trigger name |
```
```
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/triggers"
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
-F description="my description"
"https://gitlab.example.com/api/v4/projects/1/triggers"
```
```
```
json
```
json
{
{
"id"
:
10
,
"description"
:
"my trigger"
,
"created_at"
:
"2016-01-07T09:53:58.235Z"
,
"created_at"
:
"2016-01-07T09:53:58.235Z"
,
"deleted_at"
:
null
,
"deleted_at"
:
null
,
"last_used"
:
null
,
"last_used"
:
null
,
"token"
:
"6d056f63e50fe6f8c5f8f4aa10edb7"
,
"token"
:
"6d056f63e50fe6f8c5f8f4aa10edb7"
,
"updated_at"
:
"2016-01-07T09:53:58.235Z"
"updated_at"
:
"2016-01-07T09:53:58.235Z"
,
"owner"
:
null
}
```
## Update a project trigger
Update a trigger for a project.
```
PUT /projects/:id/triggers/:trigger_id
```
| Attribute | Type | required | Description |
|---------------|---------|----------|--------------------------|
|
`trigger_id`
| integer | yes | The trigger id |
|
`description`
| string | no | The trigger name |
```
curl --request PUT -F description="my description" --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/triggers/10"
```
```
json
{
"id"
:
10
,
"description"
:
"my trigger"
,
"created_at"
:
"2016-01-07T09:53:58.235Z"
,
"deleted_at"
:
null
,
"last_used"
:
null
,
"token"
:
"6d056f63e50fe6f8c5f8f4aa10edb7"
,
"updated_at"
:
"2016-01-07T09:53:58.235Z"
,
"owner"
:
null
}
```
## Take ownership of a project trigger
Update an owner of a project trigger.
```
POST /projects/:id/triggers/:trigger_id/take
```
| Attribute | Type | required | Description |
|---------------|---------|----------|--------------------------|
|
`trigger_id`
| integer | yes | The trigger id |
```
curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/triggers/10/take"
```
```
json
{
"id"
:
10
,
"description"
:
"my trigger"
,
"created_at"
:
"2016-01-07T09:53:58.235Z"
,
"deleted_at"
:
null
,
"last_used"
:
null
,
"token"
:
"6d056f63e50fe6f8c5f8f4aa10edb7"
,
"updated_at"
:
"2016-01-07T09:53:58.235Z"
,
"owner"
:
null
}
}
```
```
...
@@ -95,14 +157,14 @@ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitl
...
@@ -95,14 +157,14 @@ curl --request POST --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitl
Remove a project's build trigger.
Remove a project's build trigger.
```
```
DELETE /projects/:id/triggers/:t
oken
DELETE /projects/:id/triggers/:t
rigger_id
```
```
| Attribute | Type | required | Description |
| Attribute
| Type | required | Description |
|-----------|---------|----------|--------------------------|
|-----------
-----
|---------|----------|--------------------------|
|
`id`
| integer | yes | The ID of a project |
|
`id`
| integer | yes | The ID of a project |
|
`t
oken`
| string | yes | The
`token`
of a trigger
|
|
`t
rigger_id`
| integer | yes | The trigger id
|
```
```
curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/triggers/
7b9148c158980bbd9bcea92c17522d
"
curl --request DELETE --header "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v4/projects/1/triggers/
5
"
```
```
lib/api/entities.rb
View file @
b565ee49
...
@@ -639,6 +639,7 @@ module API
...
@@ -639,6 +639,7 @@ module API
end
end
class
Trigger
<
Grape
::
Entity
class
Trigger
<
Grape
::
Entity
expose
:id
expose
:token
,
:description
expose
:token
,
:description
expose
:created_at
,
:updated_at
,
:deleted_at
,
:last_used
expose
:created_at
,
:updated_at
,
:deleted_at
,
:last_used
expose
:owner
,
using:
Entities
::
UserBasic
expose
:owner
,
using:
Entities
::
UserBasic
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment