Remote Log

2025-02-17
No Rating

Event

File Upload Progress Notification

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: fileupload_progress

Data:

ColumnNameTypeConstraintDescription
resultReturn codeint{"max":"","min":"","step":"","unit_name":null}
outputOutputstruct
»extExtended contentstruct
»»filesFile listarray{"size": -, "item_type": struct}
»»»moduleDevice typeenum_int{"0":"Aircraft","3":"Dock"}
»»»sizeFile sizeintbyte
»»»device_snDevice serial number (SN)text
»»»keyKey in the object storage buckettext
»»»fingerprintFile fingerprinttext
»»»progressProgress informationstruct
»»»»prgressProgress valueint
»»»»finish_timeUpload finish timeint
»»»»upload_rateUpload rateint

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"output": {
			"ext": {
				"files": [
					{
						"device_sn": "drone_sn",
						"fingerprint": "4f65b891f3bc09bdb6d4c36a996b532d",
						"key": "4bf0039f-6434-44a8-b891-8d7b6b7ff138/drone_sn/video_20220621_110830.log",
						"module": "0",
						"progress": {
							"current_step": 19,
							"finish_time": 1655781395926,
							"progress": 100,
							"result": 0,
							"status": "ok",
							"upload_rate": 0
						},
						"size": 155232
					},
					{
						"device_sn": "dock_sn",
						"fingerprint": "4f65b891f3bc09bdb6d4c36a996b532d",
						"key": "4bf0039f-6434-44a8-b891-8d7b6b7ff138/dock_sn/video_20220621_110830.log",
						"module": "3",
						"progress": {
							"current_step": 19,
							"finish_time": 1655781395926,
							"progress": 100,
							"result": 0,
							"status": "ok",
							"total_step": 30,
							"upload_rate": 0
						},
						"size": 155232
					}
				]
			},
			"status": "ok"
		}
	},
	"gateway": "dock_sn",
	"need_reply": 0,
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1655781395926,
	"method": "fileupload_progress"
}

Service

Upload Status Update

Once the device receives the command issued by the server, it will directly return the execution result status.

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: fileupload_update

Data:

ColumnNameTypeConstraintDescription
statusUpload Statusenum_string{"cancel": "Cancel"}
module_listList of modules to which the logs belongarray{"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:

ColumnNameTypeConstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"gateway": "",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1655781392412,
	"method": "fileupload_update"
}

Initiate Log File Upload

Once the device receives the command issued by the server, it will directly return the execution result status.

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: fileupload_start

Data:

ColumnNameTypeConstraintDescription
bucketObject storage bucket nametext
regionRegion where the data center is locatedtext
credentialsCredential informationstruct
»access_key_idAccess key IDtext
»access_key_secretSecret access keytext
»expireAccess key expiration timeint{"step":"1","unit_name":"Seconds / s"}
»security_tokenSession tokentext
endpointAccess domain for external servicestext
providerCloud provider enumeration valuesenum_string{"ali":"Alibaba Cloud","aws":"Amazon Cloud","minio":"MinIO"}
paramsstruct
»filesarray{"size": -, "item_type": struct}
»»object_keyKey of the file in the object storage buckettext
»»moduleModule to which the log belongtext
»»listLog listarray{"size": -, "item_type": struct}
»»»boot_indexLog indexint

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"bucket": "stg-dji-service-hz-ksd7",
		"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": 321
						},
						{
							"boot_index": 322
						}
					],
					"module": "3",
					"object_key": "object_key"
				}
			]
		},
		"provider": "ali",
		"region": "hz"
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1659429523120,
	"method": "fileupload_start"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: fileupload_start

Data:

ColumnNameTypeConstraintDescription
resultReturn codeintNon-zero represents an error

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"result": 0
	},
	"gateway": "",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1655781392412,
	"method": "fileupload_start"
}

Get List of Files Available for Upload from Device

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: fileupload_list

Data:

ColumnNameTypeConstraintDescription
module_listFile ownership filter listarray{"size": -,"item_type": enum_int}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"module_list": [
			"0",
			"3"
		]
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fileupload_list"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: fileupload_list

Data:

ColumnNameTypeConstraintDescription
filesarray{"size": 2, "item_type": struct}
»device_snDevice serial number (SN)text
»resultReturn codeintNon-zero represents an error
»moduleDevice typeenum_int{"0":"Aircraft","3":"Dock"}
»listFile index listarray{"size": -, "item_type": struct}
»»boot_indexFile indexint
»»start_timeLog start timeint{"unit_name":"Milliseconds / ms"}
»»end_timeLog end timeint{"unit_name":"Milliseconds / ms"}
»»sizeLog file sizeintbyte

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"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
	},
	"gateway": "",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "fileupload_list"
}
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.