Class: Api::V2::Compliance::ScapContentsController
- Inherits:
-
BaseController
- Object
- BaseController
- Api::V2::Compliance::ScapContentsController
show all
- Includes:
- Foreman::Controller::Parameters::ScapContent, ForemanOpenscap::Api::V2::ScapApiControllerExtensions, ForemanOpenscap::BodyLogExtensions
- Defined in:
- app/controllers/api/v2/compliance/scap_contents_controller.rb
Class Method Summary
collapse
Instance Method Summary
collapse
#log_response_body, #logger_msg, #skip_body_log
Class Method Details
.bulk_upload_types ⇒ Object
10
11
12
|
# File 'app/controllers/api/v2/compliance/scap_contents_controller.rb', line 10
def self.bulk_upload_types
['files', 'directory', 'default']
end
|
Instance Method Details
#create ⇒ Object
50
51
52
53
|
# File 'app/controllers/api/v2/compliance/scap_contents_controller.rb', line 50
def create
@scap_content = ForemanOpenscap::ScapContent.new(scap_content_params)
process_response @scap_content.save
end
|
#destroy ⇒ Object
66
67
68
|
# File 'app/controllers/api/v2/compliance/scap_contents_controller.rb', line 66
def destroy
process_response @scap_content.destroy
end
|
#index ⇒ Object
20
21
22
|
# File 'app/controllers/api/v2/compliance/scap_contents_controller.rb', line 20
def index
@scap_contents = resource_scope_for_index(:permission => :view_scap_contents)
end
|
#show ⇒ Object
35
36
|
# File 'app/controllers/api/v2/compliance/scap_contents_controller.rb', line 35
def show
end
|
#update ⇒ Object
59
60
61
|
# File 'app/controllers/api/v2/compliance/scap_contents_controller.rb', line 59
def update
process_response @scap_content.update(scap_content_params)
end
|
#xml ⇒ Object
27
28
29
30
31
|
# File 'app/controllers/api/v2/compliance/scap_contents_controller.rb', line 27
def xml
send_data @scap_content.scap_file,
:type => 'application/xml',
:filename => @scap_content.original_filename || "#{@scap_content.title}.xml"
end
|