losant_rest 1.4.2 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -0
  3. data/docs/_schemas.md +560 -25
  4. data/docs/application.md +77 -0
  5. data/docs/dashboard.md +1 -0
  6. data/docs/devices.md +1 -0
  7. data/docs/edgeDeployments.md +173 -0
  8. data/docs/flows.md +1 -0
  9. data/lib/losant_rest.rb +1 -0
  10. data/lib/losant_rest/application.rb +91 -0
  11. data/lib/losant_rest/client.rb +6 -2
  12. data/lib/losant_rest/dashboard.rb +2 -0
  13. data/lib/losant_rest/devices.rb +2 -0
  14. data/lib/losant_rest/edge_deployments.rb +234 -0
  15. data/lib/losant_rest/flows.rb +2 -0
  16. data/lib/losant_rest/version.rb +1 -1
  17. data/schemas/application.json +2 -2
  18. data/schemas/applicationApiTokenPost.json +7 -0
  19. data/schemas/applicationPatch.json +2 -2
  20. data/schemas/applicationPost.json +2 -2
  21. data/schemas/applications.json +2 -2
  22. data/schemas/authedDevice.json +2 -1
  23. data/schemas/dashboard.json +4 -0
  24. data/schemas/dashboardPatch.json +4 -0
  25. data/schemas/dashboardPost.json +4 -0
  26. data/schemas/dashboards.json +4 -0
  27. data/schemas/device.json +6 -1
  28. data/schemas/devicePatch.json +2 -1
  29. data/schemas/devicePost.json +2 -1
  30. data/schemas/deviceRecipe.json +2 -1
  31. data/schemas/deviceRecipePatch.json +2 -1
  32. data/schemas/deviceRecipePost.json +2 -1
  33. data/schemas/deviceRecipes.json +2 -1
  34. data/schemas/devices.json +37 -1
  35. data/schemas/edgeDeploymentRelease.json +50 -0
  36. data/schemas/edgeDeploymentRemove.json +25 -0
  37. data/schemas/edgeDeploymentReplace.json +29 -0
  38. data/schemas/edgeDeployments.json +152 -0
  39. data/schemas/flow.json +13 -0
  40. data/schemas/flowPatch.json +6 -0
  41. data/schemas/flowPost.json +13 -0
  42. data/schemas/flowVersion.json +6 -0
  43. data/schemas/flowVersionPost.json +6 -0
  44. data/schemas/flowVersions.json +6 -0
  45. data/schemas/flows.json +20 -0
  46. data/schemas/me.json +4 -0
  47. data/schemas/mePatch.json +4 -0
  48. data/schemas/solution.json +2 -2
  49. data/schemas/solutionUser.json +4 -0
  50. data/schemas/solutionUserPatch.json +4 -0
  51. data/schemas/solutionUserPost.json +4 -0
  52. data/schemas/solutionUsers.json +4 -0
  53. data/schemas/solutions.json +2 -2
  54. metadata +8 -2
@@ -76,7 +76,8 @@
76
76
  "standalone",
77
77
  "gateway",
78
78
  "peripheral",
79
- "floating"
79
+ "floating",
80
+ "edgeCompute"
80
81
  ]
81
82
  },
82
83
  "gatewayId": {
@@ -76,7 +76,8 @@
76
76
  "standalone",
77
77
  "gateway",
78
78
  "peripheral",
79
- "floating"
79
+ "floating",
80
+ "edgeCompute"
80
81
  ]
81
82
  },
82
83
  "gatewayId": {
@@ -103,7 +103,8 @@
103
103
  "standalone",
104
104
  "gateway",
105
105
  "peripheral",
106
- "floating"
106
+ "floating",
107
+ "edgeCompute"
107
108
  ]
108
109
  },
109
110
  "gatewayId": {
data/schemas/devices.json CHANGED
@@ -94,13 +94,18 @@
94
94
  "standalone",
95
95
  "gateway",
96
96
  "peripheral",
97
- "floating"
97
+ "floating",
98
+ "edgeCompute"
98
99
  ]
99
100
  },
100
101
  "gatewayId": {
101
102
  "type": "string",
102
103
  "pattern": "^[A-Fa-f\\d]{24}$"
103
104
  },
105
+ "edgeAgentVersion": {
106
+ "type": "string",
107
+ "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
108
+ },
104
109
  "connectionInfo": {
105
110
  "type": "object",
106
111
  "properties": {
@@ -151,6 +156,37 @@
151
156
  "applicationId": {
152
157
  "type": "string",
153
158
  "pattern": "^[A-Fa-f\\d]{24}$"
159
+ },
160
+ "deviceClass": {
161
+ "type": "string",
162
+ "enum": [
163
+ "standalone",
164
+ "gateway",
165
+ "peripheral",
166
+ "floating",
167
+ "edgeCompute"
168
+ ]
169
+ },
170
+ "tagFilter": {
171
+ "title": "Device Tag Filter",
172
+ "description": "Array of Tags for filtering devices. Tag keys and tag values are optional.",
173
+ "type": "array",
174
+ "items": {
175
+ "type": "object",
176
+ "properties": {
177
+ "key": {
178
+ "type": "string",
179
+ "pattern": "^[0-9a-zA-Z_-]{1,255}$"
180
+ },
181
+ "value": {
182
+ "type": "string",
183
+ "minLength": 1,
184
+ "maxLength": 255
185
+ }
186
+ },
187
+ "additionalProperties": false
188
+ },
189
+ "maxItems": 100
154
190
  }
155
191
  }
156
192
  }
