Show alarm history (GET /v2/alarms/{alarm_id}/history)

Shows the history of the specified alarm, based on the specified query.

{alarm_id}: ID of the alarm.

Request headers

Refer to "Common API items".

Request parameters

q.field

Specifies the following fields for query.

  • timestamp: Datetime of the alarm history
  • type: The type of alarm history

If omitted, the entire history of the specified alarm is output.

Data type Cardinality
String 0..10

q.op

Specifies the comparison operator described below.

  • If q.field is "timestamp":

    gt: Greater than

    ge: Greater than or equal to

    lt: Less than

    le: Less than or equal to

  • If q.field is "type":

    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 "timestamp":

    Datetime (YYYY-MM-DDThh:mm:ss)

  • If q.field is "type":

    creation

    rule change

    state transition

    deletion

    action

Data type Cardinality
String 0..10

limit

Specifies the maximum number of alarm histories to retrieve.

Range: 1 to 1440

If omitted, "1440" is used.

Data type Cardinality
Int 0..1

offset

Specifies the number of alarm history offset items to retrieve.

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 history of the specified alarm, based on the specified query.

Refer to "type AlarmChange" for details.

Example of request

Example 1: Show the history of the specified alarm.


curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/alarms/55c6a768-e8ab-487b-b724-892b0ad4fc2a/history'
     

Example 2: Show the history of the specified alarm within the specified time range.


curl -H 'X-Auth-Token: ImFkbWluVVJMIjogImh0dHA6Ly8xMC4x . . .' \
'https://telemetry.jp-east-1.cloud.global.fujitsu.com/v2/alarms/
55c6a768-e8ab-487b-b724-892b0ad4fc2a/history?q.field=timestamp&q.op=
gt&q.value=2014-10-22T00:00:00&q.field=timestamp&q.op=lt&q.value=
2014-10-24T00:00:00'       
     

Example of response


[
    {
        "alarm_id": "55c6a768-e8ab-487b-b724-892b0ad4fc2a",
        "detail": "{\"state\": \"alarm\"}",
        "event_id": "0c83ea48-d2c0-4cf9-8e54-fbebc463c313",
        "on_behalf_of": "39bd0d0341484a1a88f8ecdb1b21311c",
        "project_id": "39bd0d0341484a1a88f8ecdb1b21311c",
        "timestamp": "2014-10-22T05:16:47.683476",
        "type": "state transition",
        "user_id": "9953aae1953a4caab3cc278e3018cf68"
    },
    {
        "alarm_id": "55c6a768-e8ab-487b-b724-892b0ad4fc2a",
        "detail": "{\"alarm_actions\": [], \"user_id\": \"9953aae1953a4caab3cc278e3018cf68\", \"name\": \"my_alarm\", \"state\": \"insufficient data\", \"timestamp\": \"2014-10-22T05:15:54.954117\", \"enabled\": true, \"state_timestamp\": \"2014-10-22T05:15:54.954117\", \"rule\": {\"meter_name\": \"my_meter\", \"evaluation_periods\": 1, \"period\": 120, \"statistic\": \"avg\", \"threshold\": 0.0, \"query\": [], \"comparison_operator\": \"gt\", \"exclude_outliers\": false}, \"alarm_id\": \"55c6a768-e8ab-487b-b724-892b0ad4fc2a\", \"time_constraints\": [], \"insufficient_data_actions\": [], \"repeat_actions\": false, \"ok_actions\": [], \"project_id\": \"39bd0d0341484a1a88f8ecdb1b21311c\", \"type\": \"threshold\", \"description\": \"testAlarm\"}",
        "event_id": "5846db80-b465-40c1-a158-e4a178ceb0ed",
        "on_behalf_of": "39bd0d0341484a1a88f8ecdb1b21311c",
        "project_id": "39bd0d0341484a1a88f8ecdb1b21311c",
        "timestamp": "2014-10-22T05:15:54.954117",
        "type": "creation",
        "user_id": "9953aae1953a4caab3cc278e3018cf68"
    }
]