class ForemanInventoryUpload::Async::GenerateReportJob

Public Class Methods

output_label(label) click to toggle source
# File lib/foreman_inventory_upload/async/generate_report_job.rb, line 4
def self.output_label(label)
  "report_for_#{label}"
end

Public Instance Methods

base_folder() click to toggle source
# File lib/foreman_inventory_upload/async/generate_report_job.rb, line 41
def base_folder
  input[:base_folder]
end
command() click to toggle source
# File lib/foreman_inventory_upload/async/generate_report_job.rb, line 30
def command
  "#{rake_prefix}rake rh_cloud_inventory:report:generate"
end
env() click to toggle source
Calls superclass method
# File lib/foreman_inventory_upload/async/generate_report_job.rb, line 34
def env
  super.merge(
    'target' => base_folder,
    'organization_id' => organization_id
  )
end
organization_id() click to toggle source
# File lib/foreman_inventory_upload/async/generate_report_job.rb, line 45
def organization_id
  input[:organization_id]
end
plan(base_folder, organization_id, disconnected) click to toggle source
Calls superclass method
# File lib/foreman_inventory_upload/async/generate_report_job.rb, line 8
def plan(base_folder, organization_id, disconnected)
  sequence do
    super(
      GenerateReportJob.output_label(organization_id),
      organization_id: organization_id,
      base_folder: base_folder
    )

    plan_action(
      QueueForUploadJob,
      base_folder,
      ForemanInventoryUpload.facts_archive_name(organization_id),
      organization_id,
      disconnected
    )
  end
end
rake_prefix() click to toggle source
# File lib/foreman_inventory_upload/async/generate_report_job.rb, line 26
def rake_prefix
  'foreman-' unless Rails.env.development?
end