You can call the ModifySQLCollectorRetention operation to modify the log backup retention period that is allowed by the SQL Explorer feature on an instance.

The SQL Explorer feature is enabled for the instance.

The instance runs MySQL. For more information, see Use the SQL Explorer and Audit feature on an ApsaraDB RDS for MySQL instance.

Note After you shorten the log backup retention period, log backup files that are stored longer than the specified log backup retention period are immediately deleted.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifySQLCollectorRetention

The operation that you want to perform. Set the value to ModifySQLCollectorRetention.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of instance.

ConfigValue String Yes 365

The log backup retention period that is allowed by the SQL Explorer feature on the instance. Valid values:

  • 30: 30 days
  • 180: 180 days
  • 365: one year
  • 1095: three years
  • 1825: five years
ResourceGroupId String No rg-acfmyxxxx

The ID of the resource group.

Response parameters

Parameter Type Example Description
RequestId String 21383BB3-3845-4628-B422-B4FB5C83DEBD

The ID of the request.

Examples

Sample requests

http(s)://rds.aliyuncs.com/?Action=ModifySQLCollectorRetention
&DBInstanceId=rm-uf6wjk5xxxxxxx
&ConfigValue=365
&ResourceGroupId=rg-acfmyxxxx
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifySQLCollectorRetentionResponse>
    <RequestId>21383BB3-3845-4628-B422-B4FB5C83DEBD</RequestId>
</ModifySQLCollectorRetentionResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "21383BB3-3845-4628-B422-B4FB5C83DEBD"
}

Error codes

HttpCode Error code Error message Description
400 InvalidConfigValue The ConfigValue is not valid. The error message returned because the specified parameter configuration is invalid.
400 IncorrectSQLLogActiveStatus Current DB instance SQL log active status does not support this operation. The error message returned because this operation is not supported when the SQL Explorer feature is disabled.
400 InvalidSqlRetention.Malformed Specified sql retention is not valid. The error message returned because the specified log retention period is invalid.
400 IncorrectSQLLogVersion Current DB instance SQL log version does not support this operation. The error message returned because this operation is not supported for the SQL Explorer version of the current instance.

For a list of error codes, see Service error codes.