远程日志
Event
文件上传进度通知
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: fileupload_progress
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 | |
| output | 输出 | struct | ||
| »ext | 扩展信息 | struct | ||
| »»files | 文件列表 | array | {"size": -, "item_type": struct} | |
| »»»module | 所属设备类型 | enum_int | {"0":"无人机","3":"机巢"} | |
| »»»size | 文件大小 | int | byte | |
| »»»device_sn | 设备序列号(SN) | text | ||
| »»»key | 对象存储桶 Key | text | ||
| »»»fingerprint | 文件指纹 | text | ||
| »»»progress | 进度信息 | struct | ||
| »»»»progress | 进度值 | int | ||
| »»»»finish_time | 上传完成时间 | int | ||
| »»»»upload_rate | 上传速率 | int |
Example:
{
"bid": "5d1ce329-0877-4dbd-a9db-14b894e6f6eb",
"data": {
"output": {
"ext": {
"files": [
{
"device_sn": "HMA111468100",
"fingerprint": "a0f4f397dd110afe8d3fa5f2b47efd2d",
"key": "2e742c87-850d-4f48-9b62-28c6feb14d5b.tar",
"module": "0",
"progress": {
"current_step": 1,
"finish_time": 1708603244736,
"progress": 100,
"result": 0,
"status": "ok",
"upload_rate": 0
},
"size": 89205156
}
]
},
"status": "ok"
}
},
"tid": "4ecd7315-a8fd-4c89-adcb-22633456553f",
"timestamp": 1708603244736,
"method": "fileupload_progress"
}
Service
获取设备可上传的文件列表
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_list
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| module_list | 文件所属过滤列表 | array | {"size": -, "item_type": enum_int} |
Example:
{
"timestamp": 1708654230926,
"data": {
"module_list": [
"3"
]
},
"method": "fileupload_list",
"tid": "a990e2ed-e1be-4ca9-b02f-74094692e889",
"bid": "5b41a737-5c6f-4b40-aa1e-d59c13bb3759",
"gateway": "NM1923221021"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fileupload_list
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| files | array | {"size": 2, "item_type": struct} | ||
| »device_sn | 设备序列号(SN) | text | ||
| »result | 返回码 | int | 非 0 代表错误 | |
| »module | 所属设备类型 | enum_int | {"0":"无人机","3":"机巢"} | |
| »list | 文件索引列表 | array | {"size": -, "item_type": struct} | |
| »»boot_index | 文件索引 | int | ||
| »»start_time | 日志开始时间 | int | {"unit_name":"毫秒 / ms"} | |
| »»end_time | 日志结束时间 | int | {"unit_name":"毫秒 / ms"} | |
| »»size | 日志文件大小 | int | byte |
Example:
{
"bid": "64fd5d4b-1e7d-4325-b984-4e3035cfddb9",
"data": {
"files": [
{
"device_sn": "NM1923221021",
"list": [
{
"boot_index": 0,
"end_time": 1659427398806,
"name_path": "机巢APP日志/autelrtc/stats/stats240117_194831.db",
"path": "/data/user/0/com.autel.nest/files/autelrtc/stats/stats240117_194831.db",
"size": 33789,
"start_time": 1654070968655
},
{
"boot_index": 22222,
"end_ime": 1659427398806,
"name_path": "机巢APP日志/nestLog/2024022115.xlog",
"path": "/data/user/0/com.autel.nest/files/nestLog/2024022115.xlog",
"size": 33789,
"start_time": 1659427398806
}
],
"module": "0",
"result": 0
}
],
"result": 0
},
"gateway": "NM1923221021",
"tid": "0ed6c833-863b-4ecf-9e61-c09329337144",
"timestamp": 1654070968655,
"method": "fileupload_list"
}
发起日志文件上传
设备端收到服务端下发的命令后,会直接返回执行结果状态
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_start
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| bucket | 对象存储桶名称 | text | ||
| region | 数据中心所在的地域 | text | ||
| credentials | 凭证信息 | struct | ||
| »access_key_id | 访问密钥 ID | text | ||
| »access_key_secret | 秘密访问密钥 | text | ||
| »expire | 访问密钥过期时间 | int | {"step":"1","unit_name":"秒 / s"} | |
| »security_token | 会话凭证 | text | ||
| endpoint | 对外服务的访问域名 | text | ||
| provider | 云厂商枚举值 | enum_string | {"ali":"阿里云","aws":"亚马逊云","minio":"minio"} | |
| params | struct | |||
| »files | array | {"size": -, "item_type": struct} | ||
| »»object_key | 文件在对象存储桶的 Key | text | ||
| »»module | 日志所属模块 | text | ||
| »»list | 日志列表 | array | {"size": -, "item_type": struct} | |
| »»»boot_index | 日志索引 | int |
Example:
{
"timestamp": 1708655170850,
"data": {
"bucket": "autel-store",
"credentials": {
"access_key_id": "GII6JJKWCLUQVO13081U",
"access_key_secret": "+p1ES5r0+oAMsBtTrFTqpSG0K+wXSqcaZmLrL74M",
"expire": 360000,
"security_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJHSUk2SkpLV0NMVVFWTzEzMDgxVSIsImV4cCI6MTcwOTAxNTE3MCwicGFyZW50IjoiYWRtaW4ifQ.mHmAH2zdFNS5m_z-k2GT_Z-BYxBHPd8PkX7C1j7Uufg_oCzvkLa_fT5LD0JTH9KaiO-A8cXEzPhkSqauiGSrhw"
},
"endpoint": "http://139.9.78.181:9000",
"provider": "minio",
"params": {
"files": [
{
"device_sn": "NM1923221021",
"object_key": "e7dd5966-5eff-43b8-8d6e-c9cc8c0da97b.tar",
"module": "3",
"list": [
{
"boot_index": 0,
"end_time": "0",
"size": "10867666",
"start_time": "0",
"name_path": "机巢APP日志/nestLog/2024022209.xlog",
"path": "/data/user/0/com.autel.nest/files/nestLog/2024022209.xlog"
}
]
}
]
}
},
"method": "fileupload_start",
"tid": "7fb9135c-41b0-4fb9-830e-f33f3d7b089b",
"bid": "51fd254c-1933-4ea3-bfc8-a17af6467d38",
"gateway": "NM1923221021"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fileupload_start
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | 非 0 代表错误 |
Example:
{
"bid": "51fd254c-1933-4ea3-bfc8-a17af6467d38",
"data": {
"result": 0
},
"tid": "7fb9135c-41b0-4fb9-830e-f33f3d7b089b",
"timestamp": 1708655170942,
"method": "fileupload_start"
}
上传状态更新
设备端收到服务端下发的命令后,会直接返回执行结果状态
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_update
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| status | 上传状态 | enum_string | {"cancel":"取消"} | |
| module_list | 日志所属模块列表 | array | {"size": -, "item_type": } |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"module_list": [
"0",
"3"
],
"status": "cancel"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "fileupload_update"
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fileupload_update
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | 返回码 | int | {0:"成功",324015:"无人机已关机或未连接,无法获取日志列表", 701001: "无人机序列号获取失败,无法获取日志列表", 701002: "日志正在上传中,请勿反复上传", 701003: "压缩无人机日志文件失败", 701004: "无人机日志文件下载失败", 701005: "暂不支持该类型文件上传服务", 701006: "固件升级中"} |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"gateway": "",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1655781392412,
"method": "fileupload_update"
}