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”.
|
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 |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
PvsDevice Struct |
The information of the DPS device. For more information, see PvsDevice Struct. |
PvsDevice Struct ¶
Name |
Data Type |
Description |
---|---|---|
sn |
String |
The device SN that is generated by system and unique in this environment. |
groupId |
String |
The registration group ID. |
regionId |
String |
The ID of the region to which the device is allocated. |
orgId |
String |
The ID of the OU to which the device is allocated. |
productKey |
String |
The corresponding product key of the device in the EnOS Management Console. |
batchOrder |
Integer |
The device creation batch number. |
batchTag |
StringI18n |
The device creation batch tag. Internationalized name representation >> |
deviceData |
Map |
The device master data. |
desc |
String |
The device description. |
status |
PvsDeviceStatus Struct |
The current status of the device. For more information, see PvsDeviceStatus Struct. |
reprovisioning |
Boolean |
|
allocateErrorMsg |
String |
The information of the device’s last allocation failure. |
createBy |
String |
Ther user ID of the person who created the device. |
createTime |
Long |
The time the device was created. |
updateBy |
String |
The user ID of the person who updated the device. |
updateTime |
Long |
The time the device was updated. |
manufacturerOrgId |
String |
The ID of the organization where the device is pre-registered. |
connectStatus |
String |
The device connection status. Values include |
allocateStatus |
String |
The device allocation status. Values include |
PvsDeviceStatus Struct ¶
Name |
Data Type |
Description |
---|---|---|
currentStatus |
String |
The device current status. Values include |
connectedTime |
Long |
The time the device was connected. |
allocatedTime |
Long |
The time the device was allocated. |
finishedTime |
Long |
The time the device finished activation. |
discardedTime |
Long |
THe time the device was discarded. |
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
}
}