Class: ForemanInventoryUpload::UploadsController

Inherits:
ApplicationController
  • Object
show all
Includes:
ForemanRhCloud::IopSmartProxyAccess, InventoryUpload::ReportActions
Defined in:
app/controllers/foreman_inventory_upload/uploads_controller.rb

Instance Method Summary collapse

Methods included from InventoryUpload::ReportActions

#report_file, #start_report_generation

Instance Method Details

#download_fileObject



8
9
10
11
12
# File 'app/controllers/foreman_inventory_upload/uploads_controller.rb', line 8

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

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

#enable_cloud_connectorObject



14
15
16
17
18
19
20
# File 'app/controllers/foreman_inventory_upload/uploads_controller.rb', line 14

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