Get Data Deletion Details¶
Get the running result details of data deletion jobs (by specifying model ID or measurement ID).
Operation Permissions¶
Required Authorization  | 
Required Operation Permission  | 
|---|---|
Asset  | 
Read  | 
For more information about resources and required permission, see Policies, Roles and Permissions>>
Request Format¶
GET https://{apigw-address}/tsdb-service/v2.1/data/delete-detail
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 organization ID>>  | 
id  | 
Query  | 
Optional  | 
String  | 
Model ID or measurement ID. If not specified, get the details of all data deletion jobs that are submitted in the organization.  | 
pageNo  | 
Query  | 
Optional  | 
Integer  | 
The request pages, starting from 1.  | 
pageSize  | 
Query  | 
Optional  | 
Integer  | 
The number of records in each page, which must be greater than 0.  | 
Response Parameters¶
Name  | 
Data Type  | 
Description  | 
|---|---|---|
total  | 
Integer  | 
Total records that are returned.  | 
pageNum  | 
Integer  | 
Number of the current page.  | 
pageSize  | 
Integer  | 
Number of returned records in the page.  | 
list  | 
List<JSONObject>  | 
The list of data deletion job running details. For more information, see list  | 
list¶
Sample¶
{
  "id": "290537323067711488",
  "status": 2,
  "modelId": "yourModelId",
  "assetIds": "yourAssetIds",
  "measurement": "yourPointId",
  "startTime": "1615444301240",
  "endTime": "1615444301240",
  "launchTime": "2021-03-12T09:32:16.442+0000",
  "finishTime": "2021-03-12T09:32:46.418+0000",
  "operator": "user.name"
}
Parameters¶
Name  | 
Data Type  | 
Description  | 
|---|---|---|
id  | 
String  | 
Data deletion job ID.  | 
status  | 
Integer  | 
Running status of the data deletion job. 0: Committed; 1: Executing; 2: Finished; 3: Suspended; 4: Canceled; 5: Failed.  | 
modelId  | 
String  | 
The model to which the deleted data belongs.  | 
assetIds  | 
String  | 
The assets to which the deleted data belongs.  | 
measurement  | 
String  | 
The measurement point to which the deleted data belongs.  | 
startTime  | 
String  | 
The specified time range of the data to be deleted (start time).  | 
endTime  | 
String  | 
The specified time range of the data to be deleted (end time).  | 
launchTime  | 
Long  | 
Time when the data deletion job was launched.  | 
finishTime  | 
Long  | 
Time when the data deletion job running was finished.  | 
operator  | 
String  | 
ID of the user who submitted the data deletion job.  | 
Error Codes¶
For description of error codes, see Common Error Codes.
Sample¶
Request Sample¶
url: https://{apigw-address}/tsdb-service/v2.1/data/delete-detail?orgId=yourOrgId&queryId=yourModelID&pageSize=10&pageNo=1
method: GET
Return Sample¶
{
  "msg": "OK",
  "code": 0,
  "data": {
    "list": [
      {
        "id": "302037106667073536",
        "status": 2,
        "endTime": " 1615530701240",
        "modelId": "yourModelId",
        "assetIds": "yourAssetIds",
        "operator": "user.name",
        "startTime": "1615444301240",
        "finishTime": "2021-03-12T10:37:46.353+0000",
        "launchTime": "2021-03-12T10:37:16.383+0000",
        "measurement": "yourPointId"
      }
    ],
    "total": 2,
    "pageNum": 1,
    "pageSize": 10
  },
  "submsg": "success"
}
Java SDK Sample¶
import com.alibaba.fastjson.JSONObject;
import com.envision.apim.poseidon.config.PConfig;
import com.envision.apim.poseidon.core.Poseidon;
import com.envision.apim.poseidon.request.PoseidonRequest;
public class GetDataDeletionDetails {
    private static final String API_GATEWAY_URL = "https://{apigw-address}";
    private static class Request extends PoseidonRequest {
        public void setBodyParams(String key, Object value) {
            bodyParams().put(key, value);
        }
        public void setMethod(String method) {
            this.method = method;
        }
        private String method;
        @Override
        public String baseUri() {
            return "";
        }
        @Override
        public String method() {
            return method;
        }
    }
    public static void main(String[] args) {
        //1. Click Application Registration in the left navigation of the EnOS Management Console.
        //2. Click the application that needs to call the API, and click Basic Information. accessKey and secretKey correspond to AccessKey and SecretKey in EnOS.
        Poseidon poseidon = Poseidon.config(
                PConfig.init()
                        .appKey("AccessKey of your APP")
                        .appSecret("SecretKey of your APP")
        ).method("GET").header("Content-Type", "application/json");
        Request request = new Request();
        JSONObject response = poseidon
                .url(API_GATEWAY_URL + "/tsdb-service/v2.1/data/delete-detail")
                .queryParam("orgId", "yourOrgId")
                .queryParam("queryId", "yourQueryId")
                .queryParam("pageSize", "10")
                .queryParam("pageNo", "1")
                .getResponse(request, JSONObject.class);
        System.out.println(response);
    }
}