diff --git a/@xen-orchestra/web/src/types/alarm.type.ts b/@xen-orchestra/web/src/types/alarm.type.ts new file mode 100644 index 00000000000..124a01450b5 --- /dev/null +++ b/@xen-orchestra/web/src/types/alarm.type.ts @@ -0,0 +1,17 @@ +export type XenApiAlarmType = + | 'cpu_usage' + | 'network_usage' + | 'disk_usage' + | 'fs_usage' + | 'log_fs_usage' + | 'mem_usage' + | 'physical_utilisation' + | 'sr_io_throughput_total_per_host' + | 'memory_free_kib' + | 'unknown' + +export interface Alarm { + level: number + triggerLevel: number + type: XenApiAlarmType +} diff --git a/@xen-orchestra/web/src/types/xo-object.type.ts b/@xen-orchestra/web/src/types/xo-object.type.ts index c14271d6e8d..aea4c887176 100644 --- a/@xen-orchestra/web/src/types/xo-object.type.ts +++ b/@xen-orchestra/web/src/types/xo-object.type.ts @@ -1,3 +1,4 @@ +import type { Alarm } from '@/types/alarm.type' import type { Host } from '@/types/host.type' import type { Pool } from '@/types/pool.type' import type { Task } from '@/types/task.type' @@ -9,7 +10,7 @@ declare const __brand: unique symbol // eslint-disable-next-line no-use-before-define export type RecordId = string & { [__brand]: `${Type}Id` } -export type XoObject = Vm | Host | Pool | Task +export type XoObject = Vm | Host | Pool | Task | Alarm export type XoObjectType = XoObject['type'] diff --git a/@xen-orchestra/web/src/utils/rest-api-config.util.ts b/@xen-orchestra/web/src/utils/rest-api-config.util.ts index f1368c3c9c9..968802308ec 100644 --- a/@xen-orchestra/web/src/utils/rest-api-config.util.ts +++ b/@xen-orchestra/web/src/utils/rest-api-config.util.ts @@ -17,4 +17,8 @@ export const restApiConfig: Record