Alertmanager API
  1. silence
Alertmanager API
  • general
    • /status
      GET
  • receiver
    • /receivers
      GET
  • silence
    • /silences
      GET
    • /silences
      POST
    • /silence/{silenceID}
      GET
    • /silence/{silenceID}
      DELETE
  • alert
    • /alerts
      GET
    • /alerts
      POST
  • alertgroup
    • /alerts/groups
      GET
  1. silence

/silences

POST
http://127.0.0.1:9093/api/v2/silences
silence
Post a new silence or update an existing one

请求参数

Body 参数application/json
id
string 
可选
matchers
array[object (matcher) {4}] 
matchers
必需
>= 1 items
name
string 
必需
value
string 
必需
isRegex
boolean 
必需
isEqual
boolean 
可选
默认值:
true
startsAt
string <date-time>
必需
endsAt
string <date-time>
必需
createdBy
string 
必需
comment
string 
必需
示例
{
  "id": "1",
  "matchers": [
    {
      "team": "elk"
      }
  ],
  "startsAt": "2023-07-07T07:07:00Z",
  "endsAt": "2023-08-08T08:08:00Z",
  "createdBy": "cuiliang",
  "comment": "test API"
}

示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://127.0.0.1:9093/api/v2/silences' \
--header 'Content-Type: application/json' \
--data-raw '{
  "id": "1",
  "matchers": [
    {
      "team": "elk"
      }
  ],
  "startsAt": "2023-07-07T07:07:00Z",
  "endsAt": "2023-08-08T08:08:00Z",
  "createdBy": "cuiliang",
  "comment": "test API"
}'

返回响应

🟢200Create / update silence response
application/json
Body
silenceID
string 
可选
示例
{
    "silenceID": "string"
}
🟠400400
🟠404A silence with the specified ID was not found
修改于 2023-07-08 05:00:58
上一页
/silences
下一页
/silence/{silenceID}
Built with