Get Audit Data

GET/zstack/v1/zwatch/audits

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/audits?startTime=1.557300700509E12&limit=50.0&auditType=Resource

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

startTime (Optional)

Long

query

The start time

 

2.3

endTime (Optional)

Long

query

The end time

 

2.3

limit (Optional)

Integer

query

The maximum number of returned records

 

2.3

labels (Optional)

List

query

The filter label list

 

2.3

auditType (Optional)

AuditType

query

The audit type. Default is Resource

  • Login
  • Resource

3.5.0

systemTags (Optional)

List

query

System tags

 

2.3

userTags (Optional)

List

query

User tags

 

2.3

API Response

Response Example

{
  "audits": [
    {
      "resourceUuid": "b1ca3fab6ebc4302ad9249d5402cb06c",
      "resourceType": "VmInstanceVO",
      "clientIp": "172.0.0.1",
      "clientBrowser": "Chrome/69.0.3497.81",
      "apiName": "org.zstack.header.vm.APISetVmRDPMsg",
      "operatorAccountUuid": "36c27e8ff05c4780bf6d2fa65700f22e",
      "duration": 22.0,
      "requestUuid": "d78093c0b2fb3850b3ce563b3a0b029d",
      "responseUuid": "08cf3fd2c4614811b4acc0620e20a98e",
      "sessionUuid": "05e5c663eb794faab5c5606c38103a17",
      "responseDump": "{\"success\":true}",
      "time": 1512037844556.0
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. See error2.3
auditsListSee audits2.3

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, such as SYS.1000, HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringThe detailed error information0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeThe root error. The source error that caused the current error. This field is null if there is no root error0.6

audits

NameTypeDescriptionStarting Version
resourceUuidStringThe resource UUID2.3
resourceTypeStringThe resource type2.3
apiNameStringThe API name2.3
errorStringThe error details2.3
operatorAccountUuidStringThe UUID of the account that initiated the API call2.3
durationlongThe API execution duration2.3
requestUuidStringThe API request UUID2.3
responseUuidStringThe API response UUID2.3
sessionUuidStringThe session UUID2.3
requestDumpStringThe API request JSON dump2.3
responseDumpStringThe API response JSON dump2.3
timelongThe record generation time2.3

SDK Examples

Java SDK

GetAuditDataAction action = new GetAuditDataAction();
action.startTime = 1.557300701132E12;
action.limit = 50.0;
action.conditions = asList("VMUuid=4ca37b1e21e846bf8d35b23d4138489c");
action.auditType = "Resource";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetAuditDataAction.Result res = action.call();

Python SDK

GetAuditDataAction action = GetAuditDataAction()
action.startTime = 1.557300701178E12
action.limit = 50.0
action.conditions = [VMUuid=6623c395df0d44b6afc3732e76aac0ac]
action.auditType = "Resource"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetAuditDataAction.Result res = action.call()