All Products
Search
Document Center

Database Autonomy Service:ModifySqlLogConfig

最終更新日:Dec 23, 2024

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
hdm:ModifySqlLogConfigupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the database instance.

rr-2ze770smbq3tpr2o9
EnablebooleanNo

Specifies whether to enable DAS Enterprise Edition. Valid values:

  • true
  • false
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
RequestEnablebooleanNo

Specifies whether to enable the SQL Explorer feature. Valid values:

  • true
  • false
Note This parameter is required if only DAS Enterprise Edition V3 can be enabled for the database instance.
true
RetentionintegerNo

The total storage duration of the SQL Explorer and Audit data. Unit: day. Valid values:

  • 7
  • 30
  • 180
  • 365
Note If you want to enable DAS Enterprise Edition V3, the value of this parameter must be greater than or equal to 30.
30
HotRetentionintegerNo

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
Filtersarray<object>No

A reserved parameter.

objectNo

A reserved parameter.

KeystringNo

A reserved parameter.

None
ValuestringNo

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

ParameterTypeDescriptionExample
object
Codestring

The response code.

403
Messagestring

The returned message.

Note If the request was successful, Successful is returned. If the request failed, an error message is returned.
Successful
RequestIdstring

The request ID.

03C88D8E-1541-518E-8BFF-BEC6589B6334
Successstring

Indicates whether the request was successful. Valid values:

  • true
  • false
False
Dataobject

The data returned.

SqlLogVisibleTimelong

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

1683712800000
RequestStopTimelong

The time when DAS Enterprise Edition V1 expired. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1715335200000
CollectorVersionstring

The collector version. Valid values:

  • MYSQL_V0
  • MYSQL_V1
  • MYSQL_V2
  • MYSQL_V3
  • PG_V1
  • rdspg_v1
  • polarpg_v1
MYSQL_V3
SupportVersionstring

The latest version of DAS Enterprise Edition that supports the database instance. Valid values:

  • SQL_LOG_V0: DAS Enterprise Edition V0.
  • SQL_LOG_V1: DAS Enterprise Edition V1.
  • SQL_LOG_V2: DAS Enterprise Edition V2.
  • SQL_LOG_V3: DAS Enterprise Edition V3.
  • SQL_LOG_NOT_ENABLE: DAS Enterprise Edition is not enabled.
  • SQL_LOG_NOT_SUPPORT: DAS Enterprise Edition is not supported.
SQL_LOG_V3
ColdRetentioninteger

The number of days for which the SQL Explorer and Audit data is stored in cold storage. The value is calculated by using the following formula: Value of ColdRetention = Value of Retention - Value of HotRetention.``

23
SqlLogEnableboolean

Indicates whether DAS Enterprise Edition is enabled. Valid values:

  • true
  • false
true
Retentioninteger

The total storage duration of the SQL Explorer and Audit data. Unit: day.

30
HotRetentioninteger

The number of days for which the SQL Explorer and Audit data is stored in hot storage.

7
RequestEnableboolean

Indicates whether the SQL Explorer feature is enabled. Valid values:

  • true
  • false
false
Versionstring

The version of DAS Enterprise Edition that is enabled for the database instance. Valid values:

  • SQL_LOG_V0: DAS Enterprise Edition V0.
  • SQL_LOG_V1: DAS Enterprise Edition V1.
  • SQL_LOG_V2: DAS Enterprise Edition V2.
  • SQL_LOG_V3: DAS Enterprise Edition V3.
  • SQL_LOG_NOT_ENABLE: DAS Enterprise Edition is not enabled.
  • SQL_LOG_NOT_SUPPORT: DAS Enterprise Edition is not supported.
SQL_LOG_V3
RequestStartTimelong

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

1683712800000
HotEnableboolean

Indicates whether the hot data storage is enabled. Valid values:

  • true
  • false
true
HotStartTimelong

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

1683712800000
ColdEnableboolean

Indicates whether the cold data storage is enabled. Valid values:

  • true
  • false
true
ColdStartTimelong

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

1683712800000
SqlLogStatestring

The state of data migration. Valid values:

  • FINISH: The historical data is migrated.
  • RUNNING: The historical data is being migrated.
  • FAILURE: The historical data fails to be migrated.
FINISH
LogFilterstring

A reserved parameter.

None

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400InvalidParamsThe request parameters are invalid.
403NoPermissionYou are not authorized to do this action.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-22The Error code has changedView Change Details