1
|
module ForemanPipeline
|
2
|
class Api::JenkinsProjectsController < Katello::Api::V2::ApiController
|
3
|
respond_to :json
|
4
|
|
5
|
include Api::Rendering
|
6
|
|
7
|
before_filter :find_jenkins_project, :only => [:show]
|
8
|
|
9
|
api :GET, "/organizations/:organization_id/jenkins_projects/:id", N_("Get jenkins project by identifier")
|
10
|
param :organization_id, :number, :desc => N_("Organization identifier")
|
11
|
param :id, :number, :desc => N_("Jenkins project identifier")
|
12
|
def show
|
13
|
respond_for_show(:resource => @jenkins_project)
|
14
|
end
|
15
|
|
16
|
private
|
17
|
|
18
|
def find_jenkins_project
|
19
|
@jenkins_project = JenkinsProject.find_by_id(params[:id])
|
20
|
fail ::Katello::HttpErrors::NotFound, "Could not find Jenkins Project with id: #{params[:id]}" if @jenkins_project.nil?
|
21
|
@jenkins_project
|
22
|
end
|
23
|
|
24
|
def jenkins_project_params
|
25
|
params.require(:jenkins_project).permit(:name)
|
26
|
end
|
27
|
|
28
|
|
29
|
|
30
|
end
|
31
|
end
|