5.22.6 Get silence of Alertmanager
- Description
-
Gets the specified silence in JSON format.
- Format
-
- Request line
GET /api/v2/silence/silence-ID HTTP/1.1
For silence-ID, you can specify value to be returned by the "Get silence list of Alertmanager" API or a value returned as a return value of the "Silence creation of Alertmanager" API.
- Request header
-
Header name
Setup values
Host
Specify the value of the header for Alertmanager host to which API is connected, in the following format:
host-name-or-IP-address:port-number
":port-number" is optional.
-
host-name-or-IP-address
Specify the host name or IPv4 address of Alertmanager.
-
port-number
Specify the port number to use when connecting to Alertmanager.
This header is not optional.
-
- Request message body
-
None
- Response message body
{ "id": "silence-ID", "status": { "state": "status" }, "updatedAt": "updated-date-and-time", "comment": "comment", "createdBy": "author-name", "endsAt": "end-date-and-time", "matchers": [ { "isRegex": regular-expression-flag, "name": "label-name", "value": "value" }, ... ], "startsAt": "start-date-and-time" }
- Parameters
-
See Parameters in the 5.22.3 Get silence list of Alertmanager.
- Status codes
-
Status code
Message
Description
200
OK
Silence was successfully acquired.
Other than 200
Other than OK
Failed to get silence.
- Examples
-
The following is an example of how this API can be used with execution using curl command of OSS. In the use cases below, line breaks and indentation are added for clarity. Newlines and indents are not printed in the actual output. The order of JSON properties is undefined.
> curl --request GET "http://localhost:20714/api/v2/silence/00ed3d4d-da1f-4971-81cd-b2687933e602" { "id":"00ed3d4d-da1f-4971-81cd-b2687933e602", "status":{ "state":"active" }, "updatedAt":"2022-08-09T03:35:41.821Z", "comment":"cc", "createdBy":"aa", "endsAt":"2022-08-09T05:35:32.825Z", "matchers":[ { "isEqual":true, "isRegex":false, "name":"env", "value":"production" } ], "startsAt":"2022-08-09T03:35:41.821Z" }