Updated on 2025-09-10 GMT+08:00

Querying User Operation Logs

Function

Query user operation logs.

URI

POST /v1/{project_id}/audit/{instance_id}/operation-log

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID. You can obtain the value by calling the IAM API for [querying the project list of a specified IAM user].

Constraints

N/A

Range

The value is determined by the value of the IAM API. The value contains 32 to 64 characters.

Default Value

N/A

instance_id

Yes

String

Definition

Instance ID. The value can be obtained from the ID field of the API for querying the instance list.

Constraints

N/A

Range

The value is determined by the value of the API for querying the instance list. The value contains 32 to 64 characters.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

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.)

Constraints

N/A

Range

Determined by the value of the IAM API used for querying user tokens.

Default Value

N/A

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

time

Yes

TimeRangeBean object

Query time range

user_name

No

String

Operation log username

action

No

String

Action name.

  • CREATE

  • DELETE

  • DOWNLOAD

  • UPDATE

page

Yes

String

Page number

size

Yes

String

Number of records on each page.

Table 4 TimeRangeBean

Parameter

Mandatory

Type

Description

end_time

No

String

Start time. This parameter must be used together with end_time. The format must be yyyy-MM-dd HH:mm:ss, in UTC time.

start_time

No

String

End time. This parameter must be used together with start_time. The format must be yyyy-MM-dd HH:mm:ss, in UTC time.

time_range

No

String

Query time range. This parameter cannot be used together with start_time or end_time. If they are specified together, this parameter has a higher priority.

  • HALF_HOUR

  • HOUR

  • THREE_HOUR

  • TWELVE_HOUR

  • DAY

  • WEEK

  • MONTH

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

total_num

Integer

Total number of license files

operate_log

Array of OperateLogInfo objects

Operation log list

Table 6 OperateLogInfo

Parameter

Type

Description

id

String

Operation log ID.

user

String

Operation log username

time

String

Time when a record is generated. The format is timestamp.

action

String

Operation type of a record. The value can be:

  • create

  • update: update

  • delete: delete

  • download: download

function

String

Function type of the record.

name

String

Operation object of a record

description

String

Description of a record

result

String

Execution result of a record. The value can be:

  • success: Request succeeded

  • fail: The operation fails.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 8 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Status code: 403

Table 9 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 10 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

details

Array of DbssErrorDetail objects

PDP5 authentication exception information

encoded_authorization_message

String

PDP5 authentication exception information

error_code

String

Error Codes

error_msg

String

Error message.

Table 12 DbssErrorDetail

Parameter

Type

Description

error_code

String

Error Codes

error_msg

String

PDP5 error information

Example Requests

/v1/{project_id}/audit/{instance_id}/operation-log

{
  "time" : {
    "time_range" : "HOUR"
  },
  "page" : 1,
  "size" : 10
}

Example Responses

Status code: 200

Success

{
  "total_num" : 3,
  "operate_log" : [ {
    "id" : "1LJP-HgBCwCqSg3BVuAp",
    "user" : "hby-test",
    "time" : "2021-04-22 06:40:52",
    "function" : "Database list.",
    "action" : "Update",
    "name" : "db01 ",
    "description" : "This API is used to disable the audit agent.",
    "result" : "success"
  }, {
    "id" : "07JO-HgBCwCqSg3ByOAD",
    "user" : "hby-test",
    "time" : "2021-04-22 06:40:15",
    "function" : "Database list.",
    "action" : "Update",
    "name" : "db01 ",
    "description" : "This API is used to disable the audit agent.",
    "result" : "success"
  }, {
    "id" : "ULKM93gBCwCqSg3BZeD1",
    "user" : "hby-test",
    "time" : "2021-04-22 03:07:56",
    "function" : "Databases",
    "action" : "Create",
    "name" : "db01",
    "description" : "Create a database.",
    "result" : "success"
  } ]
}

Status Codes

Status Code

Description

200

Success

400

Incorrect request parameter.

403

Authorization failed.

500

Internal server error.

Error Codes

See Error Codes.