Class: Aker::JobsController
Overview
Provide index and show actions to display jobs inside Sequencescapew, and start, complete and cancel endpoints to change the status of the jobs from the inbox application
Constant Summary
FlashTruncation::STRING_OVERHEAD
Instance Method Summary
collapse
#block_api_access, #clean_params_from_check, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!
#max_flash_size, #truncate_flash, #truncate_flash_array
Instance Method Details
#cancel ⇒ Object
44
45
46
|
# File 'app/controllers/aker/jobs_controller.rb', line 44
def cancel
_finish_action("#{@job.aker_job_url}/cancel")
end
|
#complete ⇒ Object
40
41
42
|
# File 'app/controllers/aker/jobs_controller.rb', line 40
def complete
_finish_action("#{@job.aker_job_url}/complete")
end
|
#index ⇒ Object
10
11
12
|
# File 'app/controllers/aker/jobs_controller.rb', line 10
def index
@jobs = Aker::Job.paginate(page: params[:page], per_page: 10).order(created_at: :desc)
end
|
#show ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
|
# File 'app/controllers/aker/jobs_controller.rb', line 14
def show
recover_from_connection_refused do
@aker_job = JSON.parse(RestClient::Request.execute(
verify_ssl: false,
method: :get,
url: @job.aker_job_url.to_s,
headers: { content_type: :json },
proxy: nil
).body)['job']
end
end
|
#start ⇒ Object
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'app/controllers/aker/jobs_controller.rb', line 26
def start
recover_from_connection_refused do
response = RestClient::Request.execute(
verify_ssl: false,
method: :put,
url: "#{@job.aker_job_url}/start",
headers: { content_type: :json },
proxy: nil
)
render json: response.body, status: :ok
end
end
|