跳到主要内容

媒体管理

接口变更说明​

✓ 提供该接口,— 未提供。未列出的接口 EVO Nest 与 Autel Nest2 一致。

Method功能EVO NestAutel Nest2说明
file_cancel取消文件上传—✓

媒体文件上传结果上报​

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: file_upload_callback

Data:

ColumnNameTypeconstraintDescription
result上传结果int固定为 0,表示文件上传成功
file文件信息struct媒体文件信息
»object_key文件在对象存储桶的 Keytext文件在对象存储桶中的Key
»path文件的业务路径text文件的业务路径
»name文件名称text文件名称
»file_size文件大小text文件字节数,字符串形式;无法获取时不上报
»width文件宽度int像素,大于 0 时上报
»height文件高度int像素,大于 0 时上报
»ext文件扩展内容struct文件的扩展元数据
»»even_id关联拍摄事件IDarray_text字符串数组
»»flight_id任务 IDtext关联的航线任务ID
»»drone_sn无人机序列号text拍摄该文件的无人机序列号
»»drone_model_key无人机产品枚举值text拍摄该文件的无人机产品枚举值
»»payload_model_key负载产品枚举值text拍摄该文件的负载产品枚举值
»»is_original是否为原图int{"0":"否","1":"是"}是否为原始未压缩图片
»metadata媒体元数据struct媒体文件的元数据信息
»»gimbal_yaw_degree云台偏航角double拍摄时云台偏航角
»»absolute_altitude拍摄绝对高度float拍摄时的海拔高度
»»relative_altitude拍摄相对高度float拍摄时的相对高度
»»create_time媒体拍摄时间date{"format":"iso8601"}媒体文件创建时间
»»duration媒体时长int{"unit_name":"秒 / s"}视频时长,照片为 0
»»file_type文件类型enum_int{"0":"jpg","1":"mov","2":"mp4","3":"m4a","4":"dng"}媒体文件类型
»»image_type图像类型enum_int{"0":"广角","1":"变焦","2":"红外","3":"夜视"}图像通道类型
»»shoot_position拍摄位置struct拍摄位置坐标
»»»lat拍摄位置纬度float拍摄位置纬度
»»»lng拍摄位置经度float拍摄位置经度

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"file": {
"ext": {
"drone_model_key": "0-4",
"drone_sn": "xxxxxxxxxx",
"flight_id": "xxx",
"is_original": 1,
"payload_model_key": "0-4",
"even_id": ["1", "2"]
},
"metadata": {
"absolute_altitude": 56.311,
"create_time": "2024-01-10 16:04:20",
"duration": 0,
"file_type": 0,
"gimbal_yaw_degree": 0,
"image_type": 1,
"relative_altitude": 41.124,
"shoot_position": {
"lat": 22.1,
"lng": 144.5
}
},
"name": "dog.jpeg",
"object_key": "object_key",
"path": "xxx"
},
"result": 0
},
"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 ID
»»access_key_secret秘密访问密钥text临时 Access Key Secret
»»expire访问密钥过期时间int{"step":"1","unit_name":"秒 / s"}凭证过期时间
»»security_token会话凭证text安全令牌
»endpoint对外服务的访问域名text对象存储服务端点地址
»provider云厂商枚举值enum_string{"s3":"S3 协议兼容存储","aws":"亚马逊云","amazon":"亚马逊云","minio":"minio","ali":"阿里云","oss":"阿里云对象存储","cos":"腾讯云对象存储","qcloud":"腾讯云","obs":"华为云对象存储","huawei":"华为云"}云存储厂商类型
»region数据中心所在的地域text存储桶所在区域
»object_key_prefix对象存储桶的 Key 的前缀text文件上传的Key前缀

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"
}

任务文件上传状态上报​

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: file_upload_status

Data:

ColumnNameTypeconstraintDescription
tasks任务列表array任务信息数组
»flight_id任务IDtext关联的航线任务ID
»total_video_files视频文件总数量int本次任务的视频文件总数
»uploaded_video_files已上传完成视频文件数量int已上传完成的视频文件数
»total_photo_files照片文件总数量int本次任务的照片文件总数
»uploaded_photo_files已上传照片数量int已上传完成的照片文件数
»status上传状态enum_int{"0":"待上传","1":"上传完成","2":"上传中","4":"上传失败"}文件上传整体状态

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"tasks": [
{
"flight_id": "flight_123456",
"total_video_files": 10,
"uploaded_video_files": 0,
"total_photo_files": 10,
"uploaded_photo_files": 10,
"status": 0
},
{
"flight_id": "flight_123457",
"total_video_files": 10,
"uploaded_video_files": 0,
"total_photo_files": 10,
"uploaded_photo_files": 10,
"status": 1
},
{
"flight_id": "flight_123458",
"total_video_files": 10,
"uploaded_video_files": 0,
"total_photo_files": 10,
"uploaded_photo_files": 10,
"status": 2
}
]
},
"gateway": "xxx",
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1709192149431,
"method": "file_upload_status"
}

删除任务文件​

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: file_delete

Data:

ColumnNameTypeconstraintDescription
flight_id任务 IDtext需删除文件的航线任务ID

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_delete"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: file_delete

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

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

重新上传任务文件​

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: file_reupload

Data:

ColumnNameTypeconstraintDescription
flight_id任务 IDtext需重新上传的航线任务ID

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxxxxxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_reupload"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: file_reupload

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

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

取消文件上传​

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: file_cancel

Data:

ColumnNameTypeconstraintDescription
files文件列表array需取消上传的文件列表
»file_path文件路径text文件完整路径,必填
»file_name文件名称text文件名称,可选

Example:

{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"files": [
{
"file_name": "IMG_0001.JPG",
"file_path": "/media/xxxxxxx/IMG_0001.JPG"
}
]
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1234567890123,
"method": "file_cancel"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: file_cancel

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误

Example:

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