Collecting Instance Alarm Statistics
Function
This API is used to collect statistics on instance 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}/instances/alarm-statistics
|
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 |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
start_time |
Yes |
String |
Definition Query start time. Constraints Up to seven days of data can be collected. 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. Default Value N/A |
|
top_num |
Yes |
Integer |
Definition Number of instances with the most alarms. Constraints N/A Range The value must be greater than 0. Default Value 5 |
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_alarm_count |
Integer |
Definition Total alarms. Range N/A |
|
ring_percentage |
Double |
Definition Period-over-period ratio. Range A value of 0 indicates no change compared to the previous period. A null value indicates that no alarm was triggered in the previous period. |
|
instance_alarm_level_statistics |
Array of InstanceAlarmLevelStatistic objects |
Definition Instance-level alarm statistics. |
|
total_alarm_level_statistics |
Array of AlarmLevelStatistics objects |
Definition All alarm statistics. |
|
Parameter |
Type |
Description |
|---|---|---|
|
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 |
|
total_count |
Integer |
Definition Total alarms. Range N/A |
|
alarm_level_statistics |
Array of AlarmLevelStatistics objects |
Definition Instance-level alarm statistics by severity. |
Example Request
Collecting alarm statistics
GET https://gaussdb-opengauss.ap-southeast-1.myhuaweicloud.com/v3/9a29cc53af2f499cb48a6d81839264cb/instances/alarm-statistics?start_time=2022-06-22T16:38:02%2B0800&top_num=5
Example Response
{
"total_alarm_count" : 99,
"ring_percentage" : 0.2,
"instance_alarm_level_statistics" : [ {
"instance_id" : "d8e6ca5a624745bcb546a227aa3ae1cfin14",
"instance_name" : "gauss_test",
"total_count" : 50,
"alarm_level_statistics" : [ {
"count" : 5,
"level_name" : "critical"
}, {
"count" : 45,
"level_name" : "notice"
} ]
} ],
"total_alarm_level_statistics" : [ {
"count" : 5,
"level_name" : "critical"
}, {
"count" : 94,
"level_name" : "notice"
} ]
}
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