Querying Alarm Masking Rules
Function
This API is used to query notification masking rules of a specified type in batches. Currently, a maximum of 100 notification masking rules can be queried in batches.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
ces:alarms:listNotificationMaskRules
List
-
g:EnterpriseProjectId
ces:notificationMasks:list
-
URI
POST /v2/{project_id}/notification-masks/batch-query
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID. It is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details, see Obtaining a Project ID. Constraints N/A Range 1 to 64 characters. Default Value N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| offset | No | Integer | Definition Pagination offset. Constraints N/A Range An integer ranging from 0 to 10,000. Default Value 0 |
| limit | No | Integer | Definition Number of records displayed on each page. Constraints N/A Range An integer ranging from 1 to 100. Default Value 100 |
| sort_key | No | String | Definition Sorting keyword, which is used together with sort_dir. Constraints The value can be create_time or update_time. Range Default Value N/A |
| sort_dir | No | String | Definition Sorting order, which is used together with sort_key. Constraints N/A Range Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | No | String | Definition MIME type of the request body. Constraints: None Value range: The value can contain 1 to 64 characters. Default value: The default type is application/json; charset=UTF-8. |
| X-Auth-Token | No | String | Definition User token. Constraints: None Value range: The value can contain 1 to 16,384 characters. Default value: None |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| relation_type | Yes | String | Definition Method for masking alarm notifications. Constraints N/A Range Enumerated value containing 1 to 32 characters.
Default Value N/A |
| relation_ids | Yes | Array of strings | Definition Association ID (alarm rule ID). Constraints The list can contain 0 to 100 association IDs. |
| metric_name | No | String | Definition Metric name of a resource. For details about the metric names of each resource, see their service documentation. You can navigate there from Services Interconnected with Cloud Eye. Constraints N/A Range The value must start with a letter and can only contain letters, digits, underscores (_), and hyphens (-). It allows 1 to 96 characters. For example, the ECS metric cpu_util indicates the CPU usage of an ECS. The DDS metric mongo001_command_ps indicates the command execution frequency. Default Value N/A |
| resource_level | No | String | Definition Resource level. Constraints N/A Range Default Value N/A |
| mask_id | No | String | Definition (Optional) Masking rule ID. Constraints N/A Range The value starts with nm and is followed by up to 62 characters of letters, digits, or a combination of both. Default Value N/A |
| mask_name | No | String | Definition (Optional) Masking rule name. Constraints N/A Range The value allows 1 to 64 characters. It can only contain letters, digits, hyphens (-), and underscores (_). Default Value N/A |
| mask_status | No | String | Definition (Optional) Masking status. Constraints N/A Range Default Value N/A |
| resource_id | No | String | Definition (Optional) Resource dimension value. You can specify one or more resource IDs from one dimension. Constraints N/A Range 1 to 700 characters. Default Value N/A |
| namespace | No | String | Definition Namespace of the service. For details, see Services Interconnected with Cloud Eye. Constraints N/A Range The value is in the service.item format. The values of service and item must start with a letter and contain only letters, digits, and underscores (_). It can contain 3 to 32 characters. Default Value N/A |
| dimensions | No | Array of ResourceDimension objects | Definition Resource dimension information. Constraints You can specify 1 to 4 dimensions. |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| name | Yes | String | Definition Dimension of a resource. For example, the dimension of an ECS is instance_id . For details about the dimension names of each resource, see their service documentation. You can navigate there from Services Interconnected with Cloud Eye. Constraints N/A Range The value starts with a letter and allows 1 to 32 characters. It can contain only letters, digits, underscores (_), and hyphens (-). Default Value N/A |
| value | Yes | String | Definition Resource dimension value, which is an instance ID, for example, 4270ff17-aba3-4138-89fa-820594c39755. Constraints N/A Range 1 to 256 characters Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| notification_masks | Array of notification_masks objects | Definition Alarm masking rules. |
| count | Integer | Definition Total number of alarm notification masking rules. Range [0,99999] |
| Parameter | Type | Description |
|---|---|---|
| notification_mask_id | String | Definition Masking rule ID. Range The value starts with nm and is followed by up to 62 characters of letters, digits, or a combination of both. |
| mask_name | String | Definition Masking rule name. Range The value allows 1 to 64 characters. It can only contain letters, digits, hyphens (-), and underscores (_). |
| relation_type | String | Definition Method for masking alarm notifications. Range Enumerated value containing 1 to 32 characters. |
| relation_id | String | Definition Association ID, which is the alarm rule ID. Range It allows 1 to 64 characters and can only contain letters, digits, and hyphens (-). |
| resource_type | String | Definition Masked resource type. Range |
| metric_names | Array of strings | Definition Names of associated metrics. This parameter is available when relation_type is set to RESOURCE. |
| product_metrics | Array of ProductMetricResp objects | Definition Metric information when the masking rule is applied by cloud product. |
| resource_level | String | Definition Resource level. Range The value can be: |
| product_name | String | Definition Cloud product name specified when Cloud product is selected for Resource Level. Range 0 to 128 characters. |
| resources | Array of ResourceCategoryResp objects | Definition Associated resource type. This parameter is available when relation_type is set to RESOURCE. You only need to query the namespace and dimension name of the resource. |
| mask_status | String | Definition Masking status. Range |
| mask_type | String | Definition Masking type. Range The value can be: |
| create_time | Integer | Definition Time when the alarm masking rule was created. The value is a UNIX timestamp and the unit is millisecond. Range N/A |
| update_time | Integer | Definition Time when the alarm masking was updated. The value is a UNIX timestamp and the unit is millisecond. Range N/A |
| start_date | String | Definition Masking start date. Range The value contains 10 characters and is in the yyyy-MM-dd format. |
| start_time | String | Definition Masking start time. Range The value contains eight characters and is in the HH:mm:ss format. |
| end_date | String | Definition Masking end date. Range The value contains 10 characters and is in the yyyy-MM-dd format. |
| end_time | String | Definition Masking end time. Range The value contains eight characters and is in the HH:mm:ss format. |
| effective_timezone | String | Definition Time zone, for example, GMT-08:00, GMT+08:00, or GMT+0:00. Range 1 to 16 characters |
| policies | Array of PoliciesInListResp objects | Definition Alarm policies. |
| Parameter | Type | Description |
|---|---|---|
| dimension_name | String | Definition Resource dimension information when the masking rule is applied by cloud product. Range The value contains up to 128 characters. Multiple dimensions are separated by commas (,). |
| metric_name | String | Definition Metric name of a resource. For details about the metric names of each resource, see their service documentation. You can navigate there from Services Interconnected with Cloud Eye. Range The value must start with a letter and can only contain letters, digits, underscores (_), and hyphens (-). It allows 1 to 96 characters. For example, the ECS metric cpu_util indicates the CPU usage of an ECS. The DDS metric mongo001_command_ps indicates the command execution frequency. |
| Parameter | Type | Description |
|---|---|---|
| namespace | String | Definition Namespace of the service. For details, see Services Interconnected with Cloud Eye. Range The value is in the service.item format. The values of service and item must start with a letter and contain only letters, digits, and underscores (_). It can contain 3 to 32 characters. |
| dimension_names | Array of strings | Definition Resource dimensions. |
| Parameter | Type | Description |
|---|---|---|
| alarm_policy_id | String | Definition Alarm policy ID. Range The value allows 1 to 64 characters and can contain only letters, digits, and hyphens (-). |
| metric_name | String | Definition Metric name of a resource. For details about the metric names of each resource, see their service documentation. You can navigate there from Services Interconnected with Cloud Eye. Range The value must start with a letter and can only contain letters, digits, underscores (_), and hyphens (-). It allows 1 to 96 characters. For example, the ECS metric cpu_util indicates the CPU usage of an ECS. The DDS metric mongo001_command_ps indicates the command execution frequency. |
| extra_info | MetricExtraInfoResp object | Definition Additional information about the alarm policy. |
| period | Integer | Definition Interval (seconds) for checking whether the alarm rule conditions are met. Range The value can be:
|
| filter | String | Definition Aggregation method. Range |
| comparison_operator | String | Definition Threshold symbol. Range The value can be >, <, >=, <=, =, !=, cycle_decrease, cycle_increase, or cycle_wave. cycle_decrease indicates the decrease relative to the last period. cycle_increase indicates the increase relative to the last period. cycle_wave indicates the increase or decrease relative to the last period. |
| value | Number | Definition Alarm threshold. For details, see Services Interconnected with Cloud Eye. Range -1.7976931348623157e+108 to 1.7976931348623157e+108 |
| hierarchical_value | HierarchicalValueResp object | Definition Multi-level alarm threshold. |
| unit | String | Definition Data unit. Range 0 to 32 characters. |
| count | Integer | Definition Number of consecutive alarm triggers. Range 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. |
| type | String | Definition Alarm policy type. This parameter has been deprecated. Range N/A |
| suppress_duration | Integer | Definition Alarm suppression duration, in seconds. This parameter corresponds to the last field in the alarm policy when you create an alarm rule. This field is used to mitigate frequent alarm occurrences. Range The value can be:
|
| alarm_level | Integer | Definition Alarm severity. Range The value can be: |
| namespace | String | Definition Namespace of the service. For details, see Services Interconnected with Cloud Eye. Range The value is in the service.item format. The values of service and item must start with a letter and contain only letters, digits, and underscores (_). It can contain 3 to 32 characters. |
| dimension_name | String | Definition Resource dimension information when the masking rule is applied by cloud product. Use commas (,) to separate multiple dimensions. Range 0 to 128 characters. |
| selected_unit | String | Definition The unit you selected, which is used for subsequent metric data display and calculation. A maximum of 64 characters are allowed. Range 0 to 64 characters. |
| Parameter | Type | Description |
|---|---|---|
| origin_metric_name | String | Definition Original metric name. Range [0,4,096] |
| metric_prefix | String | Definition Metric name prefix. Range [0,4,096] |
| custom_proc_name | String | Definition Name of a process. Range [0,250] |
| metric_type | String | Definition Metric type. Range [0,32] |
| Parameter | Type | Description |
|---|---|---|
| critical | Double | Definition Threshold for critical alarms. Range [-1.7976931348623157e+108, 1.7976931348623157e+108] |
| major | Double | Definition Threshold for major alarms. Range [-1.7976931348623157e+108, 1.7976931348623157e+108] |
| minor | Double | Definition Threshold for minor alarms. Range [-1.7976931348623157e+108, 1.7976931348623157e+108] |
| info | Double | Definition Threshold for warnings. Range [-1.7976931348623157e+108, 1.7976931348623157e+108] |
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: 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
Query the alarm masking records of the RESOURCE type (alarm masking by resource), where mask_id is nm1759214122865owK8bz16p.
{
"relation_type" : "RESOURCE",
"relation_ids" : [ ],
"mask_id" : "nm1759214122865owK8bz16p"
} Example Responses
Status code: 200
Notification masking rules queried.
{
"notification_masks" : [ {
"notification_mask_id" : "nm1759214122865owK8bz16p",
"mask_name" : "resource_mask_hl_02",
"relation_type" : "RESOURCE",
"relation_id" : "",
"mask_type" : "START_END_TIME",
"mask_status" : "MASK_INEFFECTIVE",
"start_date" : "2025-09-30",
"start_time" : "14:33:44",
"end_date" : "2025-09-30",
"end_time" : "15:33:44",
"effective_timezone" : "GMT+08:00",
"resource_type" : "MULTI_INSTANCE",
"resources" : [ {
"namespace" : "SYS.ECS",
"dimension_names" : [ "instance_id" ]
} ],
"policies" : [ ],
"metric_names" : [ ],
"product_metrics" : [ {
"dimension_name" : "instance_id",
"metric_name" : "cpu_util"
}, {
"dimension_name" : "instance_id",
"metric_name" : "disk_util_inband"
}, {
"dimension_name" : "instance_id",
"metric_name" : "cpu_usage"
}, {
"dimension_name" : "instance_id",
"metric_name" : "mem_util"
} ],
"resource_level" : "product",
"product_name" : "SYS.ECS,instance_id",
"create_time" : 1759214122000,
"update_time" : 1759214122000
} ],
"count" : 1
} Status Codes
| Status Code | Description |
|---|---|
| 200 | Notification masking rules queried. |
| 400 | Parameter verification failed. |
| 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