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.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/docs/_schemas.md +560 -25
- data/docs/application.md +77 -0
- data/docs/dashboard.md +1 -0
- data/docs/devices.md +1 -0
- data/docs/edgeDeployments.md +173 -0
- data/docs/flows.md +1 -0
- data/lib/losant_rest.rb +1 -0
- data/lib/losant_rest/application.rb +91 -0
- data/lib/losant_rest/client.rb +6 -2
- data/lib/losant_rest/dashboard.rb +2 -0
- data/lib/losant_rest/devices.rb +2 -0
- data/lib/losant_rest/edge_deployments.rb +234 -0
- data/lib/losant_rest/flows.rb +2 -0
- data/lib/losant_rest/version.rb +1 -1
- data/schemas/application.json +2 -2
- data/schemas/applicationApiTokenPost.json +7 -0
- data/schemas/applicationPatch.json +2 -2
- data/schemas/applicationPost.json +2 -2
- data/schemas/applications.json +2 -2
- data/schemas/authedDevice.json +2 -1
- data/schemas/dashboard.json +4 -0
- data/schemas/dashboardPatch.json +4 -0
- data/schemas/dashboardPost.json +4 -0
- data/schemas/dashboards.json +4 -0
- data/schemas/device.json +6 -1
- data/schemas/devicePatch.json +2 -1
- data/schemas/devicePost.json +2 -1
- data/schemas/deviceRecipe.json +2 -1
- data/schemas/deviceRecipePatch.json +2 -1
- data/schemas/deviceRecipePost.json +2 -1
- data/schemas/deviceRecipes.json +2 -1
- data/schemas/devices.json +37 -1
- data/schemas/edgeDeploymentRelease.json +50 -0
- data/schemas/edgeDeploymentRemove.json +25 -0
- data/schemas/edgeDeploymentReplace.json +29 -0
- data/schemas/edgeDeployments.json +152 -0
- data/schemas/flow.json +13 -0
- data/schemas/flowPatch.json +6 -0
- data/schemas/flowPost.json +13 -0
- data/schemas/flowVersion.json +6 -0
- data/schemas/flowVersionPost.json +6 -0
- data/schemas/flowVersions.json +6 -0
- data/schemas/flows.json +20 -0
- data/schemas/me.json +4 -0
- data/schemas/mePatch.json +4 -0
- data/schemas/solution.json +2 -2
- data/schemas/solutionUser.json +4 -0
- data/schemas/solutionUserPatch.json +4 -0
- data/schemas/solutionUserPost.json +4 -0
- data/schemas/solutionUsers.json +4 -0
- data/schemas/solutions.json +2 -2
- metadata +8 -2
data/docs/application.md
CHANGED
@@ -6,6 +6,8 @@ parameters and the potential responses.
|
|
6
6
|
|
7
7
|
##### Contents
|
8
8
|
|
9
|
+
* [Archive Data](#archive-data)
|
10
|
+
* [Backfill Archive Data](#backfill-archive-data)
|
9
11
|
* [Delete](#delete)
|
10
12
|
* [Get](#get)
|
11
13
|
* [Patch](#patch)
|
@@ -13,6 +15,81 @@ parameters and the potential responses.
|
|
13
15
|
|
14
16
|
<br/>
|
15
17
|
|
18
|
+
## Archive Data
|
19
|
+
|
20
|
+
Returns success when a job has been enqueued to archive this application's device data for a given day
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
result = client.application.archive_data(
|
24
|
+
applicationId: my_application_id,
|
25
|
+
date: my_date)
|
26
|
+
|
27
|
+
puts result
|
28
|
+
```
|
29
|
+
|
30
|
+
#### Authentication
|
31
|
+
The client must be configured with a valid api access token to call this
|
32
|
+
action. The token must include at least one of the following scopes:
|
33
|
+
all.Application, all.Organization, all.User, application.*, or application.archiveData.
|
34
|
+
|
35
|
+
#### Available Parameters
|
36
|
+
|
37
|
+
| Name | Type | Required | Description | Default | Example |
|
38
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
39
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
40
|
+
| date | string | Y | The date to archive data (ms since epoch), it must be within the archive time range older than 31 days and newer than the organizations dataTTL | | 1518556791829 |
|
41
|
+
|
42
|
+
#### Successful Responses
|
43
|
+
|
44
|
+
| Code | Type | Description |
|
45
|
+
| ---- | ---- | ----------- |
|
46
|
+
| 200 | [Success](_schemas.md#success) | Enqueued a job to archive this applications device data |
|
47
|
+
|
48
|
+
#### Error Responses
|
49
|
+
|
50
|
+
| Code | Type | Description |
|
51
|
+
| ---- | ---- | ----------- |
|
52
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
53
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
54
|
+
|
55
|
+
<br/>
|
56
|
+
|
57
|
+
## Backfill Archive Data
|
58
|
+
|
59
|
+
Returns success when a job has been enqueued to backfill all current data to it's archive
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
result = client.application.backfill_archive_data(applicationId: my_application_id)
|
63
|
+
|
64
|
+
puts result
|
65
|
+
```
|
66
|
+
|
67
|
+
#### Authentication
|
68
|
+
The client must be configured with a valid api access token to call this
|
69
|
+
action. The token must include at least one of the following scopes:
|
70
|
+
all.Application, all.Organization, all.User, application.*, or application.backfillArchiveData.
|
71
|
+
|
72
|
+
#### Available Parameters
|
73
|
+
|
74
|
+
| Name | Type | Required | Description | Default | Example |
|
75
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
76
|
+
| applicationId | string | Y | ID of the associated application | | 575ec8687ae143cd83dc4a97 |
|
77
|
+
|
78
|
+
#### Successful Responses
|
79
|
+
|
80
|
+
| Code | Type | Description |
|
81
|
+
| ---- | ---- | ----------- |
|
82
|
+
| 200 | [Success](_schemas.md#success) | Enqueued a job to backfill device data to this application archive location |
|
83
|
+
|
84
|
+
#### Error Responses
|
85
|
+
|
86
|
+
| Code | Type | Description |
|
87
|
+
| ---- | ---- | ----------- |
|
88
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
89
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
90
|
+
|
91
|
+
<br/>
|
92
|
+
|
16
93
|
## Delete
|
17
94
|
|
18
95
|
Deletes an application
|
data/docs/dashboard.md
CHANGED
@@ -144,6 +144,7 @@ No api access token is required to call this action.
|
|
144
144
|
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
145
145
|
| dashboardId | string | Y | ID of the associated dashboard | | 575ece2b7ae143cd83dc4a9b |
|
146
146
|
| ctx | [Dashboard Context Instance](_schemas.md#dashboard-context-instance) | Y | The context object to validate | | [Dashboard Context Instance Example](_schemas.md#dashboard-context-instance-example) |
|
147
|
+
| password | string | N | Password for password-protected dashboards | | myPassword |
|
147
148
|
|
148
149
|
#### Successful Responses
|
149
150
|
|
data/docs/devices.md
CHANGED
@@ -77,6 +77,7 @@ all.Application, all.Application.read, all.Device, all.Device.read, all.Organiza
|
|
77
77
|
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
78
78
|
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
79
79
|
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my * device |
|
80
|
+
| deviceClass | string | N | Filter the devices by the given device class. Accepted values are: standalone, gateway, peripheral, floating, edgeCompute | | standalone |
|
80
81
|
| 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) |
|
81
82
|
|
82
83
|
#### Successful Responses
|
@@ -0,0 +1,173 @@
|
|
1
|
+
# Edge Deployments Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Edge Deployments resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
* [Release](#release)
|
11
|
+
* [Remove](#remove)
|
12
|
+
* [Replace](#replace)
|
13
|
+
|
14
|
+
<br/>
|
15
|
+
|
16
|
+
## Get
|
17
|
+
|
18
|
+
Returns the edge deployments for an application
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
result = client.edge_deployments.get(applicationId: my_application_id)
|
22
|
+
|
23
|
+
puts result
|
24
|
+
```
|
25
|
+
|
26
|
+
#### Authentication
|
27
|
+
The client must be configured with a valid api access token to call this
|
28
|
+
action. The token must include at least one of the following scopes:
|
29
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, edgeDeployments.*, or edgeDeployments.get.
|
30
|
+
|
31
|
+
#### Available Parameters
|
32
|
+
|
33
|
+
| Name | Type | Required | Description | Default | Example |
|
34
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
35
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
36
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: id, deviceId, flowId, desiredVersion, currentVersion, creationDate, lastUpdated | lastUpdated | creationDate |
|
37
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
38
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
39
|
+
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
40
|
+
| deviceId | string | N | Filter deployments to the given Device ID | | 575ecf887ae143cd83dc4aa2 |
|
41
|
+
| version | string | N | Filter deployments to the given Workflow Version (matches against both current and desired) | | myFlowVersion |
|
42
|
+
| filterEmpty | undefined | N | Filter out deployments where both the current and desired version are null. | | true |
|
43
|
+
| flowId | string | N | Filter deployments to the given Workflow ID | | 575ed18f7ae143cd83dc4aa6 |
|
44
|
+
|
45
|
+
#### Successful Responses
|
46
|
+
|
47
|
+
| Code | Type | Description |
|
48
|
+
| ---- | ---- | ----------- |
|
49
|
+
| 200 | [Edge Deployments](_schemas.md#edge-deployments) | Collection of edge deployments |
|
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
|
+
|
60
|
+
## Release
|
61
|
+
|
62
|
+
Deploy an edge workflow version to one or more edge devices. Version can be blank, if removal is desired.
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
result = client.edge_deployments.release(
|
66
|
+
applicationId: my_application_id,
|
67
|
+
deployment: my_deployment)
|
68
|
+
|
69
|
+
puts result
|
70
|
+
```
|
71
|
+
|
72
|
+
#### Authentication
|
73
|
+
The client must be configured with a valid api access token to call this
|
74
|
+
action. The token must include at least one of the following scopes:
|
75
|
+
all.Application, all.Organization, all.User, edgeDeployments.*, or edgeDeployments.release.
|
76
|
+
|
77
|
+
#### Available Parameters
|
78
|
+
|
79
|
+
| Name | Type | Required | Description | Default | Example |
|
80
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
81
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
82
|
+
| deployment | [Edge Deployment Release](_schemas.md#edge-deployment-release) | Y | Deployment release information | | [Edge Deployment Release Example](_schemas.md#edge-deployment-release-example) |
|
83
|
+
|
84
|
+
#### Successful Responses
|
85
|
+
|
86
|
+
| Code | Type | Description |
|
87
|
+
| ---- | ---- | ----------- |
|
88
|
+
| 201 | [Success](_schemas.md#success) | If deployment release has been initiated successfully |
|
89
|
+
|
90
|
+
#### Error Responses
|
91
|
+
|
92
|
+
| Code | Type | Description |
|
93
|
+
| ---- | ---- | ----------- |
|
94
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
95
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
96
|
+
|
97
|
+
<br/>
|
98
|
+
|
99
|
+
## Remove
|
100
|
+
|
101
|
+
Remove all edge deployments from a device, remove all edge deployments of a workflow, or remove a specific workflow from a specific device
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
result = client.edge_deployments.remove(
|
105
|
+
applicationId: my_application_id,
|
106
|
+
deployment: my_deployment)
|
107
|
+
|
108
|
+
puts result
|
109
|
+
```
|
110
|
+
|
111
|
+
#### Authentication
|
112
|
+
The client must be configured with a valid api access token to call this
|
113
|
+
action. The token must include at least one of the following scopes:
|
114
|
+
all.Application, all.Organization, all.User, edgeDeployments.*, or edgeDeployments.remove.
|
115
|
+
|
116
|
+
#### Available Parameters
|
117
|
+
|
118
|
+
| Name | Type | Required | Description | Default | Example |
|
119
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
120
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
121
|
+
| deployment | [Edge Deployment Remove](_schemas.md#edge-deployment-remove) | Y | Deployment removal information | | [Edge Deployment Remove Example](_schemas.md#edge-deployment-remove-example) |
|
122
|
+
|
123
|
+
#### Successful Responses
|
124
|
+
|
125
|
+
| Code | Type | Description |
|
126
|
+
| ---- | ---- | ----------- |
|
127
|
+
| 201 | [Success](_schemas.md#success) | If deployment removal has been initiated successfully |
|
128
|
+
|
129
|
+
#### Error Responses
|
130
|
+
|
131
|
+
| Code | Type | Description |
|
132
|
+
| ---- | ---- | ----------- |
|
133
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
134
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
135
|
+
|
136
|
+
<br/>
|
137
|
+
|
138
|
+
## Replace
|
139
|
+
|
140
|
+
Replace deployments of an edge workflow version with a new version. New version can be blank, if removal is desired.
|
141
|
+
|
142
|
+
```ruby
|
143
|
+
result = client.edge_deployments.replace(
|
144
|
+
applicationId: my_application_id,
|
145
|
+
deployment: my_deployment)
|
146
|
+
|
147
|
+
puts result
|
148
|
+
```
|
149
|
+
|
150
|
+
#### Authentication
|
151
|
+
The client must be configured with a valid api access token to call this
|
152
|
+
action. The token must include at least one of the following scopes:
|
153
|
+
all.Application, all.Organization, all.User, edgeDeployments.*, or edgeDeployments.replace.
|
154
|
+
|
155
|
+
#### Available Parameters
|
156
|
+
|
157
|
+
| Name | Type | Required | Description | Default | Example |
|
158
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
159
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
160
|
+
| deployment | [Edge Deployment Replace](_schemas.md#edge-deployment-replace) | Y | Deployment replacement information | | [Edge Deployment Replace Example](_schemas.md#edge-deployment-replace-example) |
|
161
|
+
|
162
|
+
#### Successful Responses
|
163
|
+
|
164
|
+
| Code | Type | Description |
|
165
|
+
| ---- | ---- | ----------- |
|
166
|
+
| 201 | [Success](_schemas.md#success) | If deployment replacement has been initiated successfully |
|
167
|
+
|
168
|
+
#### Error Responses
|
169
|
+
|
170
|
+
| Code | Type | Description |
|
171
|
+
| ---- | ---- | ----------- |
|
172
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
173
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
data/docs/flows.md
CHANGED
@@ -37,6 +37,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
37
37
|
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
38
38
|
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
39
39
|
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*flow |
|
40
|
+
| flowClass | string | N | Filter the workflows by the given flow class. Accepted values are: edge, cloud | | cloud |
|
40
41
|
| triggerFilter | [Workflow Trigger Filter](_schemas.md#workflow-trigger-filter) | N | Array of triggers to filter by - always filters against default flow version. | | [Workflow Trigger Filter Example](_schemas.md#workflow-trigger-filter-example) |
|
41
42
|
|
42
43
|
#### Successful Responses
|
data/lib/losant_rest.rb
CHANGED
@@ -43,6 +43,7 @@ require_relative "losant_rest/device"
|
|
43
43
|
require_relative "losant_rest/device_recipe"
|
44
44
|
require_relative "losant_rest/device_recipes"
|
45
45
|
require_relative "losant_rest/devices"
|
46
|
+
require_relative "losant_rest/edge_deployments"
|
46
47
|
require_relative "losant_rest/event"
|
47
48
|
require_relative "losant_rest/events"
|
48
49
|
require_relative "losant_rest/experience_domain"
|
@@ -29,6 +29,97 @@ module LosantRest
|
|
29
29
|
@client = client
|
30
30
|
end
|
31
31
|
|
32
|
+
# Returns success when a job has been enqueued to archive this application's device data for a given day
|
33
|
+
#
|
34
|
+
# Authentication:
|
35
|
+
# The client must be configured with a valid api
|
36
|
+
# access token to call this action. The token
|
37
|
+
# must include at least one of the following scopes:
|
38
|
+
# all.Application, all.Organization, all.User, application.*, or application.archiveData.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID of the associated application
|
42
|
+
# * {string} date - The date to archive data (ms since epoch), it must be within the archive time range older than 31 days and newer than the organizations dataTTL
|
43
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
44
|
+
# * {boolean} _actions - Return resource actions in response
|
45
|
+
# * {boolean} _links - Return resource link in response
|
46
|
+
# * {boolean} _embedded - Return embedded resources in response
|
47
|
+
#
|
48
|
+
# Responses:
|
49
|
+
# * 200 - Enqueued a job to archive this applications device data (https://api.losant.com/#/definitions/success)
|
50
|
+
#
|
51
|
+
# Errors:
|
52
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
53
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
54
|
+
def archive_data(params = {})
|
55
|
+
params = Utils.symbolize_hash_keys(params)
|
56
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
57
|
+
headers = {}
|
58
|
+
body = nil
|
59
|
+
|
60
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
61
|
+
raise ArgumentError.new("date is required") unless params.has_key?(:date)
|
62
|
+
|
63
|
+
query_params[:date] = params[:date] if params.has_key?(:date)
|
64
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
65
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
66
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
67
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
68
|
+
|
69
|
+
path = "/applications/#{params[:applicationId]}/archiveData"
|
70
|
+
|
71
|
+
@client.request(
|
72
|
+
method: :get,
|
73
|
+
path: path,
|
74
|
+
query: query_params,
|
75
|
+
headers: headers,
|
76
|
+
body: body)
|
77
|
+
end
|
78
|
+
|
79
|
+
# Returns success when a job has been enqueued to backfill all current data to it's archive
|
80
|
+
#
|
81
|
+
# Authentication:
|
82
|
+
# The client must be configured with a valid api
|
83
|
+
# access token to call this action. The token
|
84
|
+
# must include at least one of the following scopes:
|
85
|
+
# all.Application, all.Organization, all.User, application.*, or application.backfillArchiveData.
|
86
|
+
#
|
87
|
+
# Parameters:
|
88
|
+
# * {string} applicationId - ID of the associated application
|
89
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
90
|
+
# * {boolean} _actions - Return resource actions in response
|
91
|
+
# * {boolean} _links - Return resource link in response
|
92
|
+
# * {boolean} _embedded - Return embedded resources in response
|
93
|
+
#
|
94
|
+
# Responses:
|
95
|
+
# * 200 - Enqueued a job to backfill device data to this application archive location (https://api.losant.com/#/definitions/success)
|
96
|
+
#
|
97
|
+
# Errors:
|
98
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
99
|
+
# * 404 - Error if application was not found (https://api.losant.com/#/definitions/error)
|
100
|
+
def backfill_archive_data(params = {})
|
101
|
+
params = Utils.symbolize_hash_keys(params)
|
102
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
103
|
+
headers = {}
|
104
|
+
body = nil
|
105
|
+
|
106
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
107
|
+
|
108
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
109
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
110
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
111
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
112
|
+
|
113
|
+
path = "/applications/#{params[:applicationId]}/backfillArchiveData"
|
114
|
+
|
115
|
+
@client.request(
|
116
|
+
method: :get,
|
117
|
+
path: path,
|
118
|
+
query: query_params,
|
119
|
+
headers: headers,
|
120
|
+
body: body)
|
121
|
+
end
|
122
|
+
|
32
123
|
# Deletes an application
|
33
124
|
#
|
34
125
|
# 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.
|
30
|
+
# Built For Version 1.10.0
|
31
31
|
class Client
|
32
32
|
attr_accessor :auth_token, :url
|
33
33
|
|
@@ -116,6 +116,10 @@ module LosantRest
|
|
116
116
|
@devices ||= Devices.new(self)
|
117
117
|
end
|
118
118
|
|
119
|
+
def edge_deployments
|
120
|
+
@edge_deployments ||= EdgeDeployments.new(self)
|
121
|
+
end
|
122
|
+
|
119
123
|
def event
|
120
124
|
@event ||= Event.new(self)
|
121
125
|
end
|
@@ -234,7 +238,7 @@ module LosantRest
|
|
234
238
|
|
235
239
|
headers["Accept"] = "application/json"
|
236
240
|
headers["Content-Type"] = "application/json"
|
237
|
-
headers["Accept-Version"] = "^1.
|
241
|
+
headers["Accept-Version"] = "^1.10.0"
|
238
242
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
239
243
|
path = self.url + options.fetch(:path, "")
|
240
244
|
|
@@ -171,6 +171,7 @@ module LosantRest
|
|
171
171
|
# Parameters:
|
172
172
|
# * {string} dashboardId - ID of the associated dashboard
|
173
173
|
# * {hash} ctx - The context object to validate (https://api.losant.com/#/definitions/dashboardContextInstance)
|
174
|
+
# * {string} password - Password for password-protected dashboards
|
174
175
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
175
176
|
# * {boolean} _actions - Return resource actions in response
|
176
177
|
# * {boolean} _links - Return resource link in response
|
@@ -192,6 +193,7 @@ module LosantRest
|
|
192
193
|
raise ArgumentError.new("ctx is required") unless params.has_key?(:ctx)
|
193
194
|
|
194
195
|
body = params[:ctx] if params.has_key?(:ctx)
|
196
|
+
query_params[:password] = params[:password] if params.has_key?(:password)
|
195
197
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
196
198
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
197
199
|
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
data/lib/losant_rest/devices.rb
CHANGED
@@ -93,6 +93,7 @@ module LosantRest
|
|
93
93
|
# * {string} perPage - How many items to return per page
|
94
94
|
# * {string} filterField - Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name
|
95
95
|
# * {string} filter - Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering.
|
96
|
+
# * {string} deviceClass - Filter the devices by the given device class. Accepted values are: standalone, gateway, peripheral, floating, edgeCompute
|
96
97
|
# * {hash} tagFilter - Array of tag pairs to filter by. (https://api.losant.com/#/definitions/deviceTagFilter)
|
97
98
|
# * {string} losantdomain - Domain scope of request (rarely needed)
|
98
99
|
# * {boolean} _actions - Return resource actions in response
|
@@ -119,6 +120,7 @@ module LosantRest
|
|
119
120
|
query_params[:perPage] = params[:perPage] if params.has_key?(:perPage)
|
120
121
|
query_params[:filterField] = params[:filterField] if params.has_key?(:filterField)
|
121
122
|
query_params[:filter] = params[:filter] if params.has_key?(:filter)
|
123
|
+
query_params[:deviceClass] = params[:deviceClass] if params.has_key?(:deviceClass)
|
122
124
|
query_params[:tagFilter] = params[:tagFilter] if params.has_key?(:tagFilter)
|
123
125
|
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
124
126
|
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|