Delete Asset Tree


Delete an asset tree and unlink the root asset associated with the tree.


Note

An asset tree cannot be deleted if it has nodes. Delete all nodes under the tree first.

Operation Permissions


Ensure that you have the permission to invoke this API. For more information, see Getting API Calling Permissions.

Request Format


POST https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=delete

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

Error Codes


Code

Message

Description

17404

TreeId is not exist

The tree ID does not exist.

17800

Query it has sub nodes when delete node

Nodes with child nodes cannot be deleted.

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-trees?action=delete&orgId=yourOrgId&treeId=yourTreeId
method: POST

Return Sample


{
  "code": 0,
  "msg": "OK",
  "requestId": "01b5477a-374e-49a0-8b68-7dbfe8f0b74f",
  "data": null
}

SDK Samples


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