Sha256: 89206bc981cd165adc69d184f89e1666437e3aeaeddf6ab032916c97d023427b

Contents?: true

Size: 844 Bytes

Versions: 28

Compression:

Stored size: 844 Bytes

Contents

module ForemanInventoryUpload
  class UploadsController < ::ApplicationController
    include InventoryUpload::ReportActions

    def last
      label = ForemanInventoryUpload::Async::UploadReportJob.output_label(params[:organization_id])
      output = ForemanInventoryUpload::Async::ProgressOutput.get(label)&.full_output

      render json: {
        output: output,
      }, status: :ok
    end

    def download_file
      filename, file = report_file(params[:organization_id])

      send_file file, disposition: 'attachment', filename: filename
    end

    def enable_cloud_connector
      # Set the autoupload to true, since it's required by the feature.
      Setting[:allow_auto_inventory_upload] = true

      cloud_connector = ForemanRhCloud::CloudConnector.new
      render json: cloud_connector.install.to_json
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
foreman_rh_cloud-9.0.59 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-11.0.2 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-11.0.1 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-11.0.0 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.58 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-10.0.2 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.57 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-10.0.1 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.56 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.55 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.54 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.53 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.52 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-8.0.52 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-9.0.51 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-8.0.51 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-7.0.48 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-7.0.47 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-8.0.50 app/controllers/foreman_inventory_upload/uploads_controller.rb
foreman_rh_cloud-8.0.49 app/controllers/foreman_inventory_upload/uploads_controller.rb