Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2016-01-04 18:38:32 +0300
committerTomasz Maczukin <tomasz@maczukin.pl>2016-01-04 18:44:09 +0300
commitd9da81f736b770bb44c4869aef5d5c455e74ab7a (patch)
treeeee8dad25362491e89c750e822e01bcdd0266d9d /lib/api/triggers.rb
parent0a62d3b5d55311eb425e92ca161d1786d16d2a0c (diff)
Add triggers feature to API
Diffstat (limited to 'lib/api/triggers.rb')
-rw-r--r--lib/api/triggers.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/api/triggers.rb b/lib/api/triggers.rb
index 2781f1cf191..9a1e3fdc976 100644
--- a/lib/api/triggers.rb
+++ b/lib/api/triggers.rb
@@ -43,6 +43,24 @@ module API
render_api_error!(errors, 400)
end
end
+
+ # Get triggers list
+ #
+ # Parameters:
+ # id (required) - The ID of a project
+ # page (optional) - The page number for pagination
+ # per_page (optional) - The value of items per page to show
+ # Example Request:
+ # GET /projects/:id/triggers
+ get ':id/triggers' do
+ authenticate!
+ authorize_admin_project
+
+ triggers = user_project.triggers.includes(:trigger_requests)
+ triggers = paginate(triggers)
+
+ present triggers, with: Entities::Trigger
+ end
end
end
end