You can call this operation to query whether the log audit function is enabled for a MongoDB instance.

The instance must be in the running state when you call this operation.

Note This operation is applicable to replica set instances and sharded cluster instances. DescribeAuditPolicy cannot be performed on standalone instances.

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
DBInstanceId String Yes dds-bpxxxxxxxx

The ID of the instance.

Action String No DescribeAuditPolicy

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

RegionId String No cn-hangzhou

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

AccessKeyId String No LTAIgbTGpxxxxxx

The AccessKey ID that Alibaba Cloud provides for you to access services.

Response parameters

Prameter Type Sample response Description
LogAuditStatus String Enable

The status of the log audit function. Valid values:

  • Enable
  • Disabled

Default value: Disabled.

RequestId String 111E7B16-0A87-4CBA-B271-F34AD61E099F

The ID of the request.

Examples

Sample requests


http(s)://mongodb.aliyuncs.com/? Action=DescribeAuditPolicy
&DBInstanceId=dds-bpxxxxxxxx
&<Common request parameters>

Sample success response

XML format

<DescribeAuditPolicyResponse>
	  <LogAuditStatus>Enable</LogAuditStatus>
	  <RequestId>111E7B16-0A87-4CBA-B271-F34AD61E099F</RequestId>
</DescribeAuditPolicyResponse>

JSON format

{
	"LogAuditStatus":"Enable",
	"RequestId":"111E7B16-0A87-4CBA-B271-F34AD61E099F"
}

Error codes.

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