Querying Details of an Alarm Template
Function
This API is used to query details of an alarm template.
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}/alarm-templates/{template_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Tenant ID. |
template_id |
Yes |
String |
ID of an alarm template. The ID starts with at and is followed by up to 64 characters, including letters and digits. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Tenant token. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
template_id |
String |
ID of an alarm template. The ID starts with at and is followed by up to 64 characters, including letters and digits. |
template_name |
String |
Name of an alarm template. The name must start with a letter and can contain 1 to 128 characters, including letters, digits, underscores (_), and hyphens (-). |
template_type |
String |
Type of an alarm template. custom indicates custom alarm templates, and system indicates default alarm templates. Enumeration values:
|
create_time |
String |
Time when an alarm template was created. |
template_description |
String |
Supplementary information about an alarm template. The description can contain 0 to 256 characters and is left blank by default. |
policies |
Array of AlarmTemplatePolicies objects |
Alarm policies in an alarm template. |
Parameter |
Type |
Description |
---|---|---|
namespace |
String |
Namespace of a service. For details about the namespace of each service, see Namespace. |
dimension_name |
String |
Resource dimension, which must start with a letter. A dimension can contain up to 32 characters, including only digits, letters, underscores (_), and hyphens (-). Use commas (,) to separate multiple dimensions. DimensionName in event alarm templates must be left blank. |
metric_name |
String |
Metric name of a resource. The name must start with a letter and contain only digits, letters, and underscores. The length ranges from 1 to 64 characters. For example, cpu_util of an ECS indicates the CPU usage of the ECS. mongo001_command_ps in DDS indicates the command execution frequency. For details about the metric name of each service, see Service metric name. |
period |
Integer |
Interval (seconds) for checking whether the alarm rule conditions are met. Enumeration values:
|
filter |
String |
Data rollup method. Regex Pattern: ^(average|variance|min|max|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, and cycle_wave indicates the increase or decrease compared with the last period. All of them can be used in alarm rules for metrics. >, <, >=, <=, =, and != can be used for alarm rules for events. |
value |
Number |
Alarm threshold. If there is only one threshold, value and alarm_level are used in pairs. If there are both hierarchical_value and value, hierarchical_value prevails. Value range: 0-2.34854258277383E108 |
hierarchical_value |
HierarchicalValue object |
Multi-level alarm threshold. If there are both hierarchical_value and value, hierarchical_value prevails. When you create or modify an alarm rule, you can set only one threshold in the following scenarios:
|
unit |
String |
Data unit. The value can contain up to 32 characters. |
count |
Integer |
Number of consecutive alarm triggering times. For event alarms, the value ranges from 1 to 180. For metric and website alarms, the value can be 1, 2, 3, 4, 5, 10, 15, 30, 60, 90, 120, or 180. |
alarm_level |
Integer |
Alarm severity, which can be 1 (critical), ** 2** (major), 3 (minor), or 4 (informational). |
suppress_duration |
Integer |
Alarm suppression period, in seconds. When the period is 0, only one alarm is generated. Enumeration values:
|
selected_unit |
String |
The unit you selected, which is used for subsequent metric data display and calculation. |
Parameter |
Type |
Description |
---|---|---|
critical |
Double |
Threshold for critical alarms. Value range: -1.7976931348623156E108-1.7976931348623156E108 |
major |
Double |
Threshold for major alarms. Value range: -1.7976931348623156E108-1.7976931348623156E108 |
minor |
Double |
Threshold for minor alarms. Value range: -1.7976931348623156E108-1.7976931348623156E108 |
info |
Double |
Threshold for informational alarms. Value range: -1.7976931348623156E108-1.7976931348623156E108 |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. |
error_msg |
String |
Request error message. |
request_id |
String |
Request ID. |
Status code: 401
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. |
error_msg |
String |
Request error message. |
request_id |
String |
Request ID. |
Status code: 403
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. |
error_msg |
String |
Request error message. |
request_id |
String |
Request ID. |
Status code: 404
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. |
error_msg |
String |
Request error message. |
request_id |
String |
Request ID. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Status codes customized by each cloud service when a request error occurs. |
error_msg |
String |
Request error message. |
request_id |
String |
Request ID. |
Example Requests
Querying details of an alarm template.
/v2/{project_id}/alarm-templates/{template_id}
Example Responses
Status code: 200
OK
{ "template_id" : "at1628592157541dB1klWgY6", "template_name" : "my_template", "template_type" : "custom", "create_time" : "2006-01-02T15:04:05.000Z", "template_description" : "hello world", "policies" : [ { "namespace" : "SYS.ECS", "dimension_name" : "instance_id", "metric_name" : "cpu_util", "period" : 300, "filter" : "sum", "comparison_operator" : ">", "value" : 2, "hierarchical_value" : { "major" : 85 }, "unit" : "bit/s", "selected_unit" : "", "count" : 2, "alarm_level" : 2, "suppress_duration" : 300 } ] }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Parameter verification failed. |
401 |
Not authenticated. |
403 |
Authentication failed. |
404 |
Resource not found. |
500 |
Internal system 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