dor-services-client 3.1.1 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -2
- data/lib/dor/services/client/object.rb +14 -1
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client/workspace.rb +11 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '05129b08c176476bd2e3ced8d6f3dfff99ddc118988170c11c6df428897fd5bd'
|
4
|
+
data.tar.gz: 4da1003e323c07a7ba9e530a2ebe46c58c5e4f200aa879dd78942fb91a9f1d0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e90d10bcee7498339bcb684e67da2612f6d4ad9fbef24b2de270c0d3ea1c508f63bae430b14d6bebc602f60286c712eb2c59eb54a33405cf5caf82928f1a657
|
7
|
+
data.tar.gz: fa54d821c6e50fc56ca824f54d89d74c0a9455c41809176c5f1f41068ca8a3f5171e27dae950477c3df7f662aab00e2b0264c8f60250723a828cb8a0661a1cb7
|
data/README.md
CHANGED
@@ -72,9 +72,12 @@ background_jobs_client.show(job_id: 123)
|
|
72
72
|
# For performing operations on a known, registered object
|
73
73
|
object_client = Dor::Services::Client.object(object_identifier)
|
74
74
|
|
75
|
-
# Publish an object
|
75
|
+
# Publish an object (push to PURL)
|
76
76
|
object_client.publish
|
77
77
|
|
78
|
+
# Shelve an object (push to Stacks)
|
79
|
+
object_client.shelve
|
80
|
+
|
78
81
|
# Update the MARC record
|
79
82
|
object_client.update_marc_record
|
80
83
|
|
@@ -110,9 +113,11 @@ object_client.sdr.content_diff(current_content: existing_content)
|
|
110
113
|
object_client.sdr.metadata(datastream: dsid)
|
111
114
|
object_client.sdr.signature_catalog
|
112
115
|
|
113
|
-
# Create and
|
116
|
+
# Create, remove, and reset workspaces
|
114
117
|
object_client.workspace.create(source: object_path_string)
|
115
118
|
object_client.workspace.cleanup
|
119
|
+
object_client.workspace.reset
|
120
|
+
|
116
121
|
|
117
122
|
# Update embargo
|
118
123
|
object_client.embargo.update(embargo_date: date_string, requesting_user: username_string)
|
@@ -64,7 +64,7 @@ module Dor
|
|
64
64
|
Collections.new(parent_params).collections
|
65
65
|
end
|
66
66
|
|
67
|
-
# Publish
|
67
|
+
# Publish an object (send to PURL)
|
68
68
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
69
69
|
# @raise [UnexpectedResponse] when the response is not successful.
|
70
70
|
# @return [boolean] true on success
|
@@ -77,6 +77,19 @@ module Dor
|
|
77
77
|
raise_exception_based_on_response!(resp)
|
78
78
|
end
|
79
79
|
|
80
|
+
# Shelve an object (send to Stacks)
|
81
|
+
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
82
|
+
# @raise [UnexpectedResponse] when the response is not successful.
|
83
|
+
# @return [boolean] true on success
|
84
|
+
def shelve
|
85
|
+
resp = connection.post do |req|
|
86
|
+
req.url "#{object_path}/shelve"
|
87
|
+
end
|
88
|
+
return true if resp.success?
|
89
|
+
|
90
|
+
raise_exception_based_on_response!(resp)
|
91
|
+
end
|
92
|
+
|
80
93
|
# Update the marc record for the given object
|
81
94
|
# @raise [NotFoundResponse] when the response is a 404 (object not found)
|
82
95
|
# @raise [UnexpectedResponse] when the response is not successful.
|
@@ -33,6 +33,17 @@ module Dor
|
|
33
33
|
raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp) unless resp.success?
|
34
34
|
end
|
35
35
|
|
36
|
+
# After an object has been copied to preservation the workspace can be
|
37
|
+
# reset. This is called by the reset-workspace step of the accessionWF
|
38
|
+
# @raise [UnexpectedResponse] if the request is unsuccessful.
|
39
|
+
# @return nil
|
40
|
+
def reset
|
41
|
+
resp = connection.post do |req|
|
42
|
+
req.url "#{workspace_path}/reset"
|
43
|
+
end
|
44
|
+
raise UnexpectedResponse, ResponseErrorFormatter.format(response: resp) unless resp.success?
|
45
|
+
end
|
46
|
+
|
36
47
|
private
|
37
48
|
|
38
49
|
def workspace_path
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dor-services-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-10-
|
12
|
+
date: 2019-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -255,8 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
255
|
- !ruby/object:Gem::Version
|
256
256
|
version: '0'
|
257
257
|
requirements: []
|
258
|
-
|
259
|
-
rubygems_version: 2.7.8
|
258
|
+
rubygems_version: 3.0.3
|
260
259
|
signing_key:
|
261
260
|
specification_version: 4
|
262
261
|
summary: A client for dor-services-app
|