Updated on 2023-08-02 GMT+08:00

Querying the Alarm List

Function

This API is used to query the alarm list.

URI

POST /v1/apm2/openapi/alarm/data/get-alarm-data-list

Request Parameters

Table 1 Request header parameters

Parameter

Mandatory

Type

Description

x-business-id

Yes

Long

Application ID.

X-Auth-Token

Yes

String

User token obtained from IAM.

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

page

Yes

Integer

Page number.

page_size

Yes

Integer

Number of records on each page.

region

No

String

Region name.

app_name

No

String

Component environment name.

business_id

Yes

Long

Application ID.

monitor_item_id

No

Long

Monitoring item ID.

status

No

String

Alarm status. Options: RECOVER, ABNORMAL, and ALERT.

alarm_level

No

String

Alarm severity. Options: COMMON and CRITICAL.

keyword

No

String

Keyword.

alarm_start_time

No

String

Alarm start time.

alarm_end_time

No

String

Alarm end time.

collector_id

No

Integer

Collector ID.

ip_address

No

String

IP address of the instance.

env_list

No

Array of integers

Environment set.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

alarm_data_list

Array of AlarmDataVO objects

Alarm list.

total_count

Integer

Total number of messages.

Table 4 AlarmDataVO

Parameter

Type

Description

id

Long

Alarm notification ID.

gmt_create

String

Creation time.

region_alarm_event_id

Long

Event ID.

business_name

String

Application name.

app_name

String

Component name.

version_number

Integer

Version.

alarm_rule_type

String

Alarm rule type.

gmt_modify

String

Update time.

process_unit

String

Processing unit.

region

String

Region name.

instance_id

Long

Instance ID.

ip_address

String

IP address of the instance.

instance_name

String

Instance name.

env_id

Long

Environment ID.

business_id

Long

Application ID.

template_id

Long

Template ID.

alarm_rule_id

Long

Alarm rule ID.

monitor_item_id

Long

Monitoring item ID.

collector_id

Integer

Collector ID.

collector_name

String

Collector name.

alarm_rule_name

String

Alarm rule name.

alarm_rule_expression

String

Alarm expression.

alarm_first_time

String

Alarm start time.

alarm_last_time

String

Latest alarm report time.

alarm_level

String

Alarm severity.

restrain_key

String

Unique alarm identifier.

status

String

Alarm status.

gmt_create_timestamp

Long

Timestamp when the creation starts.

alarm_first_time_timestamp

Long

Timestamp when an alarm was generated.

alarm_last_time_timestamp

Long

Timestamp when the last alarm was generated.

alarm_content

String

Alarm content.

alarm_data_type

String

Alarm type.

Example Requests

Query the list of alarms whose status is "ALERT" under application 1.

/v1/apm2/openapi/alarm/data/get-alarm-data-list

{
  "business_id" : 1,
  "page" : 1,
  "page_size" : 10,
  "status" : "ALERT"
}

Example Responses

Status code: 200

OK: The request is successful.

{
  "alarm_data_list" : [ {
    "id" : 510070,
    "gmt_create" : null,
    "gmt_create_timestamp" : null,
    "version_number" : null,
    "alarm_rule_type" : "TEMPLATE",
    "gmt_modify" : null,
    "process_unit" : "xxx-first-process-unit",
    "region" : "xxx",
    "instance_id" : 315237,
    "ip_address" : "xxx.xxx.xxx.xxx",
    "instance_name" : "default",
    "env_id" : 4394,
    "business_id" : 6,
    "template_id" : 91,
    "alarm_rule_id" : 333,
    "monitor_item_id" : 55152,
    "collector_id" : 3,
    "collector_name" : "Exception Log",
    "alarm_rule_name" : "Exception Alarm",
    "alarm_rule_expression" : "(count>100)",
    "alarm_first_time" : "2023-03-14 10:21:43",
    "alarm_first_time_timestamp" : 1678760503000,
    "alarm_last_time" : "2023-03-14 10:22:43",
    "alarm_last_time_timestamp" : 1678760563000,
    "alarm_level" : "COMMON",
    "restrain_key" : "4394:315237:333:TEMPLATE",
    "status" : "ALERT",
    "alarm_content" : "Alarm occurrence times: 108",
    "alarm_data_type" : "SINGLE",
    "region_alarm_event_id" : 511490,
    "business_name" : "LubanApm",
    "app_name" : "apm-archive/xxx"
  } ],
  "total_count" : 1
}

Status Codes

Status Code

Description

200

OK: The request is successful.

401

Unauthorized: No permissions.

403

Forbidden: Access forbidden.

404

Not Found: The requested resource is not found.

Error Codes

See Error Codes.