Enables or configures DAS Enterprise Edition for a database instance.
Operation description
To use this operation, the following prerequisites must be met:
Use the latest version of the Alibaba Cloud or DAS SDK.
When calling the DAS service by using the SDK, set the region to cn-shanghai.
By default, this operation enables the latest supported version. For the databases and regions supported by each DAS Enterprise Edition version, see DAS editions and supported features.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:ModifySqlLogConfig |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the database instance. |
rr-2ze770smbq3tp**** |
| Enable |
boolean |
No |
Specifies whether to enable DAS Enterprise Edition. Valid values:
Note
This parameter is required when you enable DAS Enterprise Edition. By default, the latest supported version is enabled. |
true |
| RequestEnable |
boolean |
No |
Specifies whether to enable SQL Explorer. Valid values:
Note
This parameter is required only when you enable DAS Enterprise Edition V3. |
true |
| Retention |
integer |
No |
The total data storage duration. Unit: days. Valid values:
Note
When you enable DAS Enterprise Edition V3, the value of this parameter must be greater than or equal to 30. |
30 |
| HotRetention |
integer |
No |
The hot data storage duration. Unit: days. The value is an integer in the range of [1, 7]. Note
This parameter is required only when you enable DAS Enterprise Edition V3. |
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 |
| EnableAudit |
boolean |
No |
Specifies whether to enable security auditing. |
true |
DAS Enterprise Edition has four versions: V0, V1, V2, and V3. By default, the latest supported version is enabled.
For database instances that only support DAS Enterprise Edition V0, you only need to specify the Enable and Retention parameters.
For database instances that support DAS Enterprise Edition V1, you only need to specify the Enable and Retention parameters. The system automatically enables the SQL Explorer feature (that is, the default configurations set RequestEnable to true).
For database instances that support DAS Enterprise Edition V2, you only need to specify the Enable and Retention parameters. The system automatically enables the SQL Explorer feature (that is, the default configurations set RequestEnable to true), sets the hot storage duration (HotRetention) to 7 days, and sets the cold storage duration to
Retention - 7days.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The returned status code. |
200 |
| Message |
string |
The returned message. Note
If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned. |
Successful |
| RequestId |
string |
The ID of the request. |
03C88D8E-1541-518E-8BFF-BEC6589B6334 |
| Success |
string |
Indicates whether the request was successful. Valid values:
|
false |
| Data |
object |
The returned data. |
|
| SqlLogVisibleTime |
integer |
The time when DAS Enterprise Edition was enabled. The time is in the UNIX timestamp format. Unit: milliseconds. |
1683712800000 |
| RequestStopTime |
integer |
The expiration time of DAS Enterprise Edition V1. The time is in the UNIX timestamp format. Unit: milliseconds. |
1715335200000 |
| CollectorVersion |
string |
The collector version. Valid values:
|
MYSQL_V3 |
| SupportVersion |
string |
The latest supported DAS Enterprise Edition version. Valid values:
|
SQL_LOG_V3 |
| ColdRetention |
integer |
The cold data storage duration. Unit: days. The value is calculated by using the formula: |
23 |
| SqlLogEnable |
boolean |
Indicates whether DAS Enterprise Edition is enabled. Valid values:
|
true |
| Retention |
integer |
The total data storage duration. Unit: days. |
30 |
| HotRetention |
integer |
The hot data storage duration. Unit: days. |
7 |
| RequestEnable |
boolean |
Indicates whether SQL Explorer is enabled. Valid values:
|
false |
| Version |
string |
The enabled DAS Enterprise Edition version. Valid values:
|
SQL_LOG_V3 |
| RequestStartTime |
integer |
The time when SQL Explorer was enabled. The time is in the UNIX timestamp format. Unit: milliseconds. |
1683712800000 |
| HotEnable |
boolean |
Indicates whether hot data storage is enabled. Valid values:
|
true |
| HotStartTime |
integer |
The start time of hot data storage. The time is in the UNIX timestamp format. Unit: milliseconds. |
1683712800000 |
| ColdEnable |
boolean |
Indicates whether cold data storage is enabled. Valid values:
|
true |
| ColdStartTime |
integer |
The start time of cold data storage. The time is in the UNIX timestamp format. Unit: milliseconds. |
1683712800000 |
| SqlLogState |
string |
The data migration status. Valid values:
|
FINISH |
| LogFilter |
string |
A reserved parameter. |
None |
| SqlLogSource |
string |
The source of the enabled audit logs. |
DSC:DAS_SIDE |
Examples
Success response
JSON format
{
"Code": "200",
"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",
"SqlLogSource": "DSC:DAS_SIDE"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | The request parameters are invalid. |
| 403 | NoPermission | You are not authorized to do this action. | You do not have the permission to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.