Updated on 2025-10-20 GMT+08:00

Querying Alarms

Function

This API is used to query alarms. Before calling this API:

Debugging

You can debug this API in API Explorer.

URI

GET /v3/{project_id}/alarm-history-record

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

To obtain the value, see Obtaining a Project ID.

Constraints

N/A

Range

The value can contain 32 characters. Only letters and digits are allowed.

Default Value

N/A

start_time

Yes

String

Definition

Query start time.

Constraints

N/A

Range

The value is in the yyyy-mm-ddThh:mm:ssZ format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800. Up to seven days of data can be retrieved.

Default Value

N/A

level

No

Integer

Definition

Instance alarm severity.

Constraints

N/A

Range

  • 1: critical
  • 2: major
  • 3: minor
  • 4: warning

Default Value

1

limit

Yes

Integer

Definition

Number of records returned by a query. For example, if this parameter is set to 10, a maximum of 10 records can be displayed.

Constraints

N/A

Range

[1, 50]

Default Value

50

offset

Yes

Integer

Definition

Index offset. The query starts from the next piece of data indexed by this parameter. For example, if this parameter is set to 1 and limit is set to 10, only the 2nd to 11th records are displayed.

Constraints

N/A

Range

[0, 2^31-1]

Default Value

0: The query starts from the first data record.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token.

You can obtain the token by calling the IAM API used to obtain a user token.

The value of X-Subject-Token in the response header is the token value.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Language.

Constraints

N/A

Range

  • zh-cn
  • en-us

Default Value

en-us

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

total_count

Integer

Definition

Total number.

Range

N/A

history_records

Array of Table 4 objects

Definition

Alarm records.

Table 4 AlarmHistoryRecordInfo

Parameter

Type

Description

alarm_id

String

Definition

Alarm rule ID.

Range

N/A

name

String

Definition

Alarm rule name.

Range

N/A

status

String

Definition

Alarm status.

Range

  • ok: The alarm is cleared.
  • alarm: The alarm is active.
  • invalid: The alarm is invalid.

alarm_type

String

Definition

Alarm rule type.

Range

  • EVENT.SYS: system event alarm
  • EVENT.CUSTOM: custom event alarm
  • DNSHealthCheck: DNS health check alarm
  • RESOURCE_GROUP: resource group alarm
  • MULTI_INSTANCE: alarm for a specific resource

level

Integer

Definition

Historical alarm severity.

Range

  • 1: critical
  • 2: major
  • 3: minor
  • 4: warning

instance_id

String

Definition

Instance ID.

Range

The value can contain 36 characters. Only letters and digits are allowed.

instance_name

String

Definition

Instance name.

Range

N/A

begin_time

Long

Definition

Alarm start time.

Range

The time is a UNIX timestamp (ms), for example, 1603131199000.

update_time

Long

Definition

Time when the alarm status changed.

Range

The time is a UNIX timestamp (ms), for example, 1603131199000.

Example Request

Querying alarms

GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/9a29cc53af2f499cb48a6d81839264cb/alarm-history-record?start_time=2022-06-22T16:38:02%2B0800&offset=0&limit=100

Example Response

{
  "total_count": 1,
  "history_records": [
    {
      "alarm_id": "al1603131199286dzxpqK3Ez",
      "name": "Insufficient disk resources",
      "status": "alarm",
      "alarm_type": "EVENT.SYS",
      "level": "1",
      "instance_id": "d8e6ca5a624745bcb546a227aa3ae1cfin14",
      "instance_name": "gauss_test",
      "begin_time": "1603131199000",
      "update_time": "1603131199000"
    }
  ]
}

Status Codes

Error Codes

For details, see Error Codes.