losant_rest 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +10 -0
- data/docs/_schemas.md +928 -111
- data/docs/flow.md +1 -1
- data/docs/flowVersion.md +180 -0
- data/docs/flowVersions.md +97 -0
- data/docs/flows.md +1 -1
- data/lib/losant_rest.rb +2 -0
- data/lib/losant_rest/client.rb +10 -2
- data/lib/losant_rest/flow.rb +1 -1
- data/lib/losant_rest/flow_version.rb +232 -0
- data/lib/losant_rest/flow_versions.rb +142 -0
- data/lib/losant_rest/flows.rb +1 -1
- data/lib/losant_rest/version.rb +1 -1
- data/schemas/applicationApiTokenPost.json +8 -0
- data/schemas/dashboard.json +4 -4
- data/schemas/dashboardPatch.json +4 -4
- data/schemas/dashboardPost.json +4 -4
- data/schemas/dashboards.json +4 -4
- data/schemas/deviceStateOrStates.json +10 -0
- data/schemas/deviceStates.json +5 -0
- data/schemas/flow.json +20 -0
- data/schemas/flowLog.json +3 -0
- data/schemas/flowPatch.json +11 -0
- data/schemas/flowVersion.json +154 -0
- data/schemas/flowVersionPatch.json +14 -0
- data/schemas/flowVersionPost.json +134 -0
- data/schemas/flowVersions.json +200 -0
- data/schemas/flows.json +20 -0
- data/schemas/integration.json +31 -1
- data/schemas/integrationPatch.json +31 -1
- data/schemas/integrationPost.json +31 -1
- data/schemas/integrations.json +31 -1
- data/schemas/virtualButtonPress.json +6 -1
- metadata +10 -2
data/docs/flow.md
CHANGED
@@ -96,7 +96,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
96
96
|
|
97
97
|
## Get Log Entries
|
98
98
|
|
99
|
-
Retrieve the recent log entries about
|
99
|
+
Retrieve the recent log entries about runs of this workflow
|
100
100
|
|
101
101
|
```ruby
|
102
102
|
result = client.flow.get_log_entries(
|
data/docs/flowVersion.md
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
# Flow Version Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Flow Version resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Delete](#delete)
|
10
|
+
* [Get](#get)
|
11
|
+
* [Get Log Entries](#get-log-entries)
|
12
|
+
* [Patch](#patch)
|
13
|
+
|
14
|
+
<br/>
|
15
|
+
|
16
|
+
## Delete
|
17
|
+
|
18
|
+
Deletes a flow version
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
result = client.flow_version.delete(
|
22
|
+
applicationId: my_application_id,
|
23
|
+
flowId: my_flow_id,
|
24
|
+
flowVersionId: my_flow_version_id)
|
25
|
+
|
26
|
+
puts result
|
27
|
+
```
|
28
|
+
|
29
|
+
#### Authentication
|
30
|
+
The client must be configured with a valid api access token to call this
|
31
|
+
action. The token must include at least one of the following scopes:
|
32
|
+
all.Application, all.Organization, all.User, flowVersion.*, or flowVersion.delete.
|
33
|
+
|
34
|
+
#### Available Parameters
|
35
|
+
|
36
|
+
| Name | Type | Required | Description | Default | Example |
|
37
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
38
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
39
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
40
|
+
| flowVersionId | string | Y | ID associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
|
41
|
+
|
42
|
+
#### Successful Responses
|
43
|
+
|
44
|
+
| Code | Type | Description |
|
45
|
+
| ---- | ---- | ----------- |
|
46
|
+
| 200 | [Success](_schemas.md#success) | If flow version was successfully deleted |
|
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 flow version was not found |
|
54
|
+
|
55
|
+
<br/>
|
56
|
+
|
57
|
+
## Get
|
58
|
+
|
59
|
+
Retrieves information on a flow version
|
60
|
+
|
61
|
+
```ruby
|
62
|
+
result = client.flow_version.get(
|
63
|
+
applicationId: my_application_id,
|
64
|
+
flowId: my_flow_id,
|
65
|
+
flowVersionId: my_flow_version_id)
|
66
|
+
|
67
|
+
puts result
|
68
|
+
```
|
69
|
+
|
70
|
+
#### Authentication
|
71
|
+
The client must be configured with a valid api access token to call this
|
72
|
+
action. The token must include at least one of the following scopes:
|
73
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.get.
|
74
|
+
|
75
|
+
#### Available Parameters
|
76
|
+
|
77
|
+
| Name | Type | Required | Description | Default | Example |
|
78
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
79
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
80
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
81
|
+
| flowVersionId | string | Y | ID associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
|
82
|
+
|
83
|
+
#### Successful Responses
|
84
|
+
|
85
|
+
| Code | Type | Description |
|
86
|
+
| ---- | ---- | ----------- |
|
87
|
+
| 200 | [Workflow Version](_schemas.md#workflow-version) | Flow version information |
|
88
|
+
|
89
|
+
#### Error Responses
|
90
|
+
|
91
|
+
| Code | Type | Description |
|
92
|
+
| ---- | ---- | ----------- |
|
93
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
94
|
+
| 404 | [Error](_schemas.md#error) | Error if flow version was not found |
|
95
|
+
|
96
|
+
<br/>
|
97
|
+
|
98
|
+
## Get Log Entries
|
99
|
+
|
100
|
+
Retrieve the recent log entries about runs of this workflow version
|
101
|
+
|
102
|
+
```ruby
|
103
|
+
result = client.flow_version.get_log_entries(
|
104
|
+
applicationId: my_application_id,
|
105
|
+
flowId: my_flow_id,
|
106
|
+
flowVersionId: my_flow_version_id)
|
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.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.log.
|
115
|
+
|
116
|
+
#### Available Parameters
|
117
|
+
|
118
|
+
| Name | Type | Required | Description | Default | Example |
|
119
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
120
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
121
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
122
|
+
| flowVersionId | string | Y | ID associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
|
123
|
+
| limit | string | N | Max log entries to return (ordered by time descending) | 1 | 10 |
|
124
|
+
| since | string | N | Look for log entries since this time (ms since epoch) | | 1465790400000 |
|
125
|
+
|
126
|
+
#### Successful Responses
|
127
|
+
|
128
|
+
| Code | Type | Description |
|
129
|
+
| ---- | ---- | ----------- |
|
130
|
+
| 200 | [Workflow Log](_schemas.md#workflow-log) | Recent log entries |
|
131
|
+
|
132
|
+
#### Error Responses
|
133
|
+
|
134
|
+
| Code | Type | Description |
|
135
|
+
| ---- | ---- | ----------- |
|
136
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
137
|
+
| 404 | [Error](_schemas.md#error) | Error if device was not found |
|
138
|
+
|
139
|
+
<br/>
|
140
|
+
|
141
|
+
## Patch
|
142
|
+
|
143
|
+
Updates information about a flow version
|
144
|
+
|
145
|
+
```ruby
|
146
|
+
result = client.flow_version.patch(
|
147
|
+
applicationId: my_application_id,
|
148
|
+
flowId: my_flow_id,
|
149
|
+
flowVersionId: my_flow_version_id,
|
150
|
+
flowVersion: my_flow_version)
|
151
|
+
|
152
|
+
puts result
|
153
|
+
```
|
154
|
+
|
155
|
+
#### Authentication
|
156
|
+
The client must be configured with a valid api access token to call this
|
157
|
+
action. The token must include at least one of the following scopes:
|
158
|
+
all.Application, all.Organization, all.User, flowVersion.*, or flowVersion.patch.
|
159
|
+
|
160
|
+
#### Available Parameters
|
161
|
+
|
162
|
+
| Name | Type | Required | Description | Default | Example |
|
163
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
164
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
165
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
166
|
+
| flowVersionId | string | Y | ID associated with the flow version | | 675ed18f7ae143cd83dc4bb7 |
|
167
|
+
| flowVersion | [Workflow Version Patch](_schemas.md#workflow-version-patch) | Y | Object containing new properties of the flow version | | [Workflow Version Patch Example](_schemas.md#workflow-version-patch-example) |
|
168
|
+
|
169
|
+
#### Successful Responses
|
170
|
+
|
171
|
+
| Code | Type | Description |
|
172
|
+
| ---- | ---- | ----------- |
|
173
|
+
| 200 | [Workflow Version](_schemas.md#workflow-version) | Updated flow version information |
|
174
|
+
|
175
|
+
#### Error Responses
|
176
|
+
|
177
|
+
| Code | Type | Description |
|
178
|
+
| ---- | ---- | ----------- |
|
179
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
180
|
+
| 404 | [Error](_schemas.md#error) | Error if flow version was not found |
|
@@ -0,0 +1,97 @@
|
|
1
|
+
# Flow Versions Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Flow Versions resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
* [Post](#post)
|
11
|
+
|
12
|
+
<br/>
|
13
|
+
|
14
|
+
## Get
|
15
|
+
|
16
|
+
Returns the flow versions for a flow
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
result = client.flow_versions.get(
|
20
|
+
applicationId: my_application_id,
|
21
|
+
flowId: my_flow_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, flowVersions.*, or flowVersions.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
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
37
|
+
| sortField | string | N | Field to sort the results by. Accepted values are: version, id, creationDate | version | version |
|
38
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
39
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
40
|
+
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
41
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: version | | version |
|
42
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*version |
|
43
|
+
|
44
|
+
#### Successful Responses
|
45
|
+
|
46
|
+
| Code | Type | Description |
|
47
|
+
| ---- | ---- | ----------- |
|
48
|
+
| 200 | [Workflow Versions](_schemas.md#workflow-versions) | Collection of flow versions |
|
49
|
+
|
50
|
+
#### Error Responses
|
51
|
+
|
52
|
+
| Code | Type | Description |
|
53
|
+
| ---- | ---- | ----------- |
|
54
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
55
|
+
| 404 | [Error](_schemas.md#error) | Error if flow was not found |
|
56
|
+
|
57
|
+
<br/>
|
58
|
+
|
59
|
+
## Post
|
60
|
+
|
61
|
+
Create or replace a flow version for a flow
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
result = client.flow_versions.post(
|
65
|
+
applicationId: my_application_id,
|
66
|
+
flowId: my_flow_id,
|
67
|
+
flowVersion: my_flow_version)
|
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, flowVersions.*, or flowVersions.post.
|
76
|
+
|
77
|
+
#### Available Parameters
|
78
|
+
|
79
|
+
| Name | Type | Required | Description | Default | Example |
|
80
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
81
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
82
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
83
|
+
| flowVersion | [Workflow Version Post](_schemas.md#workflow-version-post) | Y | New flow version information | | [Workflow Version Post Example](_schemas.md#workflow-version-post-example) |
|
84
|
+
| allowReplacement | undefined | N | Allow replacement of an existing flow version with same version name | false | true |
|
85
|
+
|
86
|
+
#### Successful Responses
|
87
|
+
|
88
|
+
| Code | Type | Description |
|
89
|
+
| ---- | ---- | ----------- |
|
90
|
+
| 201 | [Workflow Version](_schemas.md#workflow-version) | Successfully created flow version |
|
91
|
+
|
92
|
+
#### Error Responses
|
93
|
+
|
94
|
+
| Code | Type | Description |
|
95
|
+
| ---- | ---- | ----------- |
|
96
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
97
|
+
| 404 | [Error](_schemas.md#error) | Error if flow was not found |
|
data/docs/flows.md
CHANGED
@@ -37,7 +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
|
-
| triggerFilter | [Workflow Trigger Filter](_schemas.md#workflow-trigger-filter) | N | Array of triggers to filter by. | | [Workflow Trigger Filter Example](_schemas.md#workflow-trigger-filter-example) |
|
40
|
+
| 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
41
|
|
42
42
|
#### Successful Responses
|
43
43
|
|
data/lib/losant_rest.rb
CHANGED
@@ -48,6 +48,8 @@ require_relative "losant_rest/experience_groups"
|
|
48
48
|
require_relative "losant_rest/experience_user"
|
49
49
|
require_relative "losant_rest/experience_users"
|
50
50
|
require_relative "losant_rest/flow"
|
51
|
+
require_relative "losant_rest/flow_version"
|
52
|
+
require_relative "losant_rest/flow_versions"
|
51
53
|
require_relative "losant_rest/flows"
|
52
54
|
require_relative "losant_rest/integration"
|
53
55
|
require_relative "losant_rest/integrations"
|
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.6.
|
30
|
+
# Built For Version 1.6.2
|
31
31
|
class Client
|
32
32
|
attr_accessor :auth_token, :url
|
33
33
|
|
@@ -136,6 +136,14 @@ module LosantRest
|
|
136
136
|
@flow ||= Flow.new(self)
|
137
137
|
end
|
138
138
|
|
139
|
+
def flow_version
|
140
|
+
@flow_version ||= FlowVersion.new(self)
|
141
|
+
end
|
142
|
+
|
143
|
+
def flow_versions
|
144
|
+
@flow_versions ||= FlowVersions.new(self)
|
145
|
+
end
|
146
|
+
|
139
147
|
def flows
|
140
148
|
@flows ||= Flows.new(self)
|
141
149
|
end
|
@@ -194,7 +202,7 @@ module LosantRest
|
|
194
202
|
|
195
203
|
headers["Accept"] = "application/json"
|
196
204
|
headers["Content-Type"] = "application/json"
|
197
|
-
headers["Accept-Version"] = "^1.6.
|
205
|
+
headers["Accept-Version"] = "^1.6.2"
|
198
206
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
199
207
|
path = self.url + options.fetch(:path, "")
|
200
208
|
|
data/lib/losant_rest/flow.rb
CHANGED
@@ -0,0 +1,232 @@
|
|
1
|
+
# The MIT License (MIT)
|
2
|
+
#
|
3
|
+
# Copyright (c) 2017 Losant IoT, Inc.
|
4
|
+
#
|
5
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
# of this software and associated documentation files (the "Software"), to deal
|
7
|
+
# in the Software without restriction, including without limitation the rights
|
8
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
# copies of the Software, and to permit persons to whom the Software is
|
10
|
+
# furnished to do so, subject to the following conditions:
|
11
|
+
#
|
12
|
+
# The above copyright notice and this permission notice shall be included in all
|
13
|
+
# copies or substantial portions of the Software.
|
14
|
+
#
|
15
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
# SOFTWARE.
|
22
|
+
|
23
|
+
module LosantRest
|
24
|
+
|
25
|
+
# Class containing all the actions for the Flow Version Resource
|
26
|
+
class FlowVersion
|
27
|
+
|
28
|
+
def initialize(client)
|
29
|
+
@client = client
|
30
|
+
end
|
31
|
+
|
32
|
+
# Deletes a flow version
|
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, flowVersion.*, or flowVersion.delete.
|
39
|
+
#
|
40
|
+
# Parameters:
|
41
|
+
# * {string} applicationId - ID associated with the application
|
42
|
+
# * {string} flowId - ID associated with the flow
|
43
|
+
# * {string} flowVersionId - ID associated with the flow version
|
44
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
45
|
+
# * {boolean} _actions - Return resource actions in response
|
46
|
+
# * {boolean} _links - Return resource link in response
|
47
|
+
# * {boolean} _embedded - Return embedded resources in response
|
48
|
+
#
|
49
|
+
# Responses:
|
50
|
+
# * 200 - If flow version was successfully deleted (https://api.losant.com/#/definitions/success)
|
51
|
+
#
|
52
|
+
# Errors:
|
53
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
54
|
+
# * 404 - Error if flow version was not found (https://api.losant.com/#/definitions/error)
|
55
|
+
def delete(params = {})
|
56
|
+
params = Utils.symbolize_hash_keys(params)
|
57
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
58
|
+
headers = {}
|
59
|
+
body = nil
|
60
|
+
|
61
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
62
|
+
raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
|
63
|
+
raise ArgumentError.new("flowVersionId is required") unless params.has_key?(:flowVersionId)
|
64
|
+
|
65
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
66
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
67
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
68
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
69
|
+
|
70
|
+
path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/versions/#{params[:flowVersionId]}"
|
71
|
+
|
72
|
+
@client.request(
|
73
|
+
method: :delete,
|
74
|
+
path: path,
|
75
|
+
query: query_params,
|
76
|
+
headers: headers,
|
77
|
+
body: body)
|
78
|
+
end
|
79
|
+
|
80
|
+
# Retrieves information on a flow version
|
81
|
+
#
|
82
|
+
# Authentication:
|
83
|
+
# The client must be configured with a valid api
|
84
|
+
# access token to call this action. The token
|
85
|
+
# must include at least one of the following scopes:
|
86
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.get.
|
87
|
+
#
|
88
|
+
# Parameters:
|
89
|
+
# * {string} applicationId - ID associated with the application
|
90
|
+
# * {string} flowId - ID associated with the flow
|
91
|
+
# * {string} flowVersionId - ID associated with the flow version
|
92
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
93
|
+
# * {boolean} _actions - Return resource actions in response
|
94
|
+
# * {boolean} _links - Return resource link in response
|
95
|
+
# * {boolean} _embedded - Return embedded resources in response
|
96
|
+
#
|
97
|
+
# Responses:
|
98
|
+
# * 200 - Flow version information (https://api.losant.com/#/definitions/flowVersion)
|
99
|
+
#
|
100
|
+
# Errors:
|
101
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
102
|
+
# * 404 - Error if flow version was not found (https://api.losant.com/#/definitions/error)
|
103
|
+
def get(params = {})
|
104
|
+
params = Utils.symbolize_hash_keys(params)
|
105
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
106
|
+
headers = {}
|
107
|
+
body = nil
|
108
|
+
|
109
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
110
|
+
raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
|
111
|
+
raise ArgumentError.new("flowVersionId is required") unless params.has_key?(:flowVersionId)
|
112
|
+
|
113
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
114
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
115
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
116
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
117
|
+
|
118
|
+
path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/versions/#{params[:flowVersionId]}"
|
119
|
+
|
120
|
+
@client.request(
|
121
|
+
method: :get,
|
122
|
+
path: path,
|
123
|
+
query: query_params,
|
124
|
+
headers: headers,
|
125
|
+
body: body)
|
126
|
+
end
|
127
|
+
|
128
|
+
# Retrieve the recent log entries about runs of this workflow version
|
129
|
+
#
|
130
|
+
# Authentication:
|
131
|
+
# The client must be configured with a valid api
|
132
|
+
# access token to call this action. The token
|
133
|
+
# must include at least one of the following scopes:
|
134
|
+
# all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, flowVersion.*, or flowVersion.log.
|
135
|
+
#
|
136
|
+
# Parameters:
|
137
|
+
# * {string} applicationId - ID associated with the application
|
138
|
+
# * {string} flowId - ID associated with the flow
|
139
|
+
# * {string} flowVersionId - ID associated with the flow version
|
140
|
+
# * {string} limit - Max log entries to return (ordered by time descending)
|
141
|
+
# * {string} since - Look for log entries since this time (ms since epoch)
|
142
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
143
|
+
# * {boolean} _actions - Return resource actions in response
|
144
|
+
# * {boolean} _links - Return resource link in response
|
145
|
+
# * {boolean} _embedded - Return embedded resources in response
|
146
|
+
#
|
147
|
+
# Responses:
|
148
|
+
# * 200 - Recent log entries (https://api.losant.com/#/definitions/flowLog)
|
149
|
+
#
|
150
|
+
# Errors:
|
151
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
152
|
+
# * 404 - Error if device was not found (https://api.losant.com/#/definitions/error)
|
153
|
+
def get_log_entries(params = {})
|
154
|
+
params = Utils.symbolize_hash_keys(params)
|
155
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
156
|
+
headers = {}
|
157
|
+
body = nil
|
158
|
+
|
159
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
160
|
+
raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
|
161
|
+
raise ArgumentError.new("flowVersionId is required") unless params.has_key?(:flowVersionId)
|
162
|
+
|
163
|
+
query_params[:limit] = params[:limit] if params.has_key?(:limit)
|
164
|
+
query_params[:since] = params[:since] if params.has_key?(:since)
|
165
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
166
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
167
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
168
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
169
|
+
|
170
|
+
path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/versions/#{params[:flowVersionId]}/logs"
|
171
|
+
|
172
|
+
@client.request(
|
173
|
+
method: :get,
|
174
|
+
path: path,
|
175
|
+
query: query_params,
|
176
|
+
headers: headers,
|
177
|
+
body: body)
|
178
|
+
end
|
179
|
+
|
180
|
+
# Updates information about a flow version
|
181
|
+
#
|
182
|
+
# Authentication:
|
183
|
+
# The client must be configured with a valid api
|
184
|
+
# access token to call this action. The token
|
185
|
+
# must include at least one of the following scopes:
|
186
|
+
# all.Application, all.Organization, all.User, flowVersion.*, or flowVersion.patch.
|
187
|
+
#
|
188
|
+
# Parameters:
|
189
|
+
# * {string} applicationId - ID associated with the application
|
190
|
+
# * {string} flowId - ID associated with the flow
|
191
|
+
# * {string} flowVersionId - ID associated with the flow version
|
192
|
+
# * {hash} flowVersion - Object containing new properties of the flow version (https://api.losant.com/#/definitions/flowVersionPatch)
|
193
|
+
# * {string} losantdomain - Domain scope of request (rarely needed)
|
194
|
+
# * {boolean} _actions - Return resource actions in response
|
195
|
+
# * {boolean} _links - Return resource link in response
|
196
|
+
# * {boolean} _embedded - Return embedded resources in response
|
197
|
+
#
|
198
|
+
# Responses:
|
199
|
+
# * 200 - Updated flow version information (https://api.losant.com/#/definitions/flowVersion)
|
200
|
+
#
|
201
|
+
# Errors:
|
202
|
+
# * 400 - Error if malformed request (https://api.losant.com/#/definitions/error)
|
203
|
+
# * 404 - Error if flow version was not found (https://api.losant.com/#/definitions/error)
|
204
|
+
def patch(params = {})
|
205
|
+
params = Utils.symbolize_hash_keys(params)
|
206
|
+
query_params = { _actions: false, _links: true, _embedded: true }
|
207
|
+
headers = {}
|
208
|
+
body = nil
|
209
|
+
|
210
|
+
raise ArgumentError.new("applicationId is required") unless params.has_key?(:applicationId)
|
211
|
+
raise ArgumentError.new("flowId is required") unless params.has_key?(:flowId)
|
212
|
+
raise ArgumentError.new("flowVersionId is required") unless params.has_key?(:flowVersionId)
|
213
|
+
raise ArgumentError.new("flowVersion is required") unless params.has_key?(:flowVersion)
|
214
|
+
|
215
|
+
body = params[:flowVersion] if params.has_key?(:flowVersion)
|
216
|
+
headers[:losantdomain] = params[:losantdomain] if params.has_key?(:losantdomain)
|
217
|
+
query_params[:_actions] = params[:_actions] if params.has_key?(:_actions)
|
218
|
+
query_params[:_links] = params[:_links] if params.has_key?(:_links)
|
219
|
+
query_params[:_embedded] = params[:_embedded] if params.has_key?(:_embedded)
|
220
|
+
|
221
|
+
path = "/applications/#{params[:applicationId]}/flows/#{params[:flowId]}/versions/#{params[:flowVersionId]}"
|
222
|
+
|
223
|
+
@client.request(
|
224
|
+
method: :patch,
|
225
|
+
path: path,
|
226
|
+
query: query_params,
|
227
|
+
headers: headers,
|
228
|
+
body: body)
|
229
|
+
end
|
230
|
+
|
231
|
+
end
|
232
|
+
end
|