losant_rest 1.8.7 → 1.8.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/_schemas.md +38618 -21196
- data/docs/application.md +76 -0
- data/docs/auth.md +0 -36
- data/docs/dashboards.md +1 -1
- data/docs/dataTableRows.md +2 -2
- data/docs/device.md +1 -0
- data/docs/events.md +81 -0
- data/docs/file.md +43 -0
- data/docs/me.md +50 -13
- data/lib/losant_rest.rb +0 -4
- data/lib/losant_rest/application.rb +90 -0
- data/lib/losant_rest/application_api_token.rb +2 -0
- data/lib/losant_rest/application_api_tokens.rb +2 -0
- data/lib/losant_rest/application_certificate.rb +2 -0
- data/lib/losant_rest/application_certificate_authorities.rb +2 -0
- data/lib/losant_rest/application_certificate_authority.rb +2 -0
- data/lib/losant_rest/application_certificates.rb +2 -0
- data/lib/losant_rest/application_key.rb +2 -0
- data/lib/losant_rest/application_keys.rb +2 -0
- data/lib/losant_rest/applications.rb +2 -0
- data/lib/losant_rest/audit_log.rb +2 -0
- data/lib/losant_rest/audit_logs.rb +2 -0
- data/lib/losant_rest/auth.rb +2 -42
- data/lib/losant_rest/client.rb +2 -18
- data/lib/losant_rest/dashboard.rb +2 -0
- data/lib/losant_rest/dashboards.rb +3 -1
- data/lib/losant_rest/data.rb +2 -0
- data/lib/losant_rest/data_table.rb +2 -0
- data/lib/losant_rest/data_table_row.rb +2 -0
- data/lib/losant_rest/data_table_rows.rb +4 -2
- data/lib/losant_rest/data_tables.rb +2 -0
- data/lib/losant_rest/device.rb +4 -0
- data/lib/losant_rest/device_recipe.rb +2 -0
- data/lib/losant_rest/device_recipes.rb +2 -0
- data/lib/losant_rest/devices.rb +2 -0
- data/lib/losant_rest/edge_deployments.rb +2 -0
- data/lib/losant_rest/event.rb +2 -0
- data/lib/losant_rest/events.rb +103 -0
- data/lib/losant_rest/experience.rb +2 -0
- data/lib/losant_rest/experience_domain.rb +2 -0
- data/lib/losant_rest/experience_domains.rb +2 -0
- data/lib/losant_rest/experience_endpoint.rb +2 -0
- data/lib/losant_rest/experience_endpoints.rb +2 -0
- data/lib/losant_rest/experience_group.rb +2 -0
- data/lib/losant_rest/experience_groups.rb +2 -0
- data/lib/losant_rest/experience_slug.rb +2 -0
- data/lib/losant_rest/experience_slugs.rb +2 -0
- data/lib/losant_rest/experience_user.rb +2 -0
- data/lib/losant_rest/experience_users.rb +2 -0
- data/lib/losant_rest/experience_version.rb +2 -0
- data/lib/losant_rest/experience_versions.rb +2 -0
- data/lib/losant_rest/experience_view.rb +2 -0
- data/lib/losant_rest/experience_views.rb +2 -0
- data/lib/losant_rest/file.rb +2 -0
- data/lib/losant_rest/files.rb +2 -0
- data/lib/losant_rest/flow.rb +2 -0
- data/lib/losant_rest/flow_version.rb +2 -0
- data/lib/losant_rest/flow_versions.rb +2 -0
- data/lib/losant_rest/flows.rb +2 -0
- data/lib/losant_rest/integration.rb +2 -0
- data/lib/losant_rest/integrations.rb +2 -0
- data/lib/losant_rest/me.rb +57 -13
- data/lib/losant_rest/notebook.rb +2 -0
- data/lib/losant_rest/notebooks.rb +2 -0
- data/lib/losant_rest/org.rb +2 -0
- data/lib/losant_rest/org_invites.rb +2 -0
- data/lib/losant_rest/orgs.rb +2 -0
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest/webhook.rb +2 -0
- data/lib/losant_rest/webhooks.rb +2 -0
- data/schemas/advancedEventQuery.json +817 -0
- data/schemas/{dataTableQuery.json → advancedQuery.json} +5 -4
- data/schemas/apiTokens.json +4 -1
- data/schemas/application.json +30 -1
- data/schemas/applicationApiTokenPost.json +5 -0
- data/schemas/applicationCertificate.json +29 -1
- data/schemas/applicationCertificateAuthorities.json +36 -3
- data/schemas/applicationCertificateAuthority.json +32 -2
- data/schemas/applicationCertificateAuthorityPatch.json +3 -1
- data/schemas/applicationCertificateAuthorityPost.json +3 -1
- data/schemas/applicationCertificatePatch.json +3 -1
- data/schemas/applicationCertificatePost.json +3 -1
- data/schemas/applicationCertificates.json +33 -2
- data/schemas/applicationKeys.json +4 -1
- data/schemas/applicationPatch.json +28 -0
- data/schemas/applicationPost.json +28 -0
- data/schemas/applications.json +34 -2
- data/schemas/auditLog.json +0 -3
- data/schemas/auditLogFilter.json +0 -3
- data/schemas/auditLogs.json +4 -4
- data/schemas/authedDevice.json +7 -0
- data/schemas/dashboard.json +3970 -72
- data/schemas/dashboardPatch.json +3969 -72
- data/schemas/dashboardPost.json +3969 -72
- data/schemas/dashboardSendReport.json +4 -0
- data/schemas/dashboardUpdateEvents.json +46 -0
- data/schemas/dashboards.json +3974 -73
- data/schemas/dataTableRows.json +4 -1
- data/schemas/dataTableRowsExport.json +11 -7
- data/schemas/dataTables.json +4 -1
- data/schemas/deviceRecipes.json +4 -1
- data/schemas/devices.json +4 -1
- data/schemas/event.json +19 -2
- data/schemas/eventPost.json +0 -1
- data/schemas/eventTagsSummary.json +28 -0
- data/schemas/events.json +841 -3
- data/schemas/eventsDeleted.json +9 -0
- data/schemas/eventsExport.json +830 -0
- data/schemas/experienceDomain.json +6 -2
- data/schemas/experienceDomainPatch.json +14 -10
- data/schemas/experienceDomainPost.json +8 -4
- data/schemas/experienceDomains.json +6 -2
- data/schemas/experienceEndpoints.json +4 -1
- data/schemas/experienceGroup.json +2 -2
- data/schemas/experienceGroupPatch.json +2 -2
- data/schemas/experienceGroupPost.json +2 -2
- data/schemas/experienceGroups.json +6 -3
- data/schemas/experienceSlugPatch.json +2 -2
- data/schemas/experienceSlugPost.json +2 -2
- data/schemas/experienceUsers.json +4 -1
- data/schemas/experienceViews.json +4 -1
- data/schemas/files.json +4 -1
- data/schemas/flow.json +4 -0
- data/schemas/flowPatch.json +6 -2
- data/schemas/flowPost.json +4 -0
- data/schemas/flowVersion.json +8 -0
- data/schemas/flowVersionPost.json +4 -0
- data/schemas/flowVersions.json +12 -1
- data/schemas/flows.json +8 -1
- data/schemas/flowsImportPost.json +10 -2
- data/schemas/flowsImportResult.json +12 -0
- data/schemas/githubLogin.json +6 -15
- data/schemas/integrations.json +4 -1
- data/schemas/notebooks.json +4 -1
- data/schemas/org.json +2 -4
- data/schemas/orgPatch.json +2 -1
- data/schemas/orgPost.json +2 -1
- data/schemas/orgs.json +6 -5
- data/schemas/passwordResetFinish.json +0 -4
- data/schemas/passwordResetInput.json +0 -4
- data/schemas/resourceTransfer.json +0 -8
- data/schemas/userCredentials.json +6 -15
- data/schemas/userPost.json +6 -15
- data/schemas/webhooks.json +4 -1
- data/test/basic_test.rb +15 -0
- metadata +8 -23
- data/docs/solution.md +0 -133
- data/docs/solutionUser.md +0 -139
- data/docs/solutionUsers.md +0 -96
- data/docs/solutions.md +0 -91
- data/lib/losant_rest/solution.rb +0 -174
- data/lib/losant_rest/solution_user.rb +0 -180
- data/lib/losant_rest/solution_users.rb +0 -138
- data/lib/losant_rest/solutions.rb +0 -134
- data/schemas/authedSolutionUser.json +0 -18
- data/schemas/fileUploadPostResp.json +0 -109
- data/schemas/solution.json +0 -76
- data/schemas/solutionMe.json +0 -150
- data/schemas/solutionPatch.json +0 -48
- data/schemas/solutionPost.json +0 -52
- data/schemas/solutionUser.json +0 -103
- data/schemas/solutionUserCredentials.json +0 -34
- data/schemas/solutionUserPatch.json +0 -74
- data/schemas/solutionUserPost.json +0 -80
- data/schemas/solutionUsers.json +0 -149
- data/schemas/solutions.json +0 -118
data/lib/losant_rest.rb
CHANGED
@@ -79,10 +79,6 @@ require_relative "losant_rest/notebooks"
|
|
79
79
|
require_relative "losant_rest/org"
|
80
80
|
require_relative "losant_rest/org_invites"
|
81
81
|
require_relative "losant_rest/orgs"
|
82
|
-
require_relative "losant_rest/solution"
|
83
|
-
require_relative "losant_rest/solution_user"
|
84
|
-
require_relative "losant_rest/solution_users"
|
85
|
-
require_relative "losant_rest/solutions"
|
86
82
|
require_relative "losant_rest/webhook"
|
87
83
|
require_relative "losant_rest/webhooks"
|
88
84
|
require_relative "losant_rest/client"
|
@@ -20,6 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "json"
|
24
|
+
|
23
25
|
module LosantRest
|
24
26
|
|
25
27
|
# Class containing all the actions for the Application Resource
|
@@ -164,6 +166,94 @@ module LosantRest
|
|
164
166
|
body: body)
|
165
167
|
end
|
166
168
|
|
169
|
+
# Returns success when a job has been enqueued to archive all selected data tables
|
170
|
+
#
|
171
|
+
# Authentication:
|
172
|
+
# The client must be configured with a valid api
|
173
|
+
# access token to call this action. The token
|
174
|
+
# must include at least one of the following scopes:
|
175
|
+
# all.Application, all.Organization, all.User, application.*, or application.fullDataTablesArchive.
|
176
|
+
#
|
177
|
+
# Parameters:
|
178
|
+
# * {string} applicationId - ID of the associated application
|
179
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
180
|
+
# * {boolean} _actions - Return resource actions in response
|
181
|
+
# * {boolean} _links - Return resource link in response
|
182
|
+
# * {boolean} _embedded - Return embedded resources in response
|
183
|
+
#
|
184
|
+
# Responses:
|
185
|
+
# * 200 - Enqueued a job to archive all selected data tables of this application archive location (https://api.losant.com/#/definitions/success)
|
186
|
+
#
|
187
|
+
# Errors:
|
188
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
189
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
190
|
+
def full_data_tables_archive(params = {})
|
191
|
+
params = Utils.symbolize_hash_keys(params)
|
192
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
193
|
+
headers = {}
|
194
|
+
body = nil
|
195
|
+
|
196
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
197
|
+
|
198
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
199
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
200
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
201
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
202
|
+
|
203
|
+
path = "/applications/#{params[:applicationId]}/fullDataTablesArchive"
|
204
|
+
|
205
|
+
@client.request(
|
206
|
+
method: :get,
|
207
|
+
path: path,
|
208
|
+
query: query_params,
|
209
|
+
headers: headers,
|
210
|
+
body: body)
|
211
|
+
end
|
212
|
+
|
213
|
+
# Returns success when a job has been enqueued to archive all current events
|
214
|
+
#
|
215
|
+
# Authentication:
|
216
|
+
# The client must be configured with a valid api
|
217
|
+
# access token to call this action. The token
|
218
|
+
# must include at least one of the following scopes:
|
219
|
+
# all.Application, all.Organization, all.User, application.*, or application.fullEventsArchive.
|
220
|
+
#
|
221
|
+
# Parameters:
|
222
|
+
# * {string} applicationId - ID of the associated application
|
223
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
224
|
+
# * {boolean} _actions - Return resource actions in response
|
225
|
+
# * {boolean} _links - Return resource link in response
|
226
|
+
# * {boolean} _embedded - Return embedded resources in response
|
227
|
+
#
|
228
|
+
# Responses:
|
229
|
+
# * 200 - Enqueued a job to archive all events to this application archive location (https://api.losant.com/#/definitions/success)
|
230
|
+
#
|
231
|
+
# Errors:
|
232
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
233
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
234
|
+
def full_events_archive(params = {})
|
235
|
+
params = Utils.symbolize_hash_keys(params)
|
236
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
237
|
+
headers = {}
|
238
|
+
body = nil
|
239
|
+
|
240
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
241
|
+
|
242
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
243
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
244
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
245
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
246
|
+
|
247
|
+
path = "/applications/#{params[:applicationId]}/fullEventsArchive"
|
248
|
+
|
249
|
+
@client.request(
|
250
|
+
method: :get,
|
251
|
+
path: path,
|
252
|
+
query: query_params,
|
253
|
+
headers: headers,
|
254
|
+
body: body)
|
255
|
+
end
|
256
|
+
|
167
257
|
# Retrieves information on an application
|
168
258
|
#
|
169
259
|
# Authentication:
|
data/lib/losant_rest/auth.rb
CHANGED
@@ -20,6 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "json"
|
24
|
+
|
23
25
|
module LosantRest
|
24
26
|
|
25
27
|
# Class containing all the actions for the Auth Resource
|
@@ -71,48 +73,6 @@ module LosantRest
|
|
71
73
|
body: body)
|
72
74
|
end
|
73
75
|
|
74
|
-
# Authenticates a solution user using the provided credentials.
|
75
|
-
#
|
76
|
-
# Authentication:
|
77
|
-
# No api access token is required to call this action.
|
78
|
-
#
|
79
|
-
# Parameters:
|
80
|
-
# * {hash} credentials - Solution user authentication credentials. The included api access token has the scope 'all.SolutionUser'. (https://api.losant.com/#/definitions/solutionUserCredentials)
|
81
|
-
# * {string} losantdomain - Domain scope of request (rarely needed)
|
82
|
-
# * {boolean} _actions - Return resource actions in response
|
83
|
-
# * {boolean} _links - Return resource link in response
|
84
|
-
# * {boolean} _embedded - Return embedded resources in response
|
85
|
-
#
|
86
|
-
# Responses:
|
87
|
-
# * 200 - Successful authentication (https://api.losant.com/#/definitions/authedSolutionUser)
|
88
|
-
#
|
89
|
-
# Errors:
|
90
|
-
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
91
|
-
# * 401 - Unauthorized error if authentication fails (https://api.losant.com/#/definitions/error)
|
92
|
-
def authenticate_solution_user(params = {})
|
93
|
-
params = Utils.symbolize_hash_keys(params)
|
94
|
-
query_params = { _actions: false, _links: true, _embedded: true }
|
95
|
-
headers = {}
|
96
|
-
body = nil
|
97
|
-
|
98
|
-
raise ArgumentError.new("credentials is required") unless params.has_key?(:credentials)
|
99
|
-
|
100
|
-
body = params[:credentials] if params.has_key?(:credentials)
|
101
|
-
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
102
|
-
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
103
|
-
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
104
|
-
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
105
|
-
|
106
|
-
path = "/auth/solutionUser"
|
107
|
-
|
108
|
-
@client.request(
|
109
|
-
method: :post,
|
110
|
-
path: path,
|
111
|
-
query: query_params,
|
112
|
-
headers: headers,
|
113
|
-
body: body)
|
114
|
-
end
|
115
|
-
|
116
76
|
# Authenticates a user using the provided credentials.
|
117
77
|
#
|
118
78
|
# Authentication:
|
data/lib/losant_rest/client.rb
CHANGED
@@ -27,7 +27,7 @@ module LosantRest
|
|
27
27
|
#
|
28
28
|
# User API for accessing Losant data
|
29
29
|
#
|
30
|
-
# Built For Version 1.15.
|
30
|
+
# Built For Version 1.15.3
|
31
31
|
class Client
|
32
32
|
attr_accessor :auth_token, :url
|
33
33
|
|
@@ -260,22 +260,6 @@ module LosantRest
|
|
260
260
|
@orgs ||= Orgs.new(self)
|
261
261
|
end
|
262
262
|
|
263
|
-
def solution
|
264
|
-
@solution ||= Solution.new(self)
|
265
|
-
end
|
266
|
-
|
267
|
-
def solution_user
|
268
|
-
@solution_user ||= SolutionUser.new(self)
|
269
|
-
end
|
270
|
-
|
271
|
-
def solution_users
|
272
|
-
@solution_users ||= SolutionUsers.new(self)
|
273
|
-
end
|
274
|
-
|
275
|
-
def solutions
|
276
|
-
@solutions ||= Solutions.new(self)
|
277
|
-
end
|
278
|
-
|
279
263
|
def webhook
|
280
264
|
@webhook ||= Webhook.new(self)
|
281
265
|
end
|
@@ -290,7 +274,7 @@ module LosantRest
|
|
290
274
|
|
291
275
|
headers["Accept"] = "application/json"
|
292
276
|
headers["Content-Type"] = "application/json"
|
293
|
-
headers["Accept-Version"] = "^1.15.
|
277
|
+
headers["Accept-Version"] = "^1.15.3"
|
294
278
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
295
279
|
path = self.url + options.fetch(:path, "")
|
296
280
|
|
@@ -20,6 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "json"
|
24
|
+
|
23
25
|
module LosantRest
|
24
26
|
|
25
27
|
# Class containing all the actions for the Dashboards Resource
|
@@ -35,7 +37,7 @@ module LosantRest
|
|
35
37
|
# The client must be configured with a valid api
|
36
38
|
# access token to call this action. The token
|
37
39
|
# must include at least one of the following scopes:
|
38
|
-
# all.Organization, all.Organization.read, all.
|
40
|
+
# all.Organization, all.Organization.read, all.User, all.User.read, dashboards.*, or dashboards.get.
|
39
41
|
#
|
40
42
|
# Parameters:
|
41
43
|
# * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, applicationId
|
data/lib/losant_rest/data.rb
CHANGED
@@ -20,6 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "json"
|
24
|
+
|
23
25
|
module LosantRest
|
24
26
|
|
25
27
|
# Class containing all the actions for the Data Table Rows Resource
|
@@ -40,7 +42,7 @@ module LosantRest
|
|
40
42
|
# Parameters:
|
41
43
|
# * {string} applicationId - ID associated with the application
|
42
44
|
# * {string} dataTableId - ID associated with the data table
|
43
|
-
# * {hash} query - Query to apply to filter the data table (https://api.losant.com/#/definitions/
|
45
|
+
# * {hash} query - Query to apply to filter the data table (https://api.losant.com/#/definitions/advancedQuery)
|
44
46
|
# * {string} limit - Limit number of rows to delete from data table
|
45
47
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
46
48
|
# * {boolean} _actions - Return resource actions in response
|
@@ -249,7 +251,7 @@ module LosantRest
|
|
249
251
|
# * {string} limit - How many rows to return
|
250
252
|
# * {string} offset - How many rows to skip
|
251
253
|
# * {string} includeFields - Comma-separated list of fields to include in resulting rows. When not provided, returns all fields.
|
252
|
-
# * {hash} query - Query to apply to filter the data table (https://api.losant.com/#/definitions/
|
254
|
+
# * {hash} query - Query to apply to filter the data table (https://api.losant.com/#/definitions/advancedQuery)
|
253
255
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
254
256
|
# * {boolean} _actions - Return resource actions in response
|
255
257
|
# * {boolean} _links - Return resource link in response
|
data/lib/losant_rest/device.rb
CHANGED
@@ -20,6 +20,8 @@
|
|
20
20
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
21
|
# SOFTWARE.
|
22
22
|
|
23
|
+
require "json"
|
24
|
+
|
23
25
|
module LosantRest
|
24
26
|
|
25
27
|
# Class containing all the actions for the Device Resource
|
@@ -240,6 +242,7 @@ module LosantRest
|
|
240
242
|
# * {string} deviceId - ID associated with the device
|
241
243
|
# * {string} start - Start of time range to look at to build composite state
|
242
244
|
# * {string} end - End of time range to look at to build composite state
|
245
|
+
# * {string} attributes - Comma-separated list of attributes to include. When not provided, returns all attributes.
|
243
246
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
244
247
|
# * {boolean} _actions - Return resource actions in response
|
245
248
|
# * {boolean} _links - Return resource link in response
|
@@ -262,6 +265,7 @@ module LosantRest
|
|
262
265
|
|
263
266
|
query_params[:start] = params[:start] if params.has_key?(:start)
|
264
267
|
query_params[:end] = params[:end] if params.has_key?(:end)
|
268
|
+
query_params[:attributes] = params[:attributes] if params.has_key?(:attributes)
|
265
269
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
266
270
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
267
271
|
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|