diff options
author | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-06-11 15:17:46 +0200 |
---|---|---|
committer | Alexis Reigel <alexis.reigel.ext@siemens.com> | 2018-09-15 21:39:26 +0200 |
commit | 82546888e81488ba7b2a60a970a1cc31febcc1e9 (patch) | |
tree | af69a08e70434642862e57d549c514ff255b65cb /lib | |
parent | 048b4469e8c46327e3e3e9bbdfd7ef9bd27e047f (diff) | |
download | gitlab-ce-82546888e81488ba7b2a60a970a1cc31febcc1e9.tar.gz |
add status param to runners api
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/runners.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/api/runners.rb b/lib/api/runners.rb index d24ff8641e1..9bcdfc8cb15 100644 --- a/lib/api/runners.rb +++ b/lib/api/runners.rb @@ -13,12 +13,15 @@ module API desc: 'The scope of specific runners to show' optional :type, type: String, values: Ci::Runner::AVAILABLE_TYPES, desc: 'The type of the runners to show' + optional :status, type: String, values: Ci::Runner::AVAILABLE_STATUSES, + desc: 'The status of the runners to show' use :pagination end get do runners = current_user.ci_owned_runners runners = filter_runners(runners, params[:scope], allowed_scopes: Ci::Runner::AVAILABLE_STATUSES) runners = filter_runners(runners, params[:type], allowed_scopes: Ci::Runner::AVAILABLE_TYPES) + runners = filter_runners(runners, params[:status], allowed_scopes: Ci::Runner::AVAILABLE_STATUSES) present paginate(runners), with: Entities::Runner end @@ -31,6 +34,8 @@ module API desc: 'The scope of specific runners to show' optional :type, type: String, values: Ci::Runner::AVAILABLE_TYPES, desc: 'The type of the runners to show' + optional :status, type: String, values: Ci::Runner::AVAILABLE_STATUSES, + desc: 'The status of the runners to show' use :pagination end get 'all' do @@ -39,6 +44,7 @@ module API runners = Ci::Runner.all runners = filter_runners(runners, params[:scope]) runners = filter_runners(runners, params[:type], allowed_scopes: Ci::Runner::AVAILABLE_TYPES) + runners = filter_runners(runners, params[:status], allowed_scopes: Ci::Runner::AVAILABLE_STATUSES) present paginate(runners), with: Entities::Runner end @@ -129,12 +135,15 @@ module API desc: 'The scope of specific runners to show' optional :type, type: String, values: Ci::Runner::AVAILABLE_TYPES, desc: 'The type of the runners to show' + optional :status, type: String, values: Ci::Runner::AVAILABLE_STATUSES, + desc: 'The status of the runners to show' use :pagination end get ':id/runners' do runners = Ci::Runner.owned_or_instance_wide(user_project.id) runners = filter_runners(runners, params[:scope]) runners = filter_runners(runners, params[:type], allowed_scopes: Ci::Runner::AVAILABLE_TYPES) + runners = filter_runners(runners, params[:status], allowed_scopes: Ci::Runner::AVAILABLE_STATUSES) present paginate(runners), with: Entities::Runner end |