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

Querying an Alarm Rule

Updated on 2023-05-06 GMT+08:00

Function

This API is used to query an alarm rule based on the alarm rule ID.

URI

GET /V1.0/{project_id}/alarms/{alarm_id}

  • Parameter description
    Table 1 Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    For details about how to obtain the project ID, see Obtaining a Project ID.

    alarm_id

    Yes

    Specifies the alarm rule ID.

  • Example
    GET https://{Cloud Eye endpoint}/V1.0/{project_id}/alarms/al1441967036681YkazZ0deN

Request

None

Response

  • Response parameters

    Parameter

    Type

    Description

    metric_alarms

    Array of objects

    Specifies the list of alarm objects.

    For details, see Table 2.

    Table 2 metric_alarms data structure description

    Parameter

    Type

    Description

    alarm_name

    String

    Specifies the alarm rule name.

    alarm_description

    String

    Provides supplementary information about the alarm rule.

    metric

    Object

    Specifies the alarm metric.

    For details, see Table 3.

    condition

    Object

    Specifies the alarm triggering condition.

    For details, see Table 7.

    alarm_enabled

    Boolean

    Specifies whether to enable the alarm rule.

    alarm_level

    Integer

    Specifies the alarm severity, which can be 1, 2 (default), 3 or 4, indicating critical, major, minor, and informational, respectively.

    alarm_action_enabled

    Boolean

    Specifies whether to enable the action to be triggered by an alarm.

    alarm_actions

    Array of objects

    Specifies the action to be triggered by an alarm.

    For details, see Table 5.

    ok_actions

    Array of objects

    Specifies the action to be triggered after the alarm is cleared.

    For details, see Table 6.

    alarm_id

    String

    Specifies the alarm rule ID.

    update_time

    Long

    Specifies when the alarm status changed. The time is a UNIX timestamp and the unit is ms.

    alarm_state

    String

    Specifies the alarm status, which can be

    • ok: The alarm status is normal.
    • alarm: An alarm is generated.
    • insufficient_data: The required data is insufficient.
    Table 3 metric data structure description

    Parameter

    Type

    Description

    namespace

    String

    Query the namespace of a service. For details, see Services Interconnected with Cloud Eye.

    dimensions

    Array of objects

    Specifies the list of metric dimensions.

    For details, see Table 4.

    metric_name

    String

    Specifies the metric ID. For example, if the monitoring metric of an ECS is CPU usage, metric_name is cpu_util. For details, see Services Interconnected with Cloud Eye.

    Table 4 dimensions data structure description

    Parameter

    Type

    Description

    name

    String

    Specifies the dimension. For example, the ECS dimension is instance_id. For details about the dimension of each service, see the key column in Services Interconnected with Cloud Eye.

    value

    String

    Specifies the dimension value, for example, an ECS ID.

    Enter 1 to 256 characters.

    Table 5 alarm_actions data structure description

    Parameter

    Type

    Description

    type

    String

    Specifies the alarm notification type.
    • notification: indicates that a notification will be sent.
    • autoscaling: indicates that a scaling action will be triggered.

    notificationList

    Array of strings

    Specifies the list of objects to be notified if the alarm status changes.

    NOTE:

    The IDs in the list are strings.

    Table 6 ok_actions data structure description

    Parameter

    Type

    Description

    type

    String

    Specifies the notification type when an alarm is triggered.
    • notification: indicates that a notification will be sent.
    • autoscaling: indicates that a scaling action will be triggered.

    notificationList

    Array of strings

    Specifies the list of objects to be notified if the alarm status changes.

    NOTE:

    The IDs in the list are strings.

    Table 7 condition data structure description

    Parameter

    Type

    Description

    period

    Integer

    Specifies the interval (seconds) for checking whether the configured alarm rules are met.

    filter

    String

    Specifies the data rollup method. The following methods are supported:

    • average: Cloud Eye calculates the average value of metric data within a rollup period.
    • max: Cloud Eye calculates the maximum value of metric data within a rollup period.
    • min: Cloud Eye calculates the minimum value of metric data within a rollup period.
    • sum: Cloud Eye calculates the sum of metric data within a rollup period.
    • variance: Cloud Eye calculates the variance value of metric data within a rollup period.

    comparison_operator

    String

    Specifies the alarm threshold operator, which can be >, =, <, , or .

    value

    Double

    Specifies the alarm threshold. Supported range: 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 in Services Interconnected with Cloud Eye to 80.

    unit

    String

    Specifies the data unit. Enter up to 32 characters.

    count

    Integer

    Specifies the number of consecutive occurrence times that the alarm policy was met. Supported range: 1 to 5

  • Example response
    {
    "metric_alarms":
      [
       {
        "alarm_name":"alarm-ipwx",
        "alarm_description":"",
        "metric":
         {
          "namespace":"SYS.ELB",
          "dimensions":
          [
           {
            "name":"lb_instance_id",
            "value":"44d06d10-bce0-4237-86b9-7b4d1e7d5621"
           }
          ],
          "metric_name":"m8_out_Bps"
          },
        "condition":
         {
          "period":300,
          "filter":"sum",
          "comparison_operator":">=",
          "value":0,
          "unit":"",
          "count":1
          },
        "alarm_enabled":true,
        "alarm_level": 2,
        "alarm_action_enabled":true,
        "alarm_actions":
         [
          {
           "type":"notification",
           "notificationList":["urn:smn:region:68438a86d98e427e907e0097b7e35d48:sd"]
          }
         ],
        "ok_actions":
         [
          {
           "type":"notification",
           "notificationList":["urn:smn:region:68438a86d98e427e907e0097b7e35d48:sd"]
          }
         ],
        "alarm_id":"al1498096535573r8DNy7Gyk",
        "update_time":1498100100000,
        "alarm_state":"alarm"
       }
      ]
    }

Returned Values

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    The authentication information is not provided or is incorrect.

    403 Forbidden

    You are forbidden to access the page requested.

    408 Request Timeout

    The request timed out.

    429 Too Many Requests

    Concurrent requests are excessive.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    503 Service Unavailable

    The service is currently unavailable.

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