diff options
Diffstat (limited to 'lib/api/ci/jobs.rb')
-rw-r--r-- | lib/api/ci/jobs.rb | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/api/ci/jobs.rb b/lib/api/ci/jobs.rb index 30ce1454419..d9d0da2e4d1 100644 --- a/lib/api/ci/jobs.rb +++ b/lib/api/ci/jobs.rb @@ -38,7 +38,7 @@ module API use :pagination end # rubocop: disable CodeReuse/ActiveRecord - get ':id/jobs', feature_category: :continuous_integration do + get ':id/jobs', urgency: :low, feature_category: :continuous_integration do authorize_read_builds! builds = user_project.builds.order('id DESC') @@ -55,7 +55,7 @@ module API params do requires :job_id, type: Integer, desc: 'The ID of a job' end - get ':id/jobs/:job_id', feature_category: :continuous_integration do + get ':id/jobs/:job_id', urgency: :low, feature_category: :continuous_integration do authorize_read_builds! build = find_build!(params[:job_id]) @@ -70,7 +70,7 @@ module API params do requires :job_id, type: Integer, desc: 'The ID of a job' end - get ':id/jobs/:job_id/trace', feature_category: :continuous_integration do + get ':id/jobs/:job_id/trace', urgency: :low, feature_category: :continuous_integration do authorize_read_builds! build = find_build!(params[:job_id]) @@ -92,7 +92,7 @@ module API params do requires :job_id, type: Integer, desc: 'The ID of a job' end - post ':id/jobs/:job_id/cancel', feature_category: :continuous_integration do + post ':id/jobs/:job_id/cancel', urgency: :low, feature_category: :continuous_integration do authorize_update_builds! build = find_build!(params[:job_id]) @@ -109,7 +109,7 @@ module API params do requires :job_id, type: Integer, desc: 'The ID of a build' end - post ':id/jobs/:job_id/retry', feature_category: :continuous_integration do + post ':id/jobs/:job_id/retry', urgency: :low, feature_category: :continuous_integration do authorize_update_builds! build = find_build!(params[:job_id]) @@ -127,7 +127,7 @@ module API params do requires :job_id, type: Integer, desc: 'The ID of a build' end - post ':id/jobs/:job_id/erase', feature_category: :continuous_integration do + post ':id/jobs/:job_id/erase', urgency: :low, feature_category: :continuous_integration do authorize_update_builds! build = find_build!(params[:job_id]) @@ -144,9 +144,14 @@ module API end params do requires :job_id, type: Integer, desc: 'The ID of a Job' + optional :job_variables_attributes, type: Array, + desc: 'User defined variables that will be included when running the job' do + requires :key, type: String, desc: 'The name of the variable' + requires :value, type: String, desc: 'The value of the variable' + end end - post ":id/jobs/:job_id/play", feature_category: :continuous_integration do + post ':id/jobs/:job_id/play', urgency: :low, feature_category: :continuous_integration do authorize_read_builds! job = find_job!(params[:job_id]) @@ -155,7 +160,7 @@ module API bad_request!("Unplayable Job") unless job.playable? - job.play(current_user) + job.play(current_user, params[:job_variables_attributes]) status 200 @@ -168,11 +173,11 @@ module API end resource :job do - desc 'Get current project using job token' do + desc 'Get current job using job token' do success Entities::Ci::Job end route_setting :authentication, job_token_allowed: true - get '', feature_category: :continuous_integration do + get '', feature_category: :continuous_integration, urgency: :low do validate_current_authenticated_job present current_authenticated_job, with: Entities::Ci::Job |