All Products
Search
Document Center

Database Autonomy Service:GetEventSubscription

Last Updated:Jun 10, 2026

Mengkueri pengaturan langganan event dari Instansiasi basis data.

Deskripsi operasi

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.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

hdm:GetEventSubscription

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID instans.

rm-2ze8g2am97624****

Elemen respons

Element

Type

Description

Example

object

The response parameters.

RequestId

string

The request ID.

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

Message

string

The returned message.

Catatan

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

Contoh

Respons sukses

JSONformat

{
  "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"
}

Kode kesalahan

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.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.