Sha256: 5fca90b8819e5a405cad166059af21c2d70e8f72601354b50f6015f0e2346644
Contents?: true
Size: 941 Bytes
Versions: 20
Compression:
Stored size: 941 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.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] disconnected = params[:disconnected] start_report_generation(organization_id, disconnected) render json: { action_status: 'success', }, status: :ok end end end
Version data entries
20 entries across 20 versions & 1 rubygems