Querying the Alarm Template List
Function
This API is used to query the alarm template list.
Calling Method
For details, see Calling APIs.
URI
GET /v4/{project_id}/alarm-rules-template
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID, which can be obtained from the console or by calling an API. For details, see Obtaining a Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
No |
String |
Alarm template ID. |
type |
No |
String |
Alarm template type.
|
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token obtained from IAM. For details, see Obtaining a Token. |
Content-Type |
No |
String |
Message body type or format. Content type, which is application/json. |
Enterprise-Project-Id |
No |
String |
Enterprise project ID. For details, see Obtaining an Enterprise Project ID.
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
alarm_rule_templates |
Array of AlarmRuleTemplateBody objects |
Alarm template list. |
count |
Integer |
Total number of alarm templates. |
Parameter |
Type |
Description |
---|---|---|
alarm_rule_template_name |
String |
Alarm template name. |
alarm_rule_template_name_en |
String |
Name of an alarm template. |
alarm_rule_template_description |
String |
Alarm template description. |
alarm_rule_template_id |
String |
Alarm template ID. |
alarm_rule_template_project_id |
String |
Project ID, which can be obtained from the console or by calling an API. For details, see Obtaining a Project ID. |
alarm_rule_template_type |
String |
Alarm template type.
|
alarm_rule_template_source |
String |
Source of an alarm template. |
alarm_rule_template_binding |
Map<String,String> |
Alarm rule bound to the alarm template. |
alarm_template_spec_list |
Array of AlarmRuleTemplateSpecWithCloudService objects |
List of rules in an alarm template. |
enterprise_project_id |
String |
Enterprise project ID. For details, see Obtaining an Enterprise Project ID. |
create_time |
Long |
Creation time. |
modify_time |
Long |
Update time. |
templating |
Templating object |
List of variables in an alarm template. |
template_version |
String |
Version of an alarm template. |
Parameter |
Type |
Description |
---|---|---|
related_cloud_service |
String |
Associated cloud service. |
related_cce_clusters |
Array of strings |
Associated CCE cluster. |
related_prometheus_instances |
Array of strings |
Associated Prometheus instance. |
alarm_notification |
AlarmNotification object |
Notification information. |
alarm_template_spec_items |
Array of AlarmTemplateSpecItem objects |
Alarm template list. |
Parameter |
Type |
Description |
---|---|---|
notification_type |
String |
Notification type.
Enumeration values:
|
route_group_enable |
Boolean |
Whether to enable a grouping rule.
If both notify_triggered and notify_resolved are set to false, route_group_enable must be set to false. Enumeration values:
|
route_group_rule |
String |
Grouping rule name.
|
notification_enable |
Boolean |
Whether to enable an alarm action rule.
If both notify_triggered and notify_resolved are set to false, notification_enable must be set to false. |
bind_notification_rule_id |
String |
Alarm action rule ID.
|
notify_resolved |
Boolean |
Whether to send a notification when an alarm is cleared.
Enumeration values:
|
notify_triggered |
Boolean |
Whether to send a notification when an alarm is triggered.
Enumeration values:
|
notify_frequency |
Integer |
Notification frequency.
|
Parameter |
Type |
Description |
---|---|---|
alarm_template_name |
String |
Name of an alarm rule in an alarm template. |
alarm_template_name_en |
String |
Name of an alarm rule in an alarm template. |
desc |
String |
Description of an alarm rule in an alarm template. |
desc_en |
String |
Description of an alarm rule in an alarm template. |
alarm_template_spec_type |
String |
Type of an alarm rule.
|
metric_alarm_template_spec |
MetricAlarmTemplateSpec object |
Metric alarm template. |
event_alarm_template_spec |
EventAlarmTemplateSpec object |
Event alarm template. |
Parameter |
Type |
Description |
---|---|---|
alarm_subtype |
String |
Alarm rule type. |
alarm_source |
String |
Alarm source, for example, CCE. |
monitor_type |
String |
Monitoring type. |
trigger_conditions |
Array of TemplateTriggerCondition objects |
Trigger condition. |
no_data_conditions |
Array of NoDataCondition objects |
Action taken when data is insufficient. |
alarm_tags |
Array of AlarmTags objects |
Alarm tag. |
recovery_conditions |
RecoveryCondition object |
Alarm clearance condition. |
Parameter |
Type |
Description |
---|---|---|
metric_query_mode |
String |
Metric query mode.
Enumeration values:
|
metric_namespace |
String |
Metric namespace. |
metric_name |
String |
Metric name. |
metric_unit |
String |
Metric unit. |
metric_labels |
Array of strings |
Metric dimension. |
promql |
String |
Prometheus statement. |
promql_expr |
Array of strings |
Prometheus statement template. |
trigger_times |
String |
Number of consecutive periods. |
trigger_interval |
String |
Check interval.
|
trigger_type |
String |
Trigger type.
Enumeration values:
|
promql_for |
String |
Native Prometheus monitoring duration. |
aggregation_type |
String |
Statistical mode.
|
operator |
String |
Operator. Options: >, <, =, >=, and <=. |
thresholds |
Map<String,String> |
Key-value pair. The key indicates the alarm severity while the value indicates the alarm threshold. |
aggregation_window |
String |
Statistical period.
|
cmdb |
CmdbInfo object |
CMDB information. |
query_match |
String |
Query filter criteria. |
aom_monitor_level |
String |
Monitoring layer. |
aggregate_type |
String |
Aggregation mode.
Enumeration values:
|
metric_statistic_method |
String |
Metric statistics method to be used when you set Configuration Mode to Select from all metrics during alarm rule setting.
Enumeration values:
|
expression |
String |
Expression of a combined operation. |
mix_promql |
String |
PromQL of a combined operation. |
Parameter |
Type |
Description |
---|---|---|
app_id |
String |
Application ID. |
node_ids |
Array of NodeInfo objects |
Node information list. |
Parameter |
Type |
Description |
---|---|---|
no_data_timeframe |
Integer |
Number of periods without data. |
no_data_alert_state |
String |
Status of the threshold rule when the data is insufficient.
Enumeration values:
|
notify_no_data |
Boolean |
Whether to send a notification when data is insufficient. |
Parameter |
Type |
Description |
---|---|---|
auto_tags |
Array of strings |
Automatic tag. |
custom_tags |
Array of strings |
Custom tag. |
custom_annotations |
Array of strings |
Alarm annotation. |
Parameter |
Type |
Description |
---|---|---|
recovery_timeframe |
Integer |
Number of consecutive periods for which the trigger condition is not met to clear an alarm. |
Parameter |
Type |
Description |
---|---|---|
alarm_subtype |
String |
Alarm rule type. |
alarm_source |
String |
Alarm source, for example, CCE. |
event_source |
String |
Event source. |
monitor_object_templates |
Array of strings |
Monitored object template. Currently, only clusterId is supported. |
monitor_objects |
Array of Map<String,String> objects |
List of monitored objects. Key-value pair.
|
trigger_conditions |
Array of EventTriggerCondition objects |
Trigger condition. |
Parameter |
Type |
Description |
---|---|---|
event_name |
String |
Event name. |
trigger_type |
String |
Trigger mode.
Enumeration values:
|
aggregation_window |
Long |
Statistical period, in seconds. For example, 3600 indicates one hour. Leave this parameter empty if trigger_type is set to immediately. |
operator |
String |
Operator. Options: >, <, =, >=, and <=. Leave this parameter empty if trigger_type is set to immediately. |
thresholds |
Map<String,Integer> |
Key-value pair. The key indicates the alarm severity while the value indicates the number of accumulated trigger times. Leave this parameter empty if trigger_type is set to immediately. |
frequency |
String |
Event alarm notification frequency. Leave this parameter empty if trigger_type is set to immediately.
|
Example Requests
-
Query the alarm template list.
https://{Endpoint}/v4/{project_id}/alarm-rules-template
-
Query the alarm template whose ID is 12142546931.
https://{Endpoint}/v4/{project_id}/alarm-rules-template?id=1214****2546****931
Example Responses
Status code: 200
OK: The request is successful.
{ "alarm_rule_templates" : [ { "alarm_rule_template_binding" : { }, "alarm_rule_template_id" : "130****1802****3121", "alarm_rule_template_name" : "aomTemplate", "alarm_rule_template_project_id" : "2a47****cca5****8373****1bff****", "alarm_rule_template_type" : "statics", "alarm_template_spec_list" : [ { "alarm_template_spec_items" : [ ], "related_cce_clusters" : [ ], "related_cloud_service" : "VPC", "related_prometheus_instances" : [ ] } ], "create_time" : 1732266984780, "enterprise_project_id" : "0", "modify_time" : 1732266984780 } ], "count" : 119 }
Status Codes
Status Code |
Description |
---|---|
200 |
OK: The request is successful. |
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