Delete Active Alert¶
删除指定告警,如果不存在,返回失败并给出具体信息。
请求格式¶
POST https://{apigw-address}/event-service/v2.1/active-alerts?action=delete
请求参数(URI)¶
名称 |
位置(Path/Query) |
必需/可选 |
数据类型 |
描述 |
---|---|---|---|---|
orgId |
Query |
必需 |
String |
资产所属的组织ID。 如何获取orgId信息>> |
eventId |
Query |
必需 |
String |
告警ID。 |
示例¶
请求示例¶
url: https://{apigw-address}/event-service/v2.1/active-alerts?action=delete&orgId=yourOrgId&eventId=yourEventId
method: POST
requestBody:
{
}
返回示例¶
{
"code": 0,
"msg": "OK",
"requestId": "4873095e-621d-4cfd-bc2c-edb520f574ea",
"data": null
}
Java SDK调用示例¶
public void testDeleteActiveAlert() {
String appKey = "4ced4f38-1ced-476e0a446215-a602-4307";
String appSecret = "0a446215-a602-4307-9ff2-3feed3e983ce";
DeleteActiveAlertRequest request = new DeleteActiveAlertRequest();
request.setOrgId("1c499110e8800000");
request.setEventId("20190709d32b8269b75dc52229dfa467b60ee9a0");
try {
DeleteActiveAlertResponse response = Poseidon.config(PConfig.init().appKey(appKey).appSecret(appSecret).debug())
.url("http://10.27.20.193:8000")
.getResponse(request, DeleteActiveAlertResponse.class);
System.out.println(response);
} catch (Exception e) {
System.out.print(e);
}
}