Queries the audit log configurations of an ApsaraDB for Redis instance. The configurations include whether the audit log feature is enabled and the retention period of audit logs.

Note You can call the ModifyAuditLogConfig operation to enable or disable the audit log feature for an ApsaraDB for Redis instance. For more information, see Enable the new audit log feature.

Before you call this API operation, make sure that the ApsaraDB for Redis instance meets the following requirements:

  • The instance is an instance of the ApsaraDB for Redis Community Edition or a performance-enhanced instance of the ApsaraDB for Redis Enhanced Edition (Tair). For more information, see Performance-enhanced instances.

  • The engine version of the instance is Redis 4.0 or later, and the latest minor version is used. You can call the DescribeEngineVersion operation to check whether the instance uses the latest major version and minor version.
  • The audit log feature is enabled for the instance. For more information, see ModifyAuditLogConfig.

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 DescribeAuditLogConfig

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

RegionId String Yes cn-hanghzou

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

InstanceId String Yes r-bp1zxszhcgatnx****

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

Response parameters

Parameter Type Example Description
Retention String 5

The retention period of audit logs. Unit: day.

RequestId String 2BE6E619-A657-42E3-AD2D-18F8428A****

The ID of the request.

DbAudit String true

Indicates whether the audit log feature is enabled. Valid values:

  • true: The audit log feature is enabled.
  • false: The audit log feature is disabled.
Note You can call the ModifyAuditLogConfig operation to enable or disable the audit log feature for an ApsaraDB for Redis instance.

Examples

Sample requests

http(s)://r-kvstore.aliyuncs.com/?Action=DescribeAuditLogConfig
&InstanceId=r-bp1zxszhcgatnx****
&RegionId=cn-hanghzou
&<Common request parameters>

Sample success responses

XML format

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

<DescribeAuditLogConfigResponse>
    <DbAudit>true</DbAudit>
    <RequestId>2BE6E619-A657-42E3-AD2D-18F8428A****</RequestId>
    <Retention>5</Retention>
</DescribeAuditLogConfigResponse>

JSON format

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

{
  "DbAudit" : true,
  "RequestId" : "2BE6E619-A657-42E3-AD2D-18F8428A****",
  "Retention" : "5"
}

Error codes

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