Module: SdrClient::Find

Defined in:
lib/sdr_client/find.rb

Overview

The namespace for the “get” command

Constant Summary collapse

DRO_PATH =
'/v1/resources/%<id>s'

Class Method Summary collapse

Class Method Details

.run(druid, url:, logger: Logger.new(STDOUT)) ⇒ String

Returns job id for the background job result.

Returns:

  • (String)

    job id for the background job result



10
11
12
13
14
15
16
# File 'lib/sdr_client/find.rb', line 10

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)
  response.body
end