Last Updated on : 2023-12-07 03:33:52download
Query device operation history records based on conditions.
GET: /v1.0/devices/{device_id}/logs
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
device_id | String | uri | true | Device ID |
codes | String | query | false | The function points supported by the device. It supports multiple function points query, separated by a comma (,), the default is empty |
type | String | query | true | Types supported by log query. Supports query of multiple event types, separated by commas (,), must be transmitted. (1 online, 2 offline, 3 device activation, 4 device reset, 5 instructions Issue, 6 firmware upgrade, 7 data point report, 8 device semaphore, 9 device restart, 10 timing information) |
start_row_key | String | query | false | Free version parameter, query Hbase row key. The default value is empty |
start_time | Long | query | true | The start timestamp of the query, 13 digits |
end_time | Long | query | true | The end timestamp of the query, 13 digits |
query_type | Integer | query | false | Query type, the default is 1, (1 free version, 2 paid version) |
last_row_key | String | query | false | Paging parameters of the paid version, the row key of the last piece of data. The default value is empty, check the first page, the paid version must be passed |
last_event_time | Long | query | false | Paging parameters of the paid version, the event time of the last piece of data (the default is the first page of the empty search, the paid version must be transmitted) |
size | Integer | query | false | The size of the number of logs to be queried (the default is 20) |
Parameter name | Type | Description |
---|---|---|
result | DeviceLogResultRes |
Description of result
Parameter name | Type | Description |
---|---|---|
device_id | String | Device ID |
has_next | Boolean | Is there a next one, true yes, false no |
current_row_key | String | Free version parameter, the current row key of Hbase. |
next_row_key | String | Free version parameter, the next Hbase row key that satisfies the query condition. If the return value is null, it means that there is no next log that meets the query condition. |
logs | List | Log message body |
count | Long | Paid version parameters, the total number of logs that meet the query conditions |
Description of logs
Parameter name | Type | Description |
---|---|---|
code | String | Function Point Code |
value | Object | Function point value |
event_time | Long | Time stamp when the event occurred |
event_from | String | The source of the event trigger, (1 device itself, 2 client instructions, 3 third-party platforms, 4 cloud instructions, -1 unknown) |
event_id | Short | Type of event, (1 online, 2 offline, 3 device activation, 4 device reset, 5 command issuance, 6 firmware upgrade, 7 data point report, 8 device semaphore, 9 device restart, 10 Timing information) |
row | String | Paid version parameter, which is the current Hbase row key |
status | String | The data is valid and has not been deleted. The default value is '1' |
GET: /v1.0/devices/6c9395918f4f4d85d8****/logs?end_time=1699433821000&start_time=1699433221000&type=1,2,7
{
"tid": "a45cea067e1411eeaf49161d7283****",
"result": {
"current_row_key": "ZWM1N2U0MzQxd3htOGQ1OGQ0ZjRmODE5NTkzOWM2XzkyMjMzNzAzMzc0MjEwMTU4NjFf****",
"device_id": "6c9395918f4f4d85d8****",
"next_row_key": "ZWM1N2U0MzQxd3htOGQ1OGQ0ZjRmODE5NTkzOWM2XzkyMjMzNzAzMzc0MjExMjc4NDVf****",
"has_next": true,
"logs": [
{
"code": "target_dis_closest",
"event_from": "1",
"event_id": 7,
"value": "202",
"event_time": 1699433759946,
"status": "1"
},
{
"code": "target_dis_closest",
"event_from": "1",
"event_id": 7,
"value": "210",
"event_time": 1699433758927,
"status": "1"
}
]
},
"t": 1699433761797,
"success": true
}
For more information, see error code.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback