Querying User Operation Logs
Function
Query user operation logs.
URI
POST /v1/{project_id}/audit/{instance_id}/operation-log
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
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 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
time |
Yes |
TimeRangeBean object |
Query time range |
user_name |
No |
String |
Operation log username |
action |
No |
String |
Action name.
|
page |
Yes |
String |
Page number |
size |
Yes |
String |
Number of records on each page. |
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.
|
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
total_num |
Integer |
Total number of license files |
operate_log |
Array of OperateLogInfo objects |
Operation log list |
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:
|
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:
|
Status code: 400
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. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Codes |
error_msg |
String |
PDP5 error information |
Status code: 403
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. |
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error Codes |
error_msg |
String |
PDP5 error information |
Status code: 500
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. |
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot