MuranoCLI 3.2.1.pre.beta.3 → 3.2.1.pre.beta.4

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: da25ca3b8f76c8441e11b57712ef6d7a536cf9c70a92e03822131e29dbaf4019
4
- data.tar.gz: 68dfdbefe7259168d61e30009e305a79d505cc503ae94b86b982947724d0c588
3
+ metadata.gz: 7812fe5f8ac5180e3f818638e4586b70fab15a2007e64bd536c46d6fe741441a
4
+ data.tar.gz: 6e5f89324f7568fc559efbf72d598c17b28da66626e40004e7a1de670afd34c3
5
5
  SHA512:
6
- metadata.gz: ccdbdbfa174682349eaef3f788d031fdc6f785ac4369cf798132dc6efdd0361c0dc61f5d3bf531d6775f2589630704c799bed9ecd9e38119e4f5ddd0fa7ed0db
7
- data.tar.gz: 83e03633309260f8e50eb35b6641a48474f89f4aac27d5229b5ac1b549bf3f1a1fa0795d799c89cb38f0f1c5431162bb21828d21f64235fd69d5a72367602925
6
+ metadata.gz: b05b44d56e78ae1a5db9e8bb4a74833b203a29a52662e396df9cf26569e9e18d173201b97c28a4b3ff7b3e34d3f82045f84af6b61d456b8adc586ca9015b61d5
7
+ data.tar.gz: '020758ee1312fbbc66a966b11c8b7c69c0401b67a421c591c58a5771fbcdd0f8f881d2a097ac82987450a7a526290c5812f6e186090e1e996dee1d7849ab0ea7'
@@ -128,17 +128,9 @@ module MrMurano
128
128
  # @return [String] The resource alias.
129
129
  attr_accessor :alias
130
130
 
131
- def reject_ephemeral!
132
- super.reject do |attr_key, _|
133
- [
134
- # Server-siders:
135
- # :format,
136
- # :unit,
137
- # :settable,
138
- # :allowed,
139
- # :alias,
140
- ].include? attr_key
141
- end
131
+ def reject_ephemeral
132
+ # All attrs exist on server, so nothing to remove.
133
+ super
142
134
  end
143
135
  end
144
136
 
@@ -84,7 +84,7 @@ module MrMurano
84
84
  script = config_vars_decode(script)
85
85
 
86
86
  name = mkname(thereitem)
