Class: Api::V2::CveScansController

Inherits:
V2::BaseController
  • Object
show all
Defined in:
app/controllers/api/v2/cve_scans_controller.rb

Overview

API controller for CVE scans per host.

Instance Method Summary collapse

Instance Method Details

#destroyObject



42
43
44
45
# File 'app/controllers/api/v2/cve_scans_controller.rb', line 42

def destroy
  @cve_scan = resource_class.for_host(@host.id).find(params[:id])
  process_response @cve_scan.destroy
end

#indexObject



18
19
20
# File 'app/controllers/api/v2/cve_scans_controller.rb', line 18

def index
  @cve_scans = cve_scans_index_scope.paginate(paginate_options)
end

#latestObject



25
26
27
28
# File 'app/controllers/api/v2/cve_scans_controller.rb', line 25

def latest
  @cve_scan = cve_scans_index_scope.first
  head :no_content if @cve_scan.nil?
end

#resource_classObject



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

def resource_class
  ::ForemanCveScanner::CveScan
end

#showObject



34
35
36
# File 'app/controllers/api/v2/cve_scans_controller.rb', line 34

def show
  @cve_scan = resource_class.for_host(@host.id).find(params[:id])
end