靜默告警/解除告警靜默
更新時間 2025-04-23 15:02:54
最近更新時間: 2025-04-23 15:02:54
分享文章
本節主要介紹如何使用API靜默告警/解除告警靜默。
此操作用來靜默警或者解除告警靜默。
請求語法
PUT /rest/v1/system/alarm/alarmId/mute HTTP/1.1
Date: date
Host: ip:port
Content-Type: text/plain
Content-Length: length
Authorization: authorization
{
"operType": operType,
"dueTime": dueTime,
"reason": reason
}請求參數
| 名稱 | 描述 | 是否必須 | |
|---|---|---|---|
| alarmId | String | 告警ID。 | 是 |
| operType | Enum | 靜默操作。 取值:
| 是 |
| dueTime | Long | 靜默截止時間。 取值:unix時間戳(UTC),精確到毫秒。如果靜默操作為Mute,此項必填。 | 否 |
| reason | String | 靜默/解除靜默的原因。 取值:1~50位字符串。 | 是 |
請求示例1
靜默告警1kUyXPFy。
PUT /rest/v1/system/alarm/1kUyXPFy/mute HTTP/1.1
Date: Thu, 18 Aug 2022 08:25:06 GMT
Host: 192.168.0.121:1443
Content-Type: text/plain
Content-Length: 90
Authorization: HBlock userName:signature
{
"operType":"Mute",
"dueTime": 1660903200000,
"reason": "renew license"
}響應示例1
HTTP/1.1 204 No Content
Date: Thu, 18 Aug 2022 08:25:06 GMT
Connection: keep-alive
x-hblock-request-id: 40d4c09de42d4d4cbf2f63e42d929208
Server: HBlock請求示例2
解除告警1kUyXPFy的靜默。
PUT /rest/v1/system/alarm/1kUyXPFy/mute HTTP/1.1
Date: Thu, 18 Aug 2022 08:35:55 GMT
Host: 192.168.0.121:1443
Content-Type: text/plain
Content-Length: 81
Authorization: HBlock userName:signature
{
"operType":"ManualUnmute",
"reason": "license is about to expire."
}響應示例2
HTTP/1.1 204 No Content
Date: Thu, 18 Aug 2022 08:35:55 GMT
Connection: keep-alive
x-hblock-request-id: 40d4c09de42d4d4cbf2f63e42d929208
Server: HBlock