Hitachi

JP1 Version 13 JP1/Integrated Management 3 - Manager Command, Definition File and API Reference


5.21.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 as the return value of value and silence creation for Alertmanager API to be retrieved in silence list retrieval API of Alertmanager.

Request header

Header name

Setup values

Host

Specifies 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

    Specifies host name or IPv4 address of Alertmanager.

  • Port number

    Specifies 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": "Update Date/time",
    "comment": "Comment",
    "createdBy": "Author-name",
    "endsAt": "Exit Date/time",
    "matchers": [
        {
            "isRegex":Regex flag,
            "name": "Label name",
            "value": "Value"
        },
        ...
    ],
    "startsAt": "Starting Date/time"
}
Response parameters

See Response parameters in the 5.21.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"
}