Queries the number of audit logs.

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 DescribeSQLLogCount

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

DBInstanceId String Yes gp-xxxxxxxx

The ID of the instance.

Note You can call the DescribeDBInstances operation to query details of all AnalyticDB for PostgreSQL instances in a specific region, including instance IDs.
QueryKeywords String No test

The keywords used to query.

StartTime String Yes 2020-12-12T11:22Z

The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

Database String No testdb

The name of the database.

User String No adbpgadmin

The username that is used to log on to the database.

EndTime String Yes 2020-12-14T11:22Z

The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time must be in UTC.

Note The end time must be later than the start time. Their interval cannot be more than seven days.
ExecuteCost String No 100

The execution duration of the query. Unit: seconds.

SourceIP String No 10.**.**.13

The source IP address.

ExecuteState String No success

The execution state of the query. Valid values:

  • success
  • fail
OperationClass String No DQL

The type of the query language. Valid values:

  • DQL
  • DML
  • DDL
  • DCL
  • TCL
OperationType String No SELECT

The type of the SQL statement.

Note
  • If the OperationClass parameter is specified, the OperationType value must belong to the corresponding query language. For example, if the OperationClass value is DQL, the OperationType value must be a DQL SQL statement such as SELECT.
  • If the OperationClass parameter is not specified, the OperationType value can be an SQL statement of all query languages.
  • If neither of the OperationClass and OperationType parameters is specified, all types of SQL statements are returned.
MaxExecuteCost String No 1000

The maximum amount of time consumed by a slow query. Minimum value: 0. Unit: seconds.

MinExecuteCost String No 10

The minimum amount of time consumed by a slow query. Minimum value: 0. Unit: seconds.

Response parameters

Parameter Type Example Description
EndTime String 2020-12-14T11:22Z

The end time of the query.

RequestId String 7565770E-7C45-462D-BA4A-8A**********

The ID of the request.

StartTime String 2020-12-12T11:22Z

The start time of the query.

DBClusterId String gp-xxxxxxxx

The ID of the instance.

Items Array of Item

Details of the audit logs of the instance.

Series Array of SeriesItem

Details of the audit logs.

Values Array of ValueItem

Details of the audit logs.

Point Array of String 2020-12-14T11:00:00Z,100

The time when the audit logs were generated and the number of the audit logs.

Name String gp-xxxxxxxx

The name of the instance.

Examples

Sample requests

http(s)://gpdb.aliyuncs.com/?Action=DescribeSQLLogCount
&DBInstanceId=gp-xxxxxxxx
&StartTime=2020-12-12T11:22Z
&EndTime=2020-12-14T11:22Z
&<Common request parameters>

Sample success responses

XML format

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

<DescribeSQLLogCountResponse>
    <EndTime>2020-12-14T11:22Z</EndTime>
    <RequestId>7565770E-7C45-462D-BA4A-8A**********</RequestId>
    <StartTime>2020-12-12T11:22Z</StartTime>
    <DBClusterId>gp-xxxxxxxx</DBClusterId>
    <Items>
        <Series>
            <Values>
                <Point>2020-12-14T11:00:00Z,100</Point>
            </Values>
        </Series>
        <Name>gp-xxxxxxxx</Name>
    </Items>
</DescribeSQLLogCountResponse>

JSON format

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

{
  "EndTime" : "2020-12-14T11:22Z",
  "RequestId" : "7565770E-7C45-462D-BA4A-8A**********",
  "StartTime" : "2020-12-12T11:22Z",
  "DBClusterId" : "gp-xxxxxxxx",
  "Items" : [ {
    "Series" : [ {
      "Values" : [ {
        "Point" : [ "2020-12-14T11:00:00Z,100" ]
      } ]
    } ],
    "Name" : "gp-xxxxxxxx"
  } ]
}

Error codes

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