All Products
Search
Document Center

ApsaraDB RDS:ModifySQLCollectorPolicy

Last Updated:Mar 13, 2024

Enables or disables the SQL Explorer (SQL Audit) feature for an instance.

Operation description

Supported database engines

  • MySQL
  • PostgreSQL
  • SQL Server

References

Note Before you call this operation, read the following documentation and make sure that you fully understand the prerequisites and impacts of this operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
rds:ModifySQLCollectorPolicyWRITE
  • DBInstance
    acs:rds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}
  • rds:ResourceTag
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID. You can call the DescribeDBInstances operation to query the instance ID.

rm-uf6wjk5xxxxxxx
SQLCollectorStatusstringYes

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

  • Enable
  • Disabled
Enable
ResourceGroupIdstringNo

The resource group ID. You can call theDescribeDBInstanceAttribute operation to query the most recent region list.

rg-acfmx**********

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

RequestIdstring

The ID of the request.

1AD222E9-E606-4A42-BF6D-8A4442913CEF

Examples

Sample success responses

JSONformat

{
  "RequestId": "1AD222E9-E606-4A42-BF6D-8A4442913CEF"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidSqlLog.MalformedThe specified parameter SqlLog is not valid.-
400InvalidConfigNameThe ConfigName is not valid.-
400InvalidConfigValueThe ConfigValue is not valid.The operation failed. The values of some parameters are invalid.
400IncorrectPerfFrequencyTypeCurrent DB instance does not support this perf frequency.-
400InvalidParameters.FormatSpecified parameter is not validThe operation failed. The values of some parameters are invalid.
400ErrorMxsServiceInsNum.ErrorThe Maxscale serviceIns num must be 1.-
400IncorrectSQLLogVersionCurrent DB instance SQL log version does not support this operation.This operation is not supported for the SQL log version of the current instance.
400IncorrectSQLLogActiveStatusCurrent DB instance SQL log active status does not support this operation.The operation failed. The RDS instance is running.
403IncorrectDBInstanceStateCurrent DB instance state does not support this operation.-
403IncorrectDBTypeThe current DB type does not support this operation.The operation failed. The operation is not supported by the database engine of the RDS instance. Specify a different database engine.
403IncorrectDBInstanceTypeCurrent DB instance type does not support this operation.The operation failed. The RDS instance is not in a ready state.
403IncorrectDBInstanceCharacterTypeCurrent DB Instance character_type does not support this operation.This operation is not supported for the character type of the current instance.
403InvalidSqlRetention.MalformedSpecified sql retention is not valid.-
404InvalidDBInstanceName.NotFoundThe database instance does not exist.The name of the RDS instance cannot be found. Check the name of the RDS instance.

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

Change history

Change timeSummary of changesOperation
2024-02-20The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404
2022-10-28The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    Added Error Codes: 400
    Added Error Codes: 404