All Products
Search
Document Center

AnalyticDB for PostgreSQL:DescribeSQLLogCount

Last Updated:Mar 03, 2024

Queries the number of audit logs for an AnalyticDB for PostgreSQL instance.

Operation description

This operation is not available for instances in reserved storage mode.

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
gpdb:DescribeSQLLogCountRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID.

Note You can call the DescribeDBInstances operation to query the information about all AnalyticDB for PostgreSQL instances within a region, including instance IDs.
gp-xxxxxxxx
QueryKeywordsstringNo

The keywords that are used to query audit logs.

test
StartTimestringYes

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.

2020-12-12T11:22Z
DatabasestringNo

The name of the database.

testdb
UserstringNo

The name of the database account that is used to connect to the database.

adbpgadmin
EndTimestringYes

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. The maximum time range that can be specified is seven days.
2020-12-14T11:22Z
ExecuteCoststringNo

The execution duration of the SQL statement. Unit: seconds.

100
SourceIPstringNo

The source IP address.

10.**.**.13
ExecuteStatestringNo

The execution state of the SQL statement. Valid values:

  • success
  • fail
success
OperationClassstringNo

The type of the query language. Valid values:

  • DQL
  • DML
  • DDL
  • DCL
  • TCL
DQL
OperationTypestringNo

The type of the SQL statement.

Note
  • If OperationClass is specified, the value of OperationType must belong to the corresponding query language. For example, if OperationClass is set to DQL, the value of OperationType must be a DQL statement such as SELECT.

  • If OperationClass is not specified, the value of OperationType can be an SQL statement of any query language.

  • If OperationClass and OperationType are not specified, all types of SQL statements are returned.

SELECT
MaxExecuteCoststringNo

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

1000
MinExecuteCoststringNo

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

10

Response parameters

ParameterTypeDescriptionExample
object
EndTimestring

The end time of the query.

2020-12-14T11:22Z
RequestIdstring

The request ID.

7565770E-7C45-462D-BA4A-8A**********
StartTimestring

The start time of the query.

2020-12-12T11:22Z
DBClusterIdstring

The instance ID.

gp-xxxxxxxx
Itemsobject []

The name of the instance.

Seriesobject []

Details of the audit logs.

Valuesobject []

Details of the audit logs.

Pointarray

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

string
2020-12-14T11:00:00Z,100
Namestring

The name of the table.

gp-xxxxxxxx

Examples

Sample success responses

JSONformat

{
  "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 Service error codes.

Change history

Change timeSummary of changesOperation
No change history