Querying Alarms
Function
This API is used to query alarms. Before calling this API:
- Learn how to authenticate this API.
- Obtain the required region and endpoint.
Debugging
You can debug this API in API Explorer.
URI
GET /v3/{project_id}/alarm-history-record
|
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
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
|
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
Default Value en-us |
Response Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
total_count |
Integer |
Definition Total number. Range N/A |
|
history_records |
Array of Table 4 objects |
Definition Alarm records. |
|
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
|
|
alarm_type |
String |
Definition Alarm rule type. Range
|
|
level |
Integer |
Definition Historical alarm severity. Range
|
|
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
- Normal
- Abnormal
For details, see Status Codes.
Error Codes
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot