Media Management

2023-09-25
No Rating

Event

Result reporting of media file uploading

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: file_upload_callback

Data:

ColumnNameTypeconstraintDescription
fileFile informationstruct
»object_keyKey of file in object storage buckettext{}
»pathBussiness path of filetext{}
»nameFile nametext{}
»extExpand content of filestruct
»»flight_idTask idtext{}
»»drone_model_keyEnumeration value of flight producttext{}
»»payload_model_keyEnumeration value of payload producttext{}
»»is_originalWhether is original imagebool{"0":"No","1":"Yes"}
»metadataMedia metadatastruct
»»gimbal_yaw_degreeYaw degree of gimbalfloat{}
»»absolute_altitude拍摄绝对高度float
»»relative_altitudeAbsolute altitude of shootingfloat
»»created_timeShooting time of mediadate{"format":"iso8601"}
»»shoot_positionShooting positionstruct[{"identifier":"lat","name":"latitude of shooting position","dataType":{"type":"float"}},{"identifier":"lng","name":"longitude of shooting position","dataType":{"type":"float"}}]

Example:

{
	"method": "file_upload_callback",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"need_reply": 1,
	"gateway": "xxx",
	"timestamp:": 1654070968655,
	"data": {
		"file": {
			"object_key": "object_key",
			"path": "xxx",
			"name": "dog.jpeg",
			"ext": {
				"flight_id": "xxx",
				"drone_model_key": "0-67-0",
				"payload_model_key": "0-67-0",
				"is_original": true
			},
			"metadata": {
				"shoot_position": {
					"lat": 22.1,
					"lng": 122.5
				},
				"gimbal_yaw_degree": -91.4,
				"absolute_altitude": 56.311,
				"relative_altitude": 41.124,
				"created_time": "2021-05-10 16:04:20"
			}
		},
		"result": 0
	}
}

Priority report of the media file uploading

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: highest_priority_upload_flighttask_media

Data:

ColumnNameTypeconstraintDescription
flight_idTask idtext{}The current highest priority task id

Example:

{
	"method": "highest_priority_upload_flighttask_media",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"need_reply": 1,
	"gateway": "xxx",
	"timestamp:": 1654070968655,
	"data": {
		"flight_id": "xxx"
	}
}

Service

Set the uploading file to highest priority

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: upload_flighttask_media_prioritize

Data:

ColumnNameTypeconstraintDescription
flight_idTask idtext{}The task that needs to be uploaded in highest priority

Example:

{
	"method": "upload_flighttask_media_prioritize",
	"timestamp:": 1654070968655,
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"flight_id": "xxx"
	}
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: upload_flighttask_media_prioritize

Data:

ColumnNameTypeconstraintDescription
resultReturn CodeintNon-0 means error

Example:

{
	"method": "upload_flighttask_media_prioritize",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0
	}
}

Requests

Obtain upload temporary credentials

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: storage_config_get

Data:

ColumnNameTypeconstraintDescription
moduleModule enumeration valueenum{"0":"media"}

Example:

{
	"method": "storage_config_get",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"module": 0
	}
}

Topic: thing/product/{gateway_sn}/requests_reply

Direction: down

Method: storage_config_get

Data:

ColumnNameTypeconstraintDescription
bucketName of object storage buckettext{}
credentialscredentials informationstruct
»access_key_idAccess key IDtext{}
»access_key_secretAccess key secrettext{}
»expireExpired time of access key secretint{"unit":"s","unitName":"second","step":"1"}
»security_tokensession credentialstext{}
endpointAccess domain name for external servicestext{}
providerCloud vendor enumeration valueenum{"ali":"Ali Cloud","aws":"Amazon Cloud","minio":"minio"}
regionRegion of data centertext{}
object_key_prefixKey prefix of object storage buckettext{}

Example:

{
	"method": "storage_config_get",
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp:": 1654070968655,
	"data": {
		"result": 0,
		"output": {
			"bucket": "bucket_name",
			"credentials": {
				"access_key_id": "access_key_id",
				"access_key_secret": "access_key_secret",
				"expire": 3600,
				"security_token": "security_token"
			},
			"endpoint": "https://oss-cn-hangzhou.aliyuncs.com",
			"object_key_prefix": "b4cfaae6-bd9d-4cd0-8472-63b608c3c581",
			"provider": "ali",
			"region": "hz"
		}
	}
}
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.