Querying Alarm Templates
Function
This API is used to query alarm templates.
URI
GET /v2/{project_id}/alarm-templates
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Specifies the tenant ID. Minimum: 1 Maximum: 64 |
Parameter | Mandatory | Type | Description |
---|---|---|---|
offset | No | Integer | Specifies the start position for pagination query, indicating the sequence number of the data record where the query starts. The default value is 0. Minimum: 0 Maximum: 10000 |
limit | No | Integer | Specifies the maximum number of query results. The value ranges from 1 to 100 (default). Minimum: 1 Maximum: 100 |
namespace | No | String | Specifies the namespace of a service. For details about the namespace of each service, see Namespace. Minimum: 3 Maximum: 32 Regex Pattern: ^([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_)*\.([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_)*$ |
dim_name | No | String | Specifies the 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. Minimum: 1 Maximum: 131 Regex Pattern: ^([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_|-){0,31}(,([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_|-){0,31}){0,3}$ |
template_type | No | String | Specifies the alarm template type. system indicates default alarm templates for metrics, custom indicates the custom alarm templates for metrics, system_event indicates default event templates, custom_event indicates the custom event templates, and system_custom_event indicates all default and custom event templates. If this parameter is not specified, all metric templates are returned. Enumeration values:
|
template_name | No | String | Specifies the 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 (-). Fuzzy match is supported. Minimum: 1 Maximum: 128 Regex Pattern: ^([\u4E00-\u9FFF]|[a-z]|[A-Z]|[0-9]|_|-|\(|\)|\.|\s)+$ |
Request Parameters
Parameter | Mandatory | Type | Description |
---|---|---|---|
X-Auth-Token | Yes | String | Specifies the tenant token. Minimum: 1 Maximum: 16384 |
Response Parameters
Status code: 200
Parameter | Type | Description |
---|---|---|
alarm_templates | Array of AlarmTemplates objects | Specifies the alarm template list. Array Length: 0 - 100 |
count | Integer | Specifies the total number of alarm templates. Minimum: 0 Maximum: 9999999 |
Parameter | Type | Description |
---|---|---|
template_id | String | Specifies the 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 | Specifies the 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 | Specifies the type of an alarm template. custom indicates custom alarm templates, and system indicates default alarm templates. Enumeration values:
|
create_time | String | Specifies the time when an alarm template was created. |
template_description | String | Provides supplementary information about an alarm template. The description can contain 0 to 256 characters and is left blank by default. |
Status code: 400
Parameter | Type | Description |
---|---|---|
error_code | String | Specifies the status codes customized by each cloud service when a request error occurs. Minimum: 0 Maximum: 256 |
error_msg | String | Specifies the request error message. Minimum: 0 Maximum: 256 |
request_id | String | Specifies the request ID. Minimum: 0 Maximum: 256 |
Status code: 401
Parameter | Type | Description |
---|---|---|
error_code | String | Specifies the status codes customized by each cloud service when a request error occurs. Minimum: 0 Maximum: 256 |
error_msg | String | Specifies the request error message. Minimum: 0 Maximum: 256 |
request_id | String | Specifies the request ID. Minimum: 0 Maximum: 256 |
Status code: 403
Parameter | Type | Description |
---|---|---|
error_code | String | Specifies the status codes customized by each cloud service when a request error occurs. Minimum: 0 Maximum: 256 |
error_msg | String | Specifies the request error message. Minimum: 0 Maximum: 256 |
request_id | String | Specifies the request ID. Minimum: 0 Maximum: 256 |
Status code: 500
Parameter | Type | Description |
---|---|---|
error_code | String | Specifies the status codes customized by each cloud service when a request error occurs. Minimum: 0 Maximum: 256 |
error_msg | String | Specifies the request error message. Minimum: 0 Maximum: 256 |
request_id | String | Specifies the request ID. Minimum: 0 Maximum: 256 |
Example Requests
Querying alarm templates
/v2/{project_id}/alarm-templates?offset=0&limit=100
Example Responses
Status code: 200
OK
{"alarm_templates" : [ {"template_id" : "at1628592157541dB1klWgY6","template_name" : "my_template","template_type" : "custom","create_time" : "2006-01-02T15:04:05.000Z","template_description" : "hello world"} ],"count" : 100}
Status Codes
Status Code | Description |
---|---|
200 | OK |
400 | Failed to verify parameters. |
401 | Not authenticated. |
403 | Authentication failed. |
500 | Internal system error. |
Error Codes
See Error Codes.
- URI