Create alarm (POST /v2/alarms)

Creates an alarm.

CAUTION:
Alarm evaluation (threshold monitoring) is performed in accordance with the monitoring interval (60 seconds) specified for the monitoring service. Therefore, depending on the timing of when an alarm is created, it may be evaluated only in the next monitoring cycle, not the current one.

Request headers

Refer to "Common API items".

Request parameters

None.

Request body

Specifies information (in JSON format) on the alarm to be created.

Refer to "type Alarm" for details.

Response headers

Status

If normal, the following status is returned.

201: Normal completion

If an error occurs, the following status code is returned in addition to "Common API error codes".

409: An alarm with the same name already exists

Data type Cardinality
Int 1..1

Response elements

Returns information (in JSON format) on the created alarm.

Refer to "type Alarm" for details.

Example of request

For example, register an alarm followed by email transmission in an alarm status.


curl -X POST -H "Content-Type: application/json" \
-H "X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . ." \
-d requestBody "https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/alarms"

Request body (JSON format)
{
    "alarm_actions": [
        "{\"service\": \"mail\", \"action\": \"send\", \"parameters\":{} }",
    ],
    "name": "my_alarm ",
    "repeat_actions": false,
    "threshold_rule": {
        "meter_name": "my_meter",
        "threshold": 99.0
    },
    "type": "threshold"
}
     

Example of response


       {
        "alarm_actions": [
         "{\"service\": \"mail\", \"action\": \"send\", \"parameters\":{} }"
        ],
        "alarm_id": "8aa66462-e17b-480f-9493-909ffdb2179e",
        "description": "Alarm when cpu_util is eq a avg of 99.0 over 60 seconds",
        "enabled": true,
        "insufficient_data_actions": [],
        "name": "my_alarm",
        "ok_actions": [],
        "project_id": "22ef168c58d94872a66c90d74297136a",
        "repeat_actions": false,
        "severity": "low",
        "state": "insufficient data",
        "state_timestamp": "2014-10-22T08:42:23.817799",
        "threshold_rule": {
         "comparison_operator": "eq",
         "evaluation_periods": 1,
         "exclude_outliers": false,
         "meter_name": "my_meter",
         "period": 60,
         "query": [],
         "statistic": "avg",
         "threshold": 99.0
        },
        "time_constraints": [],
        "timestamp": "2014-10-22T08:42:23.817799",
        "type": "threshold",
        "user_id": "13d97e9c31454563b8aa78b0b2e92385"
       }