Project

General

Profile

Download (641 Bytes) Statistics
| Branch: | Tag: | Revision:

foreman_pipeline / app / controllers / foreman_pipeline / api / jenkins_requests_controller.rb @ be52ca64

1
module ForemanPipeline
2
  class Api::JenkinsRequestsController < Katello::Api::V2::ApiController
3
    respond_to :json
4

    
5
    include Api::Rendering
6

    
7
    before_filter :find_job
8

    
9
    def list
10
      fail "filter string not given" if params[:filter].blank?
11
      task = async_task(::Actions::ForemanPipeline::Jenkins::List, :job_id => params[:job_id], :filter => params[:filter])
12
      respond_for_async(:resource => task)
13
    end
14

    
15
    private 
16

    
17
    def find_job
18
      @job = Job.find_by_id(params[:job_id])
19
      fail ::Katello::HttpErrors::NotFound, "Could not find job with id #{params[:job_id]}" if @job.nil?
20
      @job 
21
    end
22
    
23
  end
24
end