diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-02-21 17:20:50 +0900 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-05-03 02:11:50 +0900 |
commit | e9d94451959e4717e0ba4ca882b5a54437efbee1 (patch) | |
tree | 9eae86aa74b50ecdff6771260fa4721deda9c2dd /lib | |
parent | 9fd1a35fa944cc27a88bc504fed3a8b65eb193dd (diff) | |
download | gitlab-ce-e9d94451959e4717e0ba4ca882b5a54437efbee1.tar.gz |
- Add new parameters for Pipeline API
- Expand PipelinesFinder functions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/pipelines.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index 754c3d85a04..905e72a3a95 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -16,11 +16,21 @@ module API use :pagination optional :scope, type: String, values: %w(running branches tags), desc: 'Either running, branches, or tags' + optional :status, type: String, values: ['running', 'pending', 'success', 'failed', 'canceled', 'skipped'], + desc: 'Pipeline Status' + optional :ref, type: String, desc: 'Pipeline Ref' + optional :duration, type: Integer, desc: 'Greater than the specified duration' + optional :yaml_error, type: Boolean, desc: 'If true, returns only yaml error pipelines.' + optional :user_id, type: String, desc: 'User who executed pipelines' + optional :order_by, type: String, values: ['id', 'status', 'ref', 'user_id', 'started_at', 'finished_at', 'created_at', 'updated_at'], default: 'id', + desc: 'Return issues ordered by `created_at` or `updated_at` fields.' + optional :sort, type: String, values: ['asc', 'desc'], default: 'desc', + desc: 'Return pipelines sorted in `asc` or `desc` order.' end get ':id/pipelines' do authorize! :read_pipeline, user_project - pipelines = PipelinesFinder.new(user_project).execute(scope: params[:scope]) + pipelines = PipelinesFinder.new(user_project, params).execute(scope: params[:scope]) present paginate(pipelines), with: Entities::PipelineBasic end |