Documentation
preview
  • latest
  • stable
  • 3.0.0
  • 2.4.4
  • 2.4.0
  • 2.3.0
  • 2.2.0
  • 2.1.0
  • preview
English
  • English
  • 简体中文

Asset Tree Service API

Overview

  • Asset Tree Service Overview

API Reference

  • Asset Tree
  • Asset Tree Node
    • Associate Asset
    • Batch Associate Asset
    • Create and Associate Asset
    • Move Asset Node
    • Delete Asset Node
    • Get Asset Trees
    • Search Asset Node
    • Search Related Asset Node
      • Request Format
      • Request Parameters (URI)
      • Request Parameters (Body)
        • Filter Struct
        • I18nSearchVo Struct
      • Response Parameters
        • AssetVo Struct
      • Error Codes
      • Samples
        • Request Sample
        • Return Sample
      • SDK Samples
    • Search Asset Path

Other References

  • About EnOS API
  • How to Invoke an EnOS API
  • About Asset Trees

Last Updated 2025-04-25

  • Documentation
  • Asset Tree Node
  • Search Related Asset Node

Search Related Asset Node¶


Search for assets under the specified asset tree based on the relationship with a known asset.

The query results will only contain valid first-level child nodes, and querying descendant nodes under child nodes is not supported.


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=searchRelatedAsset

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>>

treeId

Query

Required

String

The asset tree ID. How to get treeId>>

Request Parameters (Body)¶


Name

Required/Optional

Data Type

Description

filter

Optional

Filter Struct

The query criteria. The relationship between all the queried criteria uses the “AND” logical operator, i.e. all relationships between all the queried criteria must be true for data to be returned.
For more information, see Filter Struct.

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. sorters is not supported to sort the response. For more information, see Pagination Request Struct.

projection

Optional

String Array

Enables you to crop the data result set returned in the interface 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>>

Filter Struct ¶


Note

isParentOfAssetId, isChildOfAssetId, isAncestorOfAssetId, and isDescendantOfAssetId cannot be used concurrently. Only one can be used per query.


Name

Required/Optional

Data Type

Description

assetIds

Optional

String Array

The asset ID. Provide multiple asset IDs if you want to query multiple assets. How to get assetId>>

nameLike

Optional

I18nSearchVo Struct

The asset Name. Supports fuzzy query. For more information, see I18nSearchVo Struct.

modelIds

Optional

String Array

The model ID. Provide multiple root model IDs if you want to query multiple models. How to get modelID>>

rootModelIds

Optional

String Array

The model ID of the root node. Provide multiple root model IDs if you want to query multiple root nodes.

isParentOfAssetId

Optional (See Note above)

String

The asset to be queried is the immediate parent node of the specified asset, and its value is the asset ID of the specified asset.
How to use expression>>

isChildOfAssetId

Optional (See Note above)

String

The asset to be queried is the immediate child node of the specified asset, and its value is the asset ID of the specified asset.
How to use expression>>

isAncestorOfAssetId

Optional (See Note above)

String

The asset to be queried is the ancestor node of the specified asset, and its value is the asset ID of the specified asset.
How to use expression>>

isDescendantOfAssetId

Optional (See Note above)

String

The asset to be queried is the descendant node of the specified asset, and its value is the asset ID of the specified asset.
How to use expression>>

I18nSearchVo Struct ¶


Name

Required/Optional

Data Type

Description

locale

Optional

String

The locale language, currently supporting:

  • default (default)

  • zh_CN

  • en_US

  • jp_JP

  • es_ES

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 of AssetVo Structs

For the definition of an AssetVo struct, see AssetVo Struct.

AssetVo Struct ¶


Name

Data Type

Description

assetId

String

The asset ID.

modelId

String

The model ID of this asset.

modelIdPath

String

The path of the model ID.

name

StringI18n

The asset’s name in its respective locale’s language. For more information, see Internationalized name struct.

timezone

String

Timezone where the asset is located.

description

String

The description of the asset.

label

String

The type of asset.

  • 0: Device asset

  • 1: Logical asset

inValid

Boolean

  • True: Invalid nodes

  • False: Valid nodes

attributes

Map

The attributes of the model which the asset belongs to. Key is the attribute ID, which is of String type. The Value type depends on the attribute defined in the model.

tags

Map

User-defined tags. The Key and Value are of String type.

childAssetNodeCount (Deprecated)

Integer

The number of valid child nodes. This parameter is deprecated and only returns the default value of 0. The number of valid child nodes can be viewed in the return value of the totalSize parameter.

pagination

Pagination request structure

The pagination conditions specified in the request. For the structure, see Pagination request structure. Among them, totalSize indicates the number of valid first-level child nodes that meet the query conditions. If a child node still has descendant nodes, they will not be counted.

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=searchRelatedAsset&treeId=k6wweMTP&orgId=yourOrgId
method: POST
requestBody:
{
  "filter": {
    "isChildOfAssetId": "yourAssetId"
  },
  "projection": ["attributes", "assetId", "name", "childAssetNodeCount"]
}

Return Sample¶


{
    "code":0,
    "msg":"OK",
    "requestId":"153ad7a2-2ec1-41b0-b750-e4ea2ce2786c",
    "data":[
        {
            "assetId":"yourAssetId1",
            "name":{
                "i18nValue":{

                },
                "defaultValue":"ycmdevice_1"
            },
            "attributes":{

            },
            "childAssetNodeCount": 6
        },
        {
            "assetId":"yourAssetId2",
            "name":{
                "i18nValue":{

                },
                "defaultValue":"ycmdevice_3"
            },
            "attributes":{

            },
            "childAssetNodeCount": 2
        },
        {
            "assetId":"yourAssetId3",
            "name":{
                "i18nValue":{
                    "en_US":"Rebecca_testSiteAPI3"
                },
                "defaultValue":"Rebecca_testSiteAPI3"
            },
            "attributes":{

            },
            "childAssetNodeCount": 3
        },
        {
            "assetId":"yourAssetId4",
            "name":{
                "i18nValue":{

                },
                "defaultValue":"Rebecca_Service1"
            },
            "attributes":{

            },
            "childAssetNodeCount": 6
        },
        {
            "assetId":"yourAssetId5",
            "name":{
                "i18nValue":{

                },
                "defaultValue":"ycmdevice_2"
            },
            "attributes":{

            },
            "childAssetNodeCount": 1
        }
    ],
    "pagination":{
        "pageNo": 1,
        "pageSize": 10,
        "totalSize": 10,
        "sortedBy": null
    }
}

SDK Samples¶


You can access the SDK samples for Asset Tree Service on GitHub:

  • Java

  • Python

Previous Next
On this page
  • Search Related Asset Node
    • Request Format
    • Request Parameters (URI)
    • Request Parameters (Body)
      • Filter Struct
      • I18nSearchVo Struct
    • Response Parameters
      • AssetVo Struct
    • Error Codes
    • Samples
      • Request Sample
      • Return Sample
    • SDK Samples
© Univers. All Rights Reserved. |   Privacy Policy   User Agreement