Media Management
Event
Result reporting of media file uploading
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: file_upload_callback
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
file | File information | struct | ||
»object_key | Key of file in object storage bucket | text | {} | |
»path | Bussiness path of file | text | {} | |
»name | File name | text | {} | |
»ext | Expand content of file | struct | ||
»»flight_id | Task id | text | {} | |
»»drone_model_key | Enumeration value of flight product | text | {} | |
»»payload_model_key | Enumeration value of payload product | text | {} | |
»»is_original | Whether is original image | bool | {"0":"No","1":"Yes"} | |
»metadata | Media metadata | struct | ||
»»gimbal_yaw_degree | Yaw degree of gimbal | float | {} | |
»»absolute_altitude | 拍摄绝对高度 | float | ||
»»relative_altitude | Absolute altitude of shooting | float | ||
»»created_time | Shooting time of media | date | {"format":"iso8601"} | |
»»shoot_position | Shooting position | struct | [{"identifier":"lat","name":"latitude of shooting position","dataType":{"type":"float"}},{"identifier":"lng","name":"longitude of shooting position","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
}
}
Priority report of the media file uploading
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: highest_priority_upload_flighttask_media
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_id | Task id | text | {} | The current highest priority task 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
Set the uploading file to highest priority
Topic: thing/product/{gateway_sn}/services
Direction: down
Method: upload_flighttask_media_prioritize
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
flight_id | Task id | text | {} | The task that needs to be uploaded in highest priority |
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:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
result | Return Code | int | Non-0 means error |
Example:
{
"method": "upload_flighttask_media_prioritize",
"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
"timestamp:": 1654070968655,
"data": {
"result": 0
}
}
Requests
Obtain upload temporary credentials
Topic: thing/product/{gateway_sn}/requests
Direction: up
Method: storage_config_get
Data:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
module | Module enumeration value | enum | {"0":"media"} |
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:
Column | Name | Type | constraint | Description |
---|---|---|---|---|
bucket | Name of object storage bucket | text | {} | |
credentials | credentials information | struct | ||
»access_key_id | Access key ID | text | {} | |
»access_key_secret | Access key secret | text | {} | |
»expire | Expired time of access key secret | int | {"unit":"s","unitName":"second","step":"1"} | |
»security_token | session credentials | text | {} | |
endpoint | Access domain name for external services | text | {} | |
provider | Cloud vendor enumeration value | enum | {"ali":"Ali Cloud","aws":"Amazon Cloud","minio":"minio"} | |
region | Region of data center | text | {} | |
object_key_prefix | Key prefix of object storage bucket | 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"
}
}
}