nav-img
Advanced

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

No

Integer

Page number.

page_size

No

Integer

Number of records on each page.

region

Yes

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.

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" : 42,
"gmt_create" : null,
"version_number" : null,
"alarm_rule_type" : "TEMPLATE",
"gmt_modify" : null,
"process_unit" : "-process-unit",
"region" : "",
"instance_id" : 8,
"ip_address" : "192.168.0.87",
"instance_name" : "ins11_3",
"env_id" : 7,
"business_id" : 1,
"template_id" : 2,
"alarm_rule_id" : 3,
"monitor_item_id" : 46,
"collector_id" : 28,
"collector_name" : "JVM Monitoring",
"alarm_rule_name" : "alarm",
"alarm_rule_expression" : "(cpuRatio>0)",
"alarm_first_time" : "2022-10-23 18:12:53",
"alarm_last_time" : "2022-10-25 16:05:55",
"alarm_level" : "COMMON",
"restrain_key" : "7:8:3:TEMPLATE",
"status" : "ALERT",
"alarm_content" : "The CPU usage is 0.025.",
"alarm_data_type" : "SINGLE",
"region_alarm_event_id" : 122,
"business_name" : "default",
"app_name" : "app_new3"
}, {
"id" : 41,
"gmt_create" : null,
"version_number" : null,
"alarm_rule_type" : "TEMPLATE",
"gmt_modify" : null,
"process_unit" : "-process-unit",
"region" : "",
"instance_id" : 4,
"ip_address" : "192.168.0.87",
"instance_name" : "ins10_5",
"env_id" : 5,
"business_id" : 1,
"template_id" : 2,
"alarm_rule_id" : 3,
"monitor_item_id" : 28,
"collector_id" : 28,
"collector_name" : "JVM Monitoring",
"alarm_rule_name" : "alarm",
"alarm_rule_expression" : "(cpuRatio>0)",
"alarm_first_time" : "2022-10-23 18:02:44",
"alarm_last_time" : "2022-10-25 16:05:46",
"alarm_level" : "COMMON",
"restrain_key" : "5:4:3:TEMPLATE",
"status" : "ALERT",
"alarm_content" : "The CPU usage is 0.025.",
"alarm_data_type" : "SINGLE",
"region_alarm_event_id" : 121,
"business_name" : "default",
"app_name" : "app_new5"
} ],
"total_count" : 2
}

Status Codes

Status Code

Description

200

OK: The request is successful.

400

Bad Request: Semantic or parameter error.

401

Unauthorized: No permissions.

403

Forbidden: Access forbidden.

404

Not Found: The requested resource is not found.

Error Codes