Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Eye/ API Reference/ API V2/ Alarm Notification Masking/ Querying Alarm Notification Masking Rules

Querying Alarm Notification Masking Rules

Updated on 2024-12-26 GMT+08:00

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.

URI

POST /v2/{project_id}/notification-masks/batch-query

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the tenant ID.

Minimum: 1

Maximum: 64

Regex Pattern: ^[a-zA-Z0-9-]{1,64}$

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

offset

No

Integer

Specifies the pagination offset.

Minimum: 0

Maximum: 10000

Default: 0

Regex Pattern: ^([0]|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|10000)$

limit

No

Integer

Specifies the number of records that will be displayed on each page.

Minimum: 1

Maximum: 100

Default: 100

Regex Pattern: ^([1-9]|[1-9][0-9]|100)$

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Specifies the MIME type of the request body. The default type is application/json; charset=UTF-8.

Default: application/json; charset=UTF-8

Minimum: 1

Maximum: 64

X-Auth-Token

Yes

String

Specifies the user token.

Minimum: 1

Maximum: 16384

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

relation_type

Yes

String

Specifies the type of a resource that is associated with an alarm notification masking rule. ALARM_RULE: alarm rules RESOURCE: resources RESOURCE_POLICY_NOTIFICATION: alarm policies for the resource RESOURCE_POLICY_ALARM: alarm policies for the resource (The alarm policies are not used for alarm calculation.) DEFAULT: By default, RESOURCE and RESOURCE_POLICY_NOTIFICATION (used for querying alarm notification masking rules) are included.

Enumeration values:

  • ALARM_RULE

  • RESOURCE

  • RESOURCE_POLICY_NOTIFICATION

  • RESOURCE_POLICY_ALARM

  • DEFAULT

relation_ids

Yes

Array of strings

Specifies the ID of the alarm rule that is associated with the alarm notification masking rule.

Array Length: 1 - 100

mask_id

No

String

(Optional) Specifies the masking rule ID.

Minimum: 1

Maximum: 64

Regex Pattern: ^nm([0-9A-Za-z]){0,62}$

mask_name

No

String

Specifies the masking rule name. The value can contain up to 64 characters, including only letters, digits, hyphens (-), and underscores (_).

Minimum: 1

Maximum: 64

Regex Pattern: ^([\u4E00-\u9FFF]|[a-z]|[A-Z]|[0-9]|_|-)+$

mask_status

No

String

(Optional) Specifies whether a masking rule is in effect. MASK_EFFECTIVE: The masking rule is in effect. MASK_INEFFECTIVE: The masking rule is not in effect.

Minimum: 1

Maximum: 32

Enumeration values:

  • MASK_EFFECTIVE

  • MASK_INEFFECTIVE

resource_id

No

String

(Optional) Specifies the resource dimension value. You can specify one or more resource IDs from one dimension.

Minimum: 1

Maximum: 700

namespace

No

String

Specifies the resource namespace in service.item format. The values of service and item must be character strings, start with a letter, and can contain digits, letters, and underscores (_). A namespace can contain 3 to 32 characters.

dimensions

No

Array of Dimension objects

Specifies the resource dimension information.

Array Length: 1 - 4

Table 5 Dimension

Parameter

Mandatory

Type

Description

name

Yes

String

Specifies the dimension of a resource. For example, the dimension of an ECS can be instance_id. A maximum of four dimensions are supported. For the metric dimension of each resource, see Services Interconnected with Cloud Eye.

Regex Pattern: ^([a-z]|[A-Z]){1}([a-z]|[A-Z]|[0-9]|_|-){1,32}$

value

Yes

String

Specifies the value of a resource dimension, which is the resource ID, for example, 4270ff17-aba3-4138-89fa-820594c39755.

Regex Pattern: ^((([a-z]|[A-Z]|[0-9]){1}([a-z]|[A-Z]|[0-9]|_|-|\.)*)|\*){1,256}$

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

notification_masks

Array of notification_masks objects

Specifies the list of alarm notification masking rules.

Array Length: 1 - 100

count

Integer

Specifies the total number of alarm notification masking rules.

Minimum: 0

