Last Updated on : 2024-06-29 01:57:46download
Query the event logs of the specified device based on event types.
GET: /v2.0/cloud/thing/{device_id}/logs
Parameter name | Type | IN | Required | Description |
---|---|---|---|---|
device_id | String | path | true | The device ID. |
codes | String | query | false | The codes of data points supported by the device. You can query multiple data points, separated with commas (,). This parameter value is empty by default. |
type | String | query | true | The supported types of logs. You can query multiple event types, separated with commas (,). This parameter value is required. Valid values:
|
start_row_key | String | query | false | Query the row key of HBase. This is a parameter of the free edition. The default value is empty. |
start_time | Long | query | true | The timestamp of the start time for a query. |
end_time | Long | query | true | The timestamp of the end time for a query. |
query_type | Integer | query | true | The query type. Valid values:
|
last_row_key | String | query | false | The row key of the last entry on each page. This is a required parameter for the paid edition. The default value is empty, which means the first page. |
last_event_time | Long | query | false | The event occurrence time of the last entry on each page. The default value is empty, which means the first page. This is a required parameter for the paid edition. |
size | Integer | query | true | The number of logs allowed to be returned. Default value: 20 . |
Parameter name | Type | Description |
---|---|---|
success | Boolean | Indicates whether the request is successful. Valid values:
|
error_code | String | For more information, see the error codes. |
error_msg | String | The message that is returned if the request fails. It is empty if the request is successful. |
result | Object | The returned result. |
Description of result
Parameter name | Type | Description |
---|---|---|
current_row_key | String | The starting key value of the current page. |
device_id | String | The device ID. |
has_next | boolean | Specifies whether to return the next page. |
logs | FusionResult | The details of the log. |
Description of logs
Parameter name | Type | Description |
---|---|---|
event_time | Long | The time when the specified event occurs. |
code | String | The code of the specified data point. |
event_from | String | The source of the specified event. |
event_id | Long | The event ID. |
value | String | The event value. |
status | String | The event status. |
GET: /v2.0/cloud/thing/vdevo167115422036***/logs?codes=switch_led_1&type=1,2,3,4,5,6,7,8,9,10&start_time=1676944806000&end_time=1677141431000&query_type=&size=20&start_row_key=&last_row_key=&last_event_time=
{
"tid": "dcb6bacfbcba11eda71e169efc83a172",
"result": {
"current_row_key": "MTNhMmFmNjY4ZWRmOTllMmQ1ZGJhZTViZGl1dV85MjIzMzcwMzU4NjgwMTk1MTIxXzdfOQ==",
"device_id": "uuidb5eabd5d2e99f***",
"has_next": false,
"logs": [
{
"code": "countdown_1",
"event_from": "1",
"event_id": 7,
"value": "10",
"event_time": 1678174580686,
"status": "1"
},
{
"code": "countdown_1",
"event_from": "1",
"event_id": 7,
"value": "10",
"event_time": 1678174579758,
"status": "1"
},
{
"code": "countdown_1",
"event_from": "1",
"event_id": 7,
"value": "10",
"event_time": 1678174578453,
"status": "1"
}
]
},
"t": 1678174631163,
"success": true
}
For more information, see error code.
For more information, see Limits on API Request Frequency.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback