Remote Log
Event
Inform of file uploading progress
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: fileupload_progress
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
ext | struct | |||
»files | array | {} | ||
»»[array_item] | Elements in array | struct | {} | {"size": ""} |
»»»module | Device type | enum | {"0":"Aircraft","3":"DJI Dock"} | |
»»»size | File size | int | byte | |
»»»device_sn | Device serial number | text | ||
»»»key | Object storage bucket key | text | ||
»»»fingerprint | File fingerprint | text | ||
»»»progress | struct | [{"identifier":"prgress","dataType":{"type":"int"}},{"identifier":"finish_time","desc":"Time that uploding is finished","dataType":{"type":"int"}},{"identifier":"upload_rate","desc":"Uploading rate","dataType":{"type":"int"}}] |
Example:
{
"method": "fileupload_progress",
"need_reply": 0,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1655781395926,
"gateway": "dock_sn",
"data": {
"output": {
"ext": {
"files": [
{
"module": "0",
"size": 155232,
"device_sn": "drone_sn",
"key": "4bf0039f-6434-44a8-b891-8d7b6b7ff138/drone_sn/video_20220621_110830.log",
"fingerprint": "4f65b891f3bc09bdb6d4c36a996b532d",
"progress": {
"current_step": 19,
"prgress": 100,
"finish_time": 1655781395926,
"upload_rate": 0,
"result": 0,
"status": "ok"
}
},
{
"module": "3",
"size": 155232,
"device_sn": "dock_sn",
"key": "4bf0039f-6434-44a8-b891-8d7b6b7ff138/dock_sn/video_20220621_110830.log",
"fingerprint": "4f65b891f3bc09bdb6d4c36a996b532d",
"progress": {
"current_step": 19,
"total_step": 30,
"prgress": 100,
"finish_time": 1655781395926,
"upload_rate": 0,
"result": 0,
"status": "ok"
}
}
]
},
"status": "ok"
}
}
}
Service
Get file list of uploadable device
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_list
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
module_list | Filter list of file | array | ||
»[array_item] | Elements in array | enum | {"0":"Aircraft","3":"DJI Dock"} |
Example:
{
"method": "fileupload_list",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"data": {
"module_list": [
"0",
"3"
]
}
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fileupload_list
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
files | array | {} | ||
»[array_item] | Elements in array | struct | {} | {"size": "2"} |
»»device_sn | Device serial number | text | ||
»»result | Result code | int | Non-0 means error | |
»»module | Deivce type | enum | {"0":"Aircraft","3":"DJI Dock"} | |
»»list | File index list | array |
Example:
{
"timestamp": 1654070968655,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "fileupload_list",
"gateway": "",
"data": {
"files": [
{
"device_sn": "xxxxxxxxx",
"list": [
{
"boot_index": 1111,
"end_time": 1659427398806,
"size": 33789,
"start_time": 1654070968655
},
{
"boot_index": 22222,
"end_ime": 1659427398806,
"size": 33789,
"start_time": 1659427398806
}
],
"module": "0",
"result": 0
},
{
"device_sn": "device_sn",
"list": [
{
"boot_index": 11111,
"end_time": 1659427398806,
"size": 36772,
"start_time": 1659427398806
},
{
"boot_index": 22222,
"end_ime": 1659427398806,
"size": 33789,
"start_time": 1659427398806
}
],
"module": "3",
"result": 0
}
],
"result": 0
}
}
Start the log file uploading
When device reveived the command from server, device will return the execution result status
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_start
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
bucket | Nam of object storage bucket | text | {} | |
region | Region of data center | text | {} | |
credentials | Credential information | struct | ||
»access_key_id | Access Key ID | text | {} | |
»access_key_secret | Secret access key | text | {} | |
»expire | Expired time of access key | int | {"unit":"s","unitName":"Second","step":"1"} | |
»security_token | Security token | text | {} | |
endpoint | Access domain name for external services | text | {} | |
provider | Enumeration value of cloud vendor | enum | {"ali":"Ali Cloud","aws":"Amazon Cloud","minio":"minio"} | |
params | struct | |||
»files | array | {} | ||
»»[array_item] | Elements in array | struct | {} | {"size": ""} |
»»»object_key | Object storage key | text | ||
»»»module | The module to which the log belongs | text | ||
»»»list | File index list | array | {"item":{"type":"struct","specs":[{"identifier":"boot_index","name":"File index","dataType":{"type":"int"}},{"identifier":"start_time","name":"Start time of log (millisecond timestamp)","dataType":{"type":"int"}},{"identifier":"end_time","name":"End time of log (millisecond timestamp)","dataType":{"type":"int"}},{"identifier":"size","name":"Log file size","desc":"byte","dataType":{"type":"int"}}]}} |
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1659429523120,
"method": "fileupload_start",
"data": {
"bucket": "stg-dji-service-hz-ksd7",
"region": "hz",
"credentials": {
"access_key_id": "STS.access_key_id",
"access_key_secret": "access_key_secret",
"expire": 1659432522000,
"security_token": "security_token"
},
"endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
"params": {
"files": [
{
"list": [
{
"boot_index": 1111,
"end_time": 1659427398806,
"size": 33789,
"start_time": 1654070968655
},
{
"boot_index": 22222,
"end_ime": 1659427398806,
"size": 33789,
"start_time": 1659427398806
}
],
"module": "3",
"object_key": "object_key"
}
]
},
"provider": "ali"
}
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fileupload_start
Data: null
Example:
{
"timestamp": 1655781392412,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "fileupload_start",
"gateway": "",
"data": {
"result": 0
}
}
Update the uploding state
When device reveived the command from server, device will return the execution result status
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: fileupload_update
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
status | Uploaded status | enum | {"cancel":"Cancel"} | |
module_list | Log module list | array | {"size": } | |
»[array_item] | Elements in array | {"type":"enum","specs":{"0":"Aircraft","3":"DJI Dock"}} |
Example:
{
"method": "fileupload_update",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"status": "cancel",
"module_list": [
"0",
"3"
]
}
}
Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: fileupload_update
Data: null
Example:
{
"timestamp": 1655781392412,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"method": "fileupload_update",
"gateway": "",
"data": {
"result": 0
}
}