Sha256: 4a8572ec7aece9da453e3a2c8ba8413349ebadd12f7794750d2ff796461f7efb
Contents?: true
Size: 898 Bytes
Versions: 22
Compression:
Stored size: 898 Bytes
Contents
# frozen_string_literal: true module ForemanInventoryUpload class ReportsController < ::ApplicationController include InventoryUpload::ReportActions def last label = ForemanInventoryUpload::Async::GenerateReportJob.output_label(params[:organization_id]) output = ForemanInventoryUpload::Async::ProgressOutput.get(label)&.full_output task_label = ForemanInventoryUpload::Async::GenerateAllReportsJob.singleton_job_name scheduled = ForemanTasks::Task.where( :label => task_label, :state => 'scheduled' ).first&.start_at || nil render json: { output: output, scheduled: scheduled, }, status: :ok end def generate organization_id = params[:organization_id] start_report_generation(organization_id) render json: { action_status: 'success', }, status: :ok end end end
Version data entries
22 entries across 22 versions & 1 rubygems