losant_rest 1.17.5 → 1.18.0
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 +707 -99
- data/docs/application.md +43 -0
- data/docs/applicationDashboards.md +1 -1
- data/docs/dashboards.md +1 -1
- data/docs/device.md +44 -0
- data/docs/devices.md +46 -0
- data/docs/instance.md +43 -0
- data/docs/instanceOrg.md +46 -0
- data/docs/me.md +41 -0
- data/docs/org.md +43 -0
- data/lib/losant_rest/application.rb +54 -0
- data/lib/losant_rest/application_dashboards.rb +1 -1
- data/lib/losant_rest/client.rb +2 -2
- data/lib/losant_rest/dashboards.rb +1 -1
- data/lib/losant_rest/device.rb +52 -0
- data/lib/losant_rest/devices.rb +61 -0
- data/lib/losant_rest/instance.rb +54 -0
- data/lib/losant_rest/instance_org.rb +56 -0
- data/lib/losant_rest/me.rb +51 -0
- data/lib/losant_rest/org.rb +54 -0
- data/lib/losant_rest/version.rb +1 -1
- data/schemas/advancedFlowQuery.json +103 -0
- data/schemas/advancedFlowVersionQuery.json +103 -0
- data/schemas/apiTokenPost.json +7 -0
- data/schemas/compositeDevicesState.json +97 -0
- data/schemas/deviceCredentials.json +1 -0
- data/schemas/edgeDeployment.json +7 -0
- data/schemas/edgeDeployments.json +7 -0
- data/schemas/experienceLinkedResources.json +3 -1
- data/schemas/flow.json +3 -1
- data/schemas/flowPost.json +3 -1
- data/schemas/flowVersionsDeletePost.json +103 -0
- data/schemas/flows.json +3 -1
- data/schemas/flowsImportPost.json +3 -1
- data/schemas/flowsImportResult.json +3 -1
- data/schemas/githubLogin.json +7 -0
- data/schemas/instanceCustomNode.json +1 -0
- data/schemas/instanceCustomNodePatch.json +1 -0
- data/schemas/instanceCustomNodePost.json +1 -0
- data/schemas/instanceCustomNodes.json +1 -0
- data/schemas/lastValueQuery.json +3 -0
- data/schemas/notebookExecutionOptions.json +10 -0
- data/schemas/payloadCountsBreakdown.json +53 -0
- data/schemas/samlResponse.json +7 -0
- data/schemas/userCredentials.json +7 -0
- data/schemas/userPost.json +7 -0
- metadata +4 -2
data/docs/application.md
CHANGED
@@ -22,6 +22,7 @@ parameters and the potential responses.
|
|
22
22
|
* [Notebook Minute Counts](#notebook-minute-counts)
|
23
23
|
* [Patch](#patch)
|
24
24
|
* [Payload Counts](#payload-counts)
|
25
|
+
* [Payload Counts Breakdown](#payload-counts-breakdown)
|
25
26
|
* [Readme](#readme)
|
26
27
|
* [Readme Patch](#readme-patch)
|
27
28
|
* [Search](#search)
|
@@ -658,6 +659,48 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
658
659
|
|
659
660
|
<br/>
|
660
661
|
|
662
|
+
## Payload Counts Breakdown
|
663
|
+
|
664
|
+
Returns payload counts per resolution in the time range specified for this application
|
665
|
+
|
666
|
+
```ruby
|
667
|
+
result = client.application.payload_counts_breakdown(applicationId: my_application_id)
|
668
|
+
|
669
|
+
puts result
|
670
|
+
```
|
671
|
+
|
672
|
+
#### Authentication
|
673
|
+
The client must be configured with a valid api access token to call this
|
674
|
+
action. The token must include at least one of the following scopes:
|
675
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.payloadCountsBreakdown.
|
676
|
+
|
677
|
+
#### Available Parameters
|
678
|
+
|
679
|
+
| Name | Type | Required | Description | Default | Example |
|
680
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
681
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
682
|
+
| start | string | N | Start of range for payload count query (ms since epoch) | | 0 |
|
683
|
+
| end | string | N | End of range for payload count query (ms since epoch) | | 1465790400000 |
|
684
|
+
| resolution | string | N | Resolution in milliseconds. Accepted values are: 86400000, 3600000 | 86400000 | 86400000 |
|
685
|
+
| asBytes | string | N | If the resulting stats should be returned as bytes | false | true |
|
686
|
+
| includeNonBillable | string | N | If non-billable payloads should be included in the result | false | true |
|
687
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
688
|
+
|
689
|
+
#### Successful Responses
|
690
|
+
|
691
|
+
| Code | Type | Description |
|
692
|
+
| ---- | ---- | ----------- |
|
693
|
+
| 200 | [Payload Counts Breakdown](_schemas.md#payload-counts-breakdown) | Sum of payload counts by date |
|
694
|
+
|
695
|
+
#### Error Responses
|
696
|
+
|
697
|
+
| Code | Type | Description |
|
698
|
+
| ---- | ---- | ----------- |
|
699
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
700
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
701
|
+
|
702
|
+
<br/>
|
703
|
+
|
661
704
|
## Readme
|
662
705
|
|
663
706
|
Get the current application readme information
|
@@ -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, id, creationDate | name | name |
|
34
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated | 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 | 100 | 10 |
|
data/docs/dashboards.md
CHANGED
@@ -30,7 +30,7 @@ all.Organization, all.Organization.read, all.User, all.User.read, dashboards.*,
|
|
30
30
|
|
31
31
|
| Name | Type | Required | Description | Default | Example |
|
32
32
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
33
|
-
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, applicationId | name | name |
|
33
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, applicationId, lastUpdated | name | name |
|
34
34
|
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
35
35
|
| page | string | N | Which page of results to return | 0 | 0 |
|
36
36
|
| perPage | string | N | How many items to return per page | 100 | 10 |
|
data/docs/device.md
CHANGED
@@ -15,6 +15,7 @@ parameters and the potential responses.
|
|
15
15
|
* [Get State](#get-state)
|
16
16
|
* [Patch](#patch)
|
17
17
|
* [Payload Counts](#payload-counts)
|
18
|
+
* [Payload Counts Breakdown](#payload-counts-breakdown)
|
18
19
|
* [Remove Data](#remove-data)
|
19
20
|
* [Send Command](#send-command)
|
20
21
|
* [Send State](#send-state)
|
@@ -408,6 +409,49 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
408
409
|
|
409
410
|
<br/>
|
410
411
|
|
412
|
+
## Payload Counts Breakdown
|
413
|
+
|
414
|
+
Returns payload counts per resolution in the time range specified for this device
|
415
|
+
|
416
|
+
```ruby
|
417
|
+
result = client.device.payload_counts_breakdown(
|
418
|
+
applicationId: my_application_id,
|
419
|
+
deviceId: my_device_id)
|
420
|
+
|
421
|
+
puts result
|
422
|
+
```
|
423
|
+
|
424
|
+
#### Authentication
|
425
|
+
The client must be configured with a valid api access token to call this
|
426
|
+
action. The token must include at least one of the following scopes:
|
427
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, device.*, or device.payloadCountsBreakdown.
|
428
|
+
|
429
|
+
#### Available Parameters
|
430
|
+
|
431
|
+
| Name | Type | Required | Description | Default | Example |
|
432
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
433
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
434
|
+
| deviceId | string | Y | ID associated with the device | | 575ecf887ae143cd83dc4aa2 |
|
435
|
+
| start | string | N | Start of range for payload count query (ms since epoch) | -2592000000 | 0 |
|
436
|
+
| end | string | N | End of range for payload count query (ms since epoch) | 0 | 1465790400000 |
|
437
|
+
| resolution | string | N | Resolution in milliseconds. Accepted values are: 86400000, 3600000 | 86400000 | 86400000 |
|
438
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
439
|
+
|
440
|
+
#### Successful Responses
|
441
|
+
|
442
|
+
| Code | Type | Description |
|
443
|
+
| ---- | ---- | ----------- |
|
444
|
+
| 200 | [Payload Counts Breakdown](_schemas.md#payload-counts-breakdown) | Sum of payload counts by date |
|
445
|
+
|
446
|
+
#### Error Responses
|
447
|
+
|
448
|
+
| Code | Type | Description |
|
449
|
+
| ---- | ---- | ----------- |
|
450
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
451
|
+
| 404 | [Error](_schemas.md#error) | Error if device was not found |
|
452
|
+
|
453
|
+
<br/>
|
454
|
+
|
411
455
|
## Remove Data
|
412
456
|
|
413
457
|
Removes all device data for the specified time range. Defaults to all data.
|
data/docs/devices.md
CHANGED
@@ -11,6 +11,7 @@ parameters and the potential responses.
|
|
11
11
|
* [Device Names](#device-names)
|
12
12
|
* [Export](#export)
|
13
13
|
* [Get](#get)
|
14
|
+
* [Get Composite State](#get-composite-state)
|
14
15
|
* [Patch](#patch)
|
15
16
|
* [Payload Counts](#payload-counts)
|
16
17
|
* [Post](#post)
|
@@ -231,6 +232,51 @@ all.Application, all.Application.read, all.Device, all.Device.read, all.Organiza
|
|
231
232
|
|
232
233
|
<br/>
|
233
234
|
|
235
|
+
## Get Composite State
|
236
|
+
|
237
|
+
Retrieve the composite last complete state of the matching devices
|
238
|
+
|
239
|
+
```ruby
|
240
|
+
result = client.devices.get_composite_state(applicationId: my_application_id)
|
241
|
+
|
242
|
+
puts result
|
243
|
+
```
|
244
|
+
|
245
|
+
#### Authentication
|
246
|
+
The client must be configured with a valid api access token to call this
|
247
|
+
action. The token must include at least one of the following scopes:
|
248
|
+
all.Application, all.Application.read, all.Device, all.Device.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.getCompositeState.
|
249
|
+
|
250
|
+
#### Available Parameters
|
251
|
+
|
252
|
+
| Name | Type | Required | Description | Default | Example |
|
253
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
254
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
255
|
+
| start | string | N | Start of time range to look at to build composite state | 1 | 1465790400000 |
|
256
|
+
| end | string | N | End of time range to look at to build composite state | 0 | 1465790400000 |
|
257
|
+
| attributes | string | N | Comma-separated list of attributes to include. When not provided, returns all attributes. | | myAttr1,myAttr2 |
|
258
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated, connectionStatus | name | name |
|
259
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
260
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
261
|
+
| perPage | string | N | How many items to return per page | 100 | 10 |
|
262
|
+
| query | [Advanced Device Query](_schemas.md#advanced-device-query) | N | Device advanced query JSON object | | [Advanced Device Query Example](_schemas.md#advanced-device-query-example) |
|
263
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
264
|
+
|
265
|
+
#### Successful Responses
|
266
|
+
|
267
|
+
| Code | Type | Description |
|
268
|
+
| ---- | ---- | ----------- |
|
269
|
+
| 200 | [Devices Composite State](_schemas.md#devices-composite-state) | Collection of composite last state of the devices |
|
270
|
+
|
271
|
+
#### Error Responses
|
272
|
+
|
273
|
+
| Code | Type | Description |
|
274
|
+
| ---- | ---- | ----------- |
|
275
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
276
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
277
|
+
|
278
|
+
<br/>
|
279
|
+
|
234
280
|
## Patch
|
235
281
|
|
236
282
|
Update the fields of one or more devices
|
data/docs/instance.md
CHANGED
@@ -12,6 +12,7 @@ parameters and the potential responses.
|
|
12
12
|
* [Historical Summaries](#historical-summaries)
|
13
13
|
* [Notebook Minute Counts](#notebook-minute-counts)
|
14
14
|
* [Patch](#patch)
|
15
|
+
* [Payload Counts Breakdown](#payload-counts-breakdown)
|
15
16
|
|
16
17
|
<br/>
|
17
18
|
|
@@ -246,3 +247,45 @@ all.Instance, all.User, instance.*, or instance.patch.
|
|
246
247
|
| Code | Type | Description |
|
247
248
|
| ---- | ---- | ----------- |
|
248
249
|
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
250
|
+
|
251
|
+
<br/>
|
252
|
+
|
253
|
+
## Payload Counts Breakdown
|
254
|
+
|
255
|
+
Returns payload counts per resolution in the time range specified for this instance
|
256
|
+
|
257
|
+
```ruby
|
258
|
+
result = client.instance.payload_counts_breakdown(instanceId: my_instance_id)
|
259
|
+
|
260
|
+
puts result
|
261
|
+
```
|
262
|
+
|
263
|
+
#### Authentication
|
264
|
+
The client must be configured with a valid api access token to call this
|
265
|
+
action. The token must include at least one of the following scopes:
|
266
|
+
all.Instance, all.Instance.read, all.User, all.User.read, instance.*, or instance.payloadCountsBreakdown.
|
267
|
+
|
268
|
+
#### Available Parameters
|
269
|
+
|
270
|
+
| Name | Type | Required | Description | Default | Example |
|
271
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
272
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
273
|
+
| start | string | N | Start of range for payload count query (ms since epoch) | | 0 |
|
274
|
+
| end | string | N | End of range for payload count query (ms since epoch) | | 1465790400000 |
|
275
|
+
| resolution | string | N | Resolution in milliseconds. Accepted values are: 86400000, 3600000 | 86400000 | 86400000 |
|
276
|
+
| asBytes | string | N | If the resulting stats should be returned as bytes | false | true |
|
277
|
+
| includeNonBillable | string | N | If non-billable payloads should be included in the result | false | true |
|
278
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
279
|
+
|
280
|
+
#### Successful Responses
|
281
|
+
|
282
|
+
| Code | Type | Description |
|
283
|
+
| ---- | ---- | ----------- |
|
284
|
+
| 200 | [Payload Counts Breakdown](_schemas.md#payload-counts-breakdown) | Sum of payload counts by date |
|
285
|
+
|
286
|
+
#### Error Responses
|
287
|
+
|
288
|
+
| Code | Type | Description |
|
289
|
+
| ---- | ---- | ----------- |
|
290
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
291
|
+
| 404 | [Error](_schemas.md#error) | Error if instance was not found |
|
data/docs/instanceOrg.md
CHANGED
@@ -11,6 +11,7 @@ parameters and the potential responses.
|
|
11
11
|
* [Get](#get)
|
12
12
|
* [Notebook Minute Counts](#notebook-minute-counts)
|
13
13
|
* [Patch](#patch)
|
14
|
+
* [Payload Counts Breakdown](#payload-counts-breakdown)
|
14
15
|
|
15
16
|
<br/>
|
16
17
|
|
@@ -219,3 +220,48 @@ all.Instance, all.User, instanceOrg.*, or instanceOrg.patch.
|
|
219
220
|
| ---- | ---- | ----------- |
|
220
221
|
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
221
222
|
| 404 | [Error](_schemas.md#error) | Error if organization was not found |
|
223
|
+
|
224
|
+
<br/>
|
225
|
+
|
226
|
+
## Payload Counts Breakdown
|
227
|
+
|
228
|
+
Returns payload counts per resolution in the time range specified for all application this organization owns
|
229
|
+
|
230
|
+
```ruby
|
231
|
+
result = client.instance_org.payload_counts_breakdown(
|
232
|
+
instanceId: my_instance_id,
|
233
|
+
orgId: my_org_id)
|
234
|
+
|
235
|
+
puts result
|
236
|
+
```
|
237
|
+
|
238
|
+
#### Authentication
|
239
|
+
The client must be configured with a valid api access token to call this
|
240
|
+
action. The token must include at least one of the following scopes:
|
241
|
+
all.Instance, all.Instance.read, all.User, all.User.read, instanceOrg.*, or instanceOrg.payloadCountsBreakdown.
|
242
|
+
|
243
|
+
#### Available Parameters
|
244
|
+
|
245
|
+
| Name | Type | Required | Description | Default | Example |
|
246
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
247
|
+
| instanceId | string | Y | ID associated with the instance | | 575ec8687ae143cd83dc4a97 |
|
248
|
+
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
|
249
|
+
| start | string | N | Start of range for payload count query (ms since epoch) | | 0 |
|
250
|
+
| end | string | N | End of range for payload count query (ms since epoch) | | 1465790400000 |
|
251
|
+
| resolution | string | N | Resolution in milliseconds. Accepted values are: 86400000, 3600000 | 86400000 | 86400000 |
|
252
|
+
| asBytes | string | N | If the resulting stats should be returned as bytes | false | true |
|
253
|
+
| includeNonBillable | string | N | If non-billable payloads should be included in the result | false | true |
|
254
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
255
|
+
|
256
|
+
#### Successful Responses
|
257
|
+
|
258
|
+
| Code | Type | Description |
|
259
|
+
| ---- | ---- | ----------- |
|
260
|
+
| 200 | [Payload Counts Breakdown](_schemas.md#payload-counts-breakdown) | Payload counts, by type and source |
|
261
|
+
|
262
|
+
#### Error Responses
|
263
|
+
|
264
|
+
| Code | Type | Description |
|
265
|
+
| ---- | ---- | ----------- |
|
266
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
267
|
+
| 404 | [Error](_schemas.md#error) | Error if instance was not found |
|
data/docs/me.md
CHANGED
@@ -19,6 +19,7 @@ parameters and the potential responses.
|
|
19
19
|
* [Notebook Minute Counts](#notebook-minute-counts)
|
20
20
|
* [Patch](#patch)
|
21
21
|
* [Payload Counts](#payload-counts)
|
22
|
+
* [Payload Counts Breakdown](#payload-counts-breakdown)
|
22
23
|
* [Refresh Token](#refresh-token)
|
23
24
|
* [Transfer Resources](#transfer-resources)
|
24
25
|
* [Verify Email](#verify-email)
|
@@ -498,6 +499,46 @@ all.User, all.User.read, me.*, or me.payloadCounts.
|
|
498
499
|
|
499
500
|
<br/>
|
500
501
|
|
502
|
+
## Payload Counts Breakdown
|
503
|
+
|
504
|
+
Returns payload counts per resolution in the time range specified for all applications the current user owns
|
505
|
+
|
506
|
+
```ruby
|
507
|
+
result = client.me.payload_counts_breakdown(optional_params)
|
508
|
+
|
509
|
+
puts result
|
510
|
+
```
|
511
|
+
|
512
|
+
#### Authentication
|
513
|
+
The client must be configured with a valid api access token to call this
|
514
|
+
action. The token must include at least one of the following scopes:
|
515
|
+
all.User, all.User.read, me.*, or me.payloadCountsBreakdown.
|
516
|
+
|
517
|
+
#### Available Parameters
|
518
|
+
|
519
|
+
| Name | Type | Required | Description | Default | Example |
|
520
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
521
|
+
| start | string | N | Start of range for payload count query (ms since epoch) | | 0 |
|
522
|
+
| end | string | N | End of range for payload count query (ms since epoch) | | 1465790400000 |
|
523
|
+
| resolution | string | N | Resolution in milliseconds. Accepted values are: 86400000, 3600000 | 86400000 | 86400000 |
|
524
|
+
| asBytes | string | N | If the resulting stats should be returned as bytes | false | true |
|
525
|
+
| includeNonBillable | string | N | If non-billable payloads should be included in the result | false | true |
|
526
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
527
|
+
|
528
|
+
#### Successful Responses
|
529
|
+
|
530
|
+
| Code | Type | Description |
|
531
|
+
| ---- | ---- | ----------- |
|
532
|
+
| 200 | [Payload Counts Breakdown](_schemas.md#payload-counts-breakdown) | Sum of payload counts by date |
|
533
|
+
|
534
|
+
#### Error Responses
|
535
|
+
|
536
|
+
| Code | Type | Description |
|
537
|
+
| ---- | ---- | ----------- |
|
538
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
539
|
+
|
540
|
+
<br/>
|
541
|
+
|
501
542
|
## Refresh Token
|
502
543
|
|
503
544
|
Returns a new auth token based on the current auth token
|
data/docs/org.md
CHANGED
@@ -14,6 +14,7 @@ parameters and the potential responses.
|
|
14
14
|
* [Notebook Minute Counts](#notebook-minute-counts)
|
15
15
|
* [Patch](#patch)
|
16
16
|
* [Payload Counts](#payload-counts)
|
17
|
+
* [Payload Counts Breakdown](#payload-counts-breakdown)
|
17
18
|
* [Pending Invites](#pending-invites)
|
18
19
|
* [Remove Member](#remove-member)
|
19
20
|
* [Revoke Invite](#revoke-invite)
|
@@ -338,6 +339,48 @@ all.Organization, all.Organization.read, all.User, all.User.read, org.*, or org.
|
|
338
339
|
|
339
340
|
<br/>
|
340
341
|
|
342
|
+
## Payload Counts Breakdown
|
343
|
+
|
344
|
+
Returns payload counts per resolution in the time range specified for all application this organization owns
|
345
|
+
|
346
|
+
```ruby
|
347
|
+
result = client.org.payload_counts_breakdown(orgId: my_org_id)
|
348
|
+
|
349
|
+
puts result
|
350
|
+
```
|
351
|
+
|
352
|
+
#### Authentication
|
353
|
+
The client must be configured with a valid api access token to call this
|
354
|
+
action. The token must include at least one of the following scopes:
|
355
|
+
all.Organization, all.Organization.read, all.User, all.User.read, org.*, or org.payloadCountsBreakdown.
|
356
|
+
|
357
|
+
#### Available Parameters
|
358
|
+
|
359
|
+
| Name | Type | Required | Description | Default | Example |
|
360
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
361
|
+
| orgId | string | Y | ID associated with the organization | | 575ed6e87ae143cd83dc4aa8 |
|
362
|
+
| start | string | N | Start of range for payload count query (ms since epoch) | | 0 |
|
363
|
+
| end | string | N | End of range for payload count query (ms since epoch) | | 1465790400000 |
|
364
|
+
| resolution | string | N | Resolution in milliseconds. Accepted values are: 86400000, 3600000 | 86400000 | 86400000 |
|
365
|
+
| asBytes | string | N | If the resulting stats should be returned as bytes | false | true |
|
366
|
+
| includeNonBillable | string | N | If non-billable payloads should be included in the result | false | true |
|
367
|
+
| losantdomain | string | N | Domain scope of request (rarely needed) | | example.com |
|
368
|
+
|
369
|
+
#### Successful Responses
|
370
|
+
|
371
|
+
| Code | Type | Description |
|
372
|
+
| ---- | ---- | ----------- |
|
373
|
+
| 200 | [Payload Counts Breakdown](_schemas.md#payload-counts-breakdown) | Sum of payload counts by date |
|
374
|
+
|
375
|
+
#### Error Responses
|
376
|
+
|
377
|
+
| Code | Type | Description |
|
378
|
+
| ---- | ---- | ----------- |
|
379
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
380
|
+
| 404 | [Error](_schemas.md#error) | Error if organization was not found |
|
381
|
+
|
382
|
+
<br/>
|
383
|
+
|
341
384
|
## Pending Invites
|
342
385
|
|
343
386
|
Gets the current pending invites
|
@@ -736,6 +736,60 @@ module LosantRest
|
|
736
736
|
body: body)
|
737
737
|
end
|
738
738
|
|
739
|
+
# Returns payload counts per resolution in the time range specified for this application
|
740
|
+
#
|
741
|
+
# Authentication:
|
742
|
+
# The client must be configured with a valid api
|
743
|
+
# access token to call this action. The token
|
744
|
+
# must include at least one of the following scopes:
|
745
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, application.*, or application.payloadCountsBreakdown.
|
746
|
+
#
|
747
|
+
# Parameters:
|
748
|
+
# * {string} applicationId - ID of the associated application
|
749
|
+
# * {string} start - Start of range for payload count query (ms since epoch)
|
750
|
+
# * {string} end - End of range for payload count query (ms since epoch)
|
751
|
+
# * {string} resolution - Resolution in milliseconds. Accepted values are: 86400000, 3600000
|
752
|
+
# * {string} asBytes - If the resulting stats should be returned as bytes
|
753
|
+
# * {string} includeNonBillable - If non-billable payloads should be included in the result
|
754
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
755
|
+
# * {boolean} _actions - Return resource actions in response
|
756
|
+
# * {boolean} _links - Return resource link in response
|
757
|
+
# * {boolean} _embedded - Return embedded resources in response
|
758
|
+
#
|
759
|
+
# Responses:
|
760
|
+
# * 200 - Sum of payload counts by date (https://api.losant.com/#/definitions/payloadCountsBreakdown)
|
761
|
+
#
|
762
|
+
# Errors:
|
763
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
764
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
765
|
+
def payload_counts_breakdown(params = {})
|
766
|
+
params = Utils.symbolize_hash_keys(params)
|
767
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
768
|
+
headers = {}
|
769
|
+
body = nil
|
770
|
+
|
771
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
772
|
+
|
773
|
+
query_params[:start] = params[:start] if params.has_key?(:start)
|
774
|
+
query_params[:end] = params[:end] if params.has_key?(:end)
|
775
|
+
query_params[:resolution] = params[:resolution] if params.has_key?(:resolution)
|
776
|
+
query_params[:asBytes] = params[:asBytes] if params.has_key?(:asBytes)
|
777
|
+
query_params[:includeNonBillable] = params[:includeNonBillable] if params.has_key?(:includeNonBillable)
|
778
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
779
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
780
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
781
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
782
|
+
|
783
|
+
path = "/applications/#{params[:applicationId]}/payloadCountsBreakdown"
|
784
|
+
|
785
|
+
@client.request(
|
786
|
+
method: :get,
|
787
|
+
path: path,
|
788
|
+
query: query_params,
|
789
|
+
headers: headers,
|
790
|
+
body: body)
|
791
|
+
end
|
792
|
+
|
739
793
|
# Get the current application readme information
|
740
794
|
#
|
741
795
|
# Authentication:
|
@@ -41,7 +41,7 @@ module LosantRest
|
|
41
41
|
#
|
42
42
|
# Parameters:
|
43
43
|
# * {string} applicationId - ID associated with the application
|
44
|
-
# * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate
|
44
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated
|
45
45
|
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
46
46
|
# * {string} page - Which page of results to return
|
47
47
|
# * {string} perPage - How many items to return per page
|
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.
|
30
|
+
# Built For Version 1.25.0
|
31
31
|
class Client
|
32
32
|
attr_accessor :auth_token, :url
|
33
33
|
|
@@ -382,7 +382,7 @@ module LosantRest
|
|
382
382
|
|
383
383
|
headers["Accept"] = "application/json"
|
384
384
|
headers["Content-Type"] = "application/json"
|
385
|
-
headers["Accept-Version"] = "^1.
|
385
|
+
headers["Accept-Version"] = "^1.25.0"
|
386
386
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
387
387
|
path = self.url + options.fetch(:path, "")
|
388
388
|
|
@@ -40,7 +40,7 @@ module LosantRest
|
|
40
40
|
# all.Organization, all.Organization.read, all.User, all.User.read, dashboards.*, or dashboards.get.
|
41
41
|
#
|
42
42
|
# Parameters:
|
43
|
-
# * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, applicationId
|
43
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate, ownerId, applicationId, lastUpdated
|
44
44
|
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
45
45
|
# * {string} page - Which page of results to return
|
46
46
|
# * {string} perPage - How many items to return per page
|
data/lib/losant_rest/device.rb
CHANGED
@@ -496,6 +496,58 @@ module LosantRest
|
|
496
496
|
body: body)
|
497
497
|
end
|
498
498
|
|
499
|
+
# Returns payload counts per resolution in the time range specified for this device
|
500
|
+
#
|
501
|
+
# Authentication:
|
502
|
+
# The client must be configured with a valid api
|
503
|
+
# access token to call this action. The token
|
504
|
+
# must include at least one of the following scopes:
|
505
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, device.*, or device.payloadCountsBreakdown.
|
506
|
+
#
|
507
|
+
# Parameters:
|
508
|
+
# * {string} applicationId - ID associated with the application
|
509
|
+
# * {string} deviceId - ID associated with the device
|
510
|
+
# * {string} start - Start of range for payload count query (ms since epoch)
|
511
|
+
# * {string} end - End of range for payload count query (ms since epoch)
|
512
|
+
# * {string} resolution - Resolution in milliseconds. Accepted values are: 86400000, 3600000
|
513
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
514
|
+
# * {boolean} _actions - Return resource actions in response
|
515
|
+
# * {boolean} _links - Return resource link in response
|
516
|
+
# * {boolean} _embedded - Return embedded resources in response
|
517
|
+
#
|
518
|
+
# Responses:
|
519
|
+
# * 200 - Sum of payload counts by date (https://api.losant.com/#/definitions/payloadCountsBreakdown)
|
520
|
+
#
|
521
|
+
# Errors:
|
522
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
523
|
+
# * 404 - Error if device was not found (https://api.losant.com/#/definitions/error)
|
524
|
+
def payload_counts_breakdown(params = {})
|
525
|
+
params = Utils.symbolize_hash_keys(params)
|
526
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
527
|
+
headers = {}
|
528
|
+
body = nil
|
529
|
+
|
530
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
531
|
+
raise ArgumentError.new("deviceId is required") unless params.has_key?(:deviceId)
|
532
|
+
|
533
|
+
query_params[:start] = params[:start] if params.has_key?(:start)
|
534
|
+
query_params[:end] = params[:end] if params.has_key?(:end)
|
535
|
+
query_params[:resolution] = params[:resolution] if params.has_key?(:resolution)
|
536
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
537
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
538
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
539
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
540
|
+
|
541
|
+
path = "/applications/#{params[:applicationId]}/devices/#{params[:deviceId]}/payloadCountsBreakdown"
|
542
|
+
|
543
|
+
@client.request(
|
544
|
+
method: :get,
|
545
|
+
path: path,
|
546
|
+
query: query_params,
|
547
|
+
headers: headers,
|
548
|
+
body: body)
|
549
|
+
end
|
550
|
+
|
499
551
|
# Removes all device data for the specified time range. Defaults to all data.
|
500
552
|
#
|
501
553
|
# Authentication:
|
data/lib/losant_rest/devices.rb
CHANGED
@@ -300,6 +300,67 @@ module LosantRest
|
|
300
300
|
body: body)
|
301
301
|
end
|
302
302
|
|
303
|
+
# Retrieve the composite last complete state of the matching devices
|
304
|
+
#
|
305
|
+
# Authentication:
|
306
|
+
# The client must be configured with a valid api
|
307
|
+
# access token to call this action. The token
|
308
|
+
# must include at least one of the following scopes:
|
309
|
+
# all.Application, all.Application.read, all.Device, all.Device.read, all.Organization, all.Organization.read, all.User, all.User.read, devices.*, or devices.getCompositeState.
|
310
|
+
#
|
311
|
+
# Parameters:
|
312
|
+
# * {string} applicationId - ID associated with the application
|
313
|
+
# * {string} start - Start of time range to look at to build composite state
|
314
|
+
# * {string} end - End of time range to look at to build composite state
|
315
|
+
# * {string} attributes - Comma-separated list of attributes to include. When not provided, returns all attributes.
|
316
|
+
# * {string} sortField - Field to sort the results by. Accepted values are: name, id, creationDate, lastUpdated, connectionStatus
|
317
|
+
# * {string} sortDirection - Direction to sort the results by. Accepted values are: asc, desc
|
318
|
+
# * {string} page - Which page of results to return
|
319
|
+
# * {string} perPage - How many items to return per page
|
320
|
+
# * {hash} query - Device advanced query JSON object (https://api.losant.com/#/definitions/advancedDeviceQuery)
|
321
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
322
|
+
# * {boolean} _actions - Return resource actions in response
|
323
|
+
# * {boolean} _links - Return resource link in response
|
324
|
+
# * {boolean} _embedded - Return embedded resources in response
|
325
|
+
#
|
326
|
+
# Responses:
|
327
|
+
# * 200 - Collection of composite last state of the devices (https://api.losant.com/#/definitions/compositeDevicesState)
|
328
|
+
#
|
329
|
+
# Errors:
|
330
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
331
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
332
|
+
def get_composite_state(params = {})
|
333
|
+
params = Utils.symbolize_hash_keys(params)
|
334
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
335
|
+
headers = {}
|
336
|
+
body = nil
|
337
|
+
|
338
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
339
|
+
|
340
|
+
query_params[:start] = params[:start] if params.has_key?(:start)
|
341
|
+
query_params[:end] = params[:end] if params.has_key?(:end)
|
342
|
+
query_params[:attributes] = params[:attributes] if params.has_key?(:attributes)
|
343
|
+
query_params[:sortField] = params[:sortField] if params.has_key?(:sortField)
|
344
|
+
query_params[:sortDirection] = params[:sortDirection] if params.has_key?(:sortDirection)
|
345
|
+
query_params[:page] = params[:page] if params.has_key?(:page)
|
346
|
+
query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
|
347
|
+
query_params[:query] = params[:query] if params.has_key?(:query)
|
348
|
+
query_params[:query] = JSON.dump(query_params[:query]) if query_params.has_key?(:query)
|
349
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
350
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
351
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
352
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
353
|
+
|
354
|
+
path = "/applications/#{params[:applicationId]}/devices/compositeState"
|
355
|
+
|
356
|
+
@client.request(
|
357
|
+
method: :get,
|
358
|
+
path: path,
|
359
|
+
query: query_params,
|
360
|
+
headers: headers,
|
361
|
+
body: body)
|
362
|
+
end
|
363
|
+
|
303
364
|
# Update the fields of one or more devices
|
304
365
|
#
|
305
366
|
# Authentication:
|