Appearance
Timestream
Description
The timestream module offers the option to store historical data and events. These can than be queried later for analytic purposes.
WARNING
Please use the not deprecated endpoints to start a query. These POST endpoints have been optimized and run faster and produce less traffic. Next to the properties they can return events and offer a much more rich filtering of data. Note: Due to the fact that events might be present, the hierarchy within the response has changed. The response now returns data ordered by device then by service. The old GET endpoints returned data ordered by service then by device.
API
EndpointsStart Timestream QueryGet Next Batch of Timestream DataGet Filter InformationStart Timestream QueryGet Next Batch of Timestream DataStart Timestream QueryGet Next Batch of Timestream Data
POST
POST
GET
GET
GET
POST
POST
Start Timestream Query
Returns the historic data based on a given filter, possibly split into parts.
POST
/api/v1/timestream/iterator
Access
This endpoint requires read
permission for the resource timestream
.
Request Body
Name | Description |
---|---|
queryDataboolean optional | Whenever or not to query data. Default: true |
queryEventsboolean optional | Whenever or not to query events. Default: true |
serviceIdentifierarray string optional | Array containing the service identifier you want to filter for. If you do not want to filter any services, leave this parameter out of the request. |
deviceIdentifierarray string optional | Array containing the device identifier you want to filter for. If you do not want to filter any devices, leave this parameter out of the request. |
propertyIdentifierarray string optional | Array containing the property identifier you want to filter for. If you do not want to filter any devices, leave this parameter out of the request. |
eventsarray optional | Array containing the events you want to filter for.If you do not want to filter any events, leave this parameter out of the request. |
frominteger optional | The UTC timestamp in milliseconds from where the returned timeseries should start. Defaults to an hour before the parameter `to`. |
tointeger optional | The UTC timestamp in milliseconds to where the returned timeseries should go. Defaults to `right now`. |
limitinteger optional | The number of values to return. Can be set to zero in order to return everything. Be careful when using this in combination with a long interval for the time as it will result in a long running query. Default: 100 |
prependFirstValueboolean optional | Whenever or not to append a value right before the requested interval of time. This is useful if you want to display the information in a graph and have one value before the actual range to show the correct `baseline` for the step function. However, setting this to `true` does increase the time the query needs to process. |
Response
Name | Description |
---|---|
doneboolean | Whenever there is data that still can be fetched. |
nextTokenstring optional | The token that is used to get the next batch of data. Only present when done is equal to false. |
datadictionary optional | Object that contains all history data based on the filtering choosen. |
eventsdictionary optional | Object that contains all history events grouped under devices |
estimatedQueryProgressnumber | The estimated progress of the query. When the progress reaches 100 percent the query is finished and all data can be fetched rather quickly. While the query is not finished requests to the /next endpoint might return no data at all. This is better described as: `When the progress reaches 100, all important rows in the database have been checked. Now we still need to send them to the client.` |
Get Next Batch of Timestream Data
Returns more timestream data based on a token. Should be used in conjunction with the iterativ route.
POST
/api/v1/timestream/next/:nextToken
Access
This endpoint requires read
permission for the resource timestream
.
URL Parameter
Name | Description |
---|---|
nextTokenstring | The token from the iterator request. |
Response
Name | Description |
---|---|
doneboolean | Whenever there is data that still can be fetched. |
nextTokenstring optional | The token that is used to get the next batch of data. Only present when done is equal to false. |
datadictionary optional | Object that contains all history data based on the filtering choosen. |
eventsdictionary optional | Object that contains all history events grouped under devices |
estimatedQueryProgressnumber | The estimated progress of the query. When the progress reaches 100 percent the query is finished and all data can be fetched rather quickly. While the query is not finished requests to the /next endpoint might return no data at all. This is better described as: `When the progress reaches 100, all important rows in the database have been checked. Now we still need to send them to the client.` |
Get Filter Information
Returns the current filter settings if any.
GET
/api/v1/timestream/filter
Access
This endpoint requires read
permission for the resource timestream
.
Response
Name | Description |
---|
Start Timestream Query
Returns the historic data in batches. The client needs to request following batches via the /next endpoint.
WARNING
Please use the non-deprecated endpoints. There are in many ways and forms superior.
GET
/api/v1/timestream/iterator
Access
This endpoint requires read
permission for the resource timestream
.
Query Parameter
Name | Description |
---|---|
frominteger optional | The UTC timestamp in milliseconds from where the returned timeseries should start. If possible, the response will contain one value before the given timestamp. Defaults to an hour before the query parameter `to`. |
tointeger optional | The UTC timestamp in milliseconds to where the returned timeseries should go. If possible, the response will contain one value after the given timestamp. Defaults to `right now`. |
limitinteger optional | The number of values to return. Can be set to zero in order to return everything. Be careful when using this in combination with a long interval for the time as it will result in a long running query. Default: 100 |
Response
Name | Description |
---|---|
doneboolean | Whenever there is data that still can be fetched. |
tokenstring optional | The token that is used to get the next batch of data. Only present when done is equal to false. |
datadictionary optional | Object that contains all history data. Only present when done is equal to false. |
Get Next Batch of Timestream Data
Returns the next batch for the timestream data.
WARNING
Please use the non-deprecated endpoints. There are in many ways and forms superior.
GET
/api/v1/timestream/next/:nextToken
Access
This endpoint requires read
permission for the resource timestream
.
URL Parameter
Name | Description |
---|---|
nextTokenstring | The token from the iterator request. |
Response
Name | Description |
---|---|
doneboolean | Whenever there is data that still can be fetched. |
tokenstring optional | The token that is used to get the next batch of data. Only present when done is equal to false. |
datadictionary optional | Object that contains all history data. Only present when done is equal to false. |
Start Timestream Query
Returns the historic data in batches. The client needs to request following batches via the /next endpoint.
WARNING
Please use the non-deprecated endpoints. There are in many ways and forms superior.
POST
/api/v2/timestream/iterator
Access
This endpoint requires read
permission for the resource timestream
.
Request Body
Name | Description |
---|---|
queryDataboolean optional | Whenever or not to query data. Default: true |
queryEventsboolean optional | Whenever or not to query events. Default: true |
serviceIdentifierarray string optional | Array containing the service identifier you want to filter for. If you do not want to filter any services, leave this parameter out of the request. |
deviceIdentifierarray string optional | Array containing the device identifier you want to filter for. If you do not want to filter any devices, leave this parameter out of the request. |
propertyIdentifierarray string optional | Array containing the property identifier you want to filter for. If you do not want to filter any devices, leave this parameter out of the request. |
eventsarray optional | Array containing the events you want to filter for.If you do not want to filter any events, leave this parameter out of the request. |
frominteger optional | The UTC timestamp in milliseconds from where the returned timeseries should start. Defaults to an hour before the parameter `to`. |
tointeger optional | The UTC timestamp in milliseconds to where the returned timeseries should go. Defaults to `right now`. |
limitinteger optional | The number of values to return. Can be set to zero in order to return everything. Be careful when using this in combination with a long interval for the time as it will result in a long running query. Default: 100 |
prependFirstValueboolean optional | Whenever or not to append a value right before the requested interval of time. This is useful if you want to display the information in a graph and have one value before the actual range to show the correct `baseline` for the step function. However, setting this to `true` does increase the time the query needs to process. |
Response
Name | Description |
---|---|
doneboolean | Whenever there is data that still can be fetched. |
nextTokenstring optional | The token that is used to get the next batch of data. Only present when done is equal to false. |
datadictionary optional | Object that contains all history data based on the filtering choosen. |
eventsdictionary optional | Object that contains all history events grouped under devices |
estimatedQueryProgressnumber | The estimated progress of the query. When the progress reaches 100 percent the query is finished and all data can be fetched rather quickly. While the query is not finished requests to the /next endpoint might return no data at all. This is better described as: `When the progress reaches 100, all important rows in the database have been checked. Now we still need to send them to the client.` |
Get Next Batch of Timestream Data
Returns the next batch for the timestream data.
WARNING
Please use the non-deprecated endpoints. There are in many ways and forms superior.
POST
/api/v2/timestream/next/:nextToken
Access
This endpoint requires read
permission for the resource timestream
.
URL Parameter
Name | Description |
---|---|
nextTokenstring | The token from the iterator request. |
Response
Name | Description |
---|---|
doneboolean | Whenever there is data that still can be fetched. |
nextTokenstring optional | The token that is used to get the next batch of data. Only present when done is equal to false. |
datadictionary optional | Object that contains all history data based on the filtering choosen. |
eventsdictionary optional | Object that contains all history events grouped under devices |
estimatedQueryProgressnumber | The estimated progress of the query. When the progress reaches 100 percent the query is finished and all data can be fetched rather quickly. While the query is not finished requests to the /next endpoint might return no data at all. This is better described as: `When the progress reaches 100, all important rows in the database have been checked. Now we still need to send them to the client.` |