远程日志
文件上传进度通知
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: fileupload_progress
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| output | 输出 | struct | 服务执行的输出结果 | |
| »ext | 扩展信息 | struct | 扩展信息 | |
| »»files | 文件列表 | array | {"size": -, "item_type": struct} | 上传文件列表 |
| »»»module | 所属设备类型 | text | {"0":"无人机","3":"机巢"} | 文件所属设备类型 |
| »»»size | 文件大小 | int | byte | |
| »»»device_sn | 设备序列号(SN) | text | 设备序列号 | |
| »»»key | 对象存储桶 Key | text | 文件在对象存储桶的Key | |
| »»»fingerprint | 文件指纹 | text | 文件唯一指纹 | |
| »»»progress | 进度信息 | struct | 文件上传进度信息 | |
| »»»»current_step | 当前步骤 | int | 当前所处步骤序号 | |
| »»»»total_step | 总步骤数 | int | 总步骤数 | |
| »»»»progress | 进度值 | int | 上传进度百分比 | |
| »»»»finish_time | 上传完成时间 | int | {"unit_name":"毫秒 / ms"} | 上传完成的毫秒时间戳 |
| »»»»upload_rate | 上传速率 | int | {"unit_name":"字节每秒 / bytes/s"} | 文件上传速率 |
| »»»»result | 结果码 | int | {0:"成功",108:"日志压缩失败",111:"日志下载失败",115:"日志上传拒绝",116:"日志上传凭证过期"} | 非 0 代表错误 |
| »»»»status | 上传状态 | enum_string | {"drone_log_zip":"飞机日志打包中","drone_log_zip_success":"飞机日志打包成功","drone_log_zip_failed":"飞机日志打包失败","file_pull":"文件拉取中","file_pull_success":"文件拉取成功","file_pull_failed":"文件拉取失败","file_zip":"文件压缩中","file_zip_success":"文件压缩成功","file_zip_failed":"文件压缩失败","file_uploading":"文件上传中","ok":"上传成功","failed":"上传失败","timeout":"上传超时"} | 文件上传状态 |
| »status | 上传状态 | enum_string | 同 »»»»status | 本次上传的整体状态 |
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",
"total_step": 1,
"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": text} | 需要采集日志的模块列表,取值 {"0":"无人机","3":"机巢"};为空时返回全部模块 |
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 | 所属设备类型 | text | {"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 | |
| »»name_path | 日志名称路径 | text | 日志文件的展示路径 | |
| »»path | 日志文件标识 | text | 发起上传时需原样回传的文件标识 |
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_time": 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 ID | |
| »access_key_secret | 秘密访问密钥 | text | 临时 Access Key Secret | |
| »expire | 访问密钥过期时间 | int | {"step":"1","unit_name":"秒 / s"} | 凭证过期时间 |
| »security_token | 会话凭证 | text | 安全令牌 | |
| endpoint | 对外服务的访问域名 | text | 对象存储服务端点地址 | |
| provider | 云厂商枚举值 | enum_string | {"s3":"S3 协议兼容存储","aws":"亚马逊云","amazon":"亚马逊云","minio":"minio","ali":"阿里云","oss":"阿里云对象存储","cos":"腾讯云对象存储","qcloud":"腾讯云","obs":"华为云对象存储","huawei":"华为云"} | 存储服务提供商 |
| params | struct | 日志上传参数 | ||
| »files | array | {"size": -, "item_type": struct} | 待上传的日志文件列表 | |
| »»object_key | 文件在对象存储桶的 Key | text | 文件在存储桶中的Key | |
| »»module | 日志所属模块 | text | {"0":"无人机","3":"机巢"} | 日志所属模块 |
| »»list | 日志列表 | array | {"size": -, "item_type": struct} | 日志文件详情列表 |
| »»»name_path | 日志名称路径 | text | 取自文件列表查询结果的 name_path | |
| »»»path | 日志文件标识 | text | 取自文件列表查询结果的 path,需原样回传 |
Example:
{
"timestamp": 1708655170850,
"data": {
"bucket": "autel-store",
"credentials": {
"access_key_id": "access_key_id",
"access_key_secret": "access_key_secret",
"expire": 360000,
"security_token": "security_token"
},
"endpoint": "https://storage.example.com",
"provider": "minio",
"params": {
"files": [
{
"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 成功,非 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": text} | 正在上传的模块列表,取值 {"0":"无人机","3":"机巢"} |
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 成功,非 0 代表错误 |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"gateway": "",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1655781392412,
"method": "fileupload_update"
}