Get Attribute Info


Get Attribute Info 节点获取资产指定属性或全部属性的信息。

节点类型

EnOS。

输入和输出能力

该节点具有多个入口点和 2 个出口点 (成功/失败)。

节点属性

../../../_images/get_attribute_info.png


名称

该节点的名称。


描述

该节点的描述。

示例

返回数据将保存在 body,以 ComponentReply[Query-Attribute] 参数为 key。

查询指定属性

输入示例

{
  "MetaData": {
    "messageType": "QueryAttribute",
    "assetId": "assetId",
    "deviceKey": "deviceKey",
    "productKey": "productKey",
    "orgId": "yourOrgId",
    "ts": "1654511472266"
  },
  "Body": {
    "attributes": [
      "arr_bool",
      "attr_string",
      "attr_int"
    ]
  }
}

输出示例

{
  "MetaData": {
    "messageType": "QueryAttribute",
    "assetId": "assetId",
    "deviceKey": "deviceKey",
    "productKey": "productKey",
    "orgId": "yourOrgId",
    "componentResult": "Success",
    "ts": "1654511472266"
  },
  "Body": {
    "attributes": [],
    "ComponentReply[Query-Attribute]": {
      "arr_bool": true,
      "attr_int": 7
    }
  }
}

查询全部属性

输入示例

{
  "MetaData": {
    "messageType": "QueryAttribute",
    "assetId": "assetId",
    "deviceKey": "deviceKey",
    "productKey": "productKey",
    "orgId": "yourOrgId",
    "ts": "1654511472222"
  },
  "Body": {
    "attributes": []
  }
}

输出示例

{
  "MetaData": {
    "messageType": "QueryAttribute",
    "assetId": "assetId",
    "deviceKey": "deviceKey",
    "productKey": "productKey",
    "orgId": "yourOrgId",
    "componentResult": "Success",
    "ts": "1654511472222"
  },
  "Body": {
    "attributes": [],
    "ComponentReply[Query-Attribute]": {
      "attr_double": 7,
      "arr_bool": true,
      "attr_date": "2022-03-17",
      "attr_int": 7,
      "attr_ts": 1312672803201,
      "arr_enum": "v2",
      "attr_file": "ftp://d.com/demo7.txt",
      "new_date": "",
      "attr_float": 7
    }
  }
}