You can call this operation to enable or disable the SQL audit feature of an instance.

This operation is applicable to the following database engine versions:

  • MySQL 5.5
  • MySQL 5.6
  • MySQL 5.7 High-availability Edition (based on local SSDs)
  • SQL Server 2008 R2
  • PostgreSQL
  • PPAS

Debugging

You can use OpenAPI Explorer to perform debugging.

OpenAPI Explorer provides various functions to simplify API usage. For example, you can retrieve APIs, call APIs, and generate SDK sample code.

Request parameters

Parameter Type Required? Example Description
Action String Yes ModifySQLCollectorPolicy

The operation that you want to perform. Set this parameter to ModifySQLCollectorPolicy.

DBInstanceId String Yes rm-uf6wjk5xxxxxxx

The ID of the instance.

SQLCollectorStatus String Yes Enable

Indicates whether to enable or disable the SQL audit feature. Valid values: Enable | Disable.

AccessKeyId String No LTAIfCxxxxxxx

The AccessKey ID issued by Alibaba Cloud for users to access services.

Response parameters

Parameter Type Example Description
RequestId String 1AD222E9-E606-4A42-BF6D-8A4442913CEF

The ID of the request.

Examples

Request example


http(s)://rds.aliyuncs.com/?Action=ModifySQLCollectorPolicy
&DBInstanceId=rm-uf6wjk5xxxxxxx
&SQLCollectorStatus=Enable 
&<Common request parameters>

Normal response example

XML format

<ModifySQLCollectorPolicyResponse>
	  <requestId>C3565F9F-76E9-4F7E-A662-D1B2488EC2FC</requestId>
	  <sQLCollectorStatus>Enable</sQLCollectorStatus></ModifySQLCollectorPolicyResponse>

JSON format

{
	"requestId":"C3565F9F-76E9-4F7E-A662-D1B2488EC2FC",
	"sQLCollectorStatus":"Enable"
}

Error codes

For a list of error codes, visit the API Error Center.