设备上报日志内容
Topic
上行: $oc/devices/{device_id}/sys/events/up
接口功能
日志收集开关开启时设备使用该接口向平台上报日志内容,最大不超过1MB。
参数说明
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| services | 可选 | List<ServiceEvent> | 事件服务列表 |
ServiceEvent定义表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| service_id | 必选 | String | $log |
| event_type | 必选 | String | log_report |
| event_time | 可选 | String | 事件时间 |
| paras | 必选 | Object | 设备服务的事件列表,具体字段在设备关联的产品模型中定义。 |
paras参数列表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| timestamp | 可选 | String | 日志产生时间 |
| type | 必选 | String | 日志类型: DEVICE_STATUS :设备状态 DEVICE_PROPERTY :设备属性 DEVICE_MESSAGE :设备消息 DEVICE_COMMAND:设备命令 |
| content | 必选 | String | 日志内容。 |
示例
Topic: $oc/devices/{device_id}/sys/events/up
数据格式:
{
"services": [{
"service_id": "$log",
"event_type": "log_report",
"event_time": "20151212T121212Z",
"paras": {
"timestamp": "1235668997",
"type": "DEVICE_MESSAGE",
"content": "log content"
}
}]
} Last Article: 平台下发日志收集通知
Next Article: 模组AT指令参考
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.