cpee-instantiation 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ff6b47e9462a3f92a2e6536974359fe3cc0b18b7583518d88f83998e2f79885
4
- data.tar.gz: b881374ebad85ebe328cfe97534829979d3aec54ff8a0d976d89f79245a78d87
3
+ metadata.gz: 3fe76889766f1a2333a1cf46f15b9edc35742ff55f2abbc5afadf59e4222ee00
4
+ data.tar.gz: 4e92630e731a9b196415c69dbd647145fda7a76873e6c8f8a7afb738cb563692
5
5
  SHA512:
6
- metadata.gz: 9fd8d7ec4b66b06b94b53976886854548d27a1fc41faaf76b6fb994dbb1e58432c53be3a799eccbd23c9890723b8fab453e0375360a0f9dd981057097a672947
7
- data.tar.gz: 3d3172e5b4a6a290a34ce06867539307bb0ba283c3a25a7770f17c0bba40a37f7bd05a02c29028f4c2b2cef50d52816391c42a08e750981e4c631e9c51c36b34
6
+ metadata.gz: 551718de37d55ab2795370c873d310067e010877cfd915554cd34470fdcbd710c01b0afca5d50827e0098e33037bc3dc7f30147b6413c266932b189eaf31ccae
7
+ data.tar.gz: 01c916c086d25d62e1ce5c0e63d2455d082dc8da74c3ec000a66c1c915f9dd47b0db0499effc1bc306ac411f9e8dfc969e7bb2307d47ebc63101e06a48d6f0f1
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "cpee-instantiation"
3
- s.version = "1.0.13"
3
+ s.version = "1.0.14"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.license = "LGPL-3.0"
6
6
  s.summary = "Subprocess instantiation service for the cloud process execution engine (cpee.org)"
@@ -158,6 +158,19 @@ module CPEE
158
158
  ]
159
159
  end rescue nil
160
160
  end #}}}
161
+ def handle_attributes(cpee,instance,data) #{{{
162
+ if data && !data.empty?
163
+ content = XML::Smart.string('<attributes xmlns="http://cpee.org/ns/properties/2.0"/>')
164
+ JSON::parse(data).each do |k,v|
165
+ content.root.add(k,v)
166
+ end
167
+ srv = Riddl::Client.new(cpee, File.join(cpee,'?riddl-description'))
168
+ res = srv.resource("/#{instance}/properties/attributes/")
169
+ status, response = res.patch [
170
+ Riddl::Parameter::Complex.new('attributes','text/xml',content.to_s)
171
+ ]
172
+ end rescue nil
173
+ end #}}}
161
174
  end #}}}
162
175
 
163
176
  class InstantiateGit < Riddl::Implementation #{{{
@@ -179,9 +192,15 @@ module CPEE
179
192
  @status = 500
180
193
  else
181
194
  EM.defer do
182
- handle_data cpee, instance, @p[4]&.value if @p[4]&.name == 'init'
183
- handle_endpoints cpee, instance, @p[4]&.value if @p[4]&.name == 'endpoints'
184
- handle_endpoints cpee, instance, @p[5]&.value if @p[5]&.name == 'endpoints'
195
+ if x = @p.find{ |e| e.name == 'init' }&.value
196
+ handle_data cpee, instance, x
197
+ end
198
+ if x = @p.find{ |e| e.name == 'endpoints' }&.value
199
+ handle_endpoints cpee, instance, x
200
+ end
201
+ if x = @p.find{ |e| e.name == 'attributes' }&.value
202
+ handle_attributes cpee, instance, x
203
+ end
185
204
 
186
205
  handle_waiting cpee, instance, uuid, @p[0].value, selfurl, cblist
187
206
  handle_starting cpee, instance, @p[0].value
@@ -222,9 +241,15 @@ module CPEE
222
241
  @status = 500
223
242
  else
224
243
  EM.defer do
225
- handle_data cpee, instance, @p[2]&.value if @p[2]&.name == 'init'
226
- handle_endpoints cpee, instance, @p[2]&.value if @p[2]&.name == 'endpoints'
227
- handle_endpoints cpee, instance, @p[3]&.value if @p[3]&.name == 'endpoints'
244
+ if x = @p.find{ |e| e.name == 'init' }&.value
245
+ handle_data cpee, instance, x
246
+ end
247
+ if x = @p.find{ |e| e.name == 'endpoints' }&.value
248
+ handle_endpoints cpee, instance, x
249
+ end
250
+ if x = @p.find{ |e| e.name == 'attributes' }&.value
251
+ handle_attributes cpee, instance, x
252
+ end
228
253
 
229
254
  handle_waiting cpee, instance, uuid, @p[0].value, selfurl, cblist
230
255
  handle_starting cpee, instance, @p[0].value
@@ -33,6 +33,9 @@
33
33
  <optional>
34
34
  <parameter name="endpoints" type="string"/>
35
35
  </optional>
36
+ <optional>
37
+ <parameter name="attributes" type="string"/>
38
+ </optional>
36
39
  <optional>
37
40
  <parameter name="customization" type="string"/>
38
41
  </optional>
@@ -53,6 +56,9 @@
53
56
  <optional>
54
57
  <parameter name="endpoints" type="string"/>
55
58
  </optional>
59
+ <optional>
60
+ <parameter name="attributes" type="string"/>
61
+ </optional>
56
62
  <optional>
57
63
  <parameter name="customization" type="string"/>
58
64
  </optional>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee-instantiation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.13
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
8
8
  autorequire:
9
9
  bindir: tools
10
10
  cert_chain: []
11
- date: 2022-04-19 00:00:00.000000000 Z
11
+ date: 2022-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riddl
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.2.22
111
+ rubygems_version: 3.3.7
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Subprocess instantiation service for the cloud process execution engine (cpee.org)