21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'app/controllers/foreman_salt/api/v2/jobs_controller.rb', line 21
def upload
Rails.logger.info("Processing job #{params[:job][:job_id]} from Salt.")
case params[:job][:function]
when 'state.highstate'
task = ForemanTasks.async_task(::Actions::ForemanSalt::ReportImport, params[:job], detected_proxy.try(:id))
render :json => { :task_id => task.id }
else
render :json => { :message => 'Unsupported function' }, :status => :unprocessable_entity
end
rescue ::Foreman::Exception => e
render :json => { :message => e.to_s }, :status => :unprocessable_entity
end
|