diff --git a/@vates/types/src/xo.mts b/@vates/types/src/xo.mts index c61c26fdbc..60ead768b8 100644 --- a/@vates/types/src/xo.mts +++ b/@vates/types/src/xo.mts @@ -115,6 +115,18 @@ type BaseXoVm = BaseXapiXo & { } } +export type XoAlarm = Omit & { + body: { + value: string + name: string + } + object: { + type: XapiXoRecord['type'] | 'unknown' + uuid: XapiXoRecord['uuid'] + href?: string + } +} + export type XoGroup = { id: Branded<'group'> name: string @@ -211,6 +223,16 @@ export type XoHostPatch = BaseXapiXo & { type: 'host_patch' } +export type XoMessage = BaseXapiXo & { + $object: XapiXoRecord['id'] + + body: string + id: Branded<'message'> + name: string + time: number + type: 'message' +} + export type XoNetwork = BaseXapiXo & { id: Branded<'network'> type: 'network' @@ -445,7 +467,9 @@ export type XoVtpm = BaseXapiXo & { } export type XapiXoRecord = + | XoAlarm | XoHost + | XoMessage | XoNetwork | XoPool | XoSr diff --git a/@xen-orchestra/rest-api/src/rest-api/rest-api.type.mts b/@xen-orchestra/rest-api/src/rest-api/rest-api.type.mts index 73aa729209..51dafe77dd 100644 --- a/@xen-orchestra/rest-api/src/rest-api/rest-api.type.mts +++ b/@xen-orchestra/rest-api/src/rest-api/rest-api.type.mts @@ -3,6 +3,7 @@ import type { Task } from '@vates/types/lib/vates/task' import type { XapiHostStats, XapiVmStats, XapiStatsGranularity } from '@vates/types/common' import type { XenApiHostWrapped, + XenApiMessage, XenApiNetwork, XenApiPoolWrapped, XenApiSrWrapped, @@ -17,6 +18,7 @@ import type { XoHost, XoServer, XoUser, XapiXoRecord, XoVm, XoSchedule, XoJob } type XapiRecordByXapiXoRecord = { host: XenApiHostWrapped + message: XenApiMessage network: XenApiNetwork pool: XenApiPoolWrapped SR: XenApiSrWrapped