Class: Api::V2::TemplateCombinationsController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v2/template_combinations_controller.rb

Instance Method Summary collapse

Methods included from Api::Version2

#api_version

Methods inherited from BaseController

#get_resource, #resource_class, #resource_name, #resource_scope

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#createObject


20
21
22
23
# File 'app/controllers/api/v2/template_combinations_controller.rb', line 20

def create
  @template_combination = @config_template.template_combinations.build(params[:template_combination])
  process_response @template_combination.save
end

#destroyObject


33
34
35
# File 'app/controllers/api/v2/template_combinations_controller.rb', line 33

def destroy
  process_response @template_combination.destroy
end

#find_parent_config_templateObject


37
38
39
40
41
42
43
# File 'app/controllers/api/v2/template_combinations_controller.rb', line 37

def find_parent_config_template
  @config_template = ConfigTemplate.find(params[:config_template_id])
  unless @config_template
    render_error 'not_found', :status => :not_found and return false
  end
  @config_template
end

#indexObject


9
10
11
# File 'app/controllers/api/v2/template_combinations_controller.rb', line 9

def index
  @template_combinations = @config_template.template_combinations
end

#showObject


27
28
# File 'app/controllers/api/v2/template_combinations_controller.rb', line 27

def show
end