Delete Alert Type¶
删除告警类型。需要校验告警类型是否被其它规则使用,若有规则使用,则不允许删除。
请求格式¶
POST https://{apigw-address}/event-service/v2.1/alert-types?action=delete
请求参数(URI)¶
名称  | 
位置(Path/Query)  | 
必需/可选  | 
数据类型  | 
描述  | 
|---|---|---|---|---|
orgId  | 
Query  | 
必需  | 
String  | 
资产所属的组织ID。 如何获取orgId信息>>  | 
alertTypeId  | 
Query  | 
必需  | 
String  | 
告警类型编号。  | 
示例¶
请求示例¶
url: https://{apigw-address}/event-service/v2.1/alert-types?action=delete&orgId=yourOrgId&alertTypeId=yourAlertTypeId
method: POST
返回示例¶
{
    "code": 0,
    "msg": "OK",
    "requestId": "4873095e-621d-4cfd-bc2c-edb520f574ea",
    "data": null
}
Java SDK调用示例¶
public void testDeleteAlertType() {
    DeleteAlertTypeRequest request = new DeleteAlertTypeRequest();
    request.setOrgId(orgId);
    request.setAlertTypeId("yourTypeId");
    try {
        DeleteAlertTypeResponse response = Poseidon.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
            .url(url)
            .getResponse(request, DeleteAlertTypeResponse.class);
        Gson gson = new Gson();
        System.out.println(gson.toJson(response));
    } catch (Exception e) {
        e.printStackTrace();
    }
}