Search Asset Node¶
Search for assets based on the search criteria.
If you need to invoke this API after performing bulk updates to relevant asset trees using other APIs, it is recommended to wait for about 2 seconds to avoid obtaining unupdated data.
Request Format¶
POST https://{apigw-address}/asset-tree-service/v2.1/asset-nodes?action=searchAsset
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Required/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Required |
String |
The OU ID which the asset belongs to. How to get orgId>> |
Request Parameters (Body)¶
Note
EnOS Cloud only supports searching with expression
. EnOS Edge supports searching with either expression
or filter
, but they cannot be used simultaneously.
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
expression |
Optional |
String |
The conditions used for the search. The fields that are supported for query include the below.
Do not use this with |
filter |
Optional |
AssetSearchVo Struct |
The conditions used for the search. Do not use this with Note: EnOS Cloud does not support this parameter. |
pagination |
Optional |
Pagination Request Struct |
Lists the paging requirements in a request. When not specified, 100 records are displayed per page by default. The maximum records per page is 1000 but for optimal performance, it is recommended to have not more than 50 records per page. |
projection |
Optional |
Projection Struct |
Enables you to crop the data result set returned in the request if needed. Only the specified fields will be returned in the data result set if this parameter is used. Otherwise all fields are returned. How does projection crop the result set>>
|
AssetSearchVo Struct ¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
assetIds |
Optional |
String Array |
The list of asset IDs. |
modelIds |
Optional |
String Array |
The list of model IDs. |
rootModelIds |
Optional |
String Array |
The list of root model IDs. |
attributes |
Optional |
Map (Key is of String type, Value is of Object type) |
The attributes of the model which the asset belongs to. |
tags |
Optional |
Map (Key and Value are of String type) |
The user-defined tags. For more information, see How to use tag. |
nameLike |
Optional |
I18nSearchVo Struct |
The asset name, which supports fuzzy query. For more information, see I18nSearchVo Struct. |
treeId |
Optional |
String |
The asset tree ID. |
I18nSearchVo Struct ¶
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
locale |
Optional |
String |
The locale language, currently supporting:
|
value |
Optional |
String |
The corresponding asset name for the locale. If null, no data will be returned. If blank, the data under the specified locale will be returned. |
Response Parameters¶
Name |
Data Type |
Description |
---|---|---|
data |
Array |
A list of the assets. Information include |
Error Codes¶
Code |
Message |
Description |
---|---|---|
99400 |
Invalid arguments |
The request parameter is invalid. Check the request parameters. |
99500 |
System error |
Internal server error. Contact the system administrator. |
Samples¶
Request Sample¶
url: https://{apigw-address}/asset-tree-service/v2.1/asset-nodes?action=searchAsset&orgId=yourOrgId
method: POST
requestBody:
{
"projection": ["attributes", "assetId", "name"]
}
Return Sample¶
{
"code": 0,
"msg": "OK",
"requestId": "cf08e75c-325a-429f-bdb9-ec5d6a1250d7",
"pagination": {
"pageNo": 1,
"pageSize": 10,
"totalSzie": 10,
"sortedBy": null
},
"data": [{
"assetId": "yourAssetId1",
"name": {
"i18nValue": {},
"defaultValue": "earth"
},
"attributes": {
"starsystem": "Solar System",
"de001": 123
}
}, {
"assetId": "yourAssetId2",
"name": {
"i18nValue": {},
"defaultValue": "earth"
},
"attributes": {
"starsystem": "Solar System",
"de001": 123
}
}, {
"assetId": "yourAssetId3",
"name": {
"i18nValue": {},
"defaultValue": "earth"
},
"attributes": {
"starsystem": "Solar System",
"de001": 123
}
}, {
"assetId": "yourAssetId4",
"name": {
"i18nValue": {},
"defaultValue": "venus"
},
"attributes": {
"starsystem": "Solar System",
"de001": 123
}
}, {
"assetId": "yourAssetId5",
"name": {
"i18nValue": {},
"defaultValue": "1559140566137"
},
"attributes": {
"starsystem": "Solar System",
"de001": 123
}
}, {
"assetId": "yourAssetId6",
"name": {
"i18nValue": {},
"defaultValue": "earth"
},
"attributes": {
"starsystem": "Solar System",
"de001": 123
}
}, {
"assetId": "yourAssetId7",
"name": {
"i18nValue": {},
"defaultValue": "earth"
},
"attributes": {
"starsystem": "Solar System",
"de001": 123
}
}]
}
SDK Samples¶
You can access the SDK samples for Asset Tree Service on GitHub: