All Products
Search
Document Center

Database Autonomy Service:GetEventSubscription

Last Updated:Mar 13, 2026

Queries the event subscription settings of a database instance.

Operation description

Before you call this operation, take note of the following items:

  • If you use an Alibaba Cloud SDK or a Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.

  • If you use an SDK to call operations of DAS, you must set the region ID to cn-shanghai.

  • The database instance that you want to manage is connected to DAS.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hdm:GetEventSubscription

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

rm-2ze8g2am97624****

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

B6D17591-B48B-4D31-9CD6-9B9796B2****

Message

string

The returned message.

Note

If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned.

Successful

Data

object

The data returned.

userId

string

The user ID.

1088760496****

instanceId

string

The instance ID.

rm-2ze8g2am97624****

eventContext

string

The supported event scenarios. Only AllContext may be returned, which indicates that all scenarios are supported.

AllContext

lang

string

The language of event notifications. Only zh-CN may be returned, which indicates that event notifications are sent in Chinese.

zh_CN

active

integer

Indicates whether the event subscription feature is enabled. Valid values:

  • 0: The event subscription feature is disabled.

  • 1: The event subscription feature is enabled.

1

minInterval

string

The minimum interval between event notifications. Unit: seconds.

60

contactName

string

The name of the subscriber who receives alert notifications. Multiple names are separated by commas (,).

默认联系人

contactGroupName

string

The name of the contact group that receives alert notifications. Multiple names are separated by commas (,).

默认联系组

channelType

string

The notification method. Valid values:

  • hdm_alarm_sms: text message.

  • dingtalk: DingTalk chatbot.

  • hdm_alarm_sms_and_email: text message and email.

  • hdm_alarm_sms,dingtalk: text message and DingTalk chatbot.

hdm_alarm_sms,dingtalk

level

string

The risk level of the events that trigger notifications. Valid values:

  • Notice

  • Optimization

  • Warn

  • Critical

Optimization

contacts

array<object>

The user ID.

object

name

string

The name of the alert contact.

张先生

phone

string

The mobile number of the alert contact.

1390000****

email

string

The email address of the alert contact.

a***@example.net

dingtalkHook

string

The webhook URL of the DingTalk chatbot.

https://oapi.dingtalk.com/robot/send?access_token=68fa29a9eaf3ba9994f54fxxxc1aa9879700308f90e9c23ebfb3663642c9****

groups

array

The contact groups to which the alert contact belongs.

string

The name of the alert contact.

张先生

isCmsReduplicated

boolean

Indicates whether the alert contact name is the same as the contact name on CloudMonitor.

  • true

  • false

true

userId

string

The user ID.

1088760496****

contactGroups

array<object>

The alert contact groups.

object

name

string

The name of the alert contact group.

张先生

description

string

The description of the alert contact group.

默认联系人

contacts

string

The members of the alert contact group.

"[\"张先生\",\"王女士\",\"李先生\"]"

userId

string

The user ID.

1088760496****

eventSendGroup

array

The supported event scenarios in which event subscription can be sent.

string

The supported event scenario in which event notifications can be sent. Only AllContext may be returned, which indicates that all scenarios are supported.

AllContext

id

integer

The primary key ID of the database.

1

gmtCreate

integer

The time when event subscription was enabled. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1633071840000

gmtModified

integer

The time when the event subscription settings were most recently modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1633071850000

Code

string

The HTTP status code returned.

200

Success

string

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Examples

Success response

JSON format

{
  "RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
  "Message": "Successful",
  "Data": {
    "userId": "1088760496****",
    "instanceId": "rm-2ze8g2am97624****",
    "eventContext": "AllContext",
    "lang": "zh_CN",
    "active": 1,
    "minInterval": "60",
    "contactName": "默认联系人",
    "contactGroupName": "默认联系组",
    "channelType": "hdm_alarm_sms,dingtalk",
    "level": "Optimization",
    "contacts": [
      {
        "name": "张先生",
        "phone": "1390000****",
        "email": "a***@example.net",
        "dingtalkHook": "https://oapi.dingtalk.com/robot/send?access_token=68fa29a9eaf3ba9994f54fxxxc1aa9879700308f90e9c23ebfb3663642c9****",
        "groups": [
          "张先生"
        ],
        "isCmsReduplicated": true,
        "userId": "1088760496****"
      }
    ],
    "contactGroups": [
      {
        "name": "张先生",
        "description": "默认联系人",
        "contacts": "\"[\\\"张先生\\\",\\\"王女士\\\",\\\"李先生\\\"]\"",
        "userId": "1088760496****"
      }
    ],
    "eventSendGroup": [
      "AllContext"
    ],
    "id": 1,
    "gmtCreate": 1633071840000,
    "gmtModified": 1633071850000
  },
  "Code": "200",
  "Success": "true"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid.
403 NoPermission You are not authorized to do this action.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.