Class: ForemanInventoryUpload::UploadsController
Instance Method Summary
collapse
#report_file, #start_report_generation
Instance Method Details
#download_file ⇒ Object
17
18
19
20
21
|
# File 'app/controllers/foreman_inventory_upload/uploads_controller.rb', line 17
def download_file
filename, file = report_file(params[:organization_id])
send_file file, disposition: 'attachment', filename: filename
end
|
#enable_cloud_connector ⇒ Object
23
24
25
26
27
28
29
|
# File 'app/controllers/foreman_inventory_upload/uploads_controller.rb', line 23
def enable_cloud_connector
Setting[:allow_auto_inventory_upload] = true
cloud_connector = ForemanRhCloud::CloudConnector.new
render json: cloud_connector.install.to_json
end
|
#last ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'app/controllers/foreman_inventory_upload/uploads_controller.rb', line 8
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
|