Sha256: 1d9dc287ce895c54f0b582bce4edc532defb7e0fd7a0f1dc26af5c8e11061f4e

Contents?: true

Size: 684 Bytes

Versions: 102

Compression:

Stored size: 684 Bytes

Contents

# frozen_string_literal: true

require 'json'

module SdrClient
  # API calls around background job results from dor-services-app
  module BackgroundJobResults
    # Get status/result of a background job
    # @param url [String] url for the service
    # @param job_id [String] required string representing a job identifier
    # @return [Hash] result of background job
    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
  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
sdr-client-2.11.0 lib/sdr_client/background_job_results.rb
sdr-client-2.10.1 lib/sdr_client/background_job_results.rb
sdr-client-2.10.0 lib/sdr_client/background_job_results.rb
sdr-client-2.9.0 lib/sdr_client/background_job_results.rb
sdr-client-2.8.0 lib/sdr_client/background_job_results.rb
sdr-client-2.7.1 lib/sdr_client/background_job_results.rb
sdr-client-2.7.0 lib/sdr_client/background_job_results.rb
sdr-client-2.6.0 lib/sdr_client/background_job_results.rb
sdr-client-2.5.0 lib/sdr_client/background_job_results.rb
sdr-client-2.4.0 lib/sdr_client/background_job_results.rb
sdr-client-2.3.1 lib/sdr_client/background_job_results.rb
sdr-client-2.3.0 lib/sdr_client/background_job_results.rb
sdr-client-2.2.0 lib/sdr_client/background_job_results.rb
sdr-client-2.1.0 lib/sdr_client/background_job_results.rb
sdr-client-2.0.1 lib/sdr_client/background_job_results.rb
sdr-client-2.0.0 lib/sdr_client/background_job_results.rb
sdr-client-1.0.0 lib/sdr_client/background_job_results.rb
sdr-client-0.97.0 lib/sdr_client/background_job_results.rb
sdr-client-0.96.0 lib/sdr_client/background_job_results.rb
sdr-client-0.95.0 lib/sdr_client/background_job_results.rb