40.file
Event
Media file upload result report
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: file_upload_callback
Data:
file
File information
struct
»object_key
Key of the file in the object storage bucket
text
»path
Business path of the file
text
»name
File name
text
»ext
File extension content
struct
»»flight_id
Mission ID
text
»»drone_model_key
Aircraft product enumeration value
text
»»payload_model_key
Payload product enumeration value
text
»»is_original
Whether it is an original image
bool
{"0":"No","1":"Yes"}
»metadata
Media metadata
struct
»»gimbal_yaw_degree
Gimbal yaw angle
float
»»absolute_altitude
Absolute capturing altitude
float
»»relative_altitude
Relative altitude of the shot
float
»»create_time
Media capture time
date
{"format":"iso8601"}
»»shoot_position
Capturing position
struct
»»»lat
Latitude of the capturing position
float
»»»lng
Longitude of the capturing position
float
»cloud_to_cloud_id
Cloud-to-cloud bucket ID
text
The ID of the bucket to which the media is uploaded. If not uploaded to a cloud-to-cloud bucket, the value of this field is 'DEFAULT'
flight_task
Flight task information
struct
»uploaded_file_count
Number of media files uploaded for this flight
int
»expected_file_count
Total number of media files for this flight
int
»flight_type
Flight type enum value
enum_int
{"0":"Route mission","1":"One-click takeoff mission"}
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
}Priority report for uploading media files
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: highest_priority_upload_flighttask_media
Data:
flight_id
Mission ID
text
ID of the mission with the highest priority
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxx"
},
"gateway": "xxx",
"need_reply": 1,
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655
}Service
Adjust uploaded files to the highest priority
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: upload_flighttask_media_prioritize
Data:
flight_id
Mission ID
text
Mission with the highest priority to upload
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"flight_id": "xxx"
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655
}Topic: thing/product/{gateway_sn}/services_reply
Direction: up
Method: upload_flighttask_media_prioritize
Data:
result
Return code
int
Non-zero represents an error
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"result": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655
}Requests
Get temporary credentials for upload
Topic: thing/product/{gateway_sn}/requests
Direction: up
Method: storage_config_get
Data:
module
Module enumeration value
enum_int
{"0":"Media"}
Example:
{
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"data": {
"module": 0
},
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp": 1654070968655
}Topic: thing/product/{gateway_sn}/requests_reply
Direction: down
Method: storage_config_get
Data:
result
Return code
int
Non-zero represents an error
output
Output
struct
»bucket
Object storage bucket name
text
»credentials
Credential information
struct
»»access_key_id
Access key ID
text
»»access_key_secret
Secret access key
text
»»expire
Access key expiration time
int
{"step":"1","unit_name":"Seconds / s"}
»»security_token
Session token
text
»endpoint
Access domain for external services
text
»provider
Cloud provider enumeration values
enum_string
{"ali":"Alibaba Cloud","aws":"Amazon Cloud","minio":"minio"}
»region
Region where the data center is located
text
»object_key_prefix
Prefix of the key in the object storage bucket
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
}Last updated