Sha256: ba7b577b0134b6177cffb87e712c2b1fe5a5104a8e58cdf8b4e1515e7e5c4007
Contents?: true
Size: 723 Bytes
Versions: 16
Compression:
Stored size: 723 Bytes
Contents
# frozen_string_literal: true require 'logger' module SdrClient # The namespace for the "get" command module Find DRO_PATH = '/v1/resources/%<id>s' # @raise [Failed] if the find operation fails # @return [String] JSON for the given Cocina object or an error def self.run(druid, url:, logger: Logger.new($stdout)) connection = Connection.new(url: url) path = format(DRO_PATH, id: druid) logger.info("Retrieving metadata from: #{path}") response = connection.get(path) return response.body if response.success? logger.error("There was an HTTP #{response.status} error making the request: #{response.body}") UnexpectedResponse.call(response) end end end
Version data entries
16 entries across 16 versions & 1 rubygems