dor-services-client 1.9.2 → 1.10.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 +3 -0
- data/lib/dor/services/client/version.rb +1 -1
- data/lib/dor/services/client/workspace.rb +15 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9eb1dd2a0cc68a36000e3d29254a9c35078ba8b6745282b09c07031e7a9ad0ba
|
4
|
+
data.tar.gz: '02549f42301be4c3bb57534ea025e930e60cb4f8753aa9eae8ae1564d8aa27c9'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 20d3b410f88c8272d668ac26252c955bb2c152ebfde9105a33212a8f9bf5eee69260a0df81217f6300265068876db14d6a1bf252fc81346f59c9834375b2b3e1
|
7
|
+
data.tar.gz: 24638809a238ecbe7ec7c387d26e9f2890a542627c91356a9a96592bd6c75268848d7ac0c95fe152185a5bde5687354579ae7e61a873ec3ef691519c70a477b1
|
data/README.md
CHANGED
@@ -80,7 +80,10 @@ object_client.sdr.metadata(datastream: dsid)
|
|
80
80
|
object_client.sdr.signature_catalog
|
81
81
|
|
82
82
|
object_client.workflow.create(wf_name: workflow_name_string)
|
83
|
+
|
84
|
+
# Create and remove workspaces
|
83
85
|
object_client.workspace.create(source: object_path_string)
|
86
|
+
object_client.workspace.cleanup
|
84
87
|
|
85
88
|
# For retrieving a workflow template
|
86
89
|
workflows_client = Dor::Services::Client.workflows
|
@@ -17,14 +17,28 @@ module Dor
|
|
17
17
|
# @return nil
|
18
18
|
def create(source:)
|
19
19
|
resp = connection.post do |req|
|
20
|
-
req.url
|
20
|
+
req.url workspace_path
|
21
21
|
req.params['source'] = source
|
22
22
|
end
|
23
23
|
raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
|
24
24
|
end
|
25
25
|
|
26
|
+
# Cleans up a workspace
|
27
|
+
# @raises [UnexpectedResponse] if the request is unsuccessful.
|
28
|
+
# @return nil
|
29
|
+
def cleanup
|
30
|
+
resp = connection.delete do |req|
|
31
|
+
req.url workspace_path
|
32
|
+
end
|
33
|
+
raise UnexpectedResponse, "#{resp.reason_phrase}: #{resp.status} (#{resp.body})" unless resp.success?
|
34
|
+
end
|
35
|
+
|
26
36
|
private
|
27
37
|
|
38
|
+
def workspace_path
|
39
|
+
"#{api_version}/objects/#{object_identifier}/workspace"
|
40
|
+
end
|
41
|
+
|
28
42
|
attr_reader :object_identifier
|
29
43
|
end
|
30
44
|
end
|
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: 1.
|
4
|
+
version: 1.10.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-
|
12
|
+
date: 2019-06-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|