Media Management
Event
Reporting Media File Upload Results
Topic: thing/product/{gateway_sn}/events
Direction: up
Method: file_upload_callback
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| file | File Information | struct | File information object | |
| »object_key | File Key in Storage Bucket | text | Unique identifier of the file in the object storage bucket | |
| »path | File Business Path | text | Business path of the file (wayline task association path) | |
| »name | File Name | text | File name (including extension) | |
| »ext | File Extension Content | struct | File extension information | |
| »»flight_id | Task ID | text | Associated wayline task ID | |
| »»drone_model_key | UAV Product Key | text | Aircraft product enumeration value | |
| »»payload_model_key | Payload Product Key | text | Payload product enumeration value | |
| »»is_original | Is Original Image | bool | {"0":"No","1":"Yes"} | Whether it is the original file (original image/video) |
| »metadata | Media Metadata | struct | Media file metadata | |
| »»gimbal_yaw_degree | Gimbal Yaw Angle | float | Gimbal yaw angle at capture time | |
| »»absolute_altitude | Absolute Altitude at Capture | float | Absolute altitude at capture time (relative to sea level) | |
| »»relative_altitude | Relative Altitude at Capture | float | Relative altitude at capture time (relative to takeoff point) | |
| »»create_time | Media Capture Time | date | {"format":"iso8601"} | Media file creation time |
| »»shoot_position | Capture Location | struct | GPS position at capture time | |
| »»»lat | Latitude of Capture | float | Latitude | |
| »»»lng | Longitude of Capture | float | Longitude |
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
Get Temporary Upload Credentials
Topic: thing/product/{gateway_sn}/requests
Direction: up
Method: storage_config_get
Data:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| module | Module enumeration value | enum_int | {"0":"Media"} | Requested storage module type |
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:
| Column | Name | Type | constraint | Description |
|---|---|---|---|---|
| result | Return code | int | Non-zero indicates an error | |
| output | Output | struct | Response output content | |
| »bucket | Object storage bucket name | text | Object storage bucket name | |
| »credentials | Credential information | struct | STS temporary credential information | |
| »»access_key_id | Access key ID | text | Temporary access key ID | |
| »»access_key_secret | Secret access key | text | Temporary access key secret | |
| »»expire | Access key expiration time | int | {"step":"1","unit_name":"seconds / s"} | Credential expiration time (in seconds) |
| »»security_token | Session token | text | Security token | |
| »endpoint | Public service access domain | text | Object storage service endpoint | |
| »provider | Cloud provider enum | enum_string | {"aws":"Amazon Web Services","minio":"Minio"} | Storage service provider |
| »region | Region where the data center is located | text | Region where the storage bucket is located | |
| »object_key_prefix | Prefix for the object key in the storage bucket | text | Key prefix for uploaded files |
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"
}