平台下发文件下载临时URL
功能介绍
平台下发文件下载临时URL给设备。
Topic
Topic: $oc/devices/{device_id}/sys/events/down
参数说明
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| object_device_id | 可选 | String | 事件对应的最终目标设备,没有携带则表示目标设备即topic中指定的设备 |
| services | 可选 | List<ServiceEvent> | 事件服务列表 |
ServiceEvent定义表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| service_id | 必选 | String | $file_manager |
| event_type | 必选 | String | get_download_url_response |
| event_time | 可选 | String | 事件时间 |
| paras | 必选 | Object | 事件参数JSON对象 |
paras参数列表
| 字段名 | 必选/可选 | 类型 | 参数描述 |
|---|---|---|---|
| url | 必选 | String | 文件下载URL |
| bucket_name | 可选 | String | OBS桶的名称 |
| object_name | 可选 | String | OBS待下载对象名称,与file_name一致 |
| expire | 可选 | Integer | URL过期时间,单位:秒 |
| file_attributes | 可选 | Object | 文件属性,JSON格式的Object对象 |
示例
Topic: $oc/devices/{device_id}/sys/events/down
数据格式:
{
"object_device_id": "{object_device_id}",
"services": [{
"service_id": "$file_manager",
"event_type": "get_download_url_response",
"event_time": "20151212T121212Z",
"paras": {
"url":"https://bucket.obs.cn-north-4.com/device_file/aGEKIpp5NAGxdP2oo90000/a.jpg?Expires=1553162075&OSSAccessKeyId=LTAIYLScbHiV****&Signature=%2F88xdEFPukJ****%2F8****%2Bdv3io%3D",
"bucket_name":"bucket",
"object_name": "c6b39067b0325db34663d3ef421a42f6_12345678_a.jpg",
"expire":3600,
"file_attributes": {
"hash_code": "58059181f378062f9b446e884362a526",
"size": 1024
}
}
}]
} Last Article: 设备上报获取文件下载URL请求
Next Article: 设备上报文件下载结果
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.