# 报警日志

# 获取报警日志列表

# 简介

分页获取指定级别的报警日志

# Uri
GET /admin-api/alarm_events
# Uri参数
  • level

    type: integer

    required: no

    description: 指定的级别 (不指定返回所有级别的报警日志,0:STDERR,1:EMERG,2:ALERT,3:CRIT,4:ERROR,5:WARN,6:NOTICE,7:INFO,8:DEBUG)

  • page

    type: integer

    required: no

    description: 指定页面 (默认为 1)

  • page_size

    type: integer

    required: no

    description: 每页包含数据的数量 (默认为 20)

# 请求示例
# Shell
curl http://{admin-site}/admin-api/admin-api/alarm_events?page=1&page_size=10&level=
# 响应示例
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"
    }]
  }
}

# 修改报警日志

# 简介

更新报警日志状态。

# Uri
PUT /admin-api/alarm_events/{id}
# Json Body 参数
  • id

    type: integer

    required: yes

    description: 要修改的报警日志的 ID

  • status

    type: string

    required: yes

    description: 修改成为的状态

# 请求示例
# Shell
curl -X PUT http://{admin-site}/admin-api/admin-api/alarm_events/350
  '{
    status: "RESOLVING"
  }'
# 响应示例
Status: 200 OK
{
    "status": 0
}

# 删除报警日志

# 简介

删除指定报警日志。

# Uri
DELETE /admin-api/alarm_events/{id}
# 参数
  • id

    type: integer

    required: yes

    description: 要删除的报警日志的 ID

# 请求示例
# Shell
curl -X DELETE http://{admin-site}/admin-api/admin-api/alarm_events/350
# 响应示例
Status: 200 OK
{
    "status": 0
}