Delete Asset Tree¶
删除一个资产树。
操作权限¶
需授权的资源 |
所需操作权限 |
---|---|
资产树管理 |
Full Access |
请求格式¶
POST https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=delete
请求参数(URI)¶
名称 |
位置(Path/Query) |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|---|
orgId |
Query |
必需 |
String |
资产所属的组织ID。如何获取orgId信息>> |
treeId |
Query |
必需 |
String |
需要删除的资产树ID。如何获取资产树信息ID>> |
错误码¶
名称 |
错误信息 |
描述 |
---|---|---|
17404 |
TreeId is not exist |
Tree ID不存在。 |
17800 |
Query it has sub nodes when delete node |
非叶子节点不能被删除。 |
99400 |
Invalid arguments |
请求参数非法,请检查请求参数。 |
99500 |
System error |
服务器内部错误,请联系EnOS。 |
示例 1¶
请求示例¶
url: https://{apigw-address}/asset-tree-service/v2.1/asset-trees?action=delete&orgId=yourOrgId&treeId=yourAssetTreeId
method: POST
返回示例¶
{
"code": 0,
"msg": "OK",
"requestId": "01b5477a-374e-49a0-8b68-7dbfe8f0b74f",
"data": null
}
Java SDK调用示例¶
package com.envisioniot.enos.asset_tree_service;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envisioniot.enos.api.common.constant.request.Pagination;
import com.envisioniot.enos.api.common.constant.request.Projection;
import com.envisioniot.enos.asset_tree_service.v2_1.*;
import com.envisioniot.enos.asset_tree_service.vo.*;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
public class AssetTreeTest {
private static String AccessKey = "yourAccessKey";
private static String SecretKey = "yourSecretKey";
private static String OrgId = "yourOrgId";
private static String ServerUrl = "yourServerUrl";
@Test
public void testDeleteTree() {
DeleteTreeRequest request = new DeleteTreeRequest();
request.setOrgId(OrgId);
request.setTreeId("yourTreeId");
DeleteTreeResponse response = Poseidon.config(PConfig.init().appKey(AccessKey).appSecret(SecretKey).debug())
.url(ServerUrl)
.getResponse(request, DeleteTreeResponse.class);
}
}