Component
- telemetry API / documentation
Description
When using the telemetry API to request historical timeseries data by using
http(s)://host:port/api/plugins/telemetry/{entityType}/{entityId}/values/timeseries?keys=key1,key2,key3 according to this documentation https://thingsboard.io/docs/user-guide/telemetry/#timeseries-data-values-api
it remains unclear how to determine if all requested data has been returned or not.
Let's assume a time range of 24 hours is requested and the limit is set to 1000 but there are in fact more than 1000 values existing in that range.
Now the first request returns exactly 1000 data points, but there is no indication if there are more data in that time range that hove not been returned.
It is also not documented how to request the remaining timeseries data of the given time range, if there are any.
I know from other API requests, that they return a flag telling there are more data and also a counter to be used in subsequent requests to get the rest of the data. Example:
get /api/tenant/devices{?type,textSearch,idOffset,textOffset,limit}
returns helpful information about requests to fire subsequently:
{
"data": [
{
"id": {
"entityType": "DEVICE",
"id": "f524fbe0-343a-11e9-a96e-e5f9d91da906"
},
"createdTime": 1550576343710,
"additionalInfo": {
"description": "Rückstellmuster Colombia UVI,\nCPUID 0xBFEDD923"
},
"tenantId": {
"entityType": "TENANT",
"id": "d3a77d70-2563-11e9-b9a2-0bf84676a17b"
},
"customerId": {
"entityType": "CUSTOMER",
"id": "056dd4e0-5605-11e9-92a2-af95e9ea2dfb"
},
"name": "Colombia-RSM",
"type": "sg-iot-gen2",
"label": null
}
],
"nextPageLink": {
"limit": 1,
"textSearch": null,
"textSearchBound": null,
"textOffset": "colombia-rsm",
"idOffset": "f524fbe0-343a-11e9-a96e-e5f9d91da906"
},
"hasNext": true**
}
Questions:
- was this simple forgotten to implement or to document for timeseries data requests?
- is there another solution beside determining from the timestamps of the returned data if there may be more data?
- is an empty response body the only indication that there are no more data in the requested time range? Is it a bullet proof indicator?
Environment
- OS: Ubuntu 20 LTS
- ThingsBoard: 2.5.4 (dockerized, with cassandra database)
- same issue appears via SwaggerUI or Python or whatever way the API is used
Component
Description
When using the telemetry API to request historical timeseries data by using
http(s)://host:port/api/plugins/telemetry/{entityType}/{entityId}/values/timeseries?keys=key1,key2,key3according to this documentation https://thingsboard.io/docs/user-guide/telemetry/#timeseries-data-values-apiit remains unclear how to determine if all requested data has been returned or not.
Let's assume a time range of 24 hours is requested and the limit is set to 1000 but there are in fact more than 1000 values existing in that range.
Now the first request returns exactly 1000 data points, but there is no indication if there are more data in that time range that hove not been returned.
It is also not documented how to request the remaining timeseries data of the given time range, if there are any.
I know from other API requests, that they return a flag telling there are more data and also a counter to be used in subsequent requests to get the rest of the data. Example:
get /api/tenant/devices{?type,textSearch,idOffset,textOffset,limit}returns helpful information about requests to fire subsequently:
Questions:
Environment