物接入IoT Hub

    获取规则详情

    请求参数

    方法 API 说明
    GET /v3/iot/rules/device/{deviceName} 获取单个规则的规则详情

    返回参数

    DeviceRuleResponse

    请求示例

    GET /v3/iot/rules/device/myDeviceName HTTP/1.1
    Host: iotdm.gz.baidubce.com
    Authorization:{authorization}
    Content-Type: application/json; charset=utf-8

    返回示例

    HTTP/1.1 200 OK
    Content-Type: application/json; charset=utf-8
    x-bce-request-id: 993ff7e9-018b-4246-a7ba-5dddac970054
     
     
    {
        "id": "63d92c1de2bd46e0b257c6df67b4a7e9",
        "deviceName": "myDeviceName",
        "name": "device xxxx to TSDB yyyy",
        "sources": [{
            "description": "This is condition 1"
            "name": "name",
            "type": "string",
            "displayName": "名字",
            "unit": "count",
            "defaultValue": "0",
            "condition": "<>",
            "value": "aaa",
            "lastSaveTime": 0
        }, {
            "description": "This is condition 2",
            "name": "temperature",
            "type": "number",
            "displayName": "数量",
            "unit": "piece",
            "defaultValue": "1",
            "condition": ">=",
            "value": "20",
            "lastSaveTime": 1494904250
        }, {
            "description": "This is condition 3",
            "name": "speed",
            "type": "number",
            "displayName": "速度",
            "unit": "km/s",
            "defaultValue": "60",
            "condition": ">",
            "value": "0",
            "lastSaveTime": 1494904250
        }, {  
        // 这个规则是来自Schema里的新的属性,用户在之前的规则建立的时候并没有创建对应的规则。 如果创建的规则在Schema里没有对应的属性,则那条规则不会显示
            "description": "",
            "name": "temp",
            "type": "number",
            "displayName": "温度",
            "unit": "c",
            "defaultValue": "36",
            "condition": "",
            "value": "",
            "lastSaveTime": 0
     
        }],
        "destinations": [
            {
                "uuid": "6653da99bf9a4e35ba4f997e000a699f",
                "value": "test.tsdb.iot.gz.baidubce.com",
                "kind": "TSDB"
            }
        ],
        "enable": true,
        "createTime": 1494904250,
        "updateTime": 1494904250
    }
    一篇
    创建规则
    一篇
    修改规则