List alarms (GET /v2/alarms)

Lists alarms, based on the specified query.

Request headers

Refer to "Common API items".

Request parameters

q.field

Specifies the following fields for query.

  • alarm_id: ID of the alarm
  • enabled: Enable/disable alarm evaluation
  • name: Name of the alarm
  • user_id: The ID of the user that created the alarm

If omitted, all of the targeted alarms are output.

Data type Cardinality
String 0..10

q.op

Specifies the comparison operator described below.

  • If q.field is alarm_id:

    eq: Equal to

  • If q.field is enabled:

    eq: Equal to

  • If q.field is name:

    eq: Equal to

  • If q.field is user_id:

    eq: Equal to

If omitted, "eq" is used.

Data type Cardinality
String 0..10

q.value

Specifies the following data value targeted for comparison.

  • If q.field is alarm_id:

    Alarm ID

  • If q.field is enabled:

    true: Enabled

    false: Disabled

  • If q.field is name:

    Alarm name

  • If q.field is user_id:

    User ID

Valid characters: Fullwidth characters, halfwidth alphanumeric characters and halfwidth symbols

Number of characters: 1 to 255

Data type Cardinality
String 0..10

limit

Maximum number of alarms to retrieve.

Range: 1 to 1440

If omitted, "1440" is used.

Data type Cardinality
Int 0..1

offset

Number of alarm items to offset.

If omitted, "0" is used.

Data type Cardinality
Int 0..1

Response headers

Status

If normal, the following status is returned.

200: Normal completion

Refer to "Common API error codes" if the state is error.

Data type Cardinality
Int 1..1

Response elements

List (in JSON format) of the alarms based on the specified query.

Refer to "type Alarm" for details.

Example of request

Example 1: List alarms.


curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/alarms'
     

Example 2: List alarms with alarm evaluation enabled.


curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/alarms?q.field=enabled&q.value=true'
     

Example of response


[
    {
        "alarm_actions": [],
        "alarm_id": "55c6a768-e8ab-487b-b724-892b0ad4fc2a",
        "description": "testAlarm",
        "enabled": true,
        "insufficient_data_actions": [],
        "name": "my_alarm",
        "ok_actions": [],
        "project_id": "39bd0d0341484a1a88f8ecdb1b21311c",
        "repeat_actions": false,
        "state": "insufficient data",
        "state_timestamp": "2014-10-22T05:20:46.795969",
        "threshold_rule": {
            "comparison_operator": "gt",
            "evaluation_periods": 1,
            "exclude_outliers": false,
            "meter_name": "my_meter",
            "period": 120,
            "query": [],
            "statistic": "avg",
            "threshold": 0.0
        },
        "time_constraints": [],
        "timestamp": "2014-10-22T05:15:54.954117",
        "type": "threshold",
        "user_id": "9953aae1953a4caab3cc278e3018cf68"
    }
]