Move Asset Node¶
移动一个资产节点连同其后代节点到一个指定的位置。
操作权限¶
需授权的资源 | 所需操作权限 |
---|---|
资产树 | Full Access |
请求格式¶
POST https://{apigw-address}/asset-tree-service/v2.1/asset-nodes?action=move
请求参数(URI)¶
名称 | 位置(Path/Query) | 必需/可选 | 数据类型 | 描述 |
---|---|---|---|---|
orgId | Query | 必需 | String | 资产所属的组织 ID。如何获取 orgId 信息>> |
treeId | Query | 必需 | String | 需资产树 ID。如何获取资产树信息 ID>> |
parentAssetId | Query | 必需 | String | 移动后 assetId 的父节点资产 ID。如何获取 assetId 信息>> |
preAssetId | Query | 可选 | String | 移动后处在 assetId 的前一个位置的兄弟节点资产 ID。如果为 null ,assetId 将会移到 parentAssetId 下面的第一个位置。如何获取 assetId 信息>> |
assetId | Query | 必需 | String | 要移动的资产的资产 ID。如何获取 assetId 信息>> |
例子¶
假设资产树具有以下结构。
场景 1:如果 parentAssetId
为 7,preAssetId
为 13,assetId
为 10,移动后新的树结构将如下所示。
场景 2:如果 parentAssetId
为 3,preAssetId
为 null,assetId
为 10,移动后新的树结构将如下所示。
场景 3:如果 parentAssetId
为 5,preAssetId
为 null,assetId
为 10,移动后新的树结构将如下所示。
错误码¶
代码 | 错误信息 | 描述 |
---|---|---|
99400 |
|
|
99500 | System error | 服务器内部错误,请联系 EnOS。 |
17404 | Asset is not exist in the tree | 资产不存在该树上。 |
17762 | The tree is locked | 一次只允许一个用户修改资产树,暂时不能操作该资产树,请再次请求。 |
17764 | The root asset node can not be moved or deleted: or tree is not exist | 根节点不能被移动或资产树不存在。 |
17768 | Can not move to descendant node | 不能移动至自己的后代节点下。 |
17770 | Exceeding the layer limit(7) | 该树超过最高层数限制(7层)。 |
17777 | Parent asset is invalid | parentAssetId 不合法。 |
示例¶
请求示例¶
url: https://{apigw-address}/asset-tree-service/v2.1/asset-nodes?parentAssetId=yourParrentAssetId&assetId=yourAssetId&preAssetId=yourPreAssetId&orgId=yourOrgId&treeId=yourTreeId&action=move
method: POST
返回示例¶
{
"code": 0,
"msg": null,
"requestId": "8d0b2297-4dce-48b5-b685-3bd30e4c4636",
"data": null
}