V2.5 Search DPS Device


Search for DPS devices based on the search criteria.


This API is only available if 2.4 Cumulative Update 2 has been applied to your environment.

Request Format

POST https://{apigw-address}/dps-service/v2.5/pvs/device?action=search

Request Parameters (Body)

Name

Required/Optional

Data Type

Description

expression

Required

String

The query expression supports FQL queries with the following searchable fields: “sn”, “groupId”, “regionId”, “productKey”, “status”, “batchOrder”, “createTime”, and “deviceData”.

  • “sn”: supports the “=”, “IN” and “LIKE” operators.

  • “groupId”: supports the “=” and “IN” operators.

  • “regionId”: supports the “=” and “IN” operators.

  • “productKey”: supports the “=” and “IN” operators.

  • “status”: supports the “=” and “IN” operators.

  • “batchOrder”: supports the “=”, “!=”, “<”, “<=”, “>”, “>=”, and “IN” operators.

  • “createTime”: supports the “=”, “!=”, “<”, “<=”, “>”, “>=”, and “IN” operators.

  • “deviceData.”: supports the “=”, “IN”, “IS NULL” and wildcard “*” operators for matching any device metadata.

pagination

Optional

Pagination Request Struct

Lists the paging requirements in a request. When not specified, 10 records are displayed per page by default. The maximum records per page is 1,000 but for optimal performance, it is recommended to have not more than 50 records per page. Supports sorters parameter to sort the results. By default, the records are sorted in descending order by createTime. Pagination Request Struct>>

Response Parameters

Name

Data Type

Description

data

PvsDevice Struct

The information of the DPS device. For more information, see PvsDevice Struct.

Samples

Request Sample

url: https://{apigw-address}/dps-service/v2.5/pvs/device?action=search
method: POST
requestBody:
{
    "expression": "sn = 'sn1' || deviceData.commDeviceSn in ('InverterTest_update','InverterTest','Inverter') && deviceData.regionId = 'region1'",
    "pagination": {
        "pageNo": 1,
        "pageSize": 10,
    "sorters": [{
        "field": "deviceData.deviceSn",
        "order": "ASC"
      }]
    }
}

Return Sample

{
  "code": 0,
  "msg": "OK",
  "requestId": "ee3e2bc8-4595-490d-88d4-72bfe86b66cd",
  "data": [
    {
      "sn": "sn1",
      "groupId": "groupId",
      "regionId": null,
      "orgId": null,
      "productKey": "productKey",
      "batchOrder": 583,
      "batchTag": {
        "defaultValue": "batch_update",
        "i18nValue": {
          "en_US": "batch_update",
          "zh_CN": "批量更新"
        }
      },
      "deviceData": {
        "date": "2023-06-08",
        "commDeviceSn": "InverterTest_update",
        "seqNo": 1,
        "topoSize": 5,
        "modelID": "modelID_update",
        "optModel": "optModel_update",
        "deviceSn": "devicesn",
        "version": "version_update",
        "enum": "CENTRAL",
        "capacity": 20.2,
        "modelName": "modelName_update",
        "capacity_rated": 200.2,
        "assetId": "assetId",
        "parentDeviceSn": "InverterTest1_update",
        "regcode": "regcode_update",
        "optIndex": [
          "optIndex1_update",
          "optIndex2_update",
          "optIndex3_update"
        ],
        "tokenInUse": "tokenInUse_update",
        "optVersion": "optVersion_update",
        "optSN": [
          "optSN1_update",
          "optSN2_update"
        ]
      },
      "desc": "DCM AutoTest Desc_update",
      "status": {
        "currentStatus": "init",
        "connectedTime": null,
        "allocatedTime": null,
        "finishedTime": null,
        "discardedTime": null
      },
      "reprovisioning": true,
      "allocateErrorMsg": "",
      "createBy": null,
      "createTime": 1690184441964,
      "updateBy": null,
      "updateTime": 1690184441964,
      "manufacturerOrgId": "manufacturerOrgId1",
      "connectStatus": "init",
      "allocateStatus": "init"
    },
    {
      "sn": "sn2",
      "groupId": "OSVXYB",
      "regionId": null,
      "orgId": null,
      "productKey": null,
      "batchOrder": 587,
      "batchTag": {
        "defaultValue": "batch_update",
        "i18nValue": {
          "en_US": "batch_en_us_update",
          "zh_CN": "batch_zh_cn_update"
        }
      },
      "deviceData": {
        "date": "2023-06-09",
        "commDeviceSn": "InverterTest_update",
        "seqNo": 1,
        "topoSize": 5,
        "modelID": "modelID_update",
        "timezone": null,
        "optModel": "optModel_update",
        "deviceSn": "deviceSn2",
        "version": "version_update",
        "deviceName": {
          "i18nValue": {}
        },
        "enum": "STRING",
        "orgId": "orgId",
        "capacity": 20,
        "modelName": "modelName_update",
        "capacity_rated": 200,
        "regionId": "beta",
        "parentDeviceSn": "InverterTest1_update",
        "regcode": "regcode_update",
        "optIndex": [
          "optIndex1_update",
          "optIndex2_update",
          "optIndex3_update"
        ],
        "tokenInUse": "tokenInUse_update",
        "optVersion": "optVersion_update",
        "tokenReplacing": null,
        "optSN": [
          "optSN1_update",
          "optSN2_update"
        ]
      },
      "desc": "Desc_update",
      "status": {
        "currentStatus": "init",
        "connectedTime": null,
        "allocatedTime": null,
        "finishedTime": null,
        "discardedTime": null
      },
      "reprovisioning": false,
      "allocateErrorMsg": null,
      "createBy": null,
      "createTime": 1690184442292,
      "updateBy": null,
      "updateTime": 1690184442292,
      "manufacturerOrgId": "manufacturerOrgId2",
      "connectStatus": "init",
      "allocateStatus": "init"
    }
  ],
  "pagination": {
    "sortedBy": [
      {
        "field": "deviceData.deviceSn",
        "order": "ASC"
      }
    ],
    "pageNo": 1,
    "pageSize": 10,
    "totalSize": 2
  }
}