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 | ||
| »object_key | File Key in Storage Bucket | text | ||
| »path | File Business Path | text | ||
| »name | File Name | text | ||
| »ext | File Extension Content | struct | ||
| »»flight_id | Task ID | text | ||
| »»drone_model_key | UAV Product Key | text | ||
| »»payload_model_key | Payload Product Key | text | ||
| »»is_original | Is Original Image | bool | {"0":"No","1":"Yes"} | |
| »metadata | Media Metadata | struct | ||
| »»gimbal_yaw_degree | Gimbal Yaw Angle | float | ||
| »»absolute_altitude | Absolute Altitude at Capture | float | ||
| »»relative_altitude | Relative Altitude at Capture | float | ||
| »»create_time | Media Capture Time | date | {"format":"iso8601"} | |
| »»shoot_position | Capture Location | struct | ||
| »»»lat | Latitude of Capture | float | ||
| »»»lng | Longitude of Capture | 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
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"} | 
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 | ||
| »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 | Public service access domain | text | ||
| »provider | Cloud provider enum | enum_string | {"aws":"Amazon Web Services","minio":"Minio"} | |
| »region | Region where the data center is located | text | ||
| »object_key_prefix | Prefix for the object key in the 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": 1709192149431,
	"method": "storage_config_get"
}