test-pack-1 1.0.0 → 1.0.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 +37 -768
- data/lib/test_pack_1.rb +2 -30
- data/lib/test_pack_1/configuration.rb +5 -17
- data/lib/test_pack_1/controllers/simple_calculator_controller.rb +53 -0
- data/lib/test_pack_1/models/operation_type_enum.rb +23 -0
- data/lib/test_pack_1/test_pack1_client.rb +4 -34
- data/test/controllers/test_simple_calculator_controller.rb +33 -0
- metadata +6 -64
- data/lib/test_pack_1/controllers/alerts_controller.rb +0 -381
- data/lib/test_pack_1/controllers/assets_controller.rb +0 -227
- data/lib/test_pack_1/controllers/configuration_data_controller.rb +0 -76
- data/lib/test_pack_1/controllers/data_controller.rb +0 -349
- data/lib/test_pack_1/controllers/statuses_controller.rb +0 -215
- data/lib/test_pack_1/http/auth/custom_query_auth.rb +0 -16
- data/lib/test_pack_1/models/aggregate_mode_enum.rb +0 -23
- data/lib/test_pack_1/models/alert_item.rb +0 -104
- data/lib/test_pack_1/models/calculation_mode_enum.rb +0 -20
- data/lib/test_pack_1/models/client_configuration.rb +0 -62
- data/lib/test_pack_1/models/configuration_item.rb +0 -55
- data/lib/test_pack_1/models/data_item.rb +0 -92
- data/lib/test_pack_1/models/data_per_category_item.rb +0 -82
- data/lib/test_pack_1/models/data_per_category_response.rb +0 -63
- data/lib/test_pack_1/models/data_real_time_item.rb +0 -83
- data/lib/test_pack_1/models/data_signal.rb +0 -53
- data/lib/test_pack_1/models/data_signal_configuration.rb +0 -66
- data/lib/test_pack_1/models/data_signal_item.rb +0 -62
- data/lib/test_pack_1/models/device.rb +0 -208
- data/lib/test_pack_1/models/device_model.rb +0 -53
- data/lib/test_pack_1/models/metadata_field.rb +0 -44
- data/lib/test_pack_1/models/power_curve.rb +0 -60
- data/lib/test_pack_1/models/power_curve_value.rb +0 -44
- data/lib/test_pack_1/models/resolution_enum.rb +0 -41
- data/lib/test_pack_1/models/site.rb +0 -44
- data/lib/test_pack_1/models/site_with_data.rb +0 -78
- data/lib/test_pack_1/models/status_category_enum.rb +0 -26
- data/lib/test_pack_1/models/status_item.rb +0 -161
- data/lib/test_pack_1/models/time_zone_configuration.rb +0 -76
- data/lib/test_pack_1/models/turbine_type.rb +0 -89
- data/test/controllers/test_assets_controller.rb +0 -46
- data/test/controllers/test_configuration_data_controller.rb +0 -44
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44c136d9cab67a1ce41b6c259aabbda87a74a9f0cb3472d98e9749b983dcfa29
|
4
|
+
data.tar.gz: 9a716656a56978acf9f957fb33b379baba173fb0181fc09b5ecc56a6a4834c39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dacd79aa1f1283c0f30d6b8cef5a6c5d819beffb15bdb0bf3065cdb6d50306115e61777a9e6183f2d7e8715d5fa7f6e381b3778bef30aa3ab90a30ace5ee601f
|
7
|
+
data.tar.gz: 3380f04c655b7f686fca22ff34222b54821971e0b57f5a5b98320649ad8056503af127f10f8ed23208aeb5453d70f74c1dae2be6355e57a2730d8c8337591be3
|
data/README.md
CHANGED
@@ -1,35 +1,6 @@
|
|
1
1
|
# Getting started
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
**Note that this is the beta version of the API,** containing new features that might change. This means that any SDKs downloaded for this version might have minor incompatibilities in the future. If you want to view the latest stable API specification, use the version selection dropdown in the top right of the page.
|
6
|
-
|
7
|
-
# What's new
|
8
|
-
## 2020-06-08 – Data endpoint aggregation by group
|
9
|
-
If you have divided you sites into groups of assets, you can now aggregate your data by those groups when calling the Data, Real Time Data, and Data Per Category endpoints.
|
10
|
-
The new `deviceLevel` aggregation mode (`aggregate` parameter) aggregates data based on the hierarchy level directly below site.
|
11
|
-
|
12
|
-
## 2020-04-27 – Data signal permissions
|
13
|
-
It is now possible to set permissions for individual data signals for API keys (**Share** > **API Keys** in the Greenbyte
|
14
|
-
Platform). When adding/editing an API key, there is a new option to select authorized data signals in addition to the
|
15
|
-
device selection. Leaving the signal selection blank (nothing selected) gives permission to all current and future data
|
16
|
-
signals, just like previously created API keys.
|
17
|
-
|
18
|
-
API endpoints affected by data signal permissions:
|
19
|
-
* `datasignals.json`: filters returned data signals based on permissions.
|
20
|
-
* `data.json`, `realtimedata.json`, `datapercategory.json`: gives *401 Unauthorized* error for data signals without permission.
|
21
|
-
* `status.json`, `activestatus.json`: may omit lost production values (in the `lostProduction` field) based on data signal permissions.
|
22
|
-
|
23
|
-
## 2020-03-30 – Data Per Category endpoint
|
24
|
-
We have added a new endpoint to the Greenbyte Platform to make it possible to extract Lost Production data per contract category from the API. You can find more information about this endpoint here: [Data Per Category](#/http/api-endpoints/data/get-data-per-category).
|
25
|
-
|
26
|
-
# General notes regarding endpoints
|
27
|
-
|
28
|
-
* Endpoints that take `page` and `pageSize` parameters return a `Link` header as defined in [RFC 8288](https://tools.ietf.org/html/rfc8288).
|
29
|
-
* Some endpoints return data in your local time zone. This time zone can be fetched from the `configuration.json` endpoint.
|
30
|
-
* All endpoints can also be reached using the POST method, with a JSON request body instead of query parameters.
|
31
|
-
* All endpoints implement rate limiting. More information is available under the *429* error response description for each endpoint.
|
32
|
-
|
3
|
+
Simple calculator API hosted on APIMATIC
|
33
4
|
|
34
5
|
## How to Build
|
35
6
|
|
@@ -37,9 +8,9 @@ This client library is a Ruby gem which can be compiled and used in your Ruby an
|
|
37
8
|
|
38
9
|
1. Open the command line interface or the terminal and navigate to the folder containing the source code.
|
39
10
|
2. Run ``` gem build test_pack_1.gemspec ``` to build the gem.
|
40
|
-
3. Once built, the gem can be installed on the current work environment using ``` gem install test_pack_1-1.0.
|
11
|
+
3. Once built, the gem can be installed on the current work environment using ``` gem install test_pack_1-1.0.2.gem ```
|
41
12
|
|
42
|
-
![Building Gem](https://apidocs.io/illustration/ruby?step=buildSDK&workspaceFolder=
|
13
|
+
![Building Gem](https://apidocs.io/illustration/ruby?step=buildSDK&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=APIMATIC%20Calculator-Ruby&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
43
14
|
|
44
15
|
## How to Use
|
45
16
|
|
@@ -49,41 +20,41 @@ The following section explains how to use the TestPack1 Ruby Gem in a new Rails
|
|
49
20
|
|
50
21
|
Close any existing projects in RubyMine™ by selecting ``` File -> Close Project ```. Next, click on ``` Create New Project ``` to create a new project from scratch.
|
51
22
|
|
52
|
-
![Create a new project in RubyMine](https://apidocs.io/illustration/ruby?step=createNewProject0&workspaceFolder=
|
23
|
+
![Create a new project in RubyMine](https://apidocs.io/illustration/ruby?step=createNewProject0&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
53
24
|
|
54
25
|
Next, provide ``` TestApp ``` as the project name, choose ``` Rails Application ``` as the project type, and click ``` OK ```.
|
55
26
|
|
56
|
-
![Create a new Rails Application in RubyMine - step 1](https://apidocs.io/illustration/ruby?step=createNewProject1&workspaceFolder=
|
27
|
+
![Create a new Rails Application in RubyMine - step 1](https://apidocs.io/illustration/ruby?step=createNewProject1&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
57
28
|
|
58
29
|
In the next dialog make sure that correct *Ruby SDK* is being used (minimum 2.0.0) and click ``` OK ```.
|
59
30
|
|
60
|
-
![Create a new Rails Application in RubyMine - step 2](https://apidocs.io/illustration/ruby?step=createNewProject2&workspaceFolder=
|
31
|
+
![Create a new Rails Application in RubyMine - step 2](https://apidocs.io/illustration/ruby?step=createNewProject2&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
61
32
|
|
62
33
|
This will create a new Rails Application project with an existing set of files and folder.
|
63
34
|
|
64
35
|
### 2. Add reference of the gem
|
65
36
|
|
66
|
-
In order to use the TestPack1 gem in the new project we must add a gem reference. Locate the ```Gemfile``` in the *Project Explorer* window under the ``` TestApp ``` project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: ``` gem 'test_pack_1', '~> 1.0.
|
37
|
+
In order to use the TestPack1 gem in the new project we must add a gem reference. Locate the ```Gemfile``` in the *Project Explorer* window under the ``` TestApp ``` project node. The file contains references to all gems being used in the project. Here, add the reference to the library gem by adding the following line: ``` gem 'test_pack_1', '~> 1.0.2' ```
|
67
38
|
|
68
|
-
![Add references of the Gemfile](https://apidocs.io/illustration/ruby?step=addReference&workspaceFolder=
|
39
|
+
![Add references of the Gemfile](https://apidocs.io/illustration/ruby?step=addReference&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
69
40
|
|
70
41
|
### 3. Adding a new Rails Controller
|
71
42
|
|
72
43
|
Once the ``` TestApp ``` project is created, a folder named ``` controllers ``` will be visible in the *Project Explorer* under the following path: ``` TestApp > app > controllers ```. Right click on this folder and select ``` New -> Run Rails Generator... ```.
|
73
44
|
|
74
|
-
![Run Rails Generator on Controllers Folder](https://apidocs.io/illustration/ruby?step=addCode0&workspaceFolder=
|
45
|
+
![Run Rails Generator on Controllers Folder](https://apidocs.io/illustration/ruby?step=addCode0&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
75
46
|
|
76
47
|
Selecting the said option will popup a small window where the generator names are displayed. Here, select the ``` controller ``` template.
|
77
48
|
|
78
|
-
![Create a new Controller](https://apidocs.io/illustration/ruby?step=addCode1&workspaceFolder=
|
49
|
+
![Create a new Controller](https://apidocs.io/illustration/ruby?step=addCode1&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
79
50
|
|
80
51
|
Next, a popup window will ask you for a Controller name and included Actions. For controller name provide ``` Hello ``` and include an action named ``` Index ``` and click ``` OK ```.
|
81
52
|
|
82
|
-
![Add a new Controller](https://apidocs.io/illustration/ruby?step=addCode2&workspaceFolder=
|
53
|
+
![Add a new Controller](https://apidocs.io/illustration/ruby?step=addCode2&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
83
54
|
|
84
55
|
A new controller class anmed ``` HelloController ``` will be created in a file named ``` hello_controller.rb ``` containing a method named ``` Index ```. In this method, add code for initialization and a sample for its usage.
|
85
56
|
|
86
|
-
![Initialize the library](https://apidocs.io/illustration/ruby?step=addCode3&workspaceFolder=
|
57
|
+
![Initialize the library](https://apidocs.io/illustration/ruby?step=addCode3&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2)
|
87
58
|
|
88
59
|
## How to Test
|
89
60
|
|
@@ -95,29 +66,18 @@ cases as follows:
|
|
95
66
|
|
96
67
|
## Initialization
|
97
68
|
|
98
|
-
###
|
99
|
-
In order to setup authentication and initialization of the API client, you need the following information.
|
100
|
-
|
101
|
-
| Parameter | Description |
|
102
|
-
|-----------|-------------|
|
103
|
-
| api_token | TODO: add a description |
|
104
|
-
|
105
|
-
|
69
|
+
###
|
106
70
|
|
107
71
|
API client can be initialized as following.
|
108
72
|
|
109
73
|
```ruby
|
110
|
-
# Configuration parameters and credentials
|
111
|
-
api_token = 'api_token'
|
112
74
|
|
113
|
-
client = TestPack1::TestPack1Client.new
|
114
|
-
api_token: api_token
|
115
|
-
)
|
75
|
+
client = TestPack1::TestPack1Client.new
|
116
76
|
```
|
117
77
|
|
118
78
|
The added initlization code can be debugged by putting a breakpoint in the ``` Index ``` method and running the project in debug mode by selecting ``` Run -> Debug 'Development: TestApp' ```.
|
119
79
|
|
120
|
-
![Debug the TestApp](https://apidocs.io/illustration/ruby?step=addCode4&workspaceFolder=
|
80
|
+
![Debug the TestApp](https://apidocs.io/illustration/ruby?step=addCode4&workspaceFolder=APIMATIC%20Calculator-Ruby&workspaceName=TestPack1&projectName=test_pack_1&gemName=test_pack_1&gemVer=1.0.2&initLine=client%2520%253D%2520TestPack1Client.new)
|
121
81
|
|
122
82
|
|
123
83
|
|
@@ -125,746 +85,55 @@ The added initlization code can be debugged by putting a breakpoint in the ``` I
|
|
125
85
|
|
126
86
|
## <a name="list_of_controllers"></a>List of Controllers
|
127
87
|
|
128
|
-
* [
|
129
|
-
* [DataController](#data_controller)
|
130
|
-
* [AlertsController](#alerts_controller)
|
131
|
-
* [ConfigurationDataController](#configuration_data_controller)
|
132
|
-
* [AssetsController](#assets_controller)
|
133
|
-
|
134
|
-
## <a name="statuses_controller"></a>![Class: ](https://apidocs.io/img/class.png ".StatusesController") StatusesController
|
135
|
-
|
136
|
-
### Get singleton instance
|
137
|
-
|
138
|
-
The singleton instance of the ``` StatusesController ``` class can be accessed from the API Client.
|
139
|
-
|
140
|
-
```ruby
|
141
|
-
statuses_controller = client.statuses
|
142
|
-
```
|
143
|
-
|
144
|
-
### <a name="get_active_statuses"></a>![Method: ](https://apidocs.io/img/method.png ".StatusesController.get_active_statuses") get_active_statuses
|
145
|
-
|
146
|
-
> Gets active statuses for multiple devices. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
147
|
-
|
148
|
-
|
149
|
-
```ruby
|
150
|
-
def get_active_statuses(device_ids,
|
151
|
-
category = nil,
|
152
|
-
fields = nil,
|
153
|
-
sort_by = nil,
|
154
|
-
sort_asc = false,
|
155
|
-
page_size = 50,
|
156
|
-
page = 1); end
|
157
|
-
```
|
158
|
-
|
159
|
-
#### Parameters
|
160
|
-
|
161
|
-
| Parameter | Tags | Description |
|
162
|
-
|-----------|------|-------------|
|
163
|
-
| device_ids | ``` Required ``` ``` Collection ``` | Which devices to get statuses for. |
|
164
|
-
| category | ``` Optional ``` ``` Collection ``` | Which status categories to get statuses for. |
|
165
|
-
| fields | ``` Optional ``` ``` Collection ``` | Which fields to include in the response. Valid fields are those defined in the `StatusItem` schema. By default all fields are included. |
|
166
|
-
| sort_by | ``` Optional ``` ``` Collection ``` | Which fields to sort the response items by. By default the items are sorted by timestampStart. |
|
167
|
-
| sort_asc | ``` Optional ``` ``` DefaultValue ``` | Whether to sort the items in ascending order. |
|
168
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
169
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
170
|
-
|
171
|
-
|
172
|
-
#### Example Usage
|
173
|
-
|
174
|
-
```ruby
|
175
|
-
device_ids = [161]
|
176
|
-
category = [TestPack1::StatusCategoryEnum::STOP]
|
177
|
-
fields = ['fields']
|
178
|
-
sort_by = ['sortBy']
|
179
|
-
sort_asc = false
|
180
|
-
page_size = 50
|
181
|
-
page = 1
|
182
|
-
|
183
|
-
result = statuses_controller.get_active_statuses(device_ids, category, fields, sort_by, sort_asc, page_size, page)
|
184
|
-
|
185
|
-
```
|
186
|
-
|
187
|
-
#### Errors
|
188
|
-
|
189
|
-
| Error Code | Error Description |
|
190
|
-
|------------|-------------------|
|
191
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
192
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
193
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
194
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
### <a name="get_statuses"></a>![Method: ](https://apidocs.io/img/method.png ".StatusesController.get_statuses") get_statuses
|
199
|
-
|
200
|
-
> Gets statuses for multiple devices during the given time period. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
201
|
-
|
202
|
-
|
203
|
-
```ruby
|
204
|
-
def get_statuses(device_ids,
|
205
|
-
timestamp_start,
|
206
|
-
timestamp_end,
|
207
|
-
category = nil,
|
208
|
-
fields = nil,
|
209
|
-
sort_by = nil,
|
210
|
-
sort_asc = false,
|
211
|
-
page_size = 50,
|
212
|
-
page = 1); end
|
213
|
-
```
|
214
|
-
|
215
|
-
#### Parameters
|
216
|
-
|
217
|
-
| Parameter | Tags | Description |
|
218
|
-
|-----------|------|-------------|
|
219
|
-
| device_ids | ``` Required ``` ``` Collection ``` | Which devices to get statuses for. |
|
220
|
-
| timestamp_start | ``` Required ``` | The first timestamp to get data for. Timestamps ending with 'Z' are treated as UTC. Other timestamps are treated as local time in your system-configured time zone. |
|
221
|
-
| timestamp_end | ``` Required ``` | The last timestamp to get data for. Timestamps ending with 'Z' are treated as UTC. Other timestamps are treated as local time in your system-configured time zone. |
|
222
|
-
| category | ``` Optional ``` ``` Collection ``` | Which status categories to get statuses for. |
|
223
|
-
| fields | ``` Optional ``` ``` Collection ``` | Which fields to include in the response. Valid fields are those defined in the `StatusItem` schema. By default all fields are included. |
|
224
|
-
| sort_by | ``` Optional ``` ``` Collection ``` | Which fields to sort the response items by. By default the items are sorted by timestampStart. |
|
225
|
-
| sort_asc | ``` Optional ``` ``` DefaultValue ``` | Whether to sort the items in ascending order. |
|
226
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
227
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
228
|
-
|
229
|
-
|
230
|
-
#### Example Usage
|
231
|
-
|
232
|
-
```ruby
|
233
|
-
device_ids = [161]
|
234
|
-
timestamp_start = DateTime.now
|
235
|
-
timestamp_end = DateTime.now
|
236
|
-
category = [TestPack1::StatusCategoryEnum::STOP]
|
237
|
-
fields = ['fields']
|
238
|
-
sort_by = ['sortBy']
|
239
|
-
sort_asc = false
|
240
|
-
page_size = 50
|
241
|
-
page = 1
|
242
|
-
|
243
|
-
result = statuses_controller.get_statuses(device_ids, timestamp_start, timestamp_end, category, fields, sort_by, sort_asc, page_size, page)
|
244
|
-
|
245
|
-
```
|
246
|
-
|
247
|
-
#### Errors
|
248
|
-
|
249
|
-
| Error Code | Error Description |
|
250
|
-
|------------|-------------------|
|
251
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
252
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
253
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
254
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
[Back to List of Controllers](#list_of_controllers)
|
259
|
-
|
260
|
-
## <a name="data_controller"></a>![Class: ](https://apidocs.io/img/class.png ".DataController") DataController
|
261
|
-
|
262
|
-
### Get singleton instance
|
263
|
-
|
264
|
-
The singleton instance of the ``` DataController ``` class can be accessed from the API Client.
|
265
|
-
|
266
|
-
```ruby
|
267
|
-
data_controller = client.data
|
268
|
-
```
|
269
|
-
|
270
|
-
### <a name="get_data_signals"></a>![Method: ](https://apidocs.io/img/method.png ".DataController.get_data_signals") get_data_signals
|
271
|
-
|
272
|
-
> Gets authorized data signals for one or more devices. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
273
|
-
|
274
|
-
|
275
|
-
```ruby
|
276
|
-
def get_data_signals(device_ids); end
|
277
|
-
```
|
278
|
-
|
279
|
-
#### Parameters
|
280
|
-
|
281
|
-
| Parameter | Tags | Description |
|
282
|
-
|-----------|------|-------------|
|
283
|
-
| device_ids | ``` Required ``` ``` Collection ``` | What devices to get data signals for. |
|
284
|
-
|
285
|
-
|
286
|
-
#### Example Usage
|
287
|
-
|
288
|
-
```ruby
|
289
|
-
device_ids = [161]
|
290
|
-
|
291
|
-
result = data_controller.get_data_signals(device_ids)
|
292
|
-
|
293
|
-
```
|
294
|
-
|
295
|
-
#### Errors
|
296
|
-
|
297
|
-
| Error Code | Error Description |
|
298
|
-
|------------|-------------------|
|
299
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
300
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
301
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
302
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
### <a name="get_data"></a>![Method: ](https://apidocs.io/img/method.png ".DataController.get_data") get_data
|
307
|
-
|
308
|
-
> Gets data for multiple devices and data signals in the given resolution. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
309
|
-
|
310
|
-
|
311
|
-
```ruby
|
312
|
-
def get_data(device_ids,
|
313
|
-
data_signal_ids,
|
314
|
-
timestamp_start,
|
315
|
-
timestamp_end,
|
316
|
-
resolution = nil,
|
317
|
-
aggregate = nil,
|
318
|
-
calculation = nil); end
|
319
|
-
```
|
320
|
-
|
321
|
-
#### Parameters
|
322
|
-
|
323
|
-
| Parameter | Tags | Description |
|
324
|
-
|-----------|------|-------------|
|
325
|
-
| device_ids | ``` Required ``` ``` Collection ``` | Which devices to get data for. |
|
326
|
-
| data_signal_ids | ``` Required ``` ``` Collection ``` | Which data signals to get data for. |
|
327
|
-
| timestamp_start | ``` Required ``` | The first timestamp to get data for. Timestamps ending with 'Z' are treated as UTC. Other timestamps are treated as local time in your system-configured time zone. |
|
328
|
-
| timestamp_end | ``` Required ``` | The last timestamp to get data for. Timestamps ending with 'Z' are treated as UTC. Other timestamps are treated as local time in your system-configured time zone. |
|
329
|
-
| resolution | ``` Optional ``` | The desired data resolution. |
|
330
|
-
| aggregate | ``` Optional ``` | How the data should be aggregated with regards to device(s) or site(s). |
|
331
|
-
| calculation | ``` Optional ``` | The calculation used when aggregating data, both over time and across devices. The default is the data signal default. |
|
332
|
-
|
333
|
-
|
334
|
-
#### Example Usage
|
335
|
-
|
336
|
-
```ruby
|
337
|
-
device_ids = [161]
|
338
|
-
data_signal_ids = [161]
|
339
|
-
timestamp_start = DateTime.now
|
340
|
-
timestamp_end = DateTime.now
|
341
|
-
resolution = TestPack1::ResolutionEnum::ENUM_5MINUTE
|
342
|
-
aggregate = TestPack1::AggregateModeEnum::DEVICE
|
343
|
-
calculation = TestPack1::CalculationModeEnum::AVERAGE
|
344
|
-
|
345
|
-
result = data_controller.get_data(device_ids, data_signal_ids, timestamp_start, timestamp_end, resolution, aggregate, calculation)
|
346
|
-
|
347
|
-
```
|
348
|
-
|
349
|
-
#### Errors
|
350
|
-
|
351
|
-
| Error Code | Error Description |
|
352
|
-
|------------|-------------------|
|
353
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
354
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
355
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
356
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
### <a name="get_real_time_data"></a>![Method: ](https://apidocs.io/img/method.png ".DataController.get_real_time_data") get_real_time_data
|
361
|
-
|
362
|
-
> Gets the most recent high-resolution data point for each specified device and data signal. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
363
|
-
|
364
|
-
|
365
|
-
```ruby
|
366
|
-
def get_real_time_data(device_ids,
|
367
|
-
data_signal_ids,
|
368
|
-
aggregate = nil,
|
369
|
-
calculation = nil); end
|
370
|
-
```
|
371
|
-
|
372
|
-
#### Parameters
|
373
|
-
|
374
|
-
| Parameter | Tags | Description |
|
375
|
-
|-----------|------|-------------|
|
376
|
-
| device_ids | ``` Required ``` ``` Collection ``` | Which devices to get data for. |
|
377
|
-
| data_signal_ids | ``` Required ``` ``` Collection ``` | Which data signals to get data for. |
|
378
|
-
| aggregate | ``` Optional ``` | How the data should be aggregated with regards to device(s) or site(s). |
|
379
|
-
| calculation | ``` Optional ``` | The calculation used when aggregating data, both over time and across devices. The default is the data signal default. |
|
380
|
-
|
381
|
-
|
382
|
-
#### Example Usage
|
383
|
-
|
384
|
-
```ruby
|
385
|
-
device_ids = [161]
|
386
|
-
data_signal_ids = [161]
|
387
|
-
aggregate = TestPack1::AggregateModeEnum::DEVICE
|
388
|
-
calculation = TestPack1::CalculationModeEnum::AVERAGE
|
389
|
-
|
390
|
-
result = data_controller.get_real_time_data(device_ids, data_signal_ids, aggregate, calculation)
|
391
|
-
|
392
|
-
```
|
393
|
-
|
394
|
-
#### Errors
|
395
|
-
|
396
|
-
| Error Code | Error Description |
|
397
|
-
|------------|-------------------|
|
398
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
399
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
400
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
401
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
402
|
-
|
88
|
+
* [SimpleCalculatorController](#simple_calculator_controller)
|
403
89
|
|
404
|
-
|
405
|
-
### <a name="get_data_per_category"></a>![Method: ](https://apidocs.io/img/method.png ".DataController.get_data_per_category") get_data_per_category
|
406
|
-
|
407
|
-
> Gets signal data aggregated per availability contract category. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
408
|
-
|
409
|
-
|
410
|
-
```ruby
|
411
|
-
def get_data_per_category(device_ids,
|
412
|
-
data_signal_id,
|
413
|
-
timestamp_start,
|
414
|
-
timestamp_end,
|
415
|
-
aggregate = nil,
|
416
|
-
category = nil); end
|
417
|
-
```
|
418
|
-
|
419
|
-
#### Parameters
|
420
|
-
|
421
|
-
| Parameter | Tags | Description |
|
422
|
-
|-----------|------|-------------|
|
423
|
-
| device_ids | ``` Required ``` ``` Collection ``` | Which devices to get data for. |
|
424
|
-
| data_signal_id | ``` Required ``` | Which signal to get data for; only Lost Production signals are supported at the moment. |
|
425
|
-
| timestamp_start | ``` Required ``` | The first timestamp to get data for. Timestamps ending with 'Z' are treated as UTC. Other timestamps are treated as local time in your system-configured time zone. |
|
426
|
-
| timestamp_end | ``` Required ``` | The last timestamp to get data for. Timestamps ending with 'Z' are treated as UTC. Other timestamps are treated as local time in your system-configured time zone. |
|
427
|
-
| aggregate | ``` Optional ``` | How the data should be aggregated with regards to device(s) or site(s). |
|
428
|
-
| category | ``` Optional ``` ``` Collection ``` | Which status categories to include. By default all categories are included. |
|
429
|
-
|
430
|
-
|
431
|
-
#### Example Usage
|
432
|
-
|
433
|
-
```ruby
|
434
|
-
device_ids = [161]
|
435
|
-
data_signal_id = 161
|
436
|
-
timestamp_start = DateTime.now
|
437
|
-
timestamp_end = DateTime.now
|
438
|
-
aggregate = TestPack1::AggregateModeEnum::DEVICE
|
439
|
-
category = [TestPack1::StatusCategoryEnum::STOP]
|
440
|
-
|
441
|
-
result = data_controller.get_data_per_category(device_ids, data_signal_id, timestamp_start, timestamp_end, aggregate, category)
|
442
|
-
|
443
|
-
```
|
444
|
-
|
445
|
-
#### Errors
|
446
|
-
|
447
|
-
| Error Code | Error Description |
|
448
|
-
|------------|-------------------|
|
449
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
450
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
451
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
452
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
[Back to List of Controllers](#list_of_controllers)
|
457
|
-
|
458
|
-
## <a name="alerts_controller"></a>![Class: ](https://apidocs.io/img/class.png ".AlertsController") AlertsController
|
90
|
+
## <a name="simple_calculator_controller"></a>![Class: ](https://apidocs.io/img/class.png ".SimpleCalculatorController") SimpleCalculatorController
|
459
91
|
|
460
92
|
### Get singleton instance
|
461
93
|
|
462
|
-
The singleton instance of the ```
|
94
|
+
The singleton instance of the ``` SimpleCalculatorController ``` class can be accessed from the API Client.
|
463
95
|
|
464
96
|
```ruby
|
465
|
-
|
97
|
+
simpleCalculator_controller = client.simple_calculator
|
466
98
|
```
|
467
99
|
|
468
|
-
### <a name="
|
100
|
+
### <a name="get_calculate"></a>![Method: ](https://apidocs.io/img/method.png ".SimpleCalculatorController.get_calculate") get_calculate
|
469
101
|
|
470
|
-
>
|
102
|
+
> Calculates the expression using the specified operation.
|
471
103
|
|
472
104
|
|
473
105
|
```ruby
|
474
|
-
def
|
475
|
-
fields = nil,
|
476
|
-
sort_by = nil,
|
477
|
-
sort_asc = false,
|
478
|
-
page_size = 50,
|
479
|
-
page = 1); end
|
106
|
+
def get_calculate(options = {}); end
|
480
107
|
```
|
481
108
|
|
482
109
|
#### Parameters
|
483
110
|
|
484
111
|
| Parameter | Tags | Description |
|
485
112
|
|-----------|------|-------------|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
| sort_asc | ``` Optional ``` ``` DefaultValue ``` | Whether to sort the items in ascending order. |
|
490
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
491
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
113
|
+
| operation | ``` Required ``` | The operator to apply on the variables |
|
114
|
+
| x | ``` Required ``` | The LHS value |
|
115
|
+
| y | ``` Required ``` | The RHS value |
|
492
116
|
|
493
117
|
|
494
118
|
#### Example Usage
|
495
119
|
|
496
120
|
```ruby
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
#### Errors
|
509
|
-
|
510
|
-
| Error Code | Error Description |
|
511
|
-
|------------|-------------------|
|
512
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
513
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
514
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
515
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
### <a name="get_active_alerts"></a>![Method: ](https://apidocs.io/img/method.png ".AlertsController.get_active_alerts") get_active_alerts
|
520
|
-
|
521
|
-
> Gets active alerts for multiple devices.
|
522
|
-
|
523
|
-
|
524
|
-
```ruby
|
525
|
-
def get_active_alerts(device_ids,
|
526
|
-
fields = nil,
|
527
|
-
sort_by = nil,
|
528
|
-
sort_asc = false,
|
529
|
-
page_size = 50,
|
530
|
-
page = 1); end
|
531
|
-
```
|
532
|
-
|
533
|
-
#### Parameters
|
534
|
-
|
535
|
-
| Parameter | Tags | Description |
|
536
|
-
|-----------|------|-------------|
|
537
|
-
| device_ids | ``` Required ``` ``` Collection ``` | What devices to get alerts for. |
|
538
|
-
| fields | ``` Optional ``` ``` Collection ``` | Which fields to include in the response. Valid fields are those defined in the `AlertItem` schema. By default all fields are included. |
|
539
|
-
| sort_by | ``` Optional ``` ``` Collection ``` | Which fields to sort the response items by. By default the items are sorted by timestampStart. |
|
540
|
-
| sort_asc | ``` Optional ``` ``` DefaultValue ``` | Whether to sort the items in ascending order. |
|
541
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
542
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
543
|
-
|
544
|
-
|
545
|
-
#### Example Usage
|
546
|
-
|
547
|
-
```ruby
|
548
|
-
device_ids = [161]
|
549
|
-
fields = ['fields']
|
550
|
-
sort_by = ['sortBy']
|
551
|
-
sort_asc = false
|
552
|
-
page_size = 50
|
553
|
-
page = 1
|
554
|
-
|
555
|
-
result = alerts_controller.get_active_alerts(device_ids, fields, sort_by, sort_asc, page_size, page)
|
556
|
-
|
557
|
-
```
|
558
|
-
|
559
|
-
#### Errors
|
560
|
-
|
561
|
-
| Error Code | Error Description |
|
562
|
-
|------------|-------------------|
|
563
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
564
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
565
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
566
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
### <a name="get_alerts"></a>![Method: ](https://apidocs.io/img/method.png ".AlertsController.get_alerts") get_alerts
|
571
|
-
|
572
|
-
> Gets alerts for multiple devices and the given time period.
|
573
|
-
|
574
|
-
|
575
|
-
```ruby
|
576
|
-
def get_alerts(device_ids,
|
577
|
-
timestamp_start,
|
578
|
-
timestamp_end,
|
579
|
-
fields = nil,
|
580
|
-
sort_by = nil,
|
581
|
-
sort_asc = false,
|
582
|
-
page_size = 50,
|
583
|
-
page = 1); end
|
584
|
-
```
|
585
|
-
|
586
|
-
#### Parameters
|
587
|
-
|
588
|
-
| Parameter | Tags | Description |
|
589
|
-
|-----------|------|-------------|
|
590
|
-
| device_ids | ``` Required ``` ``` Collection ``` | What devices to get alerts for. |
|
591
|
-
| timestamp_start | ``` Required ``` | The first timestamp to get data for. |
|
592
|
-
| timestamp_end | ``` Required ``` | The last timestamp to get data for. |
|
593
|
-
| fields | ``` Optional ``` ``` Collection ``` | Which fields to include in the response. Valid fields are those defined in the `AlertItem` schema. By default all fields are included. |
|
594
|
-
| sort_by | ``` Optional ``` ``` Collection ``` | Which fields to sort the response items by. By default the items are sorted by timestampStart. |
|
595
|
-
| sort_asc | ``` Optional ``` ``` DefaultValue ``` | Whether to sort the items in ascending order. |
|
596
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
597
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
598
|
-
|
599
|
-
|
600
|
-
#### Example Usage
|
601
|
-
|
602
|
-
```ruby
|
603
|
-
device_ids = [161]
|
604
|
-
timestamp_start = DateTime.now
|
605
|
-
timestamp_end = DateTime.now
|
606
|
-
fields = ['fields']
|
607
|
-
sort_by = ['sortBy']
|
608
|
-
sort_asc = false
|
609
|
-
page_size = 50
|
610
|
-
page = 1
|
611
|
-
|
612
|
-
result = alerts_controller.get_alerts(device_ids, timestamp_start, timestamp_end, fields, sort_by, sort_asc, page_size, page)
|
613
|
-
|
614
|
-
```
|
615
|
-
|
616
|
-
#### Errors
|
617
|
-
|
618
|
-
| Error Code | Error Description |
|
619
|
-
|------------|-------------------|
|
620
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
621
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
622
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
623
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
### <a name="get_alarms"></a>![Method: ](https://apidocs.io/img/method.png ".AlertsController.get_alarms") get_alarms
|
628
|
-
|
629
|
-
> _This endpoint is deprecated. Please use the new endpoint `/alerts.json` instead._
|
630
|
-
|
631
|
-
|
632
|
-
```ruby
|
633
|
-
def get_alarms(device_ids,
|
634
|
-
timestamp_start,
|
635
|
-
timestamp_end,
|
636
|
-
fields = nil,
|
637
|
-
sort_by = nil,
|
638
|
-
sort_asc = false,
|
639
|
-
page_size = 50,
|
640
|
-
page = 1); end
|
641
|
-
```
|
642
|
-
|
643
|
-
#### Parameters
|
644
|
-
|
645
|
-
| Parameter | Tags | Description |
|
646
|
-
|-----------|------|-------------|
|
647
|
-
| device_ids | ``` Required ``` ``` Collection ``` | What devices to get alerts for. |
|
648
|
-
| timestamp_start | ``` Required ``` | The first timestamp to get data for. |
|
649
|
-
| timestamp_end | ``` Required ``` | The last timestamp to get data for. |
|
650
|
-
| fields | ``` Optional ``` ``` Collection ``` | Which fields to include in the response. Valid fields are those defined in the `AlertItem` schema. By default all fields are included. |
|
651
|
-
| sort_by | ``` Optional ``` ``` Collection ``` | Which fields to sort the response items by. By default the items are sorted by timestampStart. |
|
652
|
-
| sort_asc | ``` Optional ``` ``` DefaultValue ``` | Whether to sort the items in ascending order. |
|
653
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
654
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
655
|
-
|
656
|
-
|
657
|
-
#### Example Usage
|
658
|
-
|
659
|
-
```ruby
|
660
|
-
device_ids = [161]
|
661
|
-
timestamp_start = DateTime.now
|
662
|
-
timestamp_end = DateTime.now
|
663
|
-
fields = ['fields']
|
664
|
-
sort_by = ['sortBy']
|
665
|
-
sort_asc = false
|
666
|
-
page_size = 50
|
667
|
-
page = 1
|
668
|
-
|
669
|
-
result = alerts_controller.get_alarms(device_ids, timestamp_start, timestamp_end, fields, sort_by, sort_asc, page_size, page)
|
670
|
-
|
671
|
-
```
|
672
|
-
|
673
|
-
#### Errors
|
674
|
-
|
675
|
-
| Error Code | Error Description |
|
676
|
-
|------------|-------------------|
|
677
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
678
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
679
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
680
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
[Back to List of Controllers](#list_of_controllers)
|
685
|
-
|
686
|
-
## <a name="configuration_data_controller"></a>![Class: ](https://apidocs.io/img/class.png ".ConfigurationDataController") ConfigurationDataController
|
687
|
-
|
688
|
-
### Get singleton instance
|
689
|
-
|
690
|
-
The singleton instance of the ``` ConfigurationDataController ``` class can be accessed from the API Client.
|
691
|
-
|
692
|
-
```ruby
|
693
|
-
configurationData_controller = client.configuration_data
|
694
|
-
```
|
695
|
-
|
696
|
-
### <a name="get_configuration"></a>![Method: ](https://apidocs.io/img/method.png ".ConfigurationDataController.get_configuration") get_configuration
|
697
|
-
|
698
|
-
> Gets your system-wide configuration data. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
699
|
-
|
700
|
-
|
701
|
-
```ruby
|
702
|
-
def get_configuration; end
|
703
|
-
```
|
704
|
-
|
705
|
-
#### Example Usage
|
706
|
-
|
707
|
-
```ruby
|
708
|
-
|
709
|
-
result = configurationData_controller.get_configuration()
|
710
|
-
|
711
|
-
```
|
712
|
-
|
713
|
-
#### Errors
|
714
|
-
|
715
|
-
| Error Code | Error Description |
|
716
|
-
|------------|-------------------|
|
717
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
718
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
719
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
720
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
[Back to List of Controllers](#list_of_controllers)
|
725
|
-
|
726
|
-
## <a name="assets_controller"></a>![Class: ](https://apidocs.io/img/class.png ".AssetsController") AssetsController
|
727
|
-
|
728
|
-
### Get singleton instance
|
729
|
-
|
730
|
-
The singleton instance of the ``` AssetsController ``` class can be accessed from the API Client.
|
731
|
-
|
732
|
-
```ruby
|
733
|
-
assets_controller = client.assets
|
734
|
-
```
|
735
|
-
|
736
|
-
### <a name="get_devices"></a>![Method: ](https://apidocs.io/img/method.png ".AssetsController.get_devices") get_devices
|
737
|
-
|
738
|
-
> Gets a list of devices that the API key has permissions for. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
739
|
-
|
740
|
-
|
741
|
-
```ruby
|
742
|
-
def get_devices(device_type_ids = nil,
|
743
|
-
site_ids = nil,
|
744
|
-
parent_ids = nil,
|
745
|
-
fields = nil,
|
746
|
-
page_size = 50,
|
747
|
-
page = 1); end
|
748
|
-
```
|
749
|
-
|
750
|
-
#### Parameters
|
751
|
-
|
752
|
-
| Parameter | Tags | Description |
|
753
|
-
|-----------|------|-------------|
|
754
|
-
| device_type_ids | ``` Optional ``` ``` Collection ``` | Which device types to get. Examples:
|
755
|
-
* 1 - Wind turbine
|
756
|
-
* 2 - Production meter
|
757
|
-
* 3 - Met mast
|
758
|
-
* 4 - Inverter
|
759
|
-
* 10 - Device group
|
760
|
-
* 11 - Grid meter
|
761
|
-
* 12 - Combiner box
|
762
|
-
* 23 - String |
|
763
|
-
| site_ids | ``` Optional ``` ``` Collection ``` | Only include devices at these sites. |
|
764
|
-
| parent_ids | ``` Optional ``` ``` Collection ``` | Only include devices with these parent devices. |
|
765
|
-
| fields | ``` Optional ``` ``` Collection ``` | Which fields to include in the response. Valid fields are those defined in the `Device` schema. By default all fields are included. |
|
766
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
767
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
768
|
-
|
769
|
-
|
770
|
-
#### Example Usage
|
771
|
-
|
772
|
-
```ruby
|
773
|
-
device_type_ids = [252]
|
774
|
-
site_ids = [252]
|
775
|
-
parent_ids = [252]
|
776
|
-
fields = ['fields']
|
777
|
-
page_size = 50
|
778
|
-
page = 1
|
779
|
-
|
780
|
-
result = assets_controller.get_devices(device_type_ids, site_ids, parent_ids, fields, page_size, page)
|
781
|
-
|
782
|
-
```
|
783
|
-
|
784
|
-
#### Errors
|
785
|
-
|
786
|
-
| Error Code | Error Description |
|
787
|
-
|------------|-------------------|
|
788
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
789
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
790
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
791
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
### <a name="get_sites"></a>![Method: ](https://apidocs.io/img/method.png ".AssetsController.get_sites") get_sites
|
796
|
-
|
797
|
-
> Gets a list of sites that the API key has permissions for. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
798
|
-
|
799
|
-
|
800
|
-
```ruby
|
801
|
-
def get_sites(fields = nil,
|
802
|
-
page_size = 50,
|
803
|
-
page = 1); end
|
804
|
-
```
|
805
|
-
|
806
|
-
#### Parameters
|
807
|
-
|
808
|
-
| Parameter | Tags | Description |
|
809
|
-
|-----------|------|-------------|
|
810
|
-
| fields | ``` Optional ``` ``` Collection ``` | Which fields to include in the response. Valid fields are those defined in the `SiteWithData` schema. By default all fields are included. |
|
811
|
-
| page_size | ``` Optional ``` ``` DefaultValue ``` | The number of items to return per page. |
|
812
|
-
| page | ``` Optional ``` ``` DefaultValue ``` | Which page to return when the number of items exceed the page size. |
|
813
|
-
|
814
|
-
|
815
|
-
#### Example Usage
|
816
|
-
|
817
|
-
```ruby
|
818
|
-
fields = ['fields']
|
819
|
-
page_size = 50
|
820
|
-
page = 1
|
821
|
-
|
822
|
-
result = assets_controller.get_sites(fields, page_size, page)
|
823
|
-
|
824
|
-
```
|
825
|
-
|
826
|
-
|
827
|
-
### <a name="get_power_curves"></a>![Method: ](https://apidocs.io/img/method.png ".AssetsController.get_power_curves") get_power_curves
|
828
|
-
|
829
|
-
> Gets the default or learned power curves for wind turbines. Other device types are not supported. This request can also be made using the POST method, with a JSON request body instead of query parameters.
|
830
|
-
|
831
|
-
|
832
|
-
```ruby
|
833
|
-
def get_power_curves(device_ids,
|
834
|
-
timestamp = nil,
|
835
|
-
learned = false); end
|
836
|
-
```
|
837
|
-
|
838
|
-
#### Parameters
|
839
|
-
|
840
|
-
| Parameter | Tags | Description |
|
841
|
-
|-----------|------|-------------|
|
842
|
-
| device_ids | ``` Required ``` ``` Collection ``` | What devices to get power curves for. Only wind turbines are supported. |
|
843
|
-
| timestamp | ``` Optional ``` | The date for which to get power curves. The default is the current date. |
|
844
|
-
| learned | ``` Optional ``` ``` DefaultValue ``` | Whether to get learned power curves instead of default power curves. |
|
845
|
-
|
846
|
-
|
847
|
-
#### Example Usage
|
848
|
-
|
849
|
-
```ruby
|
850
|
-
device_ids = [252]
|
851
|
-
timestamp = DateTime.now
|
852
|
-
learned = false
|
121
|
+
collect = Hash.new
|
122
|
+
|
123
|
+
operation = TestPack1::OperationTypeEnum::MULTIPLY
|
124
|
+
collect['operation'] = operation
|
125
|
+
|
126
|
+
x = 4
|
127
|
+
collect['x'] = x
|
128
|
+
|
129
|
+
y = 5
|
130
|
+
collect['y'] = y
|
131
|
+
|
853
132
|
|
854
|
-
result =
|
133
|
+
result = simpleCalculator_controller.get_calculate(collect)
|
855
134
|
|
856
135
|
```
|
857
136
|
|
858
|
-
#### Errors
|
859
|
-
|
860
|
-
| Error Code | Error Description |
|
861
|
-
|------------|-------------------|
|
862
|
-
| 400 | The request cannot be fulfilled due to bad syntax. |
|
863
|
-
| 401 | One of the following:<br>* The request is missing a valid API key.<br>* The API key does not authorize access the requested data. Devices<br> or data signals can be limited.<br> |
|
864
|
-
| 405 | The HTTP method is not allowed for the endpoint. |
|
865
|
-
| 429 | The API key has been used in too many requests in a given amount of time. The following headers will be set in the response:<br>* X-Rate-Limit-Limit - The total number of allowed requests for this period.<br>* X-Rate-Limit-Remaining - The remaining number of requests for this period.<br>* X-Rate-Limit-Reset - The number of seconds left until the end of this period.<br> |
|
866
|
-
|
867
|
-
|
868
137
|
|
869
138
|
[Back to List of Controllers](#list_of_controllers)
|
870
139
|
|