MuranoCLI 3.2.1.pre.beta.6 → 3.2.1.pre.beta.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/HISTORY.md +10 -0
- data/MuranoCLI.gemspec +37 -6
- data/Rakefile +38 -11
- data/lib/MrMurano/commands/business.rb +0 -4
- data/lib/MrMurano/version.rb +1 -1
- metadata +2 -251
- data/dockers/Dockerfile.2.2.9 +0 -40
- data/dockers/Dockerfile.2.3.6 +0 -40
- data/dockers/Dockerfile.2.4.3 +0 -40
- data/dockers/Dockerfile.2.5.0 +0 -40
- data/dockers/Dockerfile.GemRelease +0 -49
- data/dockers/Dockerfile.m4 +0 -122
- data/dockers/README.rst +0 -362
- data/dockers/RELEASE.rst +0 -135
- data/dockers/docker-test.sh +0 -163
- data/dockers/gem-release.sh +0 -4
- data/docs/basic_example.rst +0 -436
- data/docs/ci/.trustme.plugin +0 -140
- data/docs/ci/.trustme.sh +0 -516
- data/docs/ci/.trustme.vim +0 -55
- data/docs/completions/murano_completion-bash +0 -4484
- data/docs/demo.md +0 -109
- data/docs/develop.rst +0 -392
- data/docs/release.rst +0 -295
- data/spec/Account-Passwords_spec.rb +0 -245
- data/spec/Account_spec.rb +0 -256
- data/spec/Business_spec.rb +0 -307
- data/spec/ConfigFile_spec.rb +0 -55
- data/spec/ConfigMigrate_spec.rb +0 -108
- data/spec/Config_spec.rb +0 -440
- data/spec/Content_spec.rb +0 -422
- data/spec/GatewayBase_spec.rb +0 -65
- data/spec/GatewayDevice_spec.rb +0 -403
- data/spec/GatewayResource_spec.rb +0 -283
- data/spec/GatewaySettings_spec.rb +0 -130
- data/spec/HttpAuthed_spec.rb +0 -87
- data/spec/Http_spec.rb +0 -220
- data/spec/MakePretties_spec.rb +0 -127
- data/spec/Mock_spec.rb +0 -62
- data/spec/ProjectFile_spec.rb +0 -381
- data/spec/Setting_spec.rb +0 -120
- data/spec/Solution-ServiceConfig_spec.rb +0 -272
- data/spec/Solution-ServiceEventHandler_spec.rb +0 -442
- data/spec/Solution-ServiceModules_spec.rb +0 -562
- data/spec/Solution-UsersRoles_spec.rb +0 -269
- data/spec/Solution_spec.rb +0 -140
- data/spec/SyncRoot_spec.rb +0 -111
- data/spec/SyncUpDown_spec.rb +0 -868
- data/spec/Verbosing_spec.rb +0 -332
- data/spec/Webservice-Cors_spec.rb +0 -225
- data/spec/Webservice-Endpoint_spec.rb +0 -650
- data/spec/Webservice-File_spec.rb +0 -282
- data/spec/Webservice-Setting_spec.rb +0 -105
- data/spec/_workspace.rb +0 -43
- data/spec/cmd_business_spec.rb +0 -64
- data/spec/cmd_common.rb +0 -507
- data/spec/cmd_config_spec.rb +0 -73
- data/spec/cmd_content_spec.rb +0 -109
- data/spec/cmd_cors_spec.rb +0 -54
- data/spec/cmd_device_spec.rb +0 -130
- data/spec/cmd_domain_spec.rb +0 -62
- data/spec/cmd_element_spec.rb +0 -401
- data/spec/cmd_exchange_spec.rb +0 -114
- data/spec/cmd_help_spec.rb +0 -72
- data/spec/cmd_init_spec.rb +0 -475
- data/spec/cmd_keystore_spec.rb +0 -97
- data/spec/cmd_link_spec.rb +0 -105
- data/spec/cmd_logs_spec.rb +0 -162
- data/spec/cmd_password_spec.rb +0 -64
- data/spec/cmd_setting_application_spec.rb +0 -300
- data/spec/cmd_setting_product_spec.rb +0 -246
- data/spec/cmd_status_spec.rb +0 -300
- data/spec/cmd_syncdown_application_spec.rb +0 -128
- data/spec/cmd_syncdown_both_spec.rb +0 -178
- data/spec/cmd_syncdown_unit_spec.rb +0 -861
- data/spec/cmd_syncup_spec.rb +0 -148
- data/spec/cmd_token_spec.rb +0 -53
- data/spec/cmd_usage_spec.rb +0 -79
- data/spec/dry_run_formatter.rb +0 -28
- data/spec/fixtures/.mrmuranorc +0 -9
- data/spec/fixtures/ProjectFiles/invalid.yaml +0 -9
- data/spec/fixtures/ProjectFiles/only_meta.yaml +0 -24
- data/spec/fixtures/ProjectFiles/with_routes.yaml +0 -27
- data/spec/fixtures/SolutionFiles/0.2.0.json +0 -20
- data/spec/fixtures/SolutionFiles/0.2.0_invalid.json +0 -18
- data/spec/fixtures/SolutionFiles/0.2.json +0 -21
- data/spec/fixtures/SolutionFiles/0.3.0.json +0 -20
- data/spec/fixtures/SolutionFiles/0.3.0_invalid.json +0 -19
- data/spec/fixtures/SolutionFiles/0.3.json +0 -20
- data/spec/fixtures/SolutionFiles/basic.json +0 -20
- data/spec/fixtures/SolutionFiles/secret.json +0 -6
- data/spec/fixtures/configfile +0 -9
- data/spec/fixtures/dumped_config +0 -57
- data/spec/fixtures/exchange_element/element-show.json +0 -1
- data/spec/fixtures/exchange_element/swagger-mur-6407__10k.yaml +0 -282
- data/spec/fixtures/exchange_element/swagger-mur-6407__20k.yaml +0 -588
- data/spec/fixtures/gateway_resource_files/resources.notyaml +0 -12
- data/spec/fixtures/gateway_resource_files/resources.yaml +0 -13
- data/spec/fixtures/gateway_resource_files/resources_invalid.yaml +0 -13
- data/spec/fixtures/mrmuranorc_deleted_bob +0 -6
- data/spec/fixtures/mrmuranorc_tool_bob +0 -3
- data/spec/fixtures/product_spec_files/example.exoline.spec.yaml +0 -116
- data/spec/fixtures/product_spec_files/example.murano.spec.yaml +0 -14
- data/spec/fixtures/product_spec_files/gwe.exoline.spec.yaml +0 -21
- data/spec/fixtures/product_spec_files/gwe.murano.spec.yaml +0 -16
- data/spec/fixtures/product_spec_files/lightbulb-no-state.yaml +0 -11
- data/spec/fixtures/product_spec_files/lightbulb.yaml +0 -21
- data/spec/fixtures/roles-three.yaml +0 -11
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value 0.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value 1.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value No.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value Yes.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value bob.webmock +0 -72
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value false.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value off.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value on STDIN.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value on.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a bool value true.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a json array blob with STDIN.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) a json array blob.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) an array.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting Writes (using Webservice.cors) appends an array.webmock +0 -98
- data/spec/fixtures/snapshots/murano application setting reads Webservice.cors to a file.webmock +0 -72
- data/spec/fixtures/snapshots/murano application setting reads Webservice.cors.webmock +0 -72
- data/spec/fixtures/snapshots/murano business list as json.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list as table.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list fewer fields.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list only ids.webmock +0 -27
- data/spec/fixtures/snapshots/murano business list output to file.webmock +0 -27
- data/spec/fixtures/snapshots/murano business without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Needs a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Reads a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Removes a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Sets a key.webmock +0 -9
- data/spec/fixtures/snapshots/murano config Sets a user key.webmock +0 -9
- data/spec/fixtures/snapshots/murano content life cycle.webmock +0 -144
- data/spec/fixtures/snapshots/murano cors sets CORS.webmock +0 -78
- data/spec/fixtures/snapshots/murano cors show CORS.webmock +0 -64
- data/spec/fixtures/snapshots/murano device activates.webmock +0 -86
- data/spec/fixtures/snapshots/murano device enables a batch.webmock +0 -76
- data/spec/fixtures/snapshots/murano device enables and lists.webmock +0 -78
- data/spec/fixtures/snapshots/murano device writes and reads.webmock +0 -136
- data/spec/fixtures/snapshots/murano domain show domain.webmock +0 -101
- data/spec/fixtures/snapshots/murano element edit unknown as unknown element.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano element show as csv.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as default-table.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as json.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as table truncate.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as table wrap.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show as yaml.webmock +0 -43
- data/spec/fixtures/snapshots/murano element show using ambiguous name.webmock +0 -43
- data/spec/fixtures/snapshots/murano element without project usage.webmock +0 -9
- data/spec/fixtures/snapshots/murano exchange with project list as json.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list as table.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list fewer fields.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list only ids.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list output to file.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange with project list purchase is already added ID.webmock +0 -83
- data/spec/fixtures/snapshots/murano exchange with project list purchase is ambiguous name.webmock +0 -59
- data/spec/fixtures/snapshots/murano exchange without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using commander as --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using commander no args.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using subshell no args.webmock +0 -9
- data/spec/fixtures/snapshots/murano help using subshell with --help.webmock +0 -9
- data/spec/fixtures/snapshots/murano init Won't init in HOME (gracefully).webmock +0 -9
- data/spec/fixtures/snapshots/murano init in empty directory with existing project.webmock +0 -201
- data/spec/fixtures/snapshots/murano init in empty directory without existing project.webmock +0 -193
- data/spec/fixtures/snapshots/murano init in existing project directory with ProjectFile.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory with SolutionFile 0.2.0.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory with SolutionFile 0.3.0.webmock +0 -213
- data/spec/fixtures/snapshots/murano init in existing project directory without ProjectFile.webmock +0 -213
- data/spec/fixtures/snapshots/murano keystore can call other commands.webmock +0 -108
- data/spec/fixtures/snapshots/murano keystore clearAll.webmock +0 -124
- data/spec/fixtures/snapshots/murano keystore deletes.webmock +0 -112
- data/spec/fixtures/snapshots/murano keystore gets.webmock +0 -96
- data/spec/fixtures/snapshots/murano keystore infos.webmock +0 -96
- data/spec/fixtures/snapshots/murano keystore lists.webmock +0 -96
- data/spec/fixtures/snapshots/murano link with project links and lists.webmock +0 -149
- data/spec/fixtures/snapshots/murano link with project unlinks.webmock +0 -165
- data/spec/fixtures/snapshots/murano link without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano link without project subshell vs inline using commander will not list.webmock +0 -27
- data/spec/fixtures/snapshots/murano link without project subshell vs inline using subshell will not list.webmock +0 -27
- data/spec/fixtures/snapshots/murano logs when project is setup tail log.webmock +0 -9
- data/spec/fixtures/snapshots/murano password Lists when no file.webmock +0 -9
- data/spec/fixtures/snapshots/murano password deletes a password.webmock +0 -9
- data/spec/fixtures/snapshots/murano password sets a password.webmock +0 -9
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a forced string value on STDIN.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a forced string value.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value fiftyHalf.webmock +0 -64
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value float 12.67.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value integer 12.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a number value on STDIN.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) a string value.webmock +0 -90
- data/spec/fixtures/snapshots/murano product setting Writes (using Device2.identity_format) merges into a dictionary.webmock +0 -90
- data/spec/fixtures/snapshots/murano single sync without ProjectFile syncdown.webmock +0 -322
- data/spec/fixtures/snapshots/murano status with ProjectFile status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status with Solutionfile 0.2.0 status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status with Solutionfile 0.3.0 status.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile matches file path.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile matches route.webmock +0 -153
- data/spec/fixtures/snapshots/murano status without ProjectFile status.webmock +0 -153
- data/spec/fixtures/snapshots/murano syncdown stubbed without ProjectFile syncdown.webmock +0 -151
- data/spec/fixtures/snapshots/murano syncdown without ProjectFile syncdown.webmock +0 -479
- data/spec/fixtures/snapshots/murano syncup without ProjectFile syncup.webmock +0 -357
- data/spec/fixtures/snapshots/murano token with project list as table.webmock +0 -9
- data/spec/fixtures/snapshots/murano token without project help.webmock +0 -9
- data/spec/fixtures/snapshots/murano usage show usage.webmock +0 -93
- data/spec/fixtures/syncable_conflict/services/devdata.lua +0 -18
- data/spec/fixtures/syncable_conflict/services/timers.lua +0 -4
- data/spec/fixtures/syncable_content/assets/icon.png +0 -0
- data/spec/fixtures/syncable_content/assets/index.html +0 -0
- data/spec/fixtures/syncable_content/assets/js/script.js +0 -0
- data/spec/fixtures/syncable_content/modules/table_util.lua +0 -58
- data/spec/fixtures/syncable_content/routes/manyRoutes.lua +0 -11
- data/spec/fixtures/syncable_content/routes/singleRoute.lua +0 -5
- data/spec/fixtures/websocket/README.rst +0 -110
- data/spec/fixtures/websocket/logs_blather.rb +0 -27
- data/spec/fixtures/websocket/logs_faker.rb +0 -153
- data/spec/fixtures/websocket/simple_connection.rb +0 -45
- data/spec/fixtures/websocket/simple_options.rb +0 -77
- data/spec/fixtures/websocket/simple_server.rb +0 -69
- data/spec/fixtures/websocket/wss-echo.rb +0 -48
- data/spec/fixtures/websocket/wss-fake-logs.rb +0 -20
- data/spec/spec_helper.rb +0 -131
- data/spec/variegated_TruthyFalsey_spec.rb +0 -29
- data/spec/webmock_snapshot.rb +0 -296
@@ -1,588 +0,0 @@
|
|
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: Deleted
|
283
|
-
default:
|
284
|
-
description: error
|
285
|
-
schema:
|
286
|
-
$ref: '#/definitions/ErrorResponse'
|
287
|
-
|
288
|
-
|
289
|
-
/{solution_id}/transform/{transform_id}:
|
290
|
-
parameters:
|
291
|
-
- name: solution_id
|
292
|
-
type: string
|
293
|
-
in: path
|
294
|
-
description: The solution identifier. Set automatically by Murano at service call.
|
295
|
-
x-exosite-from: solution_id # Indicate this value is injected from the user solution_id
|
296
|
-
x-exosite-restricted: true # Indicate the user cannot provide this parameter
|
297
|
-
required: true
|
298
|
-
- name: transform_id
|
299
|
-
type: string
|
300
|
-
in: path
|
301
|
-
description: The Transform id
|
302
|
-
required: true
|
303
|
-
get:
|
304
|
-
description: Retrieve a Transform
|
305
|
-
operationId: get
|
306
|
-
x-exosite-example: >
|
307
|
-
-- l
|
308
|
-
responses:
|
309
|
-
"200":
|
310
|
-
description: Successfully returned the Transform
|
311
|
-
schema:
|
312
|
-
$ref: "#/definitions/Transformation"
|
313
|
-
default:
|
314
|
-
description: Error
|
315
|
-
schema:
|
316
|
-
$ref: '#/definitions/ErrorResponse'
|
317
|
-
put:
|
318
|
-
description: Update a Transform
|
319
|
-
operationId: update
|
320
|
-
parameters:
|
321
|
-
- name: body
|
322
|
-
in: body
|
323
|
-
description: The updated Transform parameters.
|
324
|
-
required: true
|
325
|
-
schema:
|
326
|
-
$ref: "#/definitions/Transformation"
|
327
|
-
responses:
|
328
|
-
"205":
|
329
|
-
description: Transform updated
|
330
|
-
default:
|
331
|
-
description: Error
|
332
|
-
schema:
|
333
|
-
$ref: '#/definitions/ErrorResponse'
|
334
|
-
delete:
|
335
|
-
description: Delete a Transform
|
336
|
-
operationId: delete
|
337
|
-
responses:
|
338
|
-
"205":
|
339
|
-
description: Transform successfully removed.
|
340
|
-
default:
|
341
|
-
description: Error
|
342
|
-
schema:
|
343
|
-
$ref: '#/definitions/ErrorResponse'
|
344
|
-
|
345
|
-
/{solution_id}/process:
|
346
|
-
parameters:
|
347
|
-
- name: solution_id
|
348
|
-
type: string
|
349
|
-
in: path
|
350
|
-
description: The solution identifier. Set automatically by Murano at service call.
|
351
|
-
x-exosite-from: solution_id # Indicate this value is injected from the user solution_id
|
352
|
-
x-exosite-restricted: true # Indicate the user cannot provide this parameter
|
353
|
-
required: true
|
354
|
-
post:
|
355
|
-
description: |
|
356
|
-
Process an array of SignalData, likely into more of them
|
357
|
-
|
358
|
-
The `generated` property in the SignalData is used to find subscribers.
|
359
|
-
If there are no subscribed Transforms, then no new SignalData will be
|
360
|
-
produced.
|
361
|
-
|
362
|
-
Every found subscribed Transform has its JSONata executed on the
|
363
|
-
SignalData. If the result is defined, a new SignalData is generated by
|
364
|
-
the Transform’s `publishes` property. If the result is undefined, a new
|
365
|
-
SignalData is published from the `__Dropped`.
|
366
|
-
|
367
|
-
Generally, only debugging interfaces should subscribe to the `__Dropped`.
|
368
|
-
operationId: process
|
369
|
-
x-exosite-example: >
|
370
|
-
--#EVENT Scripts eventloop
|
371
|
-
-- Because private-exchange cannot generate events, we have to fake it.
|
372
|
-
-- For any internal object, if ttl > max-ttl then it is just dropped.
|
373
|
-
-- max-ttl is settable as service config
|
374
|
-
|
375
|
-
local res = Transformer.process{array=data.metricsArray}
|
376
|
-
if #res > 0 then
|
377
|
-
Scripts.trigger{event='Scripts.eventloop', mode='async', data={metricsArray=res}}
|
378
|
-
Scripts.trigger{event='Scripts.tsdbSubs', mode='async', data={metricsArray=res}}
|
379
|
-
-- Add triggers to subscribe other services. (RuleEngine, UserNotifier, ect)
|
380
|
-
|
381
|
-
end
|
382
|
-
parameters:
|
383
|
-
- name: body
|
384
|
-
in: body
|
385
|
-
description: Data to process
|
386
|
-
required: true
|
387
|
-
schema:
|
388
|
-
$ref: "#/definitions/SignalDataObjectArray"
|
389
|
-
responses:
|
390
|
-
"200":
|
391
|
-
description: Data successfully
|
392
|
-
schema:
|
393
|
-
$ref: "#/definitions/SignalDataArray"
|
394
|
-
default:
|
395
|
-
description: Error
|
396
|
-
schema:
|
397
|
-
$ref: '#/definitions/ErrorResponse'
|
398
|
-
|
399
|
-
################################################################################
|
400
|
-
# Definitions #
|
401
|
-
################################################################################
|
402
|
-
definitions:
|
403
|
-
SignalData:
|
404
|
-
type: object
|
405
|
-
description: A single instance of a piece of data inside a signal.
|
406
|
-
properties:
|
407
|
-
tags:
|
408
|
-
type: object
|
409
|
-
description: |
|
410
|
-
Tag-Value pairs to help ID the data. Used to tie the data back to an
|
411
|
-
Asset or Device or other things.
|
412
|
-
additionalProperties:
|
413
|
-
type: string
|
414
|
-
description: Value for a tag
|
415
|
-
minLength: 1
|
416
|
-
ts:
|
417
|
-
type: integer
|
418
|
-
description: Unix timestamp in microseconds of when the data originated
|
419
|
-
gts:
|
420
|
-
type: integer
|
421
|
-
description: Unix timestamp in microseconds of when this SignalData was generated
|
422
|
-
value:
|
423
|
-
type: [string, integer, object]
|
424
|
-
description: The value for this instance of data
|
425
|
-
origin:
|
426
|
-
type: string
|
427
|
-
description: The original Publishing ID
|
428
|
-
minLength: 1
|
429
|
-
generated:
|
430
|
-
type: string
|
431
|
-
description: The Publishing ID that created this SignalData.
|
432
|
-
minLength: 1
|
433
|
-
ttl:
|
434
|
-
type: integer
|
435
|
-
description: Value used to help prevent data from infinitely cycling
|
436
|
-
required:
|
437
|
-
- ts
|
438
|
-
- value
|
439
|
-
- origin
|
440
|
-
- generated
|
441
|
-
|
442
|
-
SignalDataArray:
|
443
|
-
type: array
|
444
|
-
description: Array of Signal Data
|
445
|
-
items:
|
446
|
-
$ref: '#/definitions/SignalData'
|
447
|
-
|
448
|
-
SignalDataObjectArray:
|
449
|
-
type: object
|
450
|
-
description: Workaround for Murano brokenness.
|
451
|
-
properties:
|
452
|
-
array:
|
453
|
-
$ref: '#/definitions/SignalDataArray'
|
454
|
-
|
455
|
-
Transformation:
|
456
|
-
type: object
|
457
|
-
description: Transformation definition
|
458
|
-
properties:
|
459
|
-
id:
|
460
|
-
type: string
|
461
|
-
readOnly: true
|
462
|
-
description: database assigned UUID for this Transformation
|
463
|
-
name:
|
464
|
-
type: string
|
465
|
-
description: User applied name to help identify
|
466
|
-
tags:
|
467
|
-
type: array
|
468
|
-
description: Array of tags to help identify this transformation
|
469
|
-
items:
|
470
|
-
type: string
|
471
|
-
description: Tag name
|
472
|
-
minLength: 1
|
473
|
-
subscribe:
|
474
|
-
type: array
|
475
|
-
description: Array of Publishing IDs to subscribe to
|
476
|
-
minItems: 1
|
477
|
-
items:
|
478
|
-
type: string
|
479
|
-
description: A Publishing ID to subscribe to.
|
480
|
-
minLength: 1
|
481
|
-
publishes:
|
482
|
-
type: string
|
483
|
-
description: |
|
484
|
-
Publishing ID to publish result to. If not defined, the transformations
|
485
|
-
uuid prefixed with 'Transform-' will be used.
|
486
|
-
minLength: 1
|
487
|
-
select:
|
488
|
-
type: string
|
489
|
-
minLength: 1
|
490
|
-
description: |
|
491
|
-
JSONata expression to transform the input SignalData into the result
|
492
|
-
value on the output SignalData.
|
493
|
-
|
494
|
-
http://docs.jsonata.org
|
495
|
-
|
496
|
-
In addition to the built-in functions, Transformer adds.
|
497
|
-
- $sub(array)
|
498
|
-
Subtract all elements in an array from each other.
|
499
|
-
- $deltas(array)
|
500
|
-
Create a new array that is the difference between each element of the source array.
|
501
|
-
- $enumerate(value, enums)
|
502
|
-
Convert a number into a string via lookups.
|
503
|
-
The enumeration is an array of arrays. The inner arrays having only two
|
504
|
-
elements. The first is a number, the second is a string. The outer
|
505
|
-
array is sorted by the numbers.
|
506
|
-
|
507
|
-
FE: [[10, 'critical low'], [35, 'low'], [55, 'high'], [70, 'critical high']]
|
508
|
-
|
509
|
-
The input value is matched less than each pair. When that’s true, then
|
510
|
-
the string for that pair is returned. If none of the values are
|
511
|
-
matched, the string of the last pair is returned.
|
512
|
-
|
513
|
-
additional_tags:
|
514
|
-
type: object
|
515
|
-
description: Any additional tags to add to the resulting SignalData
|
516
|
-
additionalProperties:
|
517
|
-
type: string
|
518
|
-
description: Value for a tag
|
519
|
-
minLength: 1
|
520
|
-
parameters:
|
521
|
-
type: object
|
522
|
-
description: |
|
523
|
-
Extra parameters for the JSONata expression that you want to keep seperated.
|
524
|
-
These will be in `$params`.
|
525
|
-
saving:
|
526
|
-
type: boolean
|
527
|
-
description: When true, the previous result is available in `$saved`
|
528
|
-
joining:
|
529
|
-
type: boolean
|
530
|
-
description: |
|
531
|
-
When true the previous SignalData for each subscribed topic will be
|
532
|
-
available in `$sources`
|
533
|
-
required:
|
534
|
-
- subscribe
|
535
|
-
- select
|
536
|
-
additionalProperties: false
|
537
|
-
|
538
|
-
TransformationArray:
|
539
|
-
type: array
|
540
|
-
description: Array of Transform definitions
|
541
|
-
items:
|
542
|
-
$ref: '#/definitions/Transformation'
|
543
|
-
|
544
|
-
SolutionSettings:
|
545
|
-
description: The service settings for a solution.
|
546
|
-
type: object
|
547
|
-
properties:
|
548
|
-
maximumTTL:
|
549
|
-
type: number
|
550
|
-
description: Maximum number of times a message can propagate through
|
551
|
-
minimum: 5
|
552
|
-
authToken:
|
553
|
-
type: string
|
554
|
-
description: This is a placeholder for a potential future feature.
|
555
|
-
eventURI:
|
556
|
-
type: string
|
557
|
-
description: This is a placeholder for a potential future feature.
|
558
|
-
required: [maximumTTL]
|
559
|
-
|
560
|
-
SolutionInfo:
|
561
|
-
description: The service settings & information for a solution.
|
562
|
-
type: object
|
563
|
-
properties:
|
564
|
-
maximumTTL:
|
565
|
-
type: number
|
566
|
-
description: Maximum number of times a message can propagate through
|
567
|
-
minimum: 5
|
568
|
-
authToken:
|
569
|
-
type: string
|
570
|
-
description: This is a placeholder for a potential future feature.
|
571
|
-
eventURI:
|
572
|
-
type: string
|
573
|
-
description: This is a placeholder for a potential future feature.
|
574
|
-
additionalInfo:
|
575
|
-
type: object
|
576
|
-
description: Some additional information from the service used for display purpose
|
577
|
-
|
578
|
-
ErrorResponse:
|
579
|
-
type: object
|
580
|
-
description: Error response
|
581
|
-
properties:
|
582
|
-
message:
|
583
|
-
type: string
|
584
|
-
description: Error message
|
585
|
-
name:
|
586
|
-
description: Error type
|
587
|
-
type: string
|
588
|
-
|