Help Center/ Cloud Eye/ API Reference/ API/ Alarms/ Alarm Masking Rules/ Querying Alarm Masking Rules
Updated on 2026-06-11 GMT+08:00

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

Table 1 Path Parameters

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

Table 2 Query Parameters

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

  • create_time: sorting by creation time.

  • update_time: sorting by update time.

Default Value

N/A

sort_dir

No

String

Definition

Sorting order, which is used together with sort_key.

Constraints

N/A

Range

  • DESC: descending order.

  • ASC: ascending order.

Default Value

N/A

Request Parameters

Table 3 Request header 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

Table 4 Request body parameters

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.

  • ALARM_RULE: by alarm rule.

  • RESOURCE: by resource. Usage: On the Alarm Masking page, click Create Masking Rule and set Masked By to Resource.

  • RESOURCE_POLICY_NOTIFICATION: by alarm policy. Usage: On the Alarm Masking page, click Create Masking Rule and set Masked By to Policy.

  • EVENT.SYS: by event. Usage: On the Alarm Masking page, click Create Masking Rule and set Masked By to Event.

  • RESOURCE_POLICY_ALARM: (discarded and not recommended) by alarm policy.

  • DEFAULT: (discarded and not recommended) contains RESOURCE, RESOURCE_POLICY_NOTIFICATION, and EVENT.SYS.

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

  • product: cloud product.

  • dimension: specific dimension.

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

  • MASK_EFFECTIVE: effective.

  • MASK_INEFFECTIVE: ineffective.

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.

Table 5 ResourceDimension

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

Table 6 Response body parameters

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]

Table 7 notification_masks

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.

  • ALARM_RULE: by alarm rule.

  • RESOURCE: by resource.

  • RESOURCE_POLICY_NOTIFICATION: by alarm policy.

  • RESOURCE_POLICY_ALARM: (discarded and not recommended) by alarm policy.

  • EVENT.SYS: by event.

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

  • ALL_INSTANCE: all resources.

  • MULTI_INSTANCE: multiple instances.

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: cloud product.

  • dimension: specific dimension.

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

  • UN_MASKED: unmasked.

  • MASK_EFFECTIVE: effective.

  • MASK_INEFFECTIVE: ineffective.

mask_type

String

Definition

Masking type.

Range

The value can be:

  • START_END_TIME: Alarms are masked by start time and end time.

  • FOREVER_TIME: Alarms are masked permanently.

  • CYCLE_TIME: Alarms are masked by period.

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.

Table 8 ProductMetricResp

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.

Table 9 ResourceCategoryResp

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.

Table 10 PoliciesInListResp

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:

  • 0: default value. This value can be used for event alarms.

  • 1: original metric period. For example, if the original period of an RDS metric is 60s, the metric data is collected and calculated every 60s.

  • 300: The metric data is collected and calculated every 5 minutes.

  • 1200: The metric data is collected and calculated every 20 minutes.

  • 3600: The metric data is collected and calculated every hour.

  • 14400: The metric data is collected and calculated every 4 hours.

  • 86400: The metric data is collected and calculated every day.

filter

String

Definition

Aggregation method.

Range

  • average

  • variance

  • min: minimum value.

  • max: maximum value.

  • sum

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:

  • 0: A metric alarm is generated only once. An event alarm is not suppressed in the immediate triggering scenario, and is generated only once in the accumulated triggering scenario.

  • 300: An alarm is generated every 5 minutes once the alarm triggering condition is met.

  • 600: An alarm is generated every 10 minutes once the alarm triggering condition is met.

  • 900: An alarm is generated every 15 minutes once the alarm triggering condition is met.

  • 1800: An alarm is generated every 30 minutes once the alarm triggering condition is met.

  • 3600: An alarm is generated every 60 minutes once the alarm triggering condition is met.

  • 10800: An alarm is generated every 3 hours once the alarm triggering condition is met.

  • 21600: An alarm is generated every 6 hours once the alarm triggering condition is met.

  • 43200: An alarm is generated every 12 hours once the alarm triggering condition is met.

  • 86400: An alarm is generated once every day once the alarm triggering condition is met.

alarm_level

Integer

Definition

Alarm severity.

Range

The value can be:

  • 1: critical.

  • 2: major.

  • 3: minor.

  • 4: warning.

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.

Table 11 MetricExtraInfoResp

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]

Table 12 HierarchicalValueResp

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

Table 13 Response body parameters

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

Table 14 Response body parameters

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.