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