losant_rest 1.2.3 → 1.3.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 +21 -0
- data/docs/_schemas.md +997 -157
- data/docs/dataTable.md +214 -0
- data/docs/dataTableRow.md +136 -0
- data/docs/dataTableRows.md +139 -0
- data/docs/dataTables.md +91 -0
- data/docs/flow.md +41 -1
- data/lib/losant_rest/client.rb +18 -2
- data/lib/losant_rest/data_table.rb +272 -0
- data/lib/losant_rest/data_table_row.rb +180 -0
- data/lib/losant_rest/data_table_rows.rb +192 -0
- data/lib/losant_rest/data_tables.rb +136 -0
- data/lib/losant_rest/flow.rb +47 -1
- data/lib/losant_rest/version.rb +1 -1
- data/lib/losant_rest.rb +4 -0
- data/schemas/application.json +3 -0
- data/schemas/applicationApiTokenPost.json +16 -0
- data/schemas/applications.json +3 -0
- data/schemas/auditLog.json +1 -0
- data/schemas/auditLogFilter.json +1 -0
- data/schemas/auditLogs.json +1 -0
- data/schemas/dataTable.json +79 -0
- data/schemas/dataTableColumn.json +39 -0
- data/schemas/dataTablePatch.json +16 -0
- data/schemas/dataTablePost.json +63 -0
- data/schemas/dataTableQuery.json +86 -0
- data/schemas/dataTableRow.json +28 -0
- data/schemas/dataTableRowInsertUpdate.json +15 -0
- data/schemas/dataTableRows.json +68 -0
- data/schemas/dataTables.json +121 -0
- data/schemas/flow.json +1 -0
- data/schemas/flowPatch.json +1 -0
- data/schemas/flowPost.json +1 -0
- data/schemas/flowVersion.json +1 -0
- data/schemas/flowVersionPost.json +1 -0
- data/schemas/flowVersions.json +1 -0
- data/schemas/flows.json +1 -0
- data/schemas/me.json +14 -0
- data/schemas/org.json +14 -0
- data/schemas/orgs.json +14 -0
- data/schemas/payloadCounts.json +8 -0
- metadata +19 -2
data/docs/dataTable.md
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
# Data Table Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Data Table resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Add Column](#add-column)
|
10
|
+
* [Delete](#delete)
|
11
|
+
* [Get](#get)
|
12
|
+
* [Patch](#patch)
|
13
|
+
* [Remove Column](#remove-column)
|
14
|
+
|
15
|
+
<br/>
|
16
|
+
|
17
|
+
## Add Column
|
18
|
+
|
19
|
+
Adds a new column to this data table
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
result = client.data_table.add_column(
|
23
|
+
applicationId: my_application_id,
|
24
|
+
dataTableId: my_data_table_id,
|
25
|
+
dataTableColumn: my_data_table_column)
|
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, dataTable.*, or dataTable.addColumn.
|
34
|
+
|
35
|
+
#### Available Parameters
|
36
|
+
|
37
|
+
| Name | Type | Required | Description | Default | Example |
|
38
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
39
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
40
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
41
|
+
| dataTableColumn | [Data Table Column](_schemas.md#data-table-column) | Y | Object containing the new column properties | | [Data Table Column Example](_schemas.md#data-table-column-example) |
|
42
|
+
|
43
|
+
#### Successful Responses
|
44
|
+
|
45
|
+
| Code | Type | Description |
|
46
|
+
| ---- | ---- | ----------- |
|
47
|
+
| 200 | [Data Table](_schemas.md#data-table) | Updated data table information |
|
48
|
+
|
49
|
+
#### Error Responses
|
50
|
+
|
51
|
+
| Code | Type | Description |
|
52
|
+
| ---- | ---- | ----------- |
|
53
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
54
|
+
| 404 | [Error](_schemas.md#error) | Error if data table was not found |
|
55
|
+
|
56
|
+
<br/>
|
57
|
+
|
58
|
+
## Delete
|
59
|
+
|
60
|
+
Deletes a data table
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
result = client.data_table.delete(
|
64
|
+
applicationId: my_application_id,
|
65
|
+
dataTableId: my_data_table_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.Organization, all.User, dataTable.*, or dataTable.delete.
|
74
|
+
|
75
|
+
#### Available Parameters
|
76
|
+
|
77
|
+
| Name | Type | Required | Description | Default | Example |
|
78
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
79
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
80
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
81
|
+
|
82
|
+
#### Successful Responses
|
83
|
+
|
84
|
+
| Code | Type | Description |
|
85
|
+
| ---- | ---- | ----------- |
|
86
|
+
| 200 | [Success](_schemas.md#success) | If data table was successfully deleted |
|
87
|
+
|
88
|
+
#### Error Responses
|
89
|
+
|
90
|
+
| Code | Type | Description |
|
91
|
+
| ---- | ---- | ----------- |
|
92
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
93
|
+
| 404 | [Error](_schemas.md#error) | Error if data table was not found |
|
94
|
+
|
95
|
+
<br/>
|
96
|
+
|
97
|
+
## Get
|
98
|
+
|
99
|
+
Retrieves information on a data table
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
result = client.data_table.get(
|
103
|
+
applicationId: my_application_id,
|
104
|
+
dataTableId: my_data_table_id)
|
105
|
+
|
106
|
+
puts result
|
107
|
+
```
|
108
|
+
|
109
|
+
#### Authentication
|
110
|
+
The client must be configured with a valid api access token to call this
|
111
|
+
action. The token must include at least one of the following scopes:
|
112
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, dataTable.*, or dataTable.get.
|
113
|
+
|
114
|
+
#### Available Parameters
|
115
|
+
|
116
|
+
| Name | Type | Required | Description | Default | Example |
|
117
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
118
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
119
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
120
|
+
|
121
|
+
#### Successful Responses
|
122
|
+
|
123
|
+
| Code | Type | Description |
|
124
|
+
| ---- | ---- | ----------- |
|
125
|
+
| 200 | [Data Table](_schemas.md#data-table) | Data table information |
|
126
|
+
|
127
|
+
#### Error Responses
|
128
|
+
|
129
|
+
| Code | Type | Description |
|
130
|
+
| ---- | ---- | ----------- |
|
131
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
132
|
+
| 404 | [Error](_schemas.md#error) | Error if data table was not found |
|
133
|
+
|
134
|
+
<br/>
|
135
|
+
|
136
|
+
## Patch
|
137
|
+
|
138
|
+
Updates information about a data table
|
139
|
+
|
140
|
+
```ruby
|
141
|
+
result = client.data_table.patch(
|
142
|
+
applicationId: my_application_id,
|
143
|
+
dataTableId: my_data_table_id,
|
144
|
+
dataTable: my_data_table)
|
145
|
+
|
146
|
+
puts result
|
147
|
+
```
|
148
|
+
|
149
|
+
#### Authentication
|
150
|
+
The client must be configured with a valid api access token to call this
|
151
|
+
action. The token must include at least one of the following scopes:
|
152
|
+
all.Application, all.Organization, all.User, dataTable.*, or dataTable.patch.
|
153
|
+
|
154
|
+
#### Available Parameters
|
155
|
+
|
156
|
+
| Name | Type | Required | Description | Default | Example |
|
157
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
158
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
159
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
160
|
+
| dataTable | [Data Table Patch](_schemas.md#data-table-patch) | Y | Object containing updated properties of the data table | | [Data Table Patch Example](_schemas.md#data-table-patch-example) |
|
161
|
+
|
162
|
+
#### Successful Responses
|
163
|
+
|
164
|
+
| Code | Type | Description |
|
165
|
+
| ---- | ---- | ----------- |
|
166
|
+
| 200 | [Data Table](_schemas.md#data-table) | Updated data table information |
|
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 data table was not found |
|
174
|
+
|
175
|
+
<br/>
|
176
|
+
|
177
|
+
## Remove Column
|
178
|
+
|
179
|
+
Removes a column from this data table
|
180
|
+
|
181
|
+
```ruby
|
182
|
+
result = client.data_table.remove_column(
|
183
|
+
applicationId: my_application_id,
|
184
|
+
dataTableId: my_data_table_id,
|
185
|
+
columnName: my_column_name)
|
186
|
+
|
187
|
+
puts result
|
188
|
+
```
|
189
|
+
|
190
|
+
#### Authentication
|
191
|
+
The client must be configured with a valid api access token to call this
|
192
|
+
action. The token must include at least one of the following scopes:
|
193
|
+
all.Application, all.Organization, all.User, dataTable.*, or dataTable.removeColumn.
|
194
|
+
|
195
|
+
#### Available Parameters
|
196
|
+
|
197
|
+
| Name | Type | Required | Description | Default | Example |
|
198
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
199
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
200
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
201
|
+
| columnName | string | Y | Name of the column to remove | | myColumnName |
|
202
|
+
|
203
|
+
#### Successful Responses
|
204
|
+
|
205
|
+
| Code | Type | Description |
|
206
|
+
| ---- | ---- | ----------- |
|
207
|
+
| 200 | [Data Table](_schemas.md#data-table) | Updated data table information |
|
208
|
+
|
209
|
+
#### Error Responses
|
210
|
+
|
211
|
+
| Code | Type | Description |
|
212
|
+
| ---- | ---- | ----------- |
|
213
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
214
|
+
| 404 | [Error](_schemas.md#error) | Error if data table was not found |
|
@@ -0,0 +1,136 @@
|
|
1
|
+
# Data Table Row Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Data Table Row resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Delete](#delete)
|
10
|
+
* [Get](#get)
|
11
|
+
* [Patch](#patch)
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
## Delete
|
16
|
+
|
17
|
+
Deletes a data table row
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
result = client.data_table_row.delete(
|
21
|
+
applicationId: my_application_id,
|
22
|
+
dataTableId: my_data_table_id,
|
23
|
+
rowId: my_row_id)
|
24
|
+
|
25
|
+
puts result
|
26
|
+
```
|
27
|
+
|
28
|
+
#### Authentication
|
29
|
+
The client must be configured with a valid api access token to call this
|
30
|
+
action. The token must include at least one of the following scopes:
|
31
|
+
all.Application, all.Organization, all.User, dataTableRow.*, or dataTableRow.delete.
|
32
|
+
|
33
|
+
#### Available Parameters
|
34
|
+
|
35
|
+
| Name | Type | Required | Description | Default | Example |
|
36
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
37
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
38
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
39
|
+
| rowId | string | Y | ID associated with the data table row | | 596f832b128eda5cfe765443 |
|
40
|
+
|
41
|
+
#### Successful Responses
|
42
|
+
|
43
|
+
| Code | Type | Description |
|
44
|
+
| ---- | ---- | ----------- |
|
45
|
+
| 200 | [Success](_schemas.md#success) | If data table row was successfully deleted |
|
46
|
+
|
47
|
+
#### Error Responses
|
48
|
+
|
49
|
+
| Code | Type | Description |
|
50
|
+
| ---- | ---- | ----------- |
|
51
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
52
|
+
| 404 | [Error](_schemas.md#error) | Error if data table row was not found |
|
53
|
+
|
54
|
+
<br/>
|
55
|
+
|
56
|
+
## Get
|
57
|
+
|
58
|
+
Retrieves the data table row
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
result = client.data_table_row.get(
|
62
|
+
applicationId: my_application_id,
|
63
|
+
dataTableId: my_data_table_id,
|
64
|
+
rowId: my_row_id)
|
65
|
+
|
66
|
+
puts result
|
67
|
+
```
|
68
|
+
|
69
|
+
#### Authentication
|
70
|
+
The client must be configured with a valid api access token to call this
|
71
|
+
action. The token must include at least one of the following scopes:
|
72
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, dataTableRow.*, or dataTableRow.get.
|
73
|
+
|
74
|
+
#### Available Parameters
|
75
|
+
|
76
|
+
| Name | Type | Required | Description | Default | Example |
|
77
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
78
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
79
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
80
|
+
| rowId | string | Y | ID associated with the data table row | | 596f832b128eda5cfe765443 |
|
81
|
+
|
82
|
+
#### Successful Responses
|
83
|
+
|
84
|
+
| Code | Type | Description |
|
85
|
+
| ---- | ---- | ----------- |
|
86
|
+
| 200 | [Data Table Row](_schemas.md#data-table-row) | Data table row information |
|
87
|
+
|
88
|
+
#### Error Responses
|
89
|
+
|
90
|
+
| Code | Type | Description |
|
91
|
+
| ---- | ---- | ----------- |
|
92
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
93
|
+
| 404 | [Error](_schemas.md#error) | Error if data table row was not found |
|
94
|
+
|
95
|
+
<br/>
|
96
|
+
|
97
|
+
## Patch
|
98
|
+
|
99
|
+
Updates the data table row
|
100
|
+
|
101
|
+
```ruby
|
102
|
+
result = client.data_table_row.patch(
|
103
|
+
applicationId: my_application_id,
|
104
|
+
dataTableId: my_data_table_id,
|
105
|
+
rowId: my_row_id,
|
106
|
+
dataTableRow: my_data_table_row)
|
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, dataTableRow.*, or dataTableRow.patch.
|
115
|
+
|
116
|
+
#### Available Parameters
|
117
|
+
|
118
|
+
| Name | Type | Required | Description | Default | Example |
|
119
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
120
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
121
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
122
|
+
| rowId | string | Y | ID associated with the data table row | | 596f832b128eda5cfe765443 |
|
123
|
+
| dataTableRow | [Data Table Row Insert/Update](_schemas.md#data-table-row-insert/update) | Y | Object containing updated properties for the data table row | | [Data Table Row Insert/Update Example](_schemas.md#data-table-row-insert/update-example) |
|
124
|
+
|
125
|
+
#### Successful Responses
|
126
|
+
|
127
|
+
| Code | Type | Description |
|
128
|
+
| ---- | ---- | ----------- |
|
129
|
+
| 200 | [Data Table Row](_schemas.md#data-table-row) | Updated data table row information |
|
130
|
+
|
131
|
+
#### Error Responses
|
132
|
+
|
133
|
+
| Code | Type | Description |
|
134
|
+
| ---- | ---- | ----------- |
|
135
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
136
|
+
| 404 | [Error](_schemas.md#error) | Error if data table row was not found |
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# Data Table Rows Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Data Table Rows resource, including the expected
|
5
|
+
parameters and the potential responses.
|
6
|
+
|
7
|
+
##### Contents
|
8
|
+
|
9
|
+
* [Get](#get)
|
10
|
+
* [Post](#post)
|
11
|
+
* [Query](#query)
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
## Get
|
16
|
+
|
17
|
+
Returns the rows for a data table
|
18
|
+
|
19
|
+
```ruby
|
20
|
+
result = client.data_table_rows.get(
|
21
|
+
applicationId: my_application_id,
|
22
|
+
dataTableId: my_data_table_id)
|
23
|
+
|
24
|
+
puts result
|
25
|
+
```
|
26
|
+
|
27
|
+
#### Authentication
|
28
|
+
The client must be configured with a valid api access token to call this
|
29
|
+
action. The token must include at least one of the following scopes:
|
30
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, dataTableRows.*, or dataTableRows.get.
|
31
|
+
|
32
|
+
#### Available Parameters
|
33
|
+
|
34
|
+
| Name | Type | Required | Description | Default | Example |
|
35
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
36
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
37
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
38
|
+
| sortColumn | string | N | Column to sort the rows by | | myColumnName |
|
39
|
+
| sortDirection | string | N | Direction to sort the rows by. Accepted values are: asc, desc | asc | asc |
|
40
|
+
| limit | string | N | How many rows to return | 1000 | 0 |
|
41
|
+
| offset | string | N | How many rows to skip | 0 | 0 |
|
42
|
+
|
43
|
+
#### Successful Responses
|
44
|
+
|
45
|
+
| Code | Type | Description |
|
46
|
+
| ---- | ---- | ----------- |
|
47
|
+
| 200 | [Data Table Rows](_schemas.md#data-table-rows) | Collection of data table rows |
|
48
|
+
|
49
|
+
#### Error Responses
|
50
|
+
|
51
|
+
| Code | Type | Description |
|
52
|
+
| ---- | ---- | ----------- |
|
53
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
54
|
+
| 404 | [Error](_schemas.md#error) | Error if data table was not found |
|
55
|
+
|
56
|
+
<br/>
|
57
|
+
|
58
|
+
## Post
|
59
|
+
|
60
|
+
Inserts a new row into a data table
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
result = client.data_table_rows.post(
|
64
|
+
applicationId: my_application_id,
|
65
|
+
dataTableId: my_data_table_id,
|
66
|
+
dataTableRow: my_data_table_row)
|
67
|
+
|
68
|
+
puts result
|
69
|
+
```
|
70
|
+
|
71
|
+
#### Authentication
|
72
|
+
The client must be configured with a valid api access token to call this
|
73
|
+
action. The token must include at least one of the following scopes:
|
74
|
+
all.Application, all.Organization, all.User, dataTableRows.*, or dataTableRows.post.
|
75
|
+
|
76
|
+
#### Available Parameters
|
77
|
+
|
78
|
+
| Name | Type | Required | Description | Default | Example |
|
79
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
80
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
81
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
82
|
+
| dataTableRow | [Data Table Row Insert/Update](_schemas.md#data-table-row-insert/update) | Y | The row to insert | | [Data Table Row Insert/Update Example](_schemas.md#data-table-row-insert/update-example) |
|
83
|
+
|
84
|
+
#### Successful Responses
|
85
|
+
|
86
|
+
| Code | Type | Description |
|
87
|
+
| ---- | ---- | ----------- |
|
88
|
+
| 201 | [Data Table Row](_schemas.md#data-table-row) | Successfully created data table row |
|
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 data table was not found |
|
96
|
+
|
97
|
+
<br/>
|
98
|
+
|
99
|
+
## Query
|
100
|
+
|
101
|
+
Queries for rows from a data table
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
result = client.data_table_rows.query(
|
105
|
+
applicationId: my_application_id,
|
106
|
+
dataTableId: my_data_table_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, dataTableRows.*, or dataTableRows.query.
|
115
|
+
|
116
|
+
#### Available Parameters
|
117
|
+
|
118
|
+
| Name | Type | Required | Description | Default | Example |
|
119
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
120
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
121
|
+
| dataTableId | string | Y | ID associated with the data table | | 575ed78e7ae143cd83dc4aab |
|
122
|
+
| sortColumn | string | N | Column to sort the rows by | | myColumnName |
|
123
|
+
| sortDirection | string | N | Direction to sort the rows by. Accepted values are: asc, desc | asc | asc |
|
124
|
+
| limit | string | N | How many rows to return | 1000 | 0 |
|
125
|
+
| offset | string | N | How many rows to skip | 0 | 0 |
|
126
|
+
| query | [Data Table Query](_schemas.md#data-table-query) | N | Query to apply to filter the data table | | [Data Table Query Example](_schemas.md#data-table-query-example) |
|
127
|
+
|
128
|
+
#### Successful Responses
|
129
|
+
|
130
|
+
| Code | Type | Description |
|
131
|
+
| ---- | ---- | ----------- |
|
132
|
+
| 200 | [Data Table Rows](_schemas.md#data-table-rows) | Collection of data table rows |
|
133
|
+
|
134
|
+
#### Error Responses
|
135
|
+
|
136
|
+
| Code | Type | Description |
|
137
|
+
| ---- | ---- | ----------- |
|
138
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
139
|
+
| 404 | [Error](_schemas.md#error) | Error if data table was not found |
|
data/docs/dataTables.md
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
# Data Tables Actions
|
2
|
+
|
3
|
+
Details on the various actions that can be performed on the
|
4
|
+
Data Tables 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 data tables for an application
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
result = client.data_tables.get(applicationId: my_application_id)
|
20
|
+
|
21
|
+
puts result
|
22
|
+
```
|
23
|
+
|
24
|
+
#### Authentication
|
25
|
+
The client must be configured with a valid api access token to call this
|
26
|
+
action. The token must include at least one of the following scopes:
|
27
|
+
all.Application, all.Application.read, all.Organization, all.Organization.read, all.User, all.User.read, dataTables.*, or dataTables.get.
|
28
|
+
|
29
|
+
#### Available Parameters
|
30
|
+
|
31
|
+
| Name | Type | Required | Description | Default | Example |
|
32
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
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 |
|
35
|
+
| sortDirection | string | N | Direction to sort the results by. Accepted values are: asc, desc | asc | asc |
|
36
|
+
| page | string | N | Which page of results to return | 0 | 0 |
|
37
|
+
| perPage | string | N | How many items to return per page | 1000 | 10 |
|
38
|
+
| filterField | string | N | Field to filter the results by. Blank or not provided means no filtering. Accepted values are: name | | name |
|
39
|
+
| filter | string | N | Filter to apply against the filtered field. Supports globbing. Blank or not provided means no filtering. | | my*table |
|
40
|
+
|
41
|
+
#### Successful Responses
|
42
|
+
|
43
|
+
| Code | Type | Description |
|
44
|
+
| ---- | ---- | ----------- |
|
45
|
+
| 200 | [Data Tables](_schemas.md#data-tables) | Collection of data tables |
|
46
|
+
|
47
|
+
#### Error Responses
|
48
|
+
|
49
|
+
| Code | Type | Description |
|
50
|
+
| ---- | ---- | ----------- |
|
51
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
52
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
53
|
+
|
54
|
+
<br/>
|
55
|
+
|
56
|
+
## Post
|
57
|
+
|
58
|
+
Create a new data table for an application
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
result = client.data_tables.post(
|
62
|
+
applicationId: my_application_id,
|
63
|
+
dataTable: my_data_table)
|
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.Application, all.Organization, all.User, dataTables.*, or dataTables.post.
|
72
|
+
|
73
|
+
#### Available Parameters
|
74
|
+
|
75
|
+
| Name | Type | Required | Description | Default | Example |
|
76
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
77
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
78
|
+
| dataTable | [Data Table Post](_schemas.md#data-table-post) | Y | New data table information | | [Data Table Post Example](_schemas.md#data-table-post-example) |
|
79
|
+
|
80
|
+
#### Successful Responses
|
81
|
+
|
82
|
+
| Code | Type | Description |
|
83
|
+
| ---- | ---- | ----------- |
|
84
|
+
| 201 | [Data Table](_schemas.md#data-table) | Successfully created data table |
|
85
|
+
|
86
|
+
#### Error Responses
|
87
|
+
|
88
|
+
| Code | Type | Description |
|
89
|
+
| ---- | ---- | ----------- |
|
90
|
+
| 400 | [Error](_schemas.md#error) | Error if malformed request |
|
91
|
+
| 404 | [Error](_schemas.md#error) | Error if application was not found |
|
data/docs/flow.md
CHANGED
@@ -6,6 +6,7 @@ parameters and the potential responses.
|
|
6
6
|
|
7
7
|
##### Contents
|
8
8
|
|
9
|
+
* [Clear Storage Entries](#clear-storage-entries)
|
9
10
|
* [Delete](#delete)
|
10
11
|
* [Get](#get)
|
11
12
|
* [Get Log Entries](#get-log-entries)
|
@@ -16,6 +17,45 @@ parameters and the potential responses.
|
|
16
17
|
|
17
18
|
<br/>
|
18
19
|
|
20
|
+
## Clear Storage Entries
|
21
|
+
|
22
|
+
Clear all storage entries
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
result = client.flow.clear_storage_entries(
|
26
|
+
applicationId: my_application_id,
|
27
|
+
flowId: my_flow_id)
|
28
|
+
|
29
|
+
puts result
|
30
|
+
```
|
31
|
+
|
32
|
+
#### Authentication
|
33
|
+
The client must be configured with a valid api access token to call this
|
34
|
+
action. The token must include at least one of the following scopes:
|
35
|
+
all.Application, all.Organization, all.User, flow.*, or flow.clearStorageEntries.
|
36
|
+
|
37
|
+
#### Available Parameters
|
38
|
+
|
39
|
+
| Name | Type | Required | Description | Default | Example |
|
40
|
+
| ---- | ---- | -------- | ----------- | ------- | ------- |
|
41
|
+
| applicationId | string | Y | ID associated with the application | | 575ec8687ae143cd83dc4a97 |
|
42
|
+
| flowId | string | Y | ID associated with the flow | | 575ed18f7ae143cd83dc4aa6 |
|
43
|
+
|
44
|
+
#### Successful Responses
|
45
|
+
|
46
|
+
| Code | Type | Description |
|
47
|
+
| ---- | ---- | ----------- |
|
48
|
+
| 200 | [Workflow Storage Entries](_schemas.md#workflow-storage-entries) | The current storage entries |
|
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
|
+
|
19
59
|
## Delete
|
20
60
|
|
21
61
|
Deletes a flow
|
@@ -163,7 +203,7 @@ all.Application, all.Application.read, all.Organization, all.Organization.read,
|
|
163
203
|
|
164
204
|
| Code | Type | Description |
|
165
205
|
| ---- | ---- | ----------- |
|
166
|
-
| 200 | [Workflow Storage Entries](_schemas.md#workflow-storage-entries) | The
|
206
|
+
| 200 | [Workflow Storage Entries](_schemas.md#workflow-storage-entries) | The current storage entries |
|
167
207
|
|
168
208
|
#### Error Responses
|
169
209
|
|
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.7.0
|
31
31
|
class Client
|
32
32
|
attr_accessor :auth_token, :url
|
33
33
|
|
@@ -84,6 +84,22 @@ module LosantRest
|
|
84
84
|
@data ||= Data.new(self)
|
85
85
|
end
|
86
86
|
|
87
|
+
def data_table
|
88
|
+
@data_table ||= DataTable.new(self)
|
89
|
+
end
|
90
|
+
|
91
|
+
def data_table_row
|
92
|
+
@data_table_row ||= DataTableRow.new(self)
|
93
|
+
end
|
94
|
+
|
95
|
+
def data_table_rows
|
96
|
+
@data_table_rows ||= DataTableRows.new(self)
|
97
|
+
end
|
98
|
+
|
99
|
+
def data_tables
|
100
|
+
@data_tables ||= DataTables.new(self)
|
101
|
+
end
|
102
|
+
|
87
103
|
def device
|
88
104
|
@device ||= Device.new(self)
|
89
105
|
end
|
@@ -202,7 +218,7 @@ module LosantRest
|
|
202
218
|
|
203
219
|
headers["Accept"] = "application/json"
|
204
220
|
headers["Content-Type"] = "application/json"
|
205
|
-
headers["Accept-Version"] = "^1.
|
221
|
+
headers["Accept-Version"] = "^1.7.0"
|
206
222
|
headers["Authorization"] = "Bearer #{self.auth_token}" if self.auth_token
|
207
223
|
path = self.url + options.fetch(:path, "")
|
208
224
|
|