feat(@vates/types): add XoMessage and XoAlarm

This commit is contained in:
mathieuRA
2025-04-04 17:12:07 +02:00
committed by Mathieu
parent 41b56a7fa8
commit d2e5f4213e
2 changed files with 26 additions and 0 deletions

View File

@@ -115,6 +115,18 @@ type BaseXoVm = BaseXapiXo & {
}
}
export type XoAlarm = Omit<XoMessage, '$object' | 'body'> & {
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

View File

@@ -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