Help Center/ Database Security Service/ API Reference/ API/ Data Analytics/ Querying Audit Summary Information
Updated on 2024-11-01 GMT+08:00

Querying Audit Summary Information

Function

This API is used to query audit summary information.

Calling Method

For details, see Calling APIs.

URI

GET /v2/{project_id}/audit/summary/info

Table 1 URI parameter

Parameter

Mandatory

Parameter Type

Description

project_id

Yes

String

Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

offset

No

String

Offset

limit

No

String

Number of query records.

Request Parameter

Table 3 Request header parameter

Parameter

Mandatory

Parameter Type

Description

X-Auth-Token

Yes

String

User token. The token can be queried by calling the IAM API. (The token is the value of X-Subject-Token in the response header.)

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Parameter Type

Description

project_id

String

Project ID.

audit_duration

Long

Audit duration

total_sql

Long

Total statements

total_risk

Long

Total risk

today_sql

Long

Today's statements

today_risk

Long

Today's risk

today_session

Long

Today's session

update_time

Long

Time when the agent was updated

data_list

Array of data_list objects

Task list

total

Integer

Total number

Table 5 data_list

Parameter

Parameter Type

Description

id

Long

ID

status

String

Status

  • 1: success
  • 2: failure

project_id

String

Project ID

instance_id

Long

Instance ID

instance_name

String

Instance name

audit_duration

Long

Audit duration

total_sql

Long

Total statements

total_risk

Long

Total risk

today_sql

Long

Today's statements

today_risk

Long

Today's risk

today_session

Long

Today's session

update_time

Long

Time when the agent was updated

reserve1

String

Reserved word 1

reserve2

String

Reserved word 2

Status code: 400

Table 6 Response body parameters

Parameter

Parameter Type

Description

error

Object

Error message.

Table 7 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 403

Table 8 Response body parameters

Parameter

Parameter Type

Description

error

Object

Error message.

Table 9 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Status code: 500

Table 10 Response body parameter

Parameter

Parameter Type

Description

error

Object

Error message.

Table 11 ErrorDetail

Parameter

Parameter Type

Description

error_code

String

Error code

error_msg

String

Error message

Example request

/v2/{project_id}/audit/summary/info

Example Response

Status code: 200

Audit summary information

{
  "project_id" : "b9351f98c724428794ba7d105fa3558d",
  "audit_duration" : 99423,
  "total_sql" : 120267839,
  "total_risk" : 1597508,
  "today_sql" : 4354,
  "today_risk" : 4354,
  "today_session" : 4350,
  "update_time" : 1712570404644,
  "total" : 2,
  "data_list" : [ {
    "id" : 235049,
    "status" : "1",
    "reserve1" : null,
    "reserve2" : null,
    "project_id" : "b9351f98c724428794ba7d105fa3558d",
    "instance_id" : 5542,
    "instance_name" : "DBSS-mysql8-test",
    "audit_duration" : 99423,
    "total_sql" : 3537,
    "total_risk" : 380,
    "today_sql" : 0,
    "today_risk" : 0,
    "today_session" : 0,
    "update_time" : 1712570404093
  }, {
    "id" : 235050,
    "status" : "1",
    "reserve1" : null,
    "reserve2" : null,
    "project_id" : "b9351f98c724428794ba7d105fa3558d",
    "instance_id" : 5550,
    "instance_name" : "DBSS-Q1-test",
    "audit_duration" : 0,
    "total_sql" : 148,
    "total_risk" : 36,
    "today_sql" : 0,
    "today_risk" : 0,
    "today_session" : 0,
    "update_time" : 1712570404138
  } ]
}

Status code: 400

Incorrect request parameter.

{
  "error" : {
    "error_code" : "DBSS.XXXX",
    "error_msg" : "XXX"
  }
}

Status code: 500

Internal server error.

{
  "error" : {
    "error_code" : "DBSS.XXXX",
    "error_msg" : "XXX"
  }
}

Status Code

Status Code

Description

200

Audit summary information

400

Incorrect request parameter.

403

Authentication failed.

500

Internal Server Error

Error Codes

For details, see Error Codes.