Tham chiếu API
Sự kiện
Đọc sự kiện kiểm toán từ mới nhất, bao gồm thông tin máy khách, hệ điều hành và ứng dụng.
Định nghĩa kiểu
graphql
type Query {
events(query: String!, offset: Int!, limit: Int!): [Event!]!
}
enum AuthErrorCode {
CANCELED
INTERNAL_ERROR
INVALID_LOGIN_REQUEST
INVALID_PASSWORD
PASSWORD_SETUP_REQUIRED
PEER_IDENTITY_CHANGED
REJECTED
REMOTE_ACCESS_DISABLED
TOO_MANY_LOGIN_ATTEMPTS
TIMEOUT
}
type DeviceNameEventData {
oldName: String!
newName: String!
}
enum DiskFormatErrorCode {
FORMAT_DISK_FAILED
}
type DiskFormatEventData {
disk: EventDisk!
fileSystem: String!
}
type DiskFormatFailedEventData {
disk: EventDisk!
fileSystem: String!
failure: DiskFormatFailure!
}
type DiskFormatFailure {
reason: DiskFormatErrorCode!
detail: String
}
type Event {
id: ID!
type: EventType!
data: EventData!
clientId: ID
clientName: String
clientIp: String
osName: String
osVersion: String
appName: String
appVersion: String
createdAt: Instant!
}
union EventData = LoginEventData | LoginFailedEventData | SessionEventData | DeviceNameEventData | VolumeEventData | VolumeFailedEventData | DiskFormatEventData | DiskFormatFailedEventData
type EventDisk {
id: String
name: String
path: String!
sizeBytes: Long
}
type EventSession {
clientId: String!
clientName: String!
type: SessionType!
}
enum EventType {
LOGIN
LOGIN_FAILED
LOGOUT
REVOKE_SESSION
UPDATE_DEVICE_NAME
MOUNT
MOUNT_FAILED
UNMOUNT
FORMAT_DISK
FORMAT_DISK_FAILED
}
type EventVolume {
id: String
name: String
devicePath: String
mountPath: String!
fileSystem: String
}
scalar Instant
type LoginEventData {
sessionType: SessionType!
}
type LoginFailedEventData {
reason: AuthErrorCode!
}
scalar Long
enum MountErrorCode {
MOUNT_FAILED
}
type MountFailure {
reason: MountErrorCode!
detail: String
}
type SessionEventData {
session: EventSession!
}
enum SessionType {
LOGIN
API_TOKEN
}
type VolumeEventData {
volume: EventVolume!
}
type VolumeFailedEventData {
volume: EventVolume!
failure: MountFailure!
}Thao tác
query
events
Đọc sự kiện kiểm toán từ mới nhất, bao gồm thông tin máy khách, hệ điều hành và ứng dụng.
graphql
query events($query: String!, $offset: Int!, $limit: Int!) {
events(query: $query, offset: $offset, limit: $limit) { id type clientId clientName clientIp osName osVersion appName appVersion createdAt data { __typename ... on LoginEventData { sessionType } ... on LoginFailedEventData { reason } ... on SessionEventData { session { clientId clientName type } } ... on DeviceNameEventData { oldName newName } ... on VolumeEventData { volume { id name devicePath mountPath fileSystem } } ... on VolumeFailedEventData { volume { id name devicePath mountPath fileSystem } failure { reason detail } } ... on DiskFormatEventData { disk { id name path sizeBytes } fileSystem } ... on DiskFormatFailedEventData { disk { id name path sizeBytes } fileSystem failure { reason detail } } } }
}