Maximum: 99999

Table 7 notification_masks

Parameter

Type

Description

notification_mask_id

String

Specifies the masking rule ID.

mask_name

String

Specifies the masking rule name. The value can contain up to 64 characters, including only letters, digits, hyphens (-), and underscores (_).

relation_type

String

Specifies the type of a resource that is associated with an alarm notification masking rule. ALARM_RULE: alarm rules RESOURCE: resources RESOURCE_POLICY_NOTIFICATION: alarm policies for the resource RESOURCE_POLICY_ALARM: alarm policies for the resource (The alarm policies are not used for alarm calculation.)

Enumeration values:

  • ALARM_RULE

  • RESOURCE

  • RESOURCE_POLICY_NOTIFICATION

  • RESOURCE_POLICY_ALARM

relation_id

String

Specifies the associated ID.

resources

Array of ResourceCategory objects

Specifies the 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.

Array Length: 1 - 100

mask_status

String

Specifies whether alarm notifications are masked. UN_MASKED: Alarm notifications are not masked. MASK_EFFECTIVE: Masking rules are in effect. MASK_INEFFECTIVE: Masking rules are not in effect.

Enumeration values:

  • UN_MASKED

  • MASK_EFFECTIVE

  • MASK_INEFFECTIVE

mask_type

String

Specifies the alarm notification masking type. 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.

Enumeration values:

  • START_END_TIME

  • FOREVER_TIME

  • CYCLE_TIME

start_date

String

Specifies the masking start date, in yyyy-MM-dd format.

start_time

String

Specifies the masking start time, in HH:mm:ss format.

end_date

String

Specifies the masking end date, in yyyy-MM-dd format.

end_time

String

Specifies the masking end time, in HH:mm:ss format.

policies

Array of PoliciesInListResp objects

Specifies the alarm policy list.

Array Length: 0 - 50

Table 8 ResourceCategory

Parameter

Type

Description

namespace

String

Specifies the resource namespace in service.item format. The values of service and item must be character strings, start with a letter, and can contain digits, letters, and underscores (_). A namespace can contain 3 to 32 characters.

dimension_names

Array of strings

Specifies the resource dimension information. Multiple dimensions are sorted in alphabetical order and separated with commas (,).

Minimum: 1

Maximum: 131

Array Length: 1 - 100

Table 9 PoliciesInListResp

Parameter

Type

Description

alarm_policy_id

String

Specifies the alarm policy ID.

metric_name

String

Specifies the 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].

extra_info

MetricExtraInfo object

Specifies the extended metric information.

period

Integer

Specifies the period for determining whether to generate an alarm, in seconds. The value can be 1, 300, 1200, 3600, 14400, and 86400. Note: If you set period to 1, Cloud Eye uses raw data to determine whether to trigger an alarm. You can set this parameter to 0 when you set alarm_type to EVENT.SYS or EVENT.CUSTOM.

Enumeration values:

  • 1

  • 300

  • 1200

  • 3600

  • 14400

  • 86400

filter

String

Specifies the data rollup method. The value can be max, min, average, sum, or variance.

Enumeration values:

  • max

  • min

  • average

  • sum

  • variance

comparison_operator

String

Specifies the operator, which can be >, =, <, >=, <=, !=, cycle_decrease, cycle_increase, or cycle_wave.

cycle_decrease indicates a decrease compared with the last period.

cycle_increase indicates an increase compared with the last period.

cycle_wave indicates an increase or decrease compared with the last period.

Enumeration values:

  • >

  • =

  • <

  • >=

  • <=

  • !=

  • cycle_decrease

  • cycle_increase

  • cycle_wave

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. The value ranges from 0 to Number. MAX_VALUE (1.7976931348623157e+108). For detailed thresholds, see the value range of each metric in the appendix. For example, you can set ECS cpu_util to 80.For detailed thresholds, see the value range of each metric in the appendix. For example, you can set ECS cpu_util to 80 in Services Interconnected with Cloud Eye. (tag: dt,g42,dt_test,hk_g42,hk_sbc,hws,hws_hk,ocb,sbc,tm)

unit

String

