更新时间:2024-02-28 GMT+08:00
分享

平台下发文件下载临时URL

功能介绍

平台下发文件下载临时URL给设备。

Topic

下行: $oc/devices/{device_id}/sys/events/down

参数说明

字段名

必选/可选

类型

参数描述

object_device_id

可选

String

  • 平台下发时,若为网关子设备,该参数为Topic中设备的子设备Id。
  • 平台下发时,若为直连设备,该参数会与Topic中的device_id一致。

services

可选

List<ServiceEvent>

事件服务列表。

ServiceEvent定义表

字段名

必选/可选

类型

参数描述

service_id

必选

String

系统字段,固定为:"$file_manager"。

event_type

必选

String

系统字段,固定为:"get_download_url_response"。

event_time

可选

String

事件时间。UTC时间,格式:yyyyMMdd'T'HHmmss'Z'。

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
            }

         } 
     }] 
}
分享:

    相关文档

    相关产品