Updated on 2025-12-12 GMT+08:00

Obtaining Server Alarm List

Function

This API is used to query the server alarm list.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/physicalservers/alarms

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID.

Constraints

N/A

Range

Project ID of the account.

Default Value

N/A

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

alarm_record_id

No

String

Definition

Alarm record ID, which can be empty. You can query the ID in the alarm list response.

Constraints

N/A

Range

The value starts with ah and is followed by 22 characters, including letters and digits.

Default Value

N/A

alarm_status

No

String

Definition

Alarm status.

Constraints

N/A

Range

  • ok

  • alarm

  • invalid: The monitored resources or alarm policies in the alarm rule were adjusted, so the original alarm record status expired.

Default Value

N/A

alarm_type

No

String

Definition

Alarm type.

Constraints

N/A

Range

  • event

  • metric

Default Value

N/A

resource_id

No

String

Definition

The IDs of resources for which the alarm was generated. Multiple values can be separated by commas (,).

Constraints

N/A

Range

N/A

Default Value

N/A

alarm_level

No

Integer

Definition

Alarm severity, which can be 1 (critical), ** 2** (major), 3 (minor), or 4 (warning).

Constraints

N/A

Range

  • 1: Critical

  • 2: Major

  • 3: Minor

  • 4: Warning

Default Value

N/A

from

No

Integer

Definition

Start time of the alarm, in seconds.

Constraints

The value of from must be earlier than that of to.

Range

Timestamp format.

Default Value

N/A

to

No

Integer

Definition

End time of an alarm, in seconds.

Constraints

The value of from must be earlier than that of to.

Range

Timestamp format.

Default Value

N/A

offset

No

Integer

Definition

Pagination cursor.

Constraints

N/A

Range

N/A

Default Value

N/A

limit

No

Integer

Definition

The number of records displayed on each page.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

Requests for calling an API can be authenticated using a token. If token-based authentication is used, this parameter is mandatory and must be set to a user token.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

alarms

Array of AlarmHistory objects

Definition

Objects of the alarm list.

Constraints

N/A

count

Integer

Definition

Total number of alarms.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 5 AlarmHistory

Parameter

Type

Description

alarm_record_id

String

Definition

Alarm record ID.

Constraints

N/A

Range

N/A

Default Value

N/A

alarm_id

String

Definition

Alarm ID.

Constraints

N/A

Range

N/A

Default Value

N/A

alarm_name

String

Definition

Alarm name.

Constraints

N/A

Range

N/A

Default Value

N/A

alarm_status

String

Definition

Alarm status.

Constraints

N/A

Range

  • ok

  • alarm

  • invalid: The monitored resources or alarm policies in the alarm rule were adjusted, so the original alarm record status expired.

Default Value

N/A

alarm_level

Integer

Definition

Alarm severity, which can be 1 (critical), ** 2** (major), 3 (minor), or 4 (warning).

Constraints

N/A

Range

  • 1: Critical

  • 2: Major

  • 3: Minor

  • 4: Warning

Default Value

N/A

begin_time

Integer

Definition

Alarm start time.

Constraints

N/A

Range

Unix timestamp.

Default Value

N/A

end_time

Integer

Definition

Alarm end time.

Constraints

N/A

Range

Unix timestamp.

Default Value

N/A

last_alarm_time

Integer

Definition

Time when the alarm was last reported.

Constraints

N/A

Range

Unix timestamp.

Default Value

N/A

metric

Metric object

  
Table 6 Metric

Parameter

Type

Description

metric_name

String

Definition

Metric name of a resource. For example, the ECS metric cpu_util indicates the CPU usage of the ECS. The DDS metric mongo001_command_ps indicates the command execution frequency. For details about the metric name of each service, see Service Metric Name.

Constraints

N/A

Range

Length :1 to 64 characters. The name must start with a letter and contain only letters (case-sensitive), digits, and underscores (_).

Default Value

N/A

dimensions

Array of Dimension objects

Definition

Resource dimension.

Constraints

N/A

Table 7 Dimension

Parameter

Type

Description

name

String

Definition

Resource metric dimension. For example, the dimension of an ECS can be instance_id. A maximum of four dimensions are supported. For the metric dimension of each resource, see Service Metric Dimension.

Constraints

N/A

Range

N/A

Default Value

N/A

value

String

Definition

Resource dimension value, which is an instance ID, for example, 4270ff17-aba3-4138-89fa-820594c39755.

Constraints

N/A

Range

N/A

Default Value

N/A

Status code: 400

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error description.

Status code: 401

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error description.

Status code: 429

Table 10 Response body parameters

Parameter

Type

Description

-

String

  

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

error_msg

String

Definition

Error description.

Example Requests

Obtaining the server alarm list

GET https://{endpoint}/v1/{project_id}/physicalservers/alarms

Example Responses

Status code: 200

{
  "alarms" : [ {
    "alarm_record_id" : "ah175258182510684b1cb108",
    "alarm_id" : "al17525818209074GL0BZQMw",
    "alarm_name" : "alarm-0715",
    "alarm_status" : "alarm",
    "alarm_level" : 2,
    "begin_time" : 1752581825000,
    "end_time" : 1752725863000,
    "last_alarm_time" : 1752725863000,
    "metric" : {
      "metric_name" : "disk_health",
      "dimensions" : [ {
        "name" : "device",
        "value" : "Disk0"
      }, {
        "name" : "host",
        "value" : "019661e2-5390-7aa5-91e8-5fc6841f6ed9"
      } ]
    }
  } ],
  "count" : 347
}

Status Codes

Status Code

Description

200

  

400

Invalid request parameter.

401

The request is not authenticated.

429

The request is overloaded.

500

Internal server error.

Error Codes

See Error Codes.