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
Test
RAM authorization
|
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:
|
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,dingtalk |
| level |
string |
The risk level of the events that trigger notifications. Valid values:
|
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**** |
|
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 |
| 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 |
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.