Search Asset Tree¶
Search for eligible asset trees based on tags.
Request Format¶
POST https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=search
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required or Not |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
true |
String |
Organization ID which the asset belongs to. How to get orgId>> |
Request Parameters (Body)¶
Name |
Required or Not |
Data Type |
Description |
---|---|---|---|
expression |
false |
String |
Query expression. |
pagination |
false |
Pagination request struct |
Used to describe paging requirements in an interface request. The maximum records per page is 1000. By default, it is in the first page and the pagination size is 100. Pagination Request Struct |
projection |
false |
String Array |
For details, see How does projection crop the result set>> |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
treeId |
String |
Asset tree ID |
tags |
Tag struct |
A group of user-customized asset tree tags |
asset |
asset struct |
Root asset of the asset tree |
Sample 1¶
Request Sample¶
POST
https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=search&orgId=o15541858646501
{
"expression":"tags.k1 ='v1' "
"pagination": {
"pageNo": 1,
"pageSize": 10
},
"action": "search",
"projection": ["asset"]
}
Return Sample¶
{
"code": 0,
"msg": "OK",
"requestId": "82248518-6da4-49d2-8d07-cf7a0ff55b60",
"data":
[{
"asset": {
"modelId": "NULLMODEL",
"assetId": "qf1vsBQW",
"timezone": "+08:00",
"name": {
"i18nValue": {
"en_US": "zmTree604111zzz"
},
"defaultValue": "zmTree604"
},
"description": "",
"attributes": {},
"inValid": false,
"label": "1",
"modelIdPath": "/NULLMODEL",
"tags": {}
}],
"pagination" : {
"pageNo": 1,
"pageSize": 10,
"totalSize": 10,
"sortedBy":null
}
}