Remote Log
File Upload Progress Notification
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: fileupload_progress
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| output | Output | struct | Event output data | |
| »ext | Extension info | struct | Extension information | |
| »»files | File list | array | {"size": -, "item_type": struct} | Log file list |
| »»»module | Device type | text | {"0":"Drone","3":"Nest"} | Module the log belongs to |
| »»»size | File size | int | byte | |
| »»»device_sn | Device serial number | text | Device serial number | |
| »»»key | Object storage key | text | File key in the storage bucket | |
| »»»fingerprint | File fingerprint | text | File fingerprint | |
| »»»progress | Progress info | struct | Progress information | |
| »»»»current_step | Current step | int | Index of the current step | |
| »»»»total_step | Total steps | int | Total number of steps | |
| »»»»progress | Progress value | int | Progress value (percentage) | |
| »»»»finish_time | Upload completion time | int | {"unit_name":"milliseconds / ms"} | Upload completion timestamp (milliseconds) |
| »»»»upload_rate | Upload speed | int | {"unit_name":"bytes per second / bytes/s"} | Upload speed (bytes/s) |
| »»»»result | Result code | int | {0:"Success",108:"Log compression failed",111:"Log download failed",115:"Log upload rejected",116:"Log upload credential expired"} | Non-zero represents an error |
| »»»»status | Upload status | enum_string | {"drone_log_zip":"Drone log packing","drone_log_zip_success":"Drone log packing succeeded","drone_log_zip_failed":"Drone log packing failed","file_pull":"Pulling file","file_pull_success":"File pull succeeded","file_pull_failed":"File pull failed","file_zip":"Compressing file","file_zip_success":"File compression succeeded","file_zip_failed":"File compression failed","file_uploading":"Uploading file","ok":"Upload succeeded","failed":"Upload failed","timeout":"Upload timed out"} | File upload status |
| »status | Upload status | enum_string | Same as »»»»status | Overall status of this upload |
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
Get the list of files that can be uploaded by the device
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_list
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| module_list | File ownership filter list | array | {"size": -, "item_type": text} | List of modules for log collection, values {"0":"Drone","3":"Nest"}; all modules are returned when empty |
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} | Log file list | |
| »device_sn | Device serial number (SN) | text | Device serial number | |
| »result | Return code | int | Non-zero represents an error | |
| »module | Device type | text | {"0":"Drone","3":"Nest"} | Module the log belongs to |
| »list | File index list | array | {"size": -, "item_type": struct} | Log file detail list |
| »»boot_index | File index | int | Device boot index | |
| »»start_time | Log start time | int | {"unit_name":"milliseconds / ms"} | Log start timestamp |
| »»end_time | Log end time | int | {"unit_name":"milliseconds / ms"} | Log end timestamp |
| »»size | Log file size | int | byte | |
| »»name_path | Log name path | text | Display path of the log file | |
| »»path | Log file identifier | text | File identifier that must be passed back unchanged when starting the upload |
Example:
{
"bid": "64fd5d4b-1e7d-4325-b984-4e3035cfddb9",
"data": {
"files": [
{
"device_sn": "NM1923221021",
"list": [
{
"boot_index": 0,
"end_time": 1659427398806,
"name_path": "Nest APP Log/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": "Nest APP Log/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"
}
Initiate Log File Upload
After receiving the command issued by the server, the device will directly return the execution result status.
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_start
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| bucket | Object Storage Bucket Name | text | Object storage bucket name | |
| region | Data Center Location | text | Storage bucket region | |
| credentials | Credential Information | struct | Temporary access credentials | |
| »access_key_id | Access Key ID | text | Temporary Access Key ID | |
| »access_key_secret | Secret Access Key | text | Temporary Access Key Secret | |
| »expire | Access Key Expiration Time | int | {"step":"1","unit_name":"seconds / s"} | Credential expiration time |
| »security_token | Session Token | text | Security token | |
| endpoint | Public Access Domain | text | Object storage service endpoint | |
| provider | Cloud Provider Enumeration | enum_string | {"s3":"S3-compatible storage","aws":"Amazon Web Services","amazon":"Amazon Web Services","minio":"Minio","ali":"Alibaba Cloud","oss":"Alibaba Cloud OSS","cos":"Tencent Cloud COS","qcloud":"Tencent Cloud","obs":"Huawei Cloud OBS","huawei":"Huawei Cloud"} | Storage service provider |
| params | struct | Log upload parameters | ||
| »files | array | {"size": -, "item_type": struct} | List of log files to upload | |
| »»object_key | File Key in Object Storage Bucket | text | File key in the storage bucket | |
| »»module | Log Module | text | {"0":"Drone","3":"Nest"} | Module the log belongs to |
| »»list | Log List | array | {"size": -, "item_type": struct} | Log file detail list |
| »»»name_path | Log Name Path | text | Taken from name_path in the file list query result | |
| »»»path | Log File Identifier | text | Taken from path in the file list query result, must be passed back unchanged |
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": "Nest APP Log/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 | Return code | int | 0 for success, non-zero indicates error |
Example:
{
"bid": "51fd254c-1933-4ea3-bfc8-a17af6467d38",
"data": {
"result": 0
},
"tid": "7fb9135c-41b0-4fb9-830e-f33f3d7b089b",
"timestamp": 1708655170942,
"method": "fileupload_start"
}
Upload Status Update
The device will directly return the execution result status after receiving the command sent from the server.
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_update
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| status | Upload status | enum_string | {"cancel":"Cancel"} | Log upload status |
| module_list | Log module list | array | {"size": -, "item_type": text} | List of modules being uploaded, values {"0":"Drone","3":"Nest"} |
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 | Return code | int | 0 for success, non-zero indicates error |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"gateway": "",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1655781392412,
"method": "fileupload_update"
}