Module: SdrClient::BackgroundJobResults

Defined in:
lib/sdr_client/background_job_results.rb

Overview

API calls around background job results from dor-services-app

Class Method Summary collapse

Class Method Details

.show(url:, job_id:) ⇒ Hash

Get status/result of a background job

Parameters:

  • url (String)

    url for the service

  • job_id (String)

    required string representing a job identifier

Returns:

  • (Hash)

    result of background job



12
13
14
15
16
17
18
19
# File 'lib/sdr_client/background_job_results.rb', line 12

def self.show(url:, job_id:)
  connection = Connection.new(url: "#{url}/v1/background_job_results/#{job_id}").connection
  resp = connection.get

  raise "unexpected response: #{resp.status} #{resp.body}" unless resp.success?

  JSON.parse(resp.body).with_indifferent_access
end