Query Cross-Level Sub-Assets

Last Updated on : 2023-06-15 04:50:02

Query the cross-level sub-assets on pages. If a value of the asset ID (asset_id) is passed in, use the asset ID as the root node and query all sub-assets on pages. If a value of the asset name (asset_name) is passed in, perform a fuzzy search by the asset name and query all sub-assets on pages. If both fields have no value, query all sub-assets under a specified project.

API address

POST: /v1.1/iot-02/cross-level-sub-assets

Request parameter

Description of body

Parameter nameTypeINRequiredDescription
asset_idString falseThe asset ID.
asset_nameString falseThe name of a specified asset.
last_row_keyString falseThe row key of the last entry on each page.
page_sizeInteger falseThe number of entries returned on each page.
levelInteger falseThe level of a specified asset.

Return parameter

Parameter nameTypeDescription
resultHighwayAssetsCrossLevelPageResponseThe returned result of querying the sub-assets.

Description of result

Parameter nameTypeDescription
has_nextBooleanSpecifies whether there is a next page.
countIntegerThe total number of entries.
last_row_keyStringThe row key of the last entry on each page.
page_sizeIntegerThe number of entries returned on each page.
listListThe list of asset results.

Description of list

Parameter nameTypeDescription
levelIntegerThe hierarchical level of a specified asset. The root node is set to 0.
asset_idStringThe asset ID.
parent_asset_idStringThe ID of the parent asset. The top-level ID is set to -1.
asset_nameStringThe name of a specified asset.
asset_full_nameStringThe full name of a specified asset.

Request example

POST: /v1.1/iot-02/cross-level-sub-assets
{
  "asset_id": "137493****62112",
  "asset_name": "Asset",
  "last_row_key": "13750****74592",
  "page_size": 10,
  "level": 0
}

Return example

{
    "last_row_key": "13750****74592",
    "count": 3,
    "list": [
        {
            "level": 0,
            "asset_id": "137493****62112",
            "asset_full_name": "Asset AAA",
            "asset_name": "Asset A",
            "parent_asset_id": "-1"
        },
        {
            "level": 0,
            "asset_id": "13750****74592",
            "asset_full_name": "Asset BBB",
            "asset_name": "Asset B",
            "parent_asset_id": "137493****62112"
        }
    ],
    "t": 1616663281459,
    "success": true,
    "has_next": "false",
    "page_size": 10
}

Error code

For more information, see error code.