Delete Logical Asset (Preview)¶
Delete a specified logical asset.
Operation Permissions¶
Required Authorization |
Required Operation Permission |
---|---|
Asset Tree Management |
Full Access |
Request Format¶
POST https://{apigw-address}/asset-service/v2.1/logical-assets?action=delete
Request Parameters (URI)¶
Name |
Location (Path/Query) |
Mandatory/Optional |
Data Type |
Description |
---|---|---|---|---|
orgId |
Query |
Mandatory |
String |
The organization ID which the asset belongs to. How to get orgId>> |
assetId |
Query |
Mandatory |
String |
The asset ID. How to get assetId>> |
Samples¶
Request Sample¶
url: https://{apigw-address}/asset-service/v2.1/logical-assets?action=delete&orgId=yourOrgId&assetId=yourAssetId
method: POST
Return Sample¶
{
"code": 0,
"msg": "OK",
"requestId": "01b5477a-374e-49a0-8b68-7dbfe8f0b74f"
}
Java SDK Sample¶
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 DeleteLogicAssetTest {
private static String AccessKey = "yourAccessKey";
private static String SecretKey = "yourSecretKey";
private static String OrgId = "yourOrgId";
private static String ServerUrl = "yourServerUrl";
@Test
public void testCreateAssetNode() {
DeleteLogicAssetRequest request = new DeleteLogicAssetRequest();
request.setOrgId(orgId);
request.setAssetId("yourAssetId"); //The logic asset ID to be deleted. Using a device asset ID will fail.
DeleteLogicAssetResponse response = Poseidon.config(PConfig.init().appKey(AccessKey).appSecret(SecretKey).debug())
.url(ServerUrl).getResponse(request, DeleteLogicAssetResponse.class);
}
}