Help Center/ Cloud Application Engine/ API Reference/ CAE API/ Event notification rule./ Querying the Event Notification Rule List
Updated on 2025-10-22 GMT+08:00

Querying the Event Notification Rule List

Function

Query the event notification rule list.

URI

GET /v1/{project_id}/cae/notice-rules

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. See Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

  • Obtain the token. For details, see "Obtaining a User Token" in Identity and Access Management API Reference (https://support.huaweicloud.com/intl/en-us/api-iam/iam_30_0001.html).

  • The value of X-Subject-Token in the response header is the token value.

X-Enterprise-Project-ID

No

String

Enterprise project ID.

  • When an environment is created, it will be bound with an enterprise project ID.

  • Enter 0 or up to 36 characters in UUID format with hyphens (-).

  • If this parameter is not specified or set to 0, resources in the default enterprise project are queried.

NOTE:
For details about how to obtain enterprise project IDs and enterprise project features, see Enterprise Management User Guide.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

api_version

String

API version. Fixed value: v1.

kind

String

API type. Fixed value: NoticeRule.

items

Array of CreateNoticeRuleRespItem objects

Request data.

Table 4 CreateNoticeRuleRespItem

Parameter

Type

Description

id

String

Unique ID of a notification rule.

name

String

Notification name.

event_name

String

Name of the triggered event.

scope

NoticeRuleScope object

Scope of the notification rule that takes effect.

trigger_policy

TriggerPolicy object

Trigger policy.

notification

NoticeRuleNotification object

Notification mechanism.

enable

Boolean

Enable or not.

Table 5 NoticeRuleScope

Parameter

Type

Description

type

String

Type of the effective scope. including environments (for all components in a specified environment), applications (for all components of a specified application), and components (for specified components).

environments

Array of strings

List of valid environment IDs.

applications

Array of strings

List of valid application IDs.

components

Array of strings

List of valid component IDs.

Table 6 TriggerPolicy

Parameter

Type

Description

trigger_type

String

Trigger type. Options: accumulative or immediately.

period

Integer

Trigger period. This parameter needs to be set when accumulative is selected. The default unit is second. The value can be 5 minutes, 20 minutes, 1 hour, 4 hours, or 24 hours.

operator

String

Comparison operator. The value can be > or >=.

count

Integer

Number of trigger times. This parameter needs to be set when accumulative is selected.

Table 7 NoticeRuleNotification

Parameter

Type

Description

protocol

String

Definition

Notification protocol type.

Constraints

N/A.

Range

  • email

  • sms

  • wechat

  • dingding

Default Value

N/A.

extension

extension object

endpoint

String

Notification endpoint address.

For an email protocol, the endpoint must be an email address.

For an SMS protocol, the endpoint must be a phone number.

For the WeChat protocol and DingTalk chatbot, see Obtaining Subscription Endpoints.

WeCom and DingTalk chatbot are in OBT of SMN. Submit a service ticket to enable them.

template

String

Notification template language. Options:

ZH

EN

Table 8 extension

Parameter

Type

Description

sign_secret

String

In the DingTalk scenario, you can enter the key field.

Example Requests

None

Example Responses

Status code: 200

OK

{
  "api_version": "v1",
  "kind": "NoticeRule",
  "items": [
    {
      "id": "133da017-423c-4e1c-80be-8c8c71c9b84e",
      "name": "test",
      "event_name": "Started",
      "scope": {
        "type": "environments",
        "environments": [
          "f3c12180-b34a-42d8-bb5a-12ba0a6b579e"
        ]
      },
      "trigger_policy": {
        "trigger_type": "immediately"
      },
      "notification": {
        "protocol": "email",
        "endpoint": "123@example.com"
        "template": "ZH"
      },
      "enable": true
    }
  ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.