Class: Dor::Services::Client::BackgroundJobResults

Inherits:
VersionedService show all
Defined in:
lib/dor/services/client/background_job_results.rb

Overview

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

Constant Summary

Constants inherited from VersionedService

VersionedService::EXCEPTION_CLASS, VersionedService::JSON_API_MIME_TYPE

Instance Method Summary collapse

Methods inherited from VersionedService

#async_result, #initialize, #with_querystring

Constructor Details

This class inherits a constructor from Dor::Services::Client::VersionedService

Instance Method Details

#show(job_id:) ⇒ String

Get status/result of a background job

Parameters:

  • job_id (String)

    required string representing a job identifier

Returns:

  • (String)

    result of background job

Raises:



15
16
17
18
19
20
21
22
23
24
# File 'lib/dor/services/client/background_job_results.rb', line 15

def show(job_id:)
  resp = connection.get do |req|
    req.url "#{api_version}/background_job_results/#{job_id}"
    req.headers['Accept'] = 'application/json'
  end

  return JSON.parse(resp.body).with_indifferent_access if resp.success?

  raise_exception_based_on_response!(resp)
end