跳到主要内容

媒体管理

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
»»create_time媒体拍摄时间date{"format":"iso8601"}
»»shoot_position拍摄位置struct
»»»lat拍摄位置纬度float
»»»lng拍摄位置经度float

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"file": {
"ext": {
"drone_model_key": "0-4",
"flight_id": "xxx",
"is_original": true,
"payload_model_key": "0-4"
},
"metadata": {
"absolute_altitude": 56.311,
"create_time": "2024-01-10 16:04:20",
"gimbal_yaw_degree": "0",
"relative_altitude": 41.124,
"shoot_position": {
"lat": 22.1,
"lng": 144.5
}
},
"name": "dog.jpeg",
"object_key": "object_key",
"path": "xxx"
}
},
"gateway": "xxx",
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1709192149431,
"method": "file_upload_callback"
}

Requests

获取上传临时凭证

Topic: thing/product/{gateway_sn}/requests

Direction: up

Method: storage_config_get

Data:

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

Example:

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

Topic: thing/product/{gateway_sn}/requests_reply

Direction: down

Method: storage_config_get

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误
output输出struct
»bucket对象存储桶名称text
»credentials凭证信息struct
»»access_key_id访问密钥 IDtext
»»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": 1709192149431,
"method": "storage_config_get"
}