Alarm messages

List alarm events for a specified level

Introduction

List alarm events for a specified level per page

URI

GET /admin-api/alarm_events

URI parameters

  • level

    type: integer

    required: no

    description: the specified level (return all levels of alarm events if not specified, 0: STDERR, 1: EMERG, 2: ALERT, 3: CRIT, 4: ERROR, 5: WARN, 6: NOTICE, 7: INFO, 8: DEBUG)

  • page

    type: integer

    required: no

    description: page number of the results to fetch (default 1)

  • page_size

    type: integer

    required: no

    description: results per page (default 20)

Request example

Shell

curl https://{admin-site}/admin-api/admin-api/alarm_events?page=1&page_size=10&level=

Response example

Status: 200 OK
{
  "status": 0,
  "data": {
    "meta": {
      "count": 2
    },
    "data": [{
      "_modified_unix": 1614928254.5028,
      "_created_unix": 1614928254.5028,
      "status": "UNRESOLVED",
      "id": 306408,
      "message": "Gateway nodes [49] online",
      "level": "WARNING",
      "from": "log-server"
    }, {
      "_modified_unix": 1614927900.4734,
      "_created_unix": 1614927900.4734,
      "status": "UNRESOLVED",
      "id": 306399,
      "message": "Gateway nodes [49] offline",
      "level": "ERROR",
      "from": "log-server"
    }]
  }
}

Change status of an alarm event

Introduction

Change status of an alarm event

URI

PUT /admin-api/alarm_events/{id}

Parameters

  • id

    type: integer

    required: yes

    description: The ID of the alarm event to be modified

  • status

    type: string

    required: yes

    description: The status to be changed to

Request example

Shell

curl -X PUT https://{admin-site}/admin-api/admin-api/alarm_events/350
  '{
    status: "RESOLVING"
  }'

Response example

Status: 200 OK
{
    "status": 0
}

Delete an alarm event

Introduction

Deletes a specified alarm event

URI

DELETE /admin-api/alarm_events/{id}

Parameters

  • id

    type: integer

    required: yes

    description: The ID of the alarm event to be deleted

Request example

Shell

curl -X DELETE https://{admin-site}/admin-api/admin-api/alarm_events/350

Response example

Status: 200 OK
{
    "status": 0
}