Class: Api::V2::Aker::JobsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/api/v2/aker/jobs_controller.rb

Overview

Endpoint to create Jobs inside Sequencescape from Aker

Instance Method Summary collapse

Methods inherited from ApplicationController

#block_api_access, #clean_params_from_check, #evil_parameter_hack!, #extract_header_info, #set_cache_disabled!

Instance Method Details

#createObject


11
12
13
14
15
16
17
18
19
# File 'app/controllers/api/v2/aker/jobs_controller.rb', line 11

def create
  ActiveRecord::Base.transaction do
    @msg = create_job_response(params)
    raise ActiveRecord::Rollback unless @msg[:status] == :created
  end
  render @msg
rescue StandardError => e
  render json: e.message, status: :unprocessable_entity
end