Check Dead Data¶
Check whether data of the specified measurement point of specified device is dead data and return the last changed data of the measurement point.
Judging conditions for measurement point dead data:
The comparison between the last changed data timestamp of the measurement point and the current system time is greater than the specified time interval.
If the measurement point data does not exist, no result will be returned.
Configuration:
EnOS Cloud: Configure the dead data in EnOS Management Console
EnOS Edge: Set the tag for the model points to configure the dead data (key: needCheckDead, value: true)
Operation Permissions¶
Required Authorization |
Required Operation Permission |
---|---|
Asset |
Read |
For more information about resources and required permission, see Policies, Roles and Permissions>>
Request Format¶
POST https://{apigw-address}/tsdb-service/v2.1/data/latest/check-dead
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Mandatory |
String |
The organization ID which the asset belongs to. How to get organization ID>> |
Request Parameters (Body)¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
payload |
Mandatory |
Object[] |
The request body, which contains querying conditions such as the asset ID, measurement point ID, and the time interval. See payload |
payload¶
Name |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|
assetId |
Mandatory |
String |
The asset ID. See How to get asset ID>> |
pointId |
Mandatory |
String |
The measurement point ID. See How to get measurement point ID>> |
interval |
Mandatory |
Integer |
Specify the time interval for comparing the last changed data timestamp of the measurement point with the current system time. The unit is millisecond. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
List<JSONObject> |
The checking result of whether the measurement point data is dead data. For more information, see items |
items¶
Sample¶
{
"assetId": "yourAssetId",
"pointId": "yourPointId",
"duration": 1076897472,
"judgeResult": true,
"lastChangedValue": "1",
"lastChangedTimestamp": 1610667000000
}
Parameters¶
Name |
Data Type |
Description |
---|---|---|
assetId |
String |
The asset ID. |
pointId |
String |
The measurement point ID. |
duration |
Integer |
The period of time when the measurement point data keeps unchanged. |
judgeResult |
Boolean |
The checking result. |
lastChangedValue |
Double |
The last changed value of the measurement point. |
lastChangedTimestamp |
Long |
Timestamp of the last changed measurement point data (UNIX time, accurate to millisecond). |
Error Codes¶
For description of error codes, see Common Error Codes.
Sample¶
Request Sample¶
url: https://{apigw-address}/tsdb-service/v2.1/data/latest/check-dead?orgId=yourOrgId
method: POST
Content-Type: application/json
requestBody:
{
"payload": [
{
"assetId": "yourAssetId",
"pointId": "yourPointId",
"interval": 864000000
}
]
}
Return Sample¶
{
"msg": "OK",
"code": 0,
"data": {
"items": [
{
"assetId": "yourAssetId",
"pointId": "yourPointId",
"duration": 1076897472,
"judgeResult": true,
"lastChangedValue": "1",
"lastChangedTimestamp": 1610667000000
},
{
"assetId": "yourAssetId",
"pointId": "yourPointId",
"duration": 1106897472,
"judgeResult": true,
"lastChangedValue": "1",
"lastChangedTimestamp": 1610637000000
},
{
"assetId": "yourAnotherAssetId",
"pointId": "yourPointId",
"duration": 1105757472,
"judgeResult": true,
"lastChangedValue": "29",
"lastChangedTimestamp": 1610638140000
}
]
},
"submsg": ""
}
SDK Samples¶
You can access the `Java SDK Samples<https://github.com/EnvisionIot/sample-code-java/tree/EnOS2.4/tsdbdata>`__for TSDB data service on Github.