调用ModifySQLCollectorRetention接口修改RDS实例的SQL洞察日志保存时长。

实例需要已开启SQL洞察。

当前仅RDS MySQL支持SQL洞察,详情请参见SQL洞察

说明 减少保存时长,会立刻将超过保存时长的日志删除。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求参数

名称 类型 是否必选 示例值 描述
Action String ModifySQLCollectorRetention

系统规定参数。取值:ModifySQLCollectorRetention

DBInstanceId String rm-uf6wjk5xxxxxxx

实例ID。

ConfigValue String 365

SQL洞察日志保存时长,取值:

  • 30:30天
  • 180:180天
  • 365:1年
  • 1095:3年
  • 1825:5年
ResourceGroupId String rg-acfmyxxxx

资源组ID。

返回数据

名称 类型 示例值 描述
RequestId String 21383BB3-3845-4628-B422-B4FB5C83DEBD

请求ID。

示例

请求示例

http(s)://rds.aliyuncs.com/?Action=ModifySQLCollectorRetention
&DBInstanceId=rm-uf6wjk5xxxxxxx
&ConfigValue=365
&ResourceGroupId=rg-acfmyxxxx
&公共请求参数

正常返回示例

XML格式

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

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

JSON格式

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

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

错误码

HttpCode 错误码 错误信息 描述
400 InvalidConfigValue The ConfigValue is not valid. 操作失败,指定的参数配置无效。
400 IncorrectSQLLogActiveStatus Current DB instance SQL log active status does not support this operation. 操作失败,运行状态下不支持该操作。
400 InvalidSqlRetention.Malformed Specified sql retention is not valid. 指定的sql保留无效。
400 IncorrectSQLLogVersion Current DB instance SQL log version does not support this operation. 操作失败,当前数据库实例sql log版本状态不允许此操作。

访问错误中心查看更多错误码。