@@ -0,0 +1,50 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "flowId": {
6
+ "type": "string",
7
+ "pattern": "^[A-Fa-f\\d]{24}$"
8
+ },
9
+ "version": {
10
+ "type": [
11
+ "string",
12
+ "null"
13
+ ],
14
+ "minLength": 1,
15
+ "maxLength": 255
16
+ },
17
+ "deviceIds": {
18
+ "type": "array",
19
+ "items": {
20
+ "type": "string",
21
+ "pattern": "^[A-Fa-f\\d]{24}$"
22
+ },
23
+ "maxItems": 1000
24
+ },
25
+ "deviceTags": {
26
+ "type": "array",
27
+ "items": {
28
+ "type": "object",
29
+ "properties": {
30
+ "key": {
31
+ "type": "string",
32
+ "pattern": "^[0-9a-zA-Z_-]{1,255}$"
33
+ },
34
+ "value": {
35
+ "type": "string",
36
+ "minLength": 1,
37
+ "maxLength": 255
38
+ }
39
+ },
40
+ "additionalProperties": false
41
+ },
42
+ "maxItems": 100
43
+ }
44
+ },
45
+ "additionalProperties": false,
46
+ "required": [
47
+ "flowId",
48
+ "version"
49
+ ]
50
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "flowId": {
6
+ "type": [
7
+ "string",
8
+ "null"
9
+ ],
10
+ "pattern": "^[A-Fa-f\\d]{24}$"
11
+ },
12
+ "deviceId": {
13
+ "type": [
14
+ "string",
15
+ "null"
16
+ ],
17
+ "pattern": "^[A-Fa-f\\d]{24}$"
18
+ }
19
+ },
20
+ "additionalProperties": false,
21
+ "required": [
22
+ "flowId",
23
+ "deviceId"
24
+ ]
25
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "flowId": {
6
+ "type": "string",
7
+ "pattern": "^[A-Fa-f\\d]{24}$"
8
+ },
9
+ "oldVersion": {
10
+ "type": "string",
11
+ "minLength": 1,
12
+ "maxLength": 255
13
+ },
14
+ "newVersion": {
15
+ "type": [
16
+ "string",
17
+ "null"
18
+ ],
19
+ "minLength": 1,
20
+ "maxLength": 255
21
+ }
22
+ },
23
+ "additionalProperties": false,
24
+ "required": [
25
+ "flowId",
26
+ "oldVersion",
27
+ "newVersion"
28
+ ]
29
+ }
@@ -0,0 +1,152 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "items": {
6
+ "type": "array",
7
+ "items": {
8
+ "title": "Edge Deployment",
9
+ "description": "Schema for a single deployment of an edge workflow to an edge device",
10
+ "type": "object",
11
+ "properties": {
12
+ "id": {
13
+ "type": "string",
14
+ "pattern": "^[A-Fa-f\\d]{24}$"
15
+ },
16
+ "edgeDeploymentId": {
17
+ "type": "string",
18
+ "pattern": "^[A-Fa-f\\d]{24}$"
19
+ },
20
+ "applicationId": {
21
+ "type": "string",
22
+ "pattern": "^[A-Fa-f\\d]{24}$"
23
+ },
24
+ "deviceId": {
25
+ "type": "string",
26
+ "pattern": "^[A-Fa-f\\d]{24}$"
27
+ },
28
+ "deviceName": {
29
+ "type": "string",
30
+ "minLength": 1,
31
+ "maxLength": 255
32
+ },
33
+ "flowId": {
34
+ "type": "string",
35
+ "pattern": "^[A-Fa-f\\d]{24}$"
36
+ },
37
+ "flowName": {
38
+ "type": "string",
39
+ "minLength": 1,
40
+ "maxLength": 255
41
+ },
42
+ "creationDate": {
43
+ "type": "string",
44
+ "format": "date-time"
45
+ },
46
+ "lastUpdated": {
47
+ "type": "string",
48
+ "format": "date-time"
49
+ },
50
+ "currentVersion": {
51
+ "type": [
52
+ "string",
53
+ "null"
54
+ ],
55
+ "minLength": 1,
56
+ "maxLength": 255
57
+ },
58
+ "desiredVersion": {
59
+ "type": [
60
+ "string",
61
+ "null"
62
+ ],
63
+ "minLength": 1,
64
+ "maxLength": 255
65
+ },
66
+ "logs": {
67
+ "type": "array",
68
+ "items": {
69
+ "type": "object",
70
+ "properties": {
71
+ "sourceType": {
72
+ "type": "string",
73
+ "enum": [
74
+ "flow",
75
+ "user",
76
+ "device",
77
+ "apiToken"
78
+ ]
79
+ },
80
+ "sourceId": {
81
+ "type": "string",
82
+ "pattern": "^[A-Fa-f\\d]{24}$"
83
+ },
84
+ "date": {
85
+ "type": "string",
86
+ "format": "date-time"
87
+ },
88
+ "changeType": {
89
+ "type": "string",
90
+ "enum": [
91
+ "current",
92
+ "desired"
93
+ ]
94
+ },
95
+ "newValue": {
96
+ "type": [
97
+ "string",
98
+ "null"
99
+ ],
100
+ "minLength": 1,
101
+ "maxLength": 255
102
+ },
103
+ "previousValue": {
104
+ "type": [
105
+ "string",
106
+ "null"
107
+ ],
108
+ "minLength": 1,
109
+ "maxLength": 255
110
+ },
111
+ "attemptedValue": {
112
+ "type": [
113
+ "string",
114
+ "null"
115
+ ],
116
+ "minLength": 1,
117
+ "maxLength": 255
118
+ },
119
+ "error": {
120
+ "type": "string"
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ },
128
+ "count": {
129
+ "type": "integer"
130
+ },
131
+ "totalCount": {
132
+ "type": "integer"
133
+ },
134
+ "applicationId": {
135
+ "type": "string",
136
+ "pattern": "^[A-Fa-f\\d]{24}$"
137
+ },
138
+ "deviceId": {
139
+ "type": "string",
140
+ "pattern": "^[A-Fa-f\\d]{24}$"
141
+ },
142
+ "flowId": {
143
+ "type": "string",
144
+ "pattern": "^[A-Fa-f\\d]{24}$"
145
+ },
146
+ "version": {
147
+ "type": "string",
148
+ "minLength": 1,
149
+ "maxLength": 255
150
+ }
151
+ }
152
+ }
data/schemas/flow.json CHANGED
@@ -38,6 +38,17 @@
38
38
  "type": "string",
39
39
  "pattern": "^[A-Fa-f\\d]{24}$"
40
40
  },
41
+ "minimumAgentVersion": {
42
+ "type": "string",
43
+ "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
44
+ },
45
+ "flowClass": {
46
+ "type": "string",
47
+ "enum": [
48
+ "cloud",
49
+ "edge"
50
+ ]
51
+ },
41
52
  "triggers": {
42
53
  "type": "array",
43
54
  "items": {
@@ -51,6 +62,7 @@
51
62
  "type": "string",
52
63
  "enum": [
53
64
  "dataTable",
65
+ "deviceCommand",
54
66
  "deviceId",
55
67
  "deviceIdConnect",
56
68
  "deviceIdDisconnect",
@@ -63,6 +75,7 @@
63
75
  "event",
64
76
  "integration",
65
77
  "mqttTopic",
78
+ "request",
66
79
  "timer",
67
80
  "virtualButton",
68
81
  "webhook"
@@ -38,6 +38,7 @@
38
38
  "type": "string",
39
39
  "enum": [
40
40
  "dataTable",
41
+ "deviceCommand",
41
42
  "deviceId",
42
43
  "deviceIdConnect",
43
44
  "deviceIdDisconnect",
@@ -50,6 +51,7 @@
50
51
  "event",
51
52
  "integration",
52
53
  "mqttTopic",
54
+ "request",
53
55
  "timer",
54
56
  "virtualButton",
55
57
  "webhook"
@@ -141,6 +143,10 @@
141
143
  "json"
142
144
  ]
143
145
  }
146
+ },
147
+ "minimumAgentVersion": {
148
+ "type": "string",
149
+ "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
144
150
  }
145
151
  },
146
152
  "additionalProperties": false
@@ -27,6 +27,7 @@
27
27
  "type": "string",
28
28
  "enum": [
29
29
  "dataTable",
30
+ "deviceCommand",
30
31
  "deviceId",
31
32
  "deviceIdConnect",
32
33
  "deviceIdDisconnect",
@@ -39,6 +40,7 @@
39
40
  "event",
40
41
  "integration",
41
42
  "mqttTopic",
43
+ "request",
42
44
  "timer",
43
45
  "virtualButton",
44
46
  "webhook"
@@ -130,6 +132,17 @@
130
132
  "json"
131
133
  ]
132
134
  }
135
+ },
136
+ "flowClass": {
137
+ "type": "string",
138
+ "enum": [
139
+ "cloud",
140
+ "edge"
141
+ ]
142
+ },
143
+ "minimumAgentVersion": {
144
+ "type": "string",
145
+ "pattern": "^(0|([1-9]\\d*))\\.(0|([1-9]\\d*))\\.(0|([1-9]\\d*))$"
133
146
  }
134
147
  },
135
148
  "additionalProperties": false,