Class: ForemanInventoryUpload::Async::SingleHostReportJob

Inherits:
HostInventoryReportJob show all
Defined in:
lib/foreman_inventory_upload/async/single_host_report_job.rb

Instance Method Summary collapse

Methods inherited from HostInventoryReportJob

#organization_id

Instance Method Details

#hostname(host_id) ⇒ Object



9
10
11
12
# File 'lib/foreman_inventory_upload/async/single_host_report_job.rb', line 9

def hostname(host_id)
  host = ::Host.find_by(id: host_id)
  host&.name
end

#humanized_nameObject



14
15
16
17
# File 'lib/foreman_inventory_upload/async/single_host_report_job.rb', line 14

def humanized_name
  hostname_result = hostname(input[:host_id])
  hostname_result.present? ? format(_("Single-host report job for host %s"), hostname_result) : _("Single-host report job")
end

#plan(base_folder, organization_id, host_id) ⇒ Object



4
5
6
7
# File 'lib/foreman_inventory_upload/async/single_host_report_job.rb', line 4

def plan(base_folder, organization_id, host_id)
  input[:host_id] = host_id
  super(base_folder, organization_id, "id=#{input[:host_id]}")
end