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
DataArts Fabric
IoT
IoT Device Access
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
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
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
Huawei Cloud Astro Canvas
Huawei Cloud Astro Zero
CodeArts Governance
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 (CCI)
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
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
Cloud Transformation
Well-Architected Framework
Cloud Adoption Framework
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
Blockchain
Blockchain Service
Web3 Node Engine Service
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Cloud Eye/ API Reference/ API V2/ One-Click Monitoring/ Querying Alarm Rules of a Service in One-Click Monitoring

Querying Alarm Rules of a Service in One-Click Monitoring

Updated on 2025-07-18 GMT+08:00

Function

This API is used to query alarm rules of a service in one-click monitoring.

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}/one-click-alarms/{one_click_alarm_id}/alarms

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant ID.

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

one_click_alarm_id

Yes

String

One-click monitoring ID for a service.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

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

Default value:

application/json; charset=UTF-8

X-Auth-Token

Yes

String

User token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

alarms

Array of alarms objects

Alarm rule list.

Table 4 alarms

Parameter

Type

Description

alarm_id

String

ID of an alarm rule, which starts with al and is followed by 22 characters, including letters and digits.

name

String

Name of an alarm rule. The name can contain 1 to 128 characters, including only letters, digits, underscores (_), and hyphens (-).

description

String

Alarm rule description. The description can contain 0 to 256 characters.

namespace

String

Namespace of a service. For details about the namespace of each service, see Namespace.

policies

Array of OneClickAlarmPolicy objects

Alarm policies.

resources

Array of ResourcesInListResp objects

Resource list. Associated resources can be obtained by calling the API for querying resources in an alarm rule.

type

String

Alarm rule type. ALL_INSTANCE indicates alarm rules for metrics of all resources. RESOURCE_GROUP indicates alarm rules for metrics of resources in a resource group. MULTI_INSTANCE indicates alarm rules for metrics of specified resources. EVENT.SYS indicates alarm rules for system events. EVENT.CUSTOM indicates alarm rules for custom events. DNSHealthCheck indicates alarm rules for health checks.

Enumeration values:

  • EVENT.SYS

  • EVENT.CUSTOM

  • DNSHealthCheck

  • RESOURCE_GROUP

  • MULTI_INSTANCE

  • ALL_INSTANCE

enabled

Boolean

Whether to enable the alarm rule. true: enabled; false: disabled.

notification_enabled

Boolean

Whether to enable alarm notification. true: enabled; false: disabled.

alarm_notifications

Array of Notification objects

Action to be triggered by the alarm.

ok_notifications

Array of Notification objects

Action to be triggered after an alarm is cleared.

notification_begin_time

String

Time when the alarm notification was enabled.

notification_end_time

String

Time when the alarm notification was disabled.

effective_timezone

String

Time zone, for example, GMT-08:00, GMT+08:00, or GMT+0:00.

notification_manner

String

Notification mode, which can be NOTIFICATION_GROUP (notification groups), TOPIC_SUBSCRIPTION (topic subscriptions), or NOTIFICATION_POLICY (notification policies).

Enumeration values:

  • NOTIFICATION_GROUP

  • TOPIC_SUBSCRIPTION

  • NOTIFICATION_POLICY

notification_policy_ids

Array of strings

Associated notification policy IDs.

Table 5 OneClickAlarmPolicy

Parameter

Type

Description

alarm_policy_id

String

Alarm policy ID.

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

Period for determining whether to generate an alarm, in seconds. The value can be 1, 300, 1200, 3600, 14400, or 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:

  • 0

  • 1

  • 300

  • 1200

  • 3600

  • 14400

  • 86400

filter

String

Aggregation mode. average: average value; variance: variance; min: minimum value; max: maximum value; sum: sum; tp99: 99 percentile; tp95: 95 percentile; tp90: 90 percentile

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 is used. 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.

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:

  1. The alarm type is Metric and the alarm policy is Trigger an alarm when all policies are met.

  2. The alarm type is Event.

unit

String

Data unit.

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.

suppress_duration

Integer

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

level

Integer

Alarm severity, which can be 1 (critical), ** 2** (major), 3 (minor), or 4 (informational). The default value is 2.

enabled

Boolean

Whether to enable one-click alarm reporting. true: enabled; false: disabled.

selected_unit

String

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

Table 6 HierarchicalValue

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

Table 7 ResourcesInListResp

Parameter

Type

Description

resource_group_id

String

Resource group ID. This parameter is available when the monitoring scope is Resource groups.

Regex Pattern: ^rg([a-z]|[A-Z]|[0-9]){22}$

resource_group_name

String

Resource group name. This parameter is available when the monitoring scope is Resource groups.

dimensions

Array of MetricDimension objects

Dimension information.

Table 8 MetricDimension

Parameter

Type

Description

name

String

Metric dimension name.

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

value

String

Metric dimension value.

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

Table 9 Notification

Parameter

Type

Description

type

String

Notification type. notification indicates the SMN notification, contact indicates the cloud account contact, contactGroup indicates the notification group, and autoscaling indicates AS notification.

Enumeration values:

  • notification

  • autoscaling

  • groupwatch

  • ecsRecovery

  • contact

  • contactGroup

  • iecAction

notification_list

Array of strings

List of objects to be notified if the alarm status changes. The value of topicUrn can be obtained from SMN. For details, see section "Querying Topics". If type is set to notification, the value of notificationList cannot be left blank. If type is set to autoscaling, the value of notification_list must be left blank. Note: If alarm_action_enabled is set to true, alarm_actions, ok_actions, or both of them must be specified. If both alarm_actions and ok_actions are specified, their notification_list values must be the same.

Status code: 400

Table 10 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: 401

Table 11 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: 403

Table 12 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 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.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "alarms" : [ {
    "alarm_id" : "al123232232341232132",
    "name" : "alarm1",
    "description" : "hello world",
    "namespace" : "SYS.ECS",
    "policies" : [ {
      "alarm_policy_id" : "alxdxxxdsw12321321",
      "metric_name" : "cpu_util",
      "period" : 0,
      "filter" : "max",
      "comparison_operator" : "",
      "value" : 1.7976931348623156E108,
      "unit" : "%",
      "count" : 100,
      "suppress_duration" : 0,
      "level" : 2,
      "enabled" : true
    } ],
    "resources" : [ {
      "dimensions" : [ {
        "name" : "string",
        "value" : "string"
      } ]
    } ],
    "type" : "EVENT.SYS",
    "enabled" : true,
    "notification_enabled" : true,
    "alarm_notifications" : [ {
      "type" : "notification",
      "notification_list" : [ "urn:smn:123" ]
    } ],
    "ok_notifications" : [ {
      "type" : "notification",
      "notification_list" : [ "urn:smn:123" ]
    } ],
    "notification_begin_time" : "00:00",
    "notification_end_time" : "23:59",
    "notification_manner" : "NOTIFICATION_POLICY",
    "notification_policy_ids" : [ "np15563156337845e8A2Wv63" ]
  } ]
}

Status Codes

Status Code

Description

200

OK

400

Parameter verification failed.

401

Not authenticated.

403

Authentication failed.

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