Class: Api::V2::Compliance::TailoringFilesController

Inherits:
BaseController
  • Object
show all
Includes:
Foreman::Controller::Parameters::TailoringFile, ForemanOpenscap::Api::V2::ScapApiControllerExtensions, ForemanOpenscap::BodyLogExtensions
Defined in:
app/controllers/api/v2/compliance/tailoring_files_controller.rb

Instance Method Summary collapse

Methods included from ForemanOpenscap::BodyLogExtensions

#log_response_body, #logger_msg, #skip_body_log

Instance Method Details

#createObject



44
45
46
47
# File 'app/controllers/api/v2/compliance/tailoring_files_controller.rb', line 44

def create
  @tailoring_file = ForemanOpenscap::TailoringFile.new(tailoring_file_params)
  process_response @tailoring_file.save
end

#destroyObject



60
61
62
# File 'app/controllers/api/v2/compliance/tailoring_files_controller.rb', line 60

def destroy
  process_response @tailoring_file.destroy
end

#indexObject



14
15
16
# File 'app/controllers/api/v2/compliance/tailoring_files_controller.rb', line 14

def index
  @tailoring_files = resource_scope_for_index(:permission => :view_tailoring_files)
end

#showObject



29
30
# File 'app/controllers/api/v2/compliance/tailoring_files_controller.rb', line 29

def show
end

#updateObject



53
54
55
# File 'app/controllers/api/v2/compliance/tailoring_files_controller.rb', line 53

def update
  process_response @tailoring_file.update(tailoring_file_params)
end

#xmlObject



21
22
23
24
25
# File 'app/controllers/api/v2/compliance/tailoring_files_controller.rb', line 21

def xml
  send_data @tailoring_file.scap_file,
            :type     => 'application/xml',
            :filename => @tailoring_file.original_filename || "#{@tailoring_file.name}.xml"
end