Class: Actions::ForemanSalt::ReportImport
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::ForemanSalt::ReportImport
- Defined in:
- app/lib/actions/foreman_salt/report_import.rb
Instance Method Summary collapse
Instance Method Details
#humanized_name ⇒ Object
23 24 25 |
# File 'app/lib/actions/foreman_salt/report_import.rb', line 23 def humanized_name _("Process Highstate Report: #{input[:job_id]}") end |
#plan(job, proxy_id) ⇒ Object
10 11 12 |
# File 'app/lib/actions/foreman_salt/report_import.rb', line 10 def plan(job, proxy_id) plan_self(:job_id => job[:job_id], :report => job[:result], :proxy_id => proxy_id) end |
#resource_locks ⇒ Object
6 7 8 |
# File 'app/lib/actions/foreman_salt/report_import.rb', line 6 def resource_locks :report_import end |
#run ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/lib/actions/foreman_salt/report_import.rb', line 14 def run ::User.as_anonymous_admin do reports = ::ForemanSalt::ReportImporter.import(input[:report], input[:proxy_id]) output[:state] = {:message => "Imported #{reports.count} new reports"} output[:hosts] = reports.map { |report| report.host.name } end end |