此操作用来静默警或者解除告警静默。
请求语法
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 告警ID。 是 operType 静默操作。
类型:字符串
取值:
Mute:静默告警。
ManualUnmute:解除告警静默。
是 dueTime 静默截止时间。
类型:时间戳
取值:unix时间戳(UTC),精确到毫秒。如果静默操作为Mute,此项必填。
否 reason 静默/解除静默的原因。
类型:字符串
取值: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