Querying Alarms
Function
Queries alarms from Cloud Eye.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
GET /v2/{project_id}/alarms
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
level |
No |
Integer |
Alarm severity. The value can be 1 (critical), 2 (major), 3 (minor), or 4 (warning). |
offset |
No |
Integer |
Page offset. |
limit |
No |
Integer |
Number of records displayed on each page. The default value is 100. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
alarm_histories |
Array of AlarmHistoryItem objects |
Alarm records. |
count |
Integer |
Total number of alarm records. |
Parameter |
Type |
Description |
---|---|---|
record_id |
String |
Alarm record. |
alarm_id |
String |
Alarm rule ID. |
name |
String |
Alarm rule name. |
status |
String |
Status of the alarm record. The value can be ok, alarm, or invalid. |
type |
String |
Alarm rule type. ALL_INSTANCE indicates alarm rules for metrics of all resources. RESOURCE_GROUP indicates alarm rules for metrics of resources in a resource group. MULTI_INSTANCE indicates alarm rules for metrics of specified resources. EVENT.SYS indicates alarm rules for system events. EVENT.CUSTOM indicates alarm rules for custom events. DNSHealthCheck indicates alarm rules for health checks. |
level |
Integer |
Severity of the alarm record. The value can be 1 (critical), 2 (major), 3 (minor), or 4 (warning). |
begin_time |
String |
Generation time (UTC). |
metric |
AlarmMetric object |
Alarm metric information. |
condition |
AlarmCondition object |
Alarm triggering condition. |
additional_info |
AdditionalInfo object |
Additional field of an alarm record, which applies only to alarm records generated in event monitoring scenarios. |
data_points |
Array of DataPointInfo objects |
Time when the resource monitoring data is reported and the monitoring data in the alarm record. |
Parameter |
Type |
Description |
---|---|---|
namespace |
String |
Namespace of the service to be queried. |
metric_name |
String |
Metric name of the resource. |
dimensions |
Array of AlarmMetricDimension objects |
Metric dimension. A maximum of four dimensions can be added. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Resource dimension. |
value |
String |
Resource dimension value. |
Parameter |
Type |
Description |
---|---|---|
period |
Integer |
Monitoring period of a metric, in second. The default value is 0. For an event alarm, set this parameter to 0. 1 indicates the original period of a metric. For example, if the original period of an RDS metric is 60 seconds, the interval between its data points is 60 seconds. |
filter |
String |
Rollup method. The value can be average, min, max, or sum. |
comparison_operator |
String |
Threshold symbol. The value can be >, <, >=, <=, =, !=, cycle_decrease, cycle_increase, or cycle_wave. cycle_decrease indicates the decrease compared with the last period; cycle_increase indicates the increase compared with the last period; cycle_wave indicates the increase or decrease compared with the last period. |
value |
Double |
Alarm threshold. |
unit |
String |
Data unit, which cannot exceed 32 characters. |
count |
Integer |
Times. |
suppress_duration |
Integer |
Alarm suppression time, in second. This parameter corresponds to the last field in the alarm policy when an alarm rule is created on the Cloud Eye console. This field is used to avoid frequent alarms. 0 indicates that the alarm is not suppressed and alarms are generated as long as the conditions are met. 300 indicates that an alarm is generated every 5 minutes as long as the alarm triggering conditions are met. |
Parameter |
Type |
Description |
---|---|---|
resource_id |
String |
ID of the resource corresponding to the alarm record. |
resource_name |
String |
Name of the resource corresponding to the alarm record. |
event_id |
String |
Event monitoring ID corresponding to the alarm record, which is the event generated by the resource. |
Parameter |
Type |
Description |
---|---|---|
time |
String |
UTC time when the resource monitoring data of the alarm record is reported. |
value |
Double |
Resource monitoring data of the alarm record at the time point. |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Requests
None
Example Responses
Status code: 200
Succeeded.
{ "alarm_histories" : [ { "record_id" : "string", "alarm_id" : "al1603131199286dzxpqK3Ez", "name" : "alarm-test01", "status" : "alarm", "type" : "EVENT.SYS", "level" : 1, "begin_time" : 231025, "metric" : { "namespace" : "SYS.IES", "metric_name" : "cpu_util", "dimensions" : [ { "name" : "instance_id", "value" : "4270ff17-aba3-4138-89fa-820594c39755" } ] }, "condition" : { "period" : 1, "filter" : "average", "comparison_operator" : "", "value" : 0, "unit" : "percent", "count" : 10, "suppress_duration" : 300 }, "additional_info" : { "resource_id" : "22d98f6c-16d2-4c2d-b424-50e79d82838f", "resource_name" : "ECS-Test01", "event_id" : "ev16031292300990kKN8p17J" }, "data_points" : [ { "time" : "string", "value" : 7.019 } ] } ], "count" : 0 }
Status Codes
Status Code |
Description |
---|---|
200 |
Succeeded. |
400 |
Invalid request from the client. |
401 |
Authentication failed. |
500 |
Internal error. |
Error Codes
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