Updated on 2025-07-25 GMT+08:00

Obtaining a Server Alarm List

Function

This API is used to obtain a server alarm list.

Calling Method

For details, see Calling APIs.

URI

GET /v1/{project_id}/physicalservers/alarms

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

The project ID.

Constraints

N/A

Range

The 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.

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: The alarm status is normal.

  • alarm: An alarm is generated.

  • invalid: An alarm is invalid.

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

Alarm resource ID. 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 (informational).

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

from must be smaller than to.

Range

The value is in timestamp format.

Default Value

N/A

to

No

Integer

Definition

End time of an alarm, in seconds.

Constraints

from must be smaller than to.

Range

The value is in timestamp format.

Default Value

N/A

offset

No

Integer

Definition

Pagination offset.

Constraints

N/A

Range

N/A

Default Value

N/A

limit

No

Integer

Definition

Page size.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 3 Request header parameter

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

Alarm list object.

Constraints

N/A

count

Integer

Definition

Total 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

N/A

Default Value

N/A

alarm_level

Integer

Definition

Alarm severity.

Constraints

N/A

Range

N/A

Default Value

N/A

begin_time

Integer

Definition

Alarm start time.

Constraints

N/A

Range

The value is in Unix timestamp.

Default Value

N/A

end_time

Integer

Definition

Alarm end time.

Constraints

N/A

Range

The value is in Unix timestamp.

Default Value

N/A

last_alarm_time

Integer

Definition

Time when the alarm was last reported.

Constraints

N/A

Range

The value is in 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 an ECS. The DDS metric mongo001_command_ps indicates the command execution frequency. For details about the metrics of each service, see Cloud Product Metrics

Constraints

N/A

Range

1-64 characters. The name must start with a letter and contain only letters, 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

Dimension of a resource. 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 Cloud Product Metrics.

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.

Constraints

N/A

Range

N/A

Default Value

N/A

error_msg

String

Definition

Error message.

Constraints

N/A

Range

N/A

Default Value

N/A

Status code: 401

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Constraints

N/A

Range

N/A

Default Value

N/A

error_msg

String

Definition

Error message.

Constraints

N/A

Range

N/A

Default Value

N/A

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.

Constraints

N/A

Range

N/A

Default Value

N/A

error_msg

String

Definition

Error message.

Constraints

N/A

Range

N/A

Default Value

N/A

Example Requests

Request for obtaining 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

For details, see Error Codes.