媒体管理

2023-07-18
暂无评分

Event

媒体文件上传结果上报

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: file_upload_callback

Data:

ColumnNameTypeconstraintDescription
file文件信息struct
»object_key文件在对象存储桶的keytext{}
»path文件的业务路径text{}
»name文件的名称text{}
»ext文件扩展内容struct
»»flight_id任务idtext{}
»»drone_model_key飞机产品枚举值text{}
»»payload_model_key负载产品枚举值text{}
»»is_original是否为原图bool{"0":"否","1":"是"}
»metadata媒体元数据struct
»»gimbal_yaw_degree云台偏航角float{}
»»absolute_altitude拍摄绝对高度float
»»relative_altitude拍摄相对高度float
»»created_time媒体拍摄时间date{"format":"iso8601"}
»»shoot_position拍摄位置struct[{"identifier":"lat","name":"拍摄位置纬度","dataType":{"type":"float"}},{"identifier":"lng","name":"拍摄位置经度","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
	}
}

媒体文件上传优先级上报

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: highest_priority_upload_flighttask_media

Data:

ColumnNameTypeconstraintDescription
flight_id任务idtext{}目前优先级最高的任务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

调整上传的文件为最高优先级

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: upload_flighttask_media_prioritize

Data:

ColumnNameTypeconstraintDescription
flight_id任务idtext{}需要最高优先级上传的任务

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
result返回码int非 0 代表错误

Example:

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

Requests

获取上传临时凭证

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: storage_config_get

Data:

ColumnNameTypeconstraintDescription
module模块枚举值enum{"0":"媒体"}

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
bucket对象存储桶名称text{}
credentials凭证信息struct
»access_key_id访问密钥IDtext{}
»access_key_secret秘密访问密钥text{}
»expire访问密钥过期时间int{"unit":"s","unitName":"秒","step":"1"}
»security_token会话凭证text{}
endpoint对外服务的访问域名text{}
provider云厂商枚举值enum{"ali":"阿里云","aws":"亚马逊云","minio":"minio"}
region数据中心所在的地域text{}
object_key_prefix对象存储桶的key的前缀text{}

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"
		}
	}
}
若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。