Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Cloud Data Center
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
Domain Name Service
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
Cloud Transformation
Cloud Adoption Framework
Well-Architected 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
CloudDevice
KooDrive
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
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
Meeting
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
Industry Video Management Service
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

Querying a Keyword Alarm Rule

Function

This API is used to query a keyword alarm.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/lts/alarms/keywords-alarm-rule

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. It can be obtained by calling an API or from the console. For details, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token obtained from IAM. For details about how to obtain it, see Obtaining a User Token.

Constraints

N/A

Range

N/A

Default Value

N/A

Content-Type

Yes

String

Definition

Message body format. Set this parameter to application/json;charset=utf8.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

keywords_alarm_rules

Array of KeywordsAlarmRuleRespList objects

Definition

Keyword alarm rule ID.

Table 4 KeywordsAlarmRuleRespList

Parameter

Type

Description

projectId

String

Definition

Project ID.

Range

N/A

keywords_alarm_rule_id

String

Definition

Keyword alarm rule ID.

Range

N/A

keywords_alarm_rule_name

String

Definition

Keyword alarm rule name.

Range

N/A

keywords_alarm_rule_description

String

Definition

Brief description of a keyword alarm rule.

Range

N/A

condition_expression

String

Definition

Alarm condition expression.

Range

N/A

keywords_requests

Array of KeywordsRequestResponse objects

Definition

Keyword alarm rule information.

frequency

FrequencyRespBody object

Definition

Keyword alarm query frequency.

Constraints

N/A

keywords_alarm_level

String

Definition

Keyword alarm severity.

Range

  • Info

  • Minor

  • Major

  • Critical

domain_id

String

Definition

Account ID. For details about how to obtain it, see Obtaining an Account ID.

Range

N/A

create_time

Long

Definition

Creation time (timestamp in milliseconds).

Range

N/A

update_time

Long

Definition

Update time (timestamp in milliseconds).

Range

N/A

status

String

Definition

Keyword alarm status.

Range

  • RUNNING (enabled)

  • STOPPING (disabled)

trigger_condition_count

Integer

Definition

Alarm triggering condition: number of times the condition is met.

Range

N/A

trigger_condition_frequency

Integer

Definition

Alarm triggering condition: number of queries.

Range

N/A

whether_recovery_policy

Boolean

Definition

Whether to configure an alarm restoration policy.

Range

  • true: configures an alarm restoration policy.

  • false: does not configure an alarm restoration policy.

recovery_policy

Integer

Definition

Number of consecutive queries in which the alarm's trigger condition must not be met.

Range

  • Minimum value: 1

  • Maximum value: 10

notification_frequency

Integer

Definition

Keyword alarm notification frequency, in minutes.

Range

0, 5, 10, 15, 30, 60, 180, or 360

alarm_action_rule_name

String

Definition

Alarm action rule name.

Range

N/A

tags

Array of tagsResBody objects

Definition

Alarm tag information. A tag is a key-value pair. Each key is paired with its corresponding value.

Table 5 KeywordsRequestResponse

Parameter

Type

Description

log_stream_id

String

Definition

Log stream ID. For details about how to obtain it, see Obtaining Log Group and Log Stream IDs.

Range

N/A

log_stream_name

String

Definition

Log stream name.

Range

N/A

log_group_id

String

Definition

Log stream ID.

Range

N/A

log_group_name

String

Definition

Log group name.

Range

N/A

keywords

String

Definition

Keyword that can be found in logs.

Range

N/A

condition

String

Definition

Alarm query condition.

Range

<, - >, <=, >=

number

Integer

Definition

Number of matched alarms.

Range

N/A

search_time_range

Integer

Definition

Time range for querying the latest data when an alarm task is executed.

Range

  • Minimum value: 1

  • Maximum value: 60

search_time_range_unit

String

Definition

Unit of the alarm query time range.

Range

  • minute

  • hour

Table 6 FrequencyRespBody

Parameter

Type

Description

type

String

Definition

Query frequency type of alarms.

Range

  • CRON: cron expression

  • HOURLY: every hour

  • DAILY: every day

  • WEEKLY: every week

  • FIXED_RATE: fixed interval

cron_expr

String

Definition

Cron expression. This parameter is returned when type is set to CRON. Cron expressions use the 24-hour format and are precise down to the minute.

Range

N/A

hour_of_day

Integer

Definition

Every hour of every day. This parameter is returned when type is set to DAILY or HOURLY.

Range

N/A

day_of_week

Integer

Definition

Weekly. This parameter is returned when type is set to WEEKLY.

Range

N/A

fixed_rate

Integer

Definition

Fixed interval. This parameter is returned when type is set to FIXED_RATE.

Range

N/A

fixed_rate_unit

String

Definition

Unit of the fixed interval.

Range

  • minute

  • hour

Table 7 tagsResBody

Parameter

Type

Description

key

String

Definition

Tag key.

Range

N/A

value

String

Definition

Tag value.

Range

N/A

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code. For details, see Error Codes.

Range

N/A

error_msg

String

Definition

Error message.

Range

N/A

Example Requests

Query a keyword alarm rule.

GET https://{endpoint}/v2/{project_id}/lts/alarms/keywords-alarm-rule

/v2/{project_id}/lts/alarms/keywords-alarm-rule

Example Responses

Status code: 200

The request is successful.

{
  "keywords_alarm_rules" : [ {
    "projectId" : "string",
    "keywords_alarm_rule_id" : "string",
    "keywords_alarm_rule_name" : "string",
    "keywords_alarm_rule_description" : "string",
    "condition_expression" : "string",
    "keywords_requests" : [ {
      "log_stream_id" : "string",
      "log_stream_name" : "string",
      "log_group_id" : "string",
      "log_group_name" : "string",
      "keywords" : "string",
      "condition" : ">=",
      "number" : 1,
      "search_time_range" : 0,
      "search_time_range_unit" : "minute"
    } ],
    "frequency" : {
      "type" : "CRON",
      "cron_expr" : "string",
      "hour_of_day" : 0,
      "day_of_week" : 0,
      "fixed_rate" : 0,
      "fixed_rate_unit" : "minute"
    },
    "keywords_alarm_level" : "Info",
    "domain_id" : "string",
    "create_time" : 0,
    "update_time" : 0,
    "status" : "RUNNING",
    "trigger_condition_count" : "1",
    "trigger_condition_frequency" : "1",
    "whether_recovery_policy" : false,
    "recovery_policy" : "3",
    "notification_frequency" : 5,
    "alarm_action_rule_name" : ""
  } ]
}

Status code: 500

The server has received the request but encountered an internal error.

{
  "error_code" : "LTS.2008",
  "error_msg" : "Find Alarm rule failed."
}

Status Codes

Status Code

Description

200

The request is successful.

500

The server has received the request but encountered an internal 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
咨询盘古Doer

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback