Class: Api::V1::ConfigTemplatesController

Inherits:
BaseController show all
Includes:
Foreman::Renderer
Defined in:
app/controllers/api/v1/config_templates_controller.rb

Direct Known Subclasses

Api::V2::ConfigTemplatesController

Instance Method Summary collapse

Methods included from Foreman::Renderer

#foreman_url, #render_safe, #snippet, #snippets, #unattended_render, #unattended_render_to_temp_file

Methods included from Api::Version1

#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

#build_pxe_defaultObject


77
78
79
80
# File 'app/controllers/api/v1/config_templates_controller.rb', line 77

def build_pxe_default
  status, msg = ConfigTemplate.build_pxe_default(self)
  render :json => msg, :status => status
end

#createObject


39
40
41
42
# File 'app/controllers/api/v1/config_templates_controller.rb', line 39

def create
  @config_template = ConfigTemplate.new(params[:config_template])
  process_response @config_template.save
end

#destroyObject


71
72
73
# File 'app/controllers/api/v1/config_templates_controller.rb', line 71

def destroy
  process_response @config_template.destroy
end

#indexObject


16
17
18
19
# File 'app/controllers/api/v1/config_templates_controller.rb', line 16

def index
  @config_templates = ConfigTemplate.search_for(*search_options).paginate(paginate_options).
    includes(:operatingsystems, :template_combinations, :template_kind)
end

#revisionObject


63
64
65
66
# File 'app/controllers/api/v1/config_templates_controller.rb', line 63

def revision
  audit = Audit.find(params[:version])
  render :json => audit.revision.template
end

#showObject


24
25
# File 'app/controllers/api/v1/config_templates_controller.rb', line 24

def show
end

#updateObject


56
57
58
# File 'app/controllers/api/v1/config_templates_controller.rb', line 56

def update
  process_response @config_template.update_attributes(params[:config_template])
end