All Products
Search
Document Center

ApsaraDB RDS:ModifySQLCollectorPolicy

Last Updated:May 16, 2023

You can call the ModifySQLCollectorPolicy operation to enable or disable the SQL Explorer (SQL Audit) feature for an instance.

Operation Description

Before you call this operation, make sure that the instance runs one of the following database engines:

  • MySQL
  • SQL Server
  • PostgreSQL
NoteIf you call this operation by using the credentials of a RAM user, the RAM user must have the read and write permissions such as AliyunRDSFullAccess on the instance. If the RAM user does not have the read and write permissions on the instance, the system displays a message stating that you do not have the permissions to call this operation. For more information about how to grant permissions to a RAM user, see Use RAM to manage ApsaraDB RDS permissions.

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

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

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

rm-uf6wjk5xxxxxxx
SQLCollectorStatusstringYes

Specifies whether to enable or disable the SQL Explorer (SQL Audit) feature. Valid values: Enable and Disabled.

Enable
ResourceGroupIdstringNo

The ID of the resource group. For more information, see View basic information of a resource group.

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

Response parameters

ParameterTypeDescriptionExample
object
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
2022-10-28The error codes of the API operation change.
Change itemChange content
Error CodesThe error codes of the API operation change.
    Error Codes 403 change
    Added Error Codes: 400
    Added Error Codes: 404