87
- req_body = thereitem.to_h.merge(
87
+ req_body = thereitem.reject_ephemeral.to_h.merge(
88
88
  solution_id: @api_id,
89
89
  script: script,
90
90
  alias: mkalias(thereitem),
@@ -286,21 +286,23 @@ module MrMurano
286
286
 
287
287
  # What Murano calls "Modules". Snippets of Lua code.
288
288
  class Module < ServiceBase
289
- # Module Specific details on an Item
289
+ # Module Specific details on an Item.
290
290
  class ModuleItem < Item
291
- # @return [String] Internal Alias name
291
+ # @return [String] Internal Alias name.
292
292
  attr_accessor :alias
293
- # @return [String] Timestamp when this was created.
293
+ # @return [String] Timestamp when this item was created.
294
294
  attr_accessor :created_at
295
295
  # @return [String] The application solution's ID.
296
296
  attr_accessor :solution_id
297
297
 
298
- def reject_ephemeral!
298
+ def reject_ephemeral
299
299
  super.reject do |attr_key, _|
300
300
  [
301
- :alias,
301
+ # Writeable platform properties:
302
+ # :alias,
303
+ # :solution_id,
304
+ # Read-only platform properties:
302
305
  :created_at,
303
- :solution_id,
304
306
  ].include? attr_key
305
307
  end
306
308
  end
@@ -393,10 +395,12 @@ module MrMurano
393
395
  class EventHandler < ServiceBase
394
396
  # EventHandler Specific details on an Item
395
397
  class EventHandlerItem < Item
398
+ # Already part of Item:
399
+ # :id
400
+ # :name
401
+ # :updated_at
396
402
  # @return [String] Internal Alias name
397
403
  attr_accessor :alias
398
- # @return [String] Timestamp when this was updated.
399
- attr_accessor :updated_at
400
404
  # @return [String] Timestamp when this was created.
401
405
  attr_accessor :created_at
402
406
  # @return [String] The soln's product.id or application.id (Murano's api_id).
@@ -418,19 +422,20 @@ module MrMurano
418
422
  # @return [Boolean] True if a service that should not be deleted remotely.
419
423
  attr_accessor :undeletable
420
424
 
421
- def reject_ephemeral!
425
+ def reject_ephemeral
422
426
  super.reject do |attr_key, attr_val|
423
427
  [
424
- # Server-siders:
428
+ # Writeable platform properties:
425
429
  # :alias,
426
- # :service,
427
430
  # :event,
431
+ # :service,
432
+ # :solution_id,
428
433
  # :type,
429
- :updated_at,
434
+ # Read-only platform properties:
430
435
  :created_at,
431
- :solution_id,
432
- :svc_alias,
436
+ # Local-only attrs:
433
437
  :phantom,
438
+ :svc_alias,
434
439
  :undeletable,
435
440
  ].include?(attr_key) || ((attr_key == :type) && (attr_val.nil?))
436
441
  end
@@ -158,6 +158,7 @@ module MrMurano
158
158
  warning %(Updating Users is not yet implemented.)
159
159
  # post does work if the :password field is set.
160
160
  return unless upload_item_allowed(local)
161
+ # TODO: ...implement.
161
162
  end
162
163
 
163
164
  def synckey(item)
@@ -60,19 +60,19 @@ module MrMurano
60
60
  end
61
61
  todel.select { |item| item[:phantom] }.each do |item|
62
62
  syncup_item(item, options, :delete, 'Clearing') do |aitem|
63
- remove_or_clear(aitem[itemkey], aitem.reject_ephemeral!, true)
63
+ remove_or_clear(aitem[itemkey], aitem, true)
64
64
  num_synced += 1
65
65
  end
66
66
  end
67
67
  toadd.each do |item|
68
68
  syncup_item(item, options, :create, 'Adding') do |aitem|
69
- upload(aitem[:local_path], aitem.reject_ephemeral!, false)
69
+ upload(aitem[:local_path], aitem, false)
70
70
  num_synced += 1
71
71
  end
72
72
  end
73
73
  tomod.each do |item|
74
74
  syncup_item(item, options, :update, 'Updating') do |aitem|
75
- upload(aitem[:local_path], aitem.reject_ephemeral!, true)
75
+ upload(aitem[:local_path], aitem, true)
76
76
  num_synced += 1
77
77
  end
78
78
  end
@@ -20,7 +20,8 @@ module MrMurano
20
20
  attr_accessor :name
21
21
  # @return [Pathname] Where this item lives.
22
22
  attr_accessor :local_path
23
- # FIXME/EXPLAIN: ??? what is this?
23
+ # Read-only platform UUID, used to uniquely identify items.
24
+ # See also writable :alias property available on some items.
24
25
  attr_accessor :id
25
26
  # @return [String] The Lua code for this item. (not all items use this.)
26
27
  attr_accessor :script
@@ -156,23 +157,25 @@ module MrMurano
156
157
  end
157
158
 
158
159
  # Scrub local, non-BizAPI/Pegasus attrs from Item (before uploading).
159
- def reject_ephemeral!
160
+ def reject_ephemeral
160
161
  reject do |attr_key, _|
161
162
  [
162
- # Server-siders:
163
+ # Writeable platform properties:
163
164
  # :name,
164
165
  # :script,
165
- :local_path,
166
+ # Read-only platform properties:
166
167
  :id,
168
+ :updated_at,
169
+ # Local-only attrs:
170
+ :diff,
171
+ :dup_count,
172
+ :header,
167
173
  :line_beg,
168
174
  :line_end,
169
- :header,
170
- :diff,
175
+ :local_path,
171
176
  :selected,
172
177
  :synckey,
173
178
  :synctype,
174
- :updated_at,
175
- :dup_count,
176
179
  ].include? attr_key
177
180
  end
178
181
  end
@@ -29,15 +29,9 @@ module MrMurano
29
29
  # the server, so the code actually indirectly sees it in `def []=`.
30
30
  attr_accessor :use_basic_auth
31
31
 
32
- def reject_ephemeral!
33
- super.reject do |attr_key, _|
34
- [
35
- # Server-siders:
36
- # :method,
37
- # :path,
38
- # :content_type,
39
- ].include? attr_key
40
- end
32
+ def reject_ephemeral
33
+ # All attrs exist on server, so nothing to remove.
34
+ super
41
35
  end
42
36
  end
43
37
 
@@ -139,10 +133,11 @@ module MrMurano
139
133
  remote[:script] = script
140
134
  end
141
135
  limitkeys = [:method, :path, :script, :content_type, @itemkey]
142
- remote = remote.to_h.select { |k, _v| limitkeys.include? k }
143
- if remote.key? @itemkey
144
- return unless upload_item_allowed(remote[@itemkey])
145
- put('/' + remote[@itemkey], remote) do |request, http|
136
+ itemkey = remote[@itemkey]
137
+ remote = remote.reject_ephemeral.to_h.select { |k, _v| limitkeys.include? k }
138
+ if !itemkey.nil?
139
+ return unless upload_item_allowed(itemkey)
140
+ put('/' + itemkey, remote) do |request, http|
146
141
  response = http.request(request)
147
142
  case response
148
143
  when Net::HTTPSuccess
@@ -157,7 +152,6 @@ module MrMurano
157
152
  end
158
153
  else
159
154
  verbose "\tNo itemkey, creating"
160
- #return unless upload_item_allowed(remote)
161
155
  return unless upload_item_allowed(local)
162
156
  post('', remote)
163
157
  end
@@ -28,24 +28,26 @@ module MrMurano
28
28
  attr_accessor :path
29
29
  # @return [String] The MIME-Type for this content
30
30
  attr_accessor :mime_type
31
- # @return [String] Checksum for the content.
31
+ # @return [String] Checksum for the content, returned on GET.
32
+ # EXPLAIN/2018-07-30: (lb): How does `checksum` relate to `md5`?
33
+ # 1. The asset service Swagger, at
34
+ # pegasus_api/services/asset.yaml
35
+ # suggests that `md5` is only returned on
36
+ # GET /asset/{solution_id}/store/{path}:
37
+ # 2. The Gateway service Swagger, at
38
+ # pegasus_api/services/webservice.yaml
39
+ # suggest that `checksum` is a CORS object (a typo?) returned on
40
+ # GET /{solution_id}/file
41
+ # (lb): Which leaves me very confused.
32
42
  attr_accessor :checksum
33
- # @return [String] MD5 checksum of the stored file. (Same as :checksum.)
43
+ # @return [String] MD5 checksum of the stored file. (See also :checksum.)
34
44
  attr_accessor :md5
35
45
  # @return [Integer] Size in bytes of the stored file.
36
46
  attr_accessor :size
37
47
 
38
- def reject_ephemeral!
39
- super.reject do |attr_key, _|
40
- [
41
- # Server-siders:
42
- # :path,
43
- # :mime_type,
44
- :checksum,
45
- :md5,
46
- :size,
47
- ].include? attr_key
48
- end
48
+ def reject_ephemeral
49
+ # All attrs exist on server, so nothing to remove.
50
+ super
49
51
  end
50
52
  end
51
53
 
@@ -26,7 +26,7 @@ module MrMurano
26
26
  # '3.0.0-beta.2' is changed to '3.0.0.pre.beta.2'
27
27
  # which breaks our build (which expects the version to match herein).
28
28
  # So stick to using the '.pre.X' syntax, which ruby/gems knows.
29
- VERSION = '3.2.1.pre.beta.3'
29
+ VERSION = '3.2.1.pre.beta.4'
30
30
  EXE_NAME = File.basename($PROGRAM_NAME)
31
31
  SIGN_UP_URL = 'https://exosite.com/signup/'
32
32
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MuranoCLI
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1.pre.beta.3
4
+ version: 3.2.1.pre.beta.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Conrad Tadpol Tilstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-26 00:00:00.000000000 Z
11
+ date: 2018-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: certified