MuranoCLI 3.2.0.beta.1 → 3.2.0.beta.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -1
- data/.trustme.plugin +137 -0
- data/.trustme.sh +217 -117
- data/.trustme.vim +9 -3
- data/Gemfile +9 -3
- data/MuranoCLI.gemspec +8 -5
- data/Rakefile +1 -0
- data/dockers/Dockerfile.2.2.9 +6 -3
- data/dockers/Dockerfile.2.3.6 +6 -3
- data/dockers/Dockerfile.2.4.3 +6 -3
- data/dockers/Dockerfile.2.5.0 +6 -3
- data/dockers/Dockerfile.GemRelease +10 -8
- data/dockers/Dockerfile.m4 +23 -5
- data/dockers/docker-test.sh +65 -28
- data/docs/completions/murano_completion-bash +751 -57
- data/docs/develop.rst +10 -9
- data/lib/MrMurano/AccountBase.rb +95 -6
- data/lib/MrMurano/Commander-Entry.rb +9 -4
- data/lib/MrMurano/Config-Migrate.rb +2 -0
- data/lib/MrMurano/Config.rb +94 -26
- data/lib/MrMurano/Content.rb +1 -1
- data/lib/MrMurano/Exchange.rb +77 -42
- data/lib/MrMurano/Gateway.rb +1 -1
- data/lib/MrMurano/HttpAuthed.rb +20 -7
- data/lib/MrMurano/Logs.rb +10 -1
- data/lib/MrMurano/ProjectFile.rb +1 -1
- data/lib/MrMurano/ReCommander.rb +129 -73
- data/lib/MrMurano/Solution-ServiceConfig.rb +18 -11
- data/lib/MrMurano/Solution-Services.rb +78 -50
- data/lib/MrMurano/Solution-Users.rb +1 -1
- data/lib/MrMurano/Solution.rb +13 -63
- data/lib/MrMurano/SyncUpDown-Core.rb +185 -77
- data/lib/MrMurano/SyncUpDown-Item.rb +29 -4
- data/lib/MrMurano/SyncUpDown.rb +11 -11
- data/lib/MrMurano/Webservice-Cors.rb +1 -1
- data/lib/MrMurano/Webservice-Endpoint.rb +28 -17
- data/lib/MrMurano/Webservice-File.rb +103 -43
- data/lib/MrMurano/commands/domain.rb +1 -0
- data/lib/MrMurano/commands/element.rb +585 -0
- data/lib/MrMurano/commands/exchange.rb +211 -204
- data/lib/MrMurano/commands/gb.rb +1 -0
- data/lib/MrMurano/commands/globals.rb +17 -7
- data/lib/MrMurano/commands/init.rb +115 -101
- data/lib/MrMurano/commands/keystore.rb +1 -1
- data/lib/MrMurano/commands/logs.rb +2 -1
- data/lib/MrMurano/commands/postgresql.rb +17 -7
- data/lib/MrMurano/commands/service.rb +572 -0
- data/lib/MrMurano/commands/show.rb +7 -3
- data/lib/MrMurano/commands/solution.rb +2 -1
- data/lib/MrMurano/commands/solution_picker.rb +31 -15
- data/lib/MrMurano/commands/status.rb +205 -169
- data/lib/MrMurano/commands/sync.rb +70 -38
- data/lib/MrMurano/commands/token.rb +59 -14
- data/lib/MrMurano/commands/usage.rb +1 -0
- data/lib/MrMurano/commands.rb +2 -0
- data/lib/MrMurano/hash.rb +91 -0
- data/lib/MrMurano/http.rb +55 -6
- data/lib/MrMurano/makePretty.rb +47 -0
- data/lib/MrMurano/optparse.rb +60 -45
- data/lib/MrMurano/variegated/TruthyFalsey.rb +48 -0
- data/lib/MrMurano/variegated/ruby_dig.rb +64 -0
- data/lib/MrMurano/verbosing.rb +113 -3
- data/lib/MrMurano/version.rb +1 -1
- data/spec/Account_spec.rb +34 -20
- data/spec/Business_spec.rb +12 -9
- data/spec/Config_spec.rb +7 -1
- data/spec/Content_spec.rb +17 -1
- data/spec/GatewayBase_spec.rb +5 -2
- data/spec/GatewayDevice_spec.rb +4 -2
- data/spec/GatewayResource_spec.rb +4 -1
- data/spec/GatewaySettings_spec.rb +4 -1
- data/spec/HttpAuthed_spec.rb +73 -0
- data/spec/Http_spec.rb +32 -35
- data/spec/ProjectFile_spec.rb +1 -1
- data/spec/Solution-ServiceConfig_spec.rb +4 -1
- data/spec/Solution-ServiceEventHandler_spec.rb +6 -3
- data/spec/Solution-ServiceModules_spec.rb +4 -1
- data/spec/Solution-UsersRoles_spec.rb +4 -1
- data/spec/Solution_spec.rb +4 -1
- data/spec/SyncUpDown_spec.rb +1 -1
- data/spec/Webservice-Cors_spec.rb +4 -1
- data/spec/Webservice-Endpoint_spec.rb +9 -6
- data/spec/Webservice-File_spec.rb +17 -4
- data/spec/Webservice-Setting_spec.rb +6 -2
- data/spec/_workspace.rb +2 -0
- data/spec/cmd_common.rb +42 -13
- data/spec/cmd_content_spec.rb +17 -7
- data/spec/cmd_device_spec.rb +1 -1
- data/spec/cmd_domain_spec.rb +2 -2
- data/spec/cmd_element_spec.rb +400 -0
- data/spec/cmd_exchange_spec.rb +2 -2
- data/spec/cmd_init_spec.rb +59 -25
- data/spec/cmd_keystore_spec.rb +6 -3
- data/spec/cmd_link_spec.rb +10 -5
- data/spec/cmd_logs_spec.rb +1 -1
- data/spec/cmd_setting_application_spec.rb +18 -15
- data/spec/cmd_setting_product_spec.rb +7 -7
- data/spec/cmd_status_spec.rb +27 -17
- data/spec/cmd_syncdown_application_spec.rb +30 -3
- data/spec/cmd_syncdown_both_spec.rb +72 -18
- data/spec/cmd_syncup_spec.rb +71 -5
- data/spec/cmd_token_spec.rb +2 -2
- data/spec/cmd_usage_spec.rb +2 -2
- data/spec/dry_run_formatter.rb +27 -0
- data/spec/fixtures/dumped_config +8 -0
- data/spec/fixtures/exchange_element/element-show.json +1 -0
- data/spec/fixtures/exchange_element/swagger-mur-6407__10k.yaml +282 -0
- data/spec/fixtures/exchange_element/swagger-mur-6407__20k.yaml +588 -0
- data/spec/variegated_TruthyFalsey_spec.rb +29 -0
- metadata +51 -25
@@ -0,0 +1,282 @@
|
|
1
|
+
swagger: "2.0"
|
2
|
+
|
3
|
+
################################################################################
|
4
|
+
# Service Metadata #
|
5
|
+
################################################################################
|
6
|
+
info:
|
7
|
+
version: "1.0"
|
8
|
+
title: Transformer
|
9
|
+
description: |
|
10
|
+
This service is for Transforming SignalData.
|
11
|
+
contact:
|
12
|
+
name: Exosite Exosite Exosite Exosite
|
13
|
+
email: exosite@exosite.com
|
14
|
+
|
15
|
+
################################################################################
|
16
|
+
# API Information #
|
17
|
+
################################################################################
|
18
|
+
|
19
|
+
# A hostname with a valid, signed, and active TSL certificate is required.
|
20
|
+
host: transformer-dev.hosted.exosite.io
|
21
|
+
basePath: /api/v1
|
22
|
+
schemes:
|
23
|
+
- https
|
24
|
+
consumes:
|
25
|
+
- application/json
|
26
|
+
produces:
|
27
|
+
- application/json
|
28
|
+
|
29
|
+
################################################################################
|
30
|
+
# Solution lifecycle Events #
|
31
|
+
################################################################################
|
32
|
+
# Following Operation should generally be restricted with "x-exosite-restricted: true"
|
33
|
+
x-exosite-init: createSolution # Triggered by Murano when this service is enabled in a solution
|
34
|
+
x-exosite-info: getSolution # Triggered by Murano to retrieve custom information about the service solution namespace
|
35
|
+
x-exosite-update: updateSolution # Triggered by Murano when the solution service configuration is updated
|
36
|
+
x-exosite-gc: delSolution # Triggered by Murano when the service is removed from a solution or if the solution is deleted
|
37
|
+
|
38
|
+
################################################################################
|
39
|
+
# Service Configuration Parameters #
|
40
|
+
################################################################################
|
41
|
+
x-exosite-config-parameters:
|
42
|
+
- name: maximumTTL
|
43
|
+
type: number
|
44
|
+
description: Maximum number of times a message can propagate through
|
45
|
+
required: true # Indicates this parameter is required during configuration
|
46
|
+
- name: authToken
|
47
|
+
type: string
|
48
|
+
description: This is a placeholder for a potential future feature.
|
49
|
+
required: true # the only option that works is true…
|
50
|
+
- name: eventURI
|
51
|
+
type: string
|
52
|
+
description: This is a placeholder for a potential future feature.
|
53
|
+
required: true # the only option that works is true…
|
54
|
+
|
55
|
+
################################################################################
|
56
|
+
# Operations #
|
57
|
+
################################################################################
|
58
|
+
paths:
|
59
|
+
/:
|
60
|
+
get:
|
61
|
+
description: Alive check
|
62
|
+
operationId: alive
|
63
|
+
x-exosite-restricted: true # Indicate that this operation cannot be called from user scripts
|
64
|
+
responses:
|
65
|
+
"200":
|
66
|
+
description: Solution successfully created
|
67
|
+
default:
|
68
|
+
description: Error
|
69
|
+
schema:
|
70
|
+
$ref: '#/definitions/ErrorResponse'
|
71
|
+
|
72
|
+
# Administration endpoint used by Murano solution lifecycle events
|
73
|
+
# Those operation uses the "x-exosite-restricted" to prevent the user to access them directly
|
74
|
+
/{solution_id}:
|
75
|
+
parameters:
|
76
|
+
- name: solution_id
|
77
|
+
x-exosite-from: solution_id # Indicate this value is injected from the user solution_id
|
78
|
+
x-exosite-restricted: true # Indicate the user cannot provide this parameter
|
79
|
+
type: string
|
80
|
+
in: path
|
81
|
+
description: The solution identifier. Set automatically.
|
82
|
+
required: true
|
83
|
+
post:
|
84
|
+
description: Used by Murano to create a solution namespace.
|
85
|
+
operationId: createSolution
|
86
|
+
x-exosite-restricted: true # Indicate that this operation cannot be called from user scripts
|
87
|
+
parameters:
|
88
|
+
- name: settings
|
89
|
+
in: body
|
90
|
+
description: The service settings for a solution.
|
91
|
+
required: true
|
92
|
+
schema:
|
93
|
+
$ref: "#/definitions/SolutionSettings"
|
94
|
+
responses:
|
95
|
+
"200":
|
96
|
+
description: Solution successfully created
|
97
|
+
default:
|
98
|
+
description: Error
|
99
|
+
schema:
|
100
|
+
$ref: '#/definitions/ErrorResponse'
|
101
|
+
get:
|
102
|
+
description: Used by Murano to get the solution settings.
|
103
|
+
operationId: getSolution
|
104
|
+
responses:
|
105
|
+
"200":
|
106
|
+
description: Solution settings
|
107
|
+
schema:
|
108
|
+
$ref: "#/definitions/SolutionInfo"
|
109
|
+
default:
|
110
|
+
description: Error
|
111
|
+
schema:
|
112
|
+
$ref: '#/definitions/ErrorResponse'
|
113
|
+
put:
|
114
|
+
description: Used by Murano to update the solution settings.
|
115
|
+
operationId: updateSolution
|
116
|
+
x-exosite-restricted: true
|
117
|
+
parameters:
|
118
|
+
- name: settings
|
119
|
+
in: body
|
120
|
+
description: The service settings for a solution.
|
121
|
+
required: true
|
122
|
+
schema:
|
123
|
+
$ref: "#/definitions/SolutionSettings"
|
124
|
+
responses:
|
125
|
+
"205":
|
126
|
+
description: Settings updated
|
127
|
+
default:
|
128
|
+
description: Error
|
129
|
+
schema:
|
130
|
+
$ref: '#/definitions/ErrorResponse'
|
131
|
+
delete:
|
132
|
+
description: Used by Murano to remove a solution and clean its namespace.
|
133
|
+
operationId: delSolution
|
134
|
+
x-exosite-restricted: true
|
135
|
+
responses:
|
136
|
+
"205":
|
137
|
+
description: Solution successfully removed.
|
138
|
+
default:
|
139
|
+
description: Error
|
140
|
+
schema:
|
141
|
+
$ref: '#/definitions/ErrorResponse'
|
142
|
+
|
143
|
+
# Service operations available from scripting
|
144
|
+
/{solution_id}/transform:
|
145
|
+
parameters:
|
146
|
+
- name: solution_id
|
147
|
+
type: string
|
148
|
+
in: path
|
149
|
+
description: The solution identifier. Set automatically by Murano at service call.
|
150
|
+
x-exosite-from: solution_id # Indicate this value is injected from the user solution_id
|
151
|
+
x-exosite-restricted: true # Indicate the user cannot provide this parameter
|
152
|
+
required: true
|
153
|
+
post:
|
154
|
+
description: Create Transform
|
155
|
+
operationId: create
|
156
|
+
x-exosite-example: |
|
157
|
+
local res = Transformer.create{
|
158
|
+
subscribe = {"topic.name"},
|
159
|
+
tags = {"asset-42"},
|
160
|
+
select = "value * 24"
|
161
|
+
}
|
162
|
+
-- res.id is the UUID assigned to the new transform.
|
163
|
+
|
164
|
+
parameters:
|
165
|
+
- name: body
|
166
|
+
in: body
|
167
|
+
description: The Transform to create.
|
168
|
+
required: true
|
169
|
+
schema:
|
170
|
+
$ref: "#/definitions/Transformation"
|
171
|
+
responses:
|
172
|
+
"200":
|
173
|
+
description: Transform successfully saved
|
174
|
+
schema:
|
175
|
+
type: object
|
176
|
+
description: Transformation Id Object
|
177
|
+
properties:
|
178
|
+
id:
|
179
|
+
description: Transform ID
|
180
|
+
type: string
|
181
|
+
default:
|
182
|
+
description: Error
|
183
|
+
schema:
|
184
|
+
$ref: '#/definitions/ErrorResponse'
|
185
|
+
get:
|
186
|
+
description: Retrieve Transform from the solution namespace.
|
187
|
+
operationId: list
|
188
|
+
x-exosite-example: |
|
189
|
+
|
190
|
+
-- list Transforms with all of a specified tag
|
191
|
+
tag1 = "lkj32lk3lkj3"
|
192
|
+
tag2 = "lkj32lk3xyds"
|
193
|
+
rule = Transformer.list({all={tag1, tag2}})
|
194
|
+
|
195
|
+
--------------------------------------------------
|
196
|
+
|
197
|
+
-- list Transforms with any of a specified tag
|
198
|
+
tag1 = "lkj32lk3lkj3"
|
199
|
+
tag2 = "lkj32lk3xyds"
|
200
|
+
rule = Transformer.list({any={tag1, tag2}})
|
201
|
+
|
202
|
+
--------------------------------------------------
|
203
|
+
|
204
|
+
-- list Transforms with any of a specified tag and all of another tag
|
205
|
+
tag1 = "lkj32lk3lkj3"
|
206
|
+
tag2 = "lkj32lk3xyds"
|
207
|
+
rule = Transformer.list({any={tag2, tag3}, all={tag1, tag4}})
|
208
|
+
-- That is, (tag1 && tag4 && (tag2 || tag3))
|
209
|
+
|
210
|
+
parameters:
|
211
|
+
- name: tags_all
|
212
|
+
in: query
|
213
|
+
description: If present, only return Transforms with all of the listed tags
|
214
|
+
type: array
|
215
|
+
items:
|
216
|
+
type: string
|
217
|
+
- name: tags_any
|
218
|
+
in: query
|
219
|
+
description: If present, only return Transforms with any of the listed tags
|
220
|
+
type: array
|
221
|
+
items:
|
222
|
+
type: string
|
223
|
+
- name: limit
|
224
|
+
in: query
|
225
|
+
description: Maximum results to return
|
226
|
+
type: integer
|
227
|
+
- name: offset
|
228
|
+
in: query
|
229
|
+
description: Offset into results
|
230
|
+
type: integer
|
231
|
+
responses:
|
232
|
+
"200":
|
233
|
+
description: Successfully returned the Transforms for this solution
|
234
|
+
schema:
|
235
|
+
$ref: "#/definitions/TransformationArray"
|
236
|
+
default:
|
237
|
+
description: Error
|
238
|
+
schema:
|
239
|
+
$ref: '#/definitions/ErrorResponse'
|
240
|
+
|
241
|
+
delete:
|
242
|
+
description: Delete multiple Transforms by matching tags
|
243
|
+
operationId: deleteByTags
|
244
|
+
x-exosite-example: |
|
245
|
+
|
246
|
+
-- delete Transform with all of a specified tag
|
247
|
+
tag1 = "lkj32lk3lkj3"
|
248
|
+
tag2 = "lkj32lk3xyds"
|
249
|
+
rule = Transformer.deleteByTags({all={tag1, tag2}})
|
250
|
+
|
251
|
+
--------------------------------------------------
|
252
|
+
|
253
|
+
-- delete Transform with any of a specified tag
|
254
|
+
tag1 = "lkj32lk3lkj3"
|
255
|
+
tag2 = "lkj32lk3xyds"
|
256
|
+
rule = Transformer.deleteByTags({any={tag1, tag2}})
|
257
|
+
|
258
|
+
--------------------------------------------------
|
259
|
+
|
260
|
+
-- delete Transform with any of a specified tag and all of another tag
|
261
|
+
tag1 = "lkj32lk3lkj3"
|
262
|
+
tag2 = "lkj32lk3xyds"
|
263
|
+
rule = Transformer.deleteByTags({any={tag2, tag3}, all={tag1, tag4}})
|
264
|
+
-- That is, (tag1 && tag4 && (tag2 || tag3))
|
265
|
+
parameters:
|
266
|
+
- name: all
|
267
|
+
in: query
|
268
|
+
description: If present, only delete Transforms with all listed tags
|
269
|
+
required: false
|
270
|
+
type: array
|
271
|
+
items:
|
272
|
+
type: string
|
273
|
+
- name: any
|
274
|
+
in: query
|
275
|
+
description: Delete Transforms with any listed tags
|
276
|
+
required: true
|
277
|
+
type: array
|
278
|
+
items:
|
279
|
+
type: string
|
280
|
+
responses:
|
281
|
+
"205":
|
282
|
+
description
|