跳到主要内容

Media Management

Event

Reporting Media File Upload Results

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: file_upload_callback

Data:

ColumnNameTypeconstraintDescription
fileFile InformationstructFile information object
»object_keyFile Key in Storage BuckettextUnique identifier of the file in the object storage bucket
»pathFile Business PathtextBusiness path of the file (wayline task association path)
»nameFile NametextFile name (including extension)
»extFile Extension ContentstructFile extension information
»»flight_idTask IDtextAssociated wayline task ID
»»drone_model_keyUAV Product KeytextAircraft product enumeration value
»»payload_model_keyPayload Product KeytextPayload product enumeration value
»»is_originalIs Original Imagebool{"0":"No","1":"Yes"}Whether it is the original file (original image/video)
»metadataMedia MetadatastructMedia file metadata
»»gimbal_yaw_degreeGimbal Yaw AnglefloatGimbal yaw angle at capture time
»»absolute_altitudeAbsolute Altitude at CapturefloatAbsolute altitude at capture time (relative to sea level)
»»relative_altitudeRelative Altitude at CapturefloatRelative altitude at capture time (relative to takeoff point)
»»create_timeMedia Capture Timedate{"format":"iso8601"}Media file creation time
»»shoot_positionCapture LocationstructGPS position at capture time
»»»latLatitude of CapturefloatLatitude
»»»lngLongitude of CapturefloatLongitude

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:

ColumnNameTypeconstraintDescription
moduleModule enumeration valueenum_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:

ColumnNameTypeconstraintDescription
resultReturn codeintNon-zero indicates an error
outputOutputstructResponse output content
»bucketObject storage bucket nametextObject storage bucket name
»credentialsCredential informationstructSTS temporary credential information
»»access_key_idAccess key IDtextTemporary access key ID
»»access_key_secretSecret access keytextTemporary access key secret
»»expireAccess key expiration timeint{"step":"1","unit_name":"seconds / s"}Credential expiration time (in seconds)
»»security_tokenSession tokentextSecurity token
»endpointPublic service access domaintextObject storage service endpoint
»providerCloud provider enumenum_string{"aws":"Amazon Web Services","minio":"Minio"}Storage service provider
»regionRegion where the data center is locatedtextRegion where the storage bucket is located
»object_key_prefixPrefix for the object key in the storage buckettextKey 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"
}