40.file
Event
媒体文件上传优先级上报
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: highest_priority_upload_flighttask_media
Data:
flight_id
任务 ID
text
目前优先级最高的任务 ID
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxx"
},
"gateway": "xxx",
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "highest_priority_upload_flighttask_media"
}媒体文件上传结果上报
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: file_upload_callback
Data:
file
文件信息
struct
»object_key
文件在对象存储桶的 Key
text
»path
文件的业务路径
text
»name
文件名称
text
»ext
文件扩展内容
struct
»»flight_id
任务 ID
text
»»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
»»create_time
媒体拍摄时间
date
{"format":"iso8601"}
»»shoot_position
拍摄位置
struct
»»»lat
拍摄位置纬度
float
»»»lng
拍摄位置经度
float
»cloud_to_cloud_id
云云对接云服务存储桶 ID
text
该媒体上传到的存储桶 id,若未上传到云云对接存储桶中,该字段的值为 'DEFAULT'
flight_task
飞行任务信息
struct
»uploaded_file_count
该飞行架次当前已上传媒体数量
int
»expected_file_count
该飞行架次拍摄媒体总数量
int
»flight_type
飞行类型枚举值
enum_int
{"0":"航线任务","1":"一键起飞任务"}
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"file": {
"cloud_to_cloud_id": "DEFAULT",
"ext": {
"drone_model_key": "0-67-0",
"flight_id": "xxx",
"is_original": true,
"payload_model_key": "0-67-0"
},
"metadata": {
"absolute_altitude": 56.311,
"create_time": "2021-05-10 16:04:20",
"gimbal_yaw_degree": "-91.40",
"relative_altitude": 41.124,
"shoot_position": {
"lat": 22.1,
"lng": 122.5
}
},
"name": "dog.jpeg",
"object_key": "object_key",
"path": "xxx"
},
"flight_task": {
"expected_file_count": 14,
"flight_type": 0,
"uploaded_file_count": 12
}
},
"gateway": "xxx",
"method": "file_upload_callback",
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655
}Service
调整上传的文件为最高优先级
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: upload_flighttask_media_prioritize
Data:
flight_id
任务 ID
text
需要最高优先级上传的任务
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "upload_flighttask_media_prioritize"
}Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: upload_flighttask_media_prioritize
Data:
result
返回码
int
非 0 代表错误
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "upload_flighttask_media_prioritize"
}Requests
获取上传临时凭证
Topic: thing/product/{gateway_sn}/requests
Direction: up
Method: storage_config_get
Data:
module
模块枚举值
enum_int
{"0":"媒体"}
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"module": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "storage_config_get"
}Topic: thing/product/{gateway_sn}/requests_reply
Direction: down
Method: storage_config_get
Data:
result
返回码
int
非 0 代表错误
output
输出
struct
»bucket
对象存储桶名称
text
»credentials
凭证信息
struct
»»access_key_id
访问密钥 ID
text
»»access_key_secret
秘密访问密钥
text
»»expire
访问密钥过期时间
int
{"step":"1","unit_name":"秒 / s"}
»»security_token
会话凭证
text
»endpoint
对外服务的访问域名
text
»provider
云厂商枚举值
enum_string
{"ali":"阿里云","aws":"亚马逊云","minio":"minio"}
»region
数据中心所在的地域
text
»object_key_prefix
对象存储桶的 Key 的前缀
text
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"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"
},
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655,
"method": "storage_config_get"
}Last updated