Query Cross-Level Sub-Assets

Last Updated on : 2023-07-19 09:51:52download

Query the cross-level sub-assets on pages.
If the asset ID (asset_id) has a value, the asset ID is used as the root node, and you can query the information about all sub-assets on pages.
If the asset name (asset_name) has a value, you can perform a fuzzy query on the asset name, and query the information about all sub-assets on pages.
If neither value is passed, you can query the information about all sub-assets under the 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 asset name.
last_row_keyString falseThe row key of the last entry on each page.
page_sizeInteger trueThe number of items returned on each page.
levelInteger falseThe level of the specified asset.

Return parameter

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

Description of result

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

Description of list

Parameter nameTypeDescription
levelIntegerThe hierarchical level of the 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 asset name.
asset_full_nameStringThe full name of the 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.