losant_rest 1.9.3 → 1.10.4
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 +17405 -2766
- data/docs/application.md +85 -0
- data/docs/applicationApiTokens.md +1 -1
- data/docs/applicationTemplate.md +46 -0
- data/docs/applicationTemplates.md +76 -1
- data/docs/device.md +7 -3
- data/docs/devices.md +92 -4
- data/docs/experienceEndpoints.md +1 -0
- data/docs/file.md +4 -4
- data/docs/flow.md +94 -1
- data/docs/flowVersion.md +96 -1
- data/docs/me.md +0 -36
- data/lib/losant_rest.rb +1 -0
- data/lib/losant_rest/application.rb +48 -0
- data/lib/losant_rest/application_api_tokens.rb +1 -1
- data/lib/losant_rest/application_template.rb +79 -0
- data/lib/losant_rest/application_templates.rb +89 -1
- data/lib/losant_rest/client.rb +6 -2
- data/lib/losant_rest/device.rb +11 -3
- data/lib/losant_rest/devices.rb +103 -3
- data/lib/losant_rest/experience_endpoints.rb +2 -0
- data/lib/losant_rest/file.rb +3 -3
- data/lib/losant_rest/flow.rb +115 -1
- data/lib/losant_rest/flow_version.rb +115 -1
- data/lib/losant_rest/me.rb +0 -41
- data/lib/losant_rest/version.rb +1 -1
- data/schemas/advancedDeviceQuery.json +117 -0
- data/schemas/advancedEventQuery.json +205 -0
- data/schemas/advancedQuery.json +34 -3
- data/schemas/application.json +13 -0
- data/schemas/applicationApiTokenPost.json +9 -1
- data/schemas/applicationApplyTemplatePatch.json +19 -0
- data/schemas/applicationCreationByTemplateResult.json +13 -0
- data/schemas/applicationPatch.json +5 -0
- data/schemas/applicationPost.json +13 -0
- data/schemas/applicationTemplate.json +32 -0
- data/schemas/applicationTemplateCategories.json +43 -0
- data/schemas/applicationTemplateCategory.json +23 -0
- data/schemas/applicationTemplates.json +44 -0
- data/schemas/applications.json +13 -0
- data/schemas/changePassword.json +2 -2
- data/schemas/dashboard.json +1285 -145
- data/schemas/dashboardPatch.json +1285 -145
- data/schemas/dashboardPost.json +1285 -145
- data/schemas/dashboards.json +1285 -145
- data/schemas/dataExport.json +142 -0
- data/schemas/dataTableRowsExport.json +34 -3
- data/schemas/device.json +16 -3
- data/schemas/devicePatch.json +16 -3
- data/schemas/devicePost.json +16 -3
- data/schemas/deviceRecipe.json +16 -3
- data/schemas/deviceRecipePatch.json +16 -3
- data/schemas/deviceRecipePost.json +16 -3
- data/schemas/deviceRecipes.json +16 -3
- data/schemas/devices.json +16 -3
- data/schemas/devicesDataRemoved.json +12 -0
- data/schemas/devicesDeletePost.json +1034 -0
- data/schemas/devicesDeleted.json +12 -0
- data/schemas/devicesExportPost.json +1035 -0
- data/schemas/devicesPatch.json +1773 -7
- data/schemas/devicesRemoveDataPost.json +1056 -0
- data/schemas/devicesUpdated.json +18 -0
- data/schemas/eventPost.json +22 -0
- data/schemas/eventsExport.json +205 -0
- data/schemas/experienceDomain.json +1 -1
- data/schemas/experienceDomainPatch.json +1 -1
- data/schemas/experienceDomainPost.json +1 -1
- data/schemas/experienceDomains.json +1 -1
- data/schemas/experienceGroup.json +7 -0
- data/schemas/experienceGroupPatch.json +7 -0
- data/schemas/experienceGroupPost.json +7 -0
- data/schemas/experienceGroups.json +7 -0
- data/schemas/experienceLinkedResources.json +348 -3
- data/schemas/experienceVersion.json +1 -1
- data/schemas/experienceVersions.json +1 -1
- data/schemas/flow.json +116 -1
- data/schemas/flowErrors.json +87 -0
- data/schemas/flowPatch.json +116 -1
- data/schemas/flowPost.json +116 -1
- data/schemas/flowStats.json +54 -0
- data/schemas/flowVersion.json +232 -2
- data/schemas/flowVersionPost.json +116 -1
- data/schemas/flowVersions.json +232 -2
- data/schemas/flows.json +116 -1
- data/schemas/flowsImportPost.json +232 -2
- data/schemas/flowsImportResult.json +348 -3
- data/schemas/githubLogin.json +15 -4
- data/schemas/me.json +0 -3
- data/schemas/mePatch.json +2 -2
- data/schemas/multiDeviceCommand.json +1019 -0
- data/schemas/notebook.json +99 -2
- data/schemas/notebookPatch.json +99 -2
- data/schemas/notebookPost.json +99 -2
- data/schemas/notebooks.json +99 -2
- data/schemas/org.json +1 -1
- data/schemas/orgInviteInfo.json +3 -0
- data/schemas/orgInvitePost.json +3 -0
- data/schemas/orgInvites.json +3 -0
- data/schemas/orgPatch.json +1 -1
- data/schemas/orgPost.json +0 -9
- data/schemas/orgs.json +1 -1
- data/schemas/passwordResetFinish.json +2 -2
- data/schemas/samlResponse.json +1 -1
- data/schemas/templateKeywords.json +14 -0
- data/schemas/timeSeriesData.json +101 -12
- data/schemas/timeSeriesQuery.json +101 -12
- data/schemas/userCredentials.json +13 -3
- data/schemas/userPost.json +21 -7
- metadata +19 -5
data/docs/application.md
CHANGED
@@ -6,6 +6,7 @@ parameters and the potential responses.
|
|
6
6
|
|
7
7
|
##### Contents
|
8
8
|
|
9
|
+
* [Apply Template](#apply-template)
|
9
10
|
* [Archive Data](#archive-data)
|
10
11
|
* [Backfill Archive Data](#backfill-archive-data)
|
11
12
|
* [Clone](#clone)
|
@@ -14,6 +15,7 @@ parameters and the potential responses.
|
|
14
15
|
* [Full Data Tables Archive](#full-data-tables-archive)
|
15
16
|
* [Full Events Archive](#full-events-archive)
|
16
17
|
* [Get](#get)
|
18
|
+
* [Import](#import)
|
17
19
|
* [Mqtt Publish Message](#mqtt-publish-message)
|
18
20
|
* [Patch](#patch)
|
19
21
|
* [Payload Counts](#payload-counts)
|
@@ -23,6 +25,47 @@ parameters and the potential responses.
|
|
23
25
|
|
24
26
|
<br/>
|
25
27
|
|
28
|
+
## Apply Template
|
29
|
+
|
30
|
+
Add resources to an application via an application template
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
result = client.application.apply_template(
|
34
|
+
applicationId: my_application_id,
|
35
|
+
options: my_options)
|
36
|
+
|
37
|
+
puts result
|
38
|
+
```
|
39
|
+
|
40
|
+
#### Authentication
|
41
|
+
The client must be configured with a valid api access token to call this
|
42
|
+
action. The token must include at least one of the following scopes:
|
43
|
+
all.Application, all.Organization, all.User, application.*, or application.applyTemplate.
|
44
|
+
|
45
|
+
#### Available Parameters
|
46
|
+
|
47
|
+
| Name | Type | Required | Description | Default | Example |
|
48
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
49
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
50
|
+
| options | [Application Apply Template Patch Schema](_schemas.md#application-apply-template-patch-schema) | Y | Object containing template import options | | [Application Apply Template Patch Schema Example](_schemas.md#application-apply-template-patch-schema-example) |
|
51
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
52
|
+
|
53
|
+
#### Successful Responses
|
54
|
+
|
55
|
+
| Code | Type | Description |
|
56
|
+
| ---- | ---- | ----------- |
|
57
|
+
| 200 | [Application](_schemas.md#application) | Updated application information |
|
58
|
+
| 202 | [Job Enqueued API Result](_schemas.md#job-enqueued-api-result) | If a job was enqueued for the resources to be imported into the application |
|
59
|
+
|
60
|
+
#### Error Responses
|
61
|
+
|
62
|
+
| Code | Type | Description |
|
63
|
+
| ---- | ---- | ----------- |
|
64
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
65
|
+
| 404 | [Error](_schemas.md#error) | Error if application is not found |
|
66
|
+
|
67
|
+
<br/>
|
68
|
+
|
26
69
|
## Archive Data
|
27
70
|
|
28
71
|
Returns success when a job has been enqueued to archive this application's device data for a given day
|
@@ -332,6 +375,48 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
332
375
|
|
333
376
|
<br/>
|
334
377
|
|
378
|
+
## Import
|
379
|
+
|
380
|
+
Add multiple resources to an application via a zip file
|
381
|
+
|
382
|
+
```ruby
|
383
|
+
result = client.application.import(
|
384
|
+
applicationId: my_application_id,
|
385
|
+
importBundle: my_import_bundle)
|
386
|
+
|
387
|
+
puts result
|
388
|
+
```
|
389
|
+
|
390
|
+
#### Authentication
|
391
|
+
The client must be configured with a valid api access token to call this
|
392
|
+
action. The token must include at least one of the following scopes:
|
393
|
+
all.Application, all.Organization, all.User, application.*, or application.import.
|
394
|
+
|
395
|
+
#### Available Parameters
|
396
|
+
|
397
|
+
| Name | Type | Required | Description | Default | Example |
|
398
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
399
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
400
|
+
| importBundle | file | Y | The zip file containing all of the resources to import into the application | | undefined |
|
401
|
+
| email | string | N | Email address to notify the user when the job to import the application resources has completed or errored, defaults to the email address of the user making the request | | email@example.com |
|
402
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
403
|
+
|
404
|
+
#### Successful Responses
|
405
|
+
|
406
|
+
| Code | Type | Description |
|
407
|
+
| ---- | ---- | ----------- |
|
408
|
+
| 200 | [Application](_schemas.md#application) | Updated application information |
|
409
|
+
| 202 | [Job Enqueued API Result](_schemas.md#job-enqueued-api-result) | If a job was enqueued for the resources to be imported into the application |
|
410
|
+
|
411
|
+
#### Error Responses
|
412
|
+
|
413
|
+
| Code | Type | Description |
|
414
|
+
| ---- | ---- | ----------- |
|
415
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
416
|
+
| 404 | [Error](_schemas.md#error) | Error if application is not found |
|
417
|
+
|
418
|
+
<br/>
|
419
|
+
|
335
420
|
## Mqtt Publish Message
|
336
421
|
|
337
422
|
Publishes the given message to the given MQTT topic
|
@@ -31,7 +31,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
31
31
|
| Name | Type | Required | Description | Default | Example |
|
32
32
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
33
33
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
34
|
-
| sortField | string | N | Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated | name | name |
|
34
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, status, id, creationDate, lastUpdated, expirationDate | name | name |
|
35
35
|
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
36
36
|
| page | string | N | Which page of results to return | 0 | 0 |
|
37
37
|
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# Application Template Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Application Template resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
|
11
|
+
<br/>
|
12
|
+
|
13
|
+
## Get
|
14
|
+
|
15
|
+
Retrieves information on an application template
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
result = client.application_template.get(templateId: my_template_id)
|
19
|
+
|
20
|
+
puts result
|
21
|
+
```
|
22
|
+
|
23
|
+
#### Authentication
|
24
|
+
The client must be configured with a valid api access token to call this
|
25
|
+
action. The token must include at least one of the following scopes:
|
26
|
+
all.User, all.User.read, applicationTemplate.*, or applicationTemplate.get.
|
27
|
+
|
28
|
+
#### Available Parameters
|
29
|
+
|
30
|
+
| Name | Type | Required | Description | Default | Example |
|
31
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
32
|
+
| templateId | string | Y | ID associated with the template | | 575ed0de7ae143cd83dc4aa5 |
|
33
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
34
|
+
|
35
|
+
#### Successful Responses
|
36
|
+
|
37
|
+
| Code | Type | Description |
|
38
|
+
| ---- | ---- | ----------- |
|
39
|
+
| 200 | [Application Template](_schemas.md#application-template) | Application template information |
|
40
|
+
|
41
|
+
#### Error Responses
|
42
|
+
|
43
|
+
| Code | Type | Description |
|
44
|
+
| ---- | ---- | ----------- |
|
45
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
46
|
+
| 404 | [Error](_schemas.md#error) | Error if template was not found |
|
@@ -7,6 +7,8 @@ parameters and the potential responses.
|
|
7
7
|
##### Contents
|
8
8
|
|
9
9
|
* [Get](#get)
|
10
|
+
* [Get Categories](#get-categories)
|
11
|
+
* [Get Unique Keywords](#get-unique-keywords)
|
10
12
|
|
11
13
|
<br/>
|
12
14
|
|
@@ -33,8 +35,10 @@ all.User, all.User.read, applicationTemplates.*, or applicationTemplates.get.
|
|
33
35
|
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
34
36
|
| page | string | N | Which page of results to return | 0 | 0 |
|
35
37
|
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
36
|
-
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
38
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name, authorName | | name |
|
37
39
|
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * app |
|
40
|
+
| keywords | array | N | List of keywords to filter by. Matches all provided keywords. | | [ 'gps', 'aws' ] |
|
41
|
+
| categoryId | string | N | ID of a category to filter by. | | 575ec76c7ae143cd83dc4a96 |
|
38
42
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
39
43
|
|
40
44
|
#### Successful Responses
|
@@ -48,3 +52,74 @@ all.User, all.User.read, applicationTemplates.*, or applicationTemplates.get.
|
|
48
52
|
| Code | Type | Description |
|
49
53
|
| ---- | ---- | ----------- |
|
50
54
|
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
55
|
+
|
56
|
+
<br/>
|
57
|
+
|
58
|
+
## Get Categories
|
59
|
+
|
60
|
+
Returns a category list, beginning at the specified category
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
result = client.application_templates.get_categories(optional_params)
|
64
|
+
|
65
|
+
puts result
|
66
|
+
```
|
67
|
+
|
68
|
+
#### Authentication
|
69
|
+
The client must be configured with a valid api access token to call this
|
70
|
+
action. The token must include at least one of the following scopes:
|
71
|
+
all.User, all.User.read, applicationTemplates.*, or applicationTemplates.getCategories.
|
72
|
+
|
73
|
+
#### Available Parameters
|
74
|
+
|
75
|
+
| Name | Type | Required | Description | Default | Example |
|
76
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
77
|
+
| baseId | string | N | ID of the category to begin from | | 575ed6e87ae143cd83dc4aa8 |
|
78
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
79
|
+
|
80
|
+
#### Successful Responses
|
81
|
+
|
82
|
+
| Code | Type | Description |
|
83
|
+
| ---- | ---- | ----------- |
|
84
|
+
| 200 | [Application Template Categories](_schemas.md#application-template-categories) | Collection of application categories |
|
85
|
+
|
86
|
+
#### Error Responses
|
87
|
+
|
88
|
+
| Code | Type | Description |
|
89
|
+
| ---- | ---- | ----------- |
|
90
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
91
|
+
|
92
|
+
<br/>
|
93
|
+
|
94
|
+
## Get Unique Keywords
|
95
|
+
|
96
|
+
Returns an array of all unique keywords currently in use by templates
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
result = client.application_templates.get_unique_keywords(optional_params)
|
100
|
+
|
101
|
+
puts result
|
102
|
+
```
|
103
|
+
|
104
|
+
#### Authentication
|
105
|
+
The client must be configured with a valid api access token to call this
|
106
|
+
action. The token must include at least one of the following scopes:
|
107
|
+
all.User, all.User.read, applicationTemplates.*, or applicationTemplates.getUniqueKeywords.
|
108
|
+
|
109
|
+
#### Available Parameters
|
110
|
+
|
111
|
+
| Name | Type | Required | Description | Default | Example |
|
112
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
113
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
114
|
+
|
115
|
+
#### Successful Responses
|
116
|
+
|
117
|
+
| Code | Type | Description |
|
118
|
+
| ---- | ---- | ----------- |
|
119
|
+
| 200 | [Template Keywords](_schemas.md#template-keywords) | Array of all unique template keywords |
|
120
|
+
|
121
|
+
#### Error Responses
|
122
|
+
|
123
|
+
| Code | Type | Description |
|
124
|
+
| ---- | ---- | ----------- |
|
125
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
data/docs/device.md
CHANGED
@@ -88,6 +88,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
88
88
|
| end | string | N | End time of export (ms since epoch - 0 means now, negative is relative to now) | 0 | 1465790400000 |
|
89
89
|
| email | string | N | Email address to send export to. Defaults to current user's email. | | email@example.com |
|
90
90
|
| callbackUrl | string | N | Callback URL to call with export result | | https://example.com/cburl |
|
91
|
+
| includeBlobData | string | N | If set will export any blob attributes in base64 form, otherwise they will be downloadable links which will expire. | | true |
|
91
92
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
92
93
|
|
93
94
|
#### Successful Responses
|
@@ -169,8 +170,9 @@ all.Application, all.Application.read, all.Device, all.Device.read, all.Organiza
|
|
169
170
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
170
171
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
171
172
|
| deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
|
172
|
-
| limit | string | N |
|
173
|
+
| limit | string | N | Maximum number of command entries to return | 1 | 10 |
|
173
174
|
| since | string | N | Look for command entries since this time (ms since epoch) | | 1465790400000 |
|
175
|
+
| sortDirection | string | N | Direction to sort the command entries (by time). Accepted values are: asc, desc | desc | desc |
|
174
176
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
175
177
|
|
176
178
|
#### Successful Responses
|
@@ -254,8 +256,9 @@ all.Application, all.Application.read, all.Device, all.Device.read, all.Organiza
|
|
254
256
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
255
257
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
256
258
|
| deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
|
257
|
-
| limit | string | N |
|
259
|
+
| limit | string | N | Maximum number of log entries to return | 1 | 10 |
|
258
260
|
| since | string | N | Look for log entries since this time (ms since epoch) | | 1465790400000 |
|
261
|
+
| sortDirection | string | N | Direction to sort the log entries (by time). Accepted values are: asc, desc | desc | desc |
|
259
262
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
260
263
|
|
261
264
|
#### Successful Responses
|
@@ -296,8 +299,9 @@ all.Application, all.Application.read, all.Device, all.Device.read, all.Organiza
|
|
296
299
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
297
300
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
298
301
|
| deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
|
299
|
-
| limit | string | N |
|
302
|
+
| limit | string | N | Maximum number of state entries to return | 1 | 10 |
|
300
303
|
| since | string | N | Look for state entries since this time (ms since epoch) | | 1465790400000 |
|
304
|
+
| sortDirection | string | N | Direction to sort the state entries (by time). Accepted values are: asc, desc | desc | desc |
|
301
305
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
302
306
|
|
303
307
|
#### Successful Responses
|
data/docs/devices.md
CHANGED
@@ -6,14 +6,57 @@ parameters and the potential responses.
|
|
6
6
|
|
7
7
|
##### Contents
|
8
8
|
|
9
|
+
* [Delete](#delete)
|
9
10
|
* [Export](#export)
|
10
11
|
* [Get](#get)
|
11
12
|
* [Patch](#patch)
|
12
13
|
* [Post](#post)
|
14
|
+
* [Remove Data](#remove-data)
|
13
15
|
* [Send Command](#send-command)
|
14
16
|
|
15
17
|
<br/>
|
16
18
|
|
19
|
+
## Delete
|
20
|
+
|
21
|
+
Delete devices
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
result = client.devices.delete(
|
25
|
+
applicationId: my_application_id,
|
26
|
+
options: my_options)
|
27
|
+
|
28
|
+
puts result
|
29
|
+
```
|
30
|
+
|
31
|
+
#### Authentication
|
32
|
+
The client must be configured with a valid api access token to call this
|
33
|
+
action. The token must include at least one of the following scopes:
|
34
|
+
all.Application, all.Organization, all.User, devices.*, or devices.delete.
|
35
|
+
|
36
|
+
#### Available Parameters
|
37
|
+
|
38
|
+
| Name | Type | Required | Description | Default | Example |
|
39
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
40
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
41
|
+
| options | [Devices Delete Post](_schemas.md#devices-delete-post) | Y | Object containing device query and email | | [Devices Delete Post Example](_schemas.md#devices-delete-post-example) |
|
42
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
43
|
+
|
44
|
+
#### Successful Responses
|
45
|
+
|
46
|
+
| Code | Type | Description |
|
47
|
+
| ---- | ---- | ----------- |
|
48
|
+
| 200 | [Devices Deleted](_schemas.md#devices-deleted) | Object indicating number of devices deleted or failed |
|
49
|
+
| 202 | [Job Enqueued API Result](_schemas.md#job-enqueued-api-result) | If a job was enqueued for the devices to be deleted |
|
50
|
+
|
51
|
+
#### Error Responses
|
52
|
+
|
53
|
+
| Code | Type | Description |
|
54
|
+
| ---- | ---- | ----------- |
|
55
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
56
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
57
|
+
|
58
|
+
<br/>
|
59
|
+
|
17
60
|
## Export
|
18
61
|
|
19
62
|
Creates an export of all device metadata
|
@@ -36,6 +79,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
36
79
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
37
80
|
| email | string | N | Email address to send export to. Defaults to current user's email. | | email@example.com |
|
38
81
|
| callbackUrl | string | N | Callback URL to call with export result | | https://example.com/cburl |
|
82
|
+
| options | [Devices Metadata Export Post](_schemas.md#devices-metadata-export-post) | N | Object containing device query and optionally email or callback | | [Devices Metadata Export Post Example](_schemas.md#devices-metadata-export-post-example) |
|
39
83
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
40
84
|
|
41
85
|
#### Successful Responses
|
@@ -83,7 +127,7 @@ all.Application, all.Application.read, all.Device, all.Device.read, all.Organiza
|
|
83
127
|
| tagFilter | [Device Tag Filter](_schemas.md#device-tag-filter) | N | Array of tag pairs to filter by | | [Device Tag Filter Example](_schemas.md#device-tag-filter-example) |
|
84
128
|
| excludeConnectionInfo | string | N | If set, do not return connection info | | true |
|
85
129
|
| parentId | string | N | Filter devices as children of a given system id | | 575ecf887ae143cd83dc4aa2 |
|
86
|
-
| query | [Advanced Device Query](_schemas.md#advanced-device-query) | N | Device filter JSON object which
|
130
|
+
| query | [Advanced Device Query](_schemas.md#advanced-device-query) | N | Device filter JSON object which overrides the filterField, filter, deviceClass, tagFilter, and parentId parameters. | | [Advanced Device Query Example](_schemas.md#advanced-device-query-example) |
|
87
131
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
88
132
|
|
89
133
|
#### Successful Responses
|
@@ -106,7 +150,9 @@ all.Application, all.Application.read, all.Device, all.Device.read, all.Organiza
|
|
106
150
|
Update the fields of one or more devices
|
107
151
|
|
108
152
|
```ruby
|
109
|
-
result = client.devices.patch(
|
153
|
+
result = client.devices.patch(
|
154
|
+
applicationId: my_application_id,
|
155
|
+
patchInfo: my_patch_info)
|
110
156
|
|
111
157
|
puts result
|
112
158
|
```
|
@@ -121,14 +167,15 @@ all.Application, all.Organization, all.User, devices.*, or devices.patch.
|
|
121
167
|
| Name | Type | Required | Description | Default | Example |
|
122
168
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
123
169
|
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
124
|
-
| patchInfo | [Devices Patch](_schemas.md#devices-patch) |
|
170
|
+
| patchInfo | [Devices Patch](_schemas.md#devices-patch) | Y | Object containing device query or IDs and update operations | | [Devices Patch Example](_schemas.md#devices-patch-example) |
|
125
171
|
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
126
172
|
|
127
173
|
#### Successful Responses
|
128
174
|
|
129
175
|
| Code | Type | Description |
|
130
176
|
| ---- | ---- | ----------- |
|
131
|
-
|
|
177
|
+
| 200 | [Devices Updated](_schemas.md#devices-updated) | Object including an update log link and the number of devices updated, failed, and skipped |
|
178
|
+
| 202 | [Job Enqueued API Result](_schemas.md#job-enqueued-api-result) | Successfully queued bulk update job |
|
132
179
|
|
133
180
|
#### Error Responses
|
134
181
|
|
@@ -179,6 +226,47 @@ all.Application, all.Organization, all.User, devices.*, or devices.post.
|
|
179
226
|
|
180
227
|
<br/>
|
181
228
|
|
229
|
+
## Remove Data
|
230
|
+
|
231
|
+
Removes all device data for the specified time range. Defaults to all data.
|
232
|
+
|
233
|
+
```ruby
|
234
|
+
result = client.devices.remove_data(
|
235
|
+
applicationId: my_application_id,
|
236
|
+
options: my_options)
|
237
|
+
|
238
|
+
puts result
|
239
|
+
```
|
240
|
+
|
241
|
+
#### Authentication
|
242
|
+
The client must be configured with a valid api access token to call this
|
243
|
+
action. The token must include at least one of the following scopes:
|
244
|
+
all.Application, all.Organization, all.User, devices.*, or devices.removeData.
|
245
|
+
|
246
|
+
#### Available Parameters
|
247
|
+
|
248
|
+
| Name | Type | Required | Description | Default | Example |
|
249
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
250
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
251
|
+
| options | [Devices Remove Data Post](_schemas.md#devices-remove-data-post) | Y | Object defining the device data to delete and devices to delete from | | [Devices Remove Data Post Example](_schemas.md#devices-remove-data-post-example) |
|
252
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
253
|
+
|
254
|
+
#### Successful Responses
|
255
|
+
|
256
|
+
| Code | Type | Description |
|
257
|
+
| ---- | ---- | ----------- |
|
258
|
+
| 200 | [Devices Data Removed](_schemas.md#devices-data-removed) | Object indicating number of devices completed or skipped |
|
259
|
+
| 202 | [Job Enqueued API Result](_schemas.md#job-enqueued-api-result) | If a job was enqueued for device data to be removed |
|
260
|
+
|
261
|
+
#### Error Responses
|
262
|
+
|
263
|
+
| Code | Type | Description |
|
264
|
+
| ---- | ---- | ----------- |
|
265
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
266
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
267
|
+
|
268
|
+
<br/>
|
269
|
+
|
182
270
|
## Send Command
|
183
271
|
|
184
272
|
Send a command to multiple devices
|