Enables or configures Database Autonomy Service (DAS) Enterprise Edition for 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 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.
- By default, the latest version of DAS Enterprise Edition that supports the database instance is enabled. For information about the databases and regions that are supported by different versions of DAS Enterprise Edition, see Editions and supported features.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
hdm:ModifySqlLogConfig | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the database instance. | rr-2ze770smbq3tpr2o9 |
Enable | boolean | No | Specifies whether to enable DAS Enterprise Edition. Valid values:
Note
This parameter is required if you want to enable DAS Enterprise Edition. By default, the latest version of DAS Enterprise Edition that supports the database instance is enabled.
| true |
RequestEnable | boolean | No | Specifies whether to enable the SQL Explorer feature. Valid values:
Note
This parameter is required if only DAS Enterprise Edition V3 can be enabled for the database instance.
| true |
Retention | integer | No | The total storage duration of the SQL Explorer and Audit data. Unit: day. Valid values:
Note
If you want to enable DAS Enterprise Edition V3, the value of this parameter must be greater than or equal to 30.
| 30 |
HotRetention | integer | No | The number of days for which the SQL Explorer and Audit data is stored in hot storage. Valid values: 1 to 7. Note
This parameter is required if only DAS Enterprise Edition V3 can be enabled for the database instance.
| 1 |
Filters | array<object> | No | A reserved parameter. | |
object | No | A reserved parameter. | ||
Key | string | No | A reserved parameter. | None |
Value | string | No | A reserved parameter. | None |
DAS Enterprise Edition has the following versions: DAS Enterprise Edition V0, DAS Enterprise Edition V1, DAS Enterprise Edition V2, and DAS Enterprise Edition V3. By default, the latest version of DAS Enterprise Edition that supports the database instance is activated.
- For a database instance for which DAS Enterprise Edition V0 is activated, you need to specify only Enable and Retention.
- For a database instance for which DAS Enterprise Edition V1 is activated, you need to specify only Enable and Retention. DAS automatically enables the SQL Explorer feature for the database instance. The default value of RequestEnable is true.
- For a database instance for which DAS Enterprise Edition V2 is activated, you need to specify only Enable and Retention. DAS automatically enables the SQL Explorer feature for the database instance. The default value of RequestEnable is true. The value of HotRetention is fixed to 7, which specifies that the retention period for data in the hot storage is seven days. The default value of
Retention
is 7, which specifies that the retention period for data in the cold storage is seven days.
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "403",
"Message": "Successful",
"RequestId": "03C88D8E-1541-518E-8BFF-BEC6589B6334",
"Success": "False",
"Data": {
"SqlLogVisibleTime": 1683712800000,
"RequestStopTime": 1715335200000,
"CollectorVersion": "MYSQL_V3",
"SupportVersion": "SQL_LOG_V3",
"ColdRetention": 23,
"SqlLogEnable": true,
"Retention": 30,
"HotRetention": 7,
"RequestEnable": false,
"Version": "SQL_LOG_V3",
"RequestStartTime": 1683712800000,
"HotEnable": true,
"HotStartTime": 1683712800000,
"ColdEnable": true,
"ColdStartTime": 1683712800000,
"SqlLogState": "FINISH",
"LogFilter": "None"
}
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidParams | The request parameters are invalid. |
403 | NoPermission | You are not authorized to do this action. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-05-22 | The Error code has changed | View Change Details |