Specifies the data unit.

count

Integer

Specifies the number of consecutive times that alarm conditions are met. Supported range: 1 to 5

type

String

Specifies the alarm policy type. (This parameter is not used currently.)

Minimum: 0

Maximum: 32

suppress_duration

Integer

Specifies the interval for triggering alarms. The value can be 0, 300, 600, 900, 1800, 3600, 10800, 21600, 43200, or 86400. 0: Cloud Eye triggers the alarm only once. 300: Cloud Eye triggers an alarm every 5 minutes. 600: Cloud Eye triggers an alarm every 10 minutes. 900: Cloud Eye triggers an alarm every 15 minutes. 1800: Cloud Eye triggers an alarm every 30 minutes. 3600: Cloud Eye triggers an alarm every hour. 10800: Cloud Eye triggers an alarm every 3 hours. 21600: Cloud Eye triggers an alarm every 6 hour. 43200: Cloud Eye triggers an alarm every 12 hours. 86400: Cloud Eye triggers an alarm every day.

Enumeration values:

  • 0

  • 300

  • 600

  • 900

  • 1800

  • 3600

  • 10800

  • 21600

  • 43200

  • 86400

alarm_level

Integer

Specifies the alarm severity. The value can be 1 (critical), ** 2** (major), 3 (minor), or 4 (informational).

selected_unit

String

The unit you selected, which is used for subsequent metric data display and calculation.

Table 10 MetricExtraInfo

Parameter

Type

Description

origin_metric_name

String

Specifies the original metric name.

Minimum: 1

Maximum: 4096

Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$

metric_prefix

String

Specifies the metric name prefix.

Minimum: 1

Maximum: 4096

Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$

custom_proc_name

String

Specifies the name of a user process.

Minimum: 1

Maximum: 250

metric_type

String

Specifies the metric type.

Minimum: 1

Maximum: 32

Regex Pattern: ^([a-z]|[A-Z]|[0-9]|_|-|~|\.|/|:)*$

Status code: 400

Table 11 Response body parameters

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

Table 12 Response body parameters

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

{
  "relation_type" : "DEFAULT",
  "relation_ids" : [ "al123232232341232132" ],
  "mask_id" : "nm1689737291469aj38xNVLK",
  "mask_name" : "mn_test",
  "mask_status" : "MASK_EFFECTIVE",
  "resource_id" : "dse23xw43",
  "namespace" : "SYS.ECS",
  "dimensions" : [ {
    "name" : "instance_id",
    "value" : "4270ff17-aba3-4138-89fa-820594c39755"
  } ]
}

Example Responses

Status code: 200

Notification masking rules queried.

{
  "notification_masks" : [ {
    "notification_mask_id" : "nm123232232341232132",
    "mask_name" : "mn_test",
    "relation_type" : "ALARM_RULE",
    "relation_id" : "al123232232341232132",
    "resources" : [ {
      "namespace" : "SYS.ECS",
      "dimension_names" : [ "disk_utils,instance_id" ]
    } ],
    "mask_status" : "UN_MASKED",
    "mask_type" : "START_END_TIME",
    "start_date" : "yyyy-MM-dd",
    "start_time" : "HH:mm:ss",
    "end_date" : "yyyy-MM-dd",
    "end_time" : "HH:mm:ss",
    "policies" : [ {
      "alarm_policy_id" : "0f921f55-89b1-4534-ae54-7b40b597b5a6",
      "metric_name" : "cpu_util",
      "extra_info" : {
        "origin_metric_name" : "disk_usedPercent",
        "metric_prefix" : "SlAsh_",
        "custom_proc_name" : "proc_zombie_count1",
        "metric_type" : "string"
      },
      "period" : 300,
      "filter" : "average",
      "comparison_operator" : ">",
      "value" : 0,
      "unit" : "%",
      "count" : 3,
      "type" : "string",
      "suppress_duration" : 300,
      "alarm_level" : 2
    } ]
  } ],
  "count" : 100
}

Status Codes

Status Code

Description

200

Notification masking rules queried.

400

Failed to verify parameters.

500

Internal system error.

Error Codes

See Error Codes.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback