@vates/types 1.4.1 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/common.d.mts CHANGED
@@ -517,6 +517,12 @@ export declare const OPAQUE_REF: {
517
517
  readonly EMPTY: "OpaqueRef:NULL";
518
518
  };
519
519
  export type OPAQUE_REF_NULL = (typeof OPAQUE_REF)['EMPTY'];
520
+ export declare const BACKUP_TYPE: {
521
+ readonly backup: "backup";
522
+ readonly metadata: "metadataBackup";
523
+ readonly mirror: "mirrorBackup";
524
+ };
525
+ export type BACKUP_TYPE = (typeof BACKUP_TYPE)[keyof typeof BACKUP_TYPE];
520
526
  type XapiStatsResponse<T> = {
521
527
  endTimestamp: number;
522
528
  interval: number;
@@ -524,43 +530,63 @@ type XapiStatsResponse<T> = {
524
530
  };
525
531
  export type XapiStatsGranularity = 'seconds' | 'minutes' | 'hours' | 'days';
526
532
  export type XapiHostStats = XapiStatsResponse<{
527
- cpus: Record<string, number[]>;
528
- ioThroughput: {
533
+ cpus?: Record<string, number[]>;
534
+ ioThroughput?: {
529
535
  r: Record<string, number[]>;
530
536
  w: Record<string, number[]>;
531
537
  };
532
- iops: {
538
+ iops?: {
533
539
  r: Record<string, number[]>;
534
540
  w: Record<string, number[]>;
535
541
  };
536
- iowait: Record<string, number[]>;
537
- latency: {
542
+ iowait?: Record<string, number[]>;
543
+ latency?: {
538
544
  r: Record<string, number[]>;
539
545
  w: Record<string, number[]>;
540
546
  };
541
- load: number[];
542
- memory: number[];
543
- memoryFree: number[];
544
- pifs: {
547
+ load?: number[];
548
+ memory?: number[];
549
+ memoryFree?: number[];
550
+ pifs?: {
545
551
  rx: Record<string, number[]>;
546
552
  tx: Record<string, number[]>;
547
553
  };
548
554
  }>;
549
555
  export type XapiVmStats = XapiStatsResponse<{
550
- cpus: Record<string, number[]>;
551
- iops: {
556
+ cpus?: Record<string, number[]>;
557
+ cpuUsage?: number[];
558
+ runstateFullrun?: number[];
559
+ runstateFullContention?: number[];
560
+ runstatePartialRun?: number[];
561
+ runstatePartialContention?: number[];
562
+ runstateConcurrencyHazard?: number[];
563
+ runstateBlocked?: number[];
564
+ iops?: {
552
565
  r: Record<string, number[]>;
553
566
  w: Record<string, number[]>;
554
567
  };
555
- memory: number[];
568
+ memory?: number[];
556
569
  memoryFree?: number[];
557
- vifs: {
570
+ memoryTarget?: number[];
571
+ vifs?: {
572
+ rx: Record<string, number[]>;
573
+ tx: Record<string, number[]>;
574
+ };
575
+ vifErrors?: {
558
576
  rx: Record<string, number[]>;
559
577
  tx: Record<string, number[]>;
560
578
  };
561
- xvds: {
579
+ xvds?: {
580
+ w?: Record<string, number[]>;
581
+ r?: Record<string, number[]>;
582
+ total?: Record<string, number[]>;
583
+ };
584
+ vbdLatency?: {
562
585
  w: Record<string, number[]>;
563
586
  r: Record<string, number[]>;
564
587
  };
588
+ vbdIowait?: Record<string, number[]>;
589
+ vbdInflight?: Record<string, number[]>;
590
+ vbdAvgquSz?: Record<string, number[]>;
565
591
  }>;
566
592
  export {};
package/dist/common.mjs CHANGED
@@ -445,3 +445,4 @@ export const CERTIFICATE_TYPE = {
445
445
  HOST_INTERNAL: 'host_internal',
446
446
  };
447
447
  export const OPAQUE_REF = { EMPTY: 'OpaqueRef:NULL' };
448
+ export const BACKUP_TYPE = { backup: 'backup', metadata: 'metadataBackup', mirror: 'mirrorBackup' };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './common.mjs';
2
2
  export * from './xen-api.mjs';
3
3
  export * from './xo.mjs';
4
+ export * from './lib/xen-orchestra-xapi.mjs';
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './common.mjs';
2
2
  export * from './xen-api.mjs';
3
3
  export * from './xo.mjs';
4
+ export * from './lib/xen-orchestra-xapi.mjs';
@@ -0,0 +1,121 @@
1
+ import { WrappedXenApiRecord, XenApiNetworkWrapped, XenApiRecord, XenApiSr, XenApiVdi, XenApiVm, XenApiVmWrapped } from '../xen-api.mjs';
2
+ import type { Readable } from 'node:stream';
3
+ import type { XoGpuGroup, XoVgpuType, XoHost, XoNetwork, XoPif, XoSr, XoUser, XoVdi, XoVm, XoVmTemplate } from '../xo.mjs';
4
+ type XcpPatches = {
5
+ changelog?: {
6
+ author: string;
7
+ date: number;
8
+ description: string;
9
+ };
10
+ description: string;
11
+ license: string;
12
+ name: string;
13
+ release: string;
14
+ size: number;
15
+ url: string;
16
+ version: string;
17
+ };
18
+ type XsPatches = {
19
+ conflicts?: string[];
20
+ date: string;
21
+ description: string;
22
+ documentationUrl?: string;
23
+ guidances: string;
24
+ name: string;
25
+ id?: string;
26
+ paid?: boolean;
27
+ requirements?: string[];
28
+ upgrade?: boolean;
29
+ url?: string;
30
+ uuid?: string;
31
+ };
32
+ export interface Xapi {
33
+ call: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
34
+ callAsync: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
35
+ getField<T extends XenApiRecord, K extends keyof T>(type: Extract<WrappedXenApiRecord, T>['$type'], ref: T['$ref'], field: K): Promise<T[K]>;
36
+ createNetwork(params: {
37
+ name: string;
38
+ description?: string;
39
+ mtu?: number;
40
+ } | {
41
+ name: string;
42
+ description?: string;
43
+ pifId: XoPif['id'];
44
+ mtu?: number;
45
+ vlan: number;
46
+ }): Promise<XenApiNetworkWrapped>;
47
+ deleteNetwork(id: XoNetwork['id']): Promise<void>;
48
+ listMissingPatches(host: XoHost['id']): Promise<XcpPatches[] | XsPatches[]>;
49
+ pool_emergencyShutdown(): Promise<void>;
50
+ resumeVm(id: XoVm['id']): Promise<void>;
51
+ unpauseVm(id: XoVm['id']): Promise<void>;
52
+ startVm(id: XoVm['id'], opts?: {
53
+ bypassMacAddressesCheck?: boolean;
54
+ force?: boolean;
55
+ hostId?: XoHost['id'];
56
+ /**
57
+ * if startOnly is true and the VM is not halted, throw VM_BAD_POWER_STATE
58
+ * otherwise, unpause/resume the VM
59
+ *
60
+ * @default false
61
+ */
62
+ startOnly?: boolean;
63
+ }): Promise<void>;
64
+ VM_import(stream: Readable, srRef?: XenApiSr['$ref'], onVmCreation?: null | ((vm: XenApiVm) => unknown)): Promise<XenApiVm['$ref']>;
65
+ createVm(templateUuid: XoVmTemplate['uuid'], metadataVm: {
66
+ affinityHost?: XoHost['id'];
67
+ name_label: string;
68
+ nameLabel?: string;
69
+ clone?: boolean;
70
+ installRepository?: XoVdi['id'] | '' | null;
71
+ vdis?: (/** Create VDI */ {
72
+ name_label: string;
73
+ size: number;
74
+ sr?: XoSr['id'];
75
+ name_description?: string;
76
+ } | /** Update VDI*/ {
77
+ userdevice: string;
78
+ name_label?: string;
79
+ size?: number;
80
+ sr?: XoSr['id'];
81
+ name_description?: string;
82
+ } | /** Destroy VDI*/ {
83
+ destroy: true;
84
+ userdevice: string;
85
+ })[];
86
+ vifs?: (/** Create/update VIF */ {
87
+ device?: string;
88
+ ipv4_allowed?: string[];
89
+ ipv6_allowed?: string[];
90
+ mac?: string;
91
+ mtu?: number;
92
+ network: string;
93
+ } | /** Destroy VIF */ {
94
+ destroy: true;
95
+ device: string;
96
+ })[];
97
+ existingVdis?: {
98
+ $SR: XoSr['id'];
99
+ size: number;
100
+ userdevice: string;
101
+ }[];
102
+ vgpuType?: XoVgpuType['id'];
103
+ gpuGroup?: XoGpuGroup['id'];
104
+ copyHostBiosStrings?: boolean;
105
+ }, checkLimits?: boolean, creatorId?: XoUser['id'], opts?: {
106
+ destroyAllVifs: boolean;
107
+ }): Promise<XenApiVmWrapped>;
108
+ VDI_destroyCloudInitConfig(vdiRef: XenApiVdi['$ref'], opts?: {
109
+ timeLimit?: number;
110
+ }): Promise<void>;
111
+ VM_createCloudInitConfig(vmRef: XenApiVm['$ref'], cloudConfig: string, opts?: {
112
+ networkConfig?: string;
113
+ }): Promise<XoVdi['uuid']>;
114
+ VM_destroy(vmRef: XenApiVm['$ref'], opts?: {
115
+ deleteDisks?: boolean;
116
+ force?: boolean;
117
+ bypassBlockedOperation?: boolean;
118
+ forceDeleteDefaultTemplate?: boolean;
119
+ }): Promise<void>;
120
+ }
121
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { AFTER_APPLY_GUIDANCE, ALLOCATION_ALGORITHM, BOND_MODE, Branded, CERTIFICATE_TYPE, CLS, CLUSTER_HOST_OPERATION, CLUSTER_OPERATION, CONSOLE_PROTOCOL, DOMAIN_TYPE, EVENT_OPERATION, HOST_ALLOWED_OPERATIONS, HOST_DISPLAY, HOST_NUMA_AFFINITY_POLICY, IP_CONFIGURATION_MODE, IPV6_CONFIGURATION_MODE, LATEST_SYNCED_UPDATES_APPLIED_STATE, NETWORK_DEFAULT_LOCKING_MODE, NETWORK_OPERATIONS, NETWORK_PURPOSE, ON_BOOT, ON_CRASH_BEHAVIOUR, ON_NORMAL_EXIT, ON_SOFTREBOOT_BEHAVIOR, OPAQUE_REF_NULL, PERSISTENCE_BACKEND, PGPU_DOM0_ACCESS, PIF_IGMP_STATUS, POOL_ALLOWED_OPERATIONS, PRIMARY_ADDRESS_TYPE, PVS_PROXY_STATUS, SDN_CONTROLLER_PROTOCOL, SR_HEALTH, SRIOV_CONFIGURATION_MODE, STORAGE_OPERATIONS, TASK_ALLOWED_OPERATIONS, TASK_STATUS_TYPE, TELEMETRY_FREQUENCY, TRISTATE_TYPE, TUNNEL_PROTOCOL, UPDATE_AFTER_APPLY_GUIDANCE, UPDATE_GUIDANCES, UPDATE_SYNC_FREQUENCY, VBD_MODE, VBD_OPERATIONS, VBD_TYPE, VDI_OPERATIONS, VDI_TYPE, VGPU_TYPE_IMPLEMENTATION, VIF_IPV4_CONFIGURATION_MODE, VIF_IPV6_CONFIGURATION_MODE, VIF_LOCKING_MODE, VIF_OPERATIONS, VM_APPLIANCE_OPERATION, VM_OPERATIONS, VM_POWER_STATE, VMPP_ARCHIVE_FREQUENCY, VMPP_ARCHIVE_TARGET_TYPE, VMPP_BACKUP_FREQUENCY, VMPP_BACKUP_TYPE, VMSS_FREQUENCY, VMSS_TYPE, VTPM_OPERATIONS, VUSB_OPERATIONS } from './common.mjs';
2
+ import type { Xapi } from './lib/xen-orchestra-xapi.mjs';
2
3
  /**
3
4
  * Add properties injected by `xen-api`.
4
5
  * $ref property is also injected by XOLite, so she is not present here.
@@ -15,11 +16,7 @@ type WrapperXenApi<T, Type extends string, Fn = {
15
16
  name_label?: string;
16
17
  unplugVusbs?: boolean;
17
18
  }): Promise<XenApiVm['$ref']>;
18
- $xapi: {
19
- call: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
20
- callAsync: <ReturnType>(...args: unknown[]) => Promise<ReturnType>;
21
- getField<T extends XenApiRecord, K extends keyof T>(type: Type, ref: T['$ref'], field: K): Promise<T[K]>;
22
- };
19
+ $xapi: Xapi;
23
20
  };
24
21
  export interface XenApiSession {
25
22
  $ref: Branded<'session'>;
@@ -187,6 +184,10 @@ type XenApiVmCallMethods = {
187
184
  (method: 'hard_shutdown'): Promise<void>;
188
185
  (method: 'clean_reboot'): Promise<void>;
189
186
  (method: 'hard_reboot'): Promise<void>;
187
+ (method: 'pause'): Promise<void>;
188
+ (method: 'suspend'): Promise<void>;
189
+ (method: 'record_data_source', dataSource: string): Promise<void>;
190
+ (method: 'forget_data_source_archives', dataSource: string): Promise<void>;
190
191
  };
191
192
  export interface XenApiVm {
192
193
  $ref: Branded<'VM'>;
@@ -542,6 +543,8 @@ export interface XenApiNetwork {
542
543
  uuid: string;
543
544
  VIFs: XenApiVif['$ref'][];
544
545
  }
546
+ export interface XenApiNetworkWrapped extends WrapperXenApi<XenApiNetwork, 'network'> {
547
+ }
545
548
  export interface XenApiVif {
546
549
  $ref: Branded<'VIF'>;
547
550
  allowed_operations: VIF_OPERATIONS[];
@@ -675,11 +678,13 @@ export interface XenApiSm {
675
678
  other_config: Record<string, string>;
676
679
  required_api_version: string;
677
680
  required_cluster_stack: string[];
681
+ supported_image_formats?: string[];
678
682
  type: string;
679
683
  uuid: string;
680
684
  vendor: string;
681
685
  version: string;
682
686
  }
687
+ export type XenApiSmWrapped = WrapperXenApi<XenApiSm, 'SM'>;
683
688
  export interface XenApiSr {
684
689
  $ref: Branded<'SR'>;
685
690
  allowed_operations: STORAGE_OPERATIONS[];
@@ -916,6 +921,7 @@ export interface XenApiPci {
916
921
  uuid: string;
917
922
  vendor_name: string;
918
923
  }
924
+ export type XenApiPciWrapped = WrapperXenApi<XenApiPci, 'PCI'>;
919
925
  export interface XenApiPgpu {
920
926
  $ref: Branded<'PGPU'>;
921
927
  compatibility_metadata?: Record<string, string>;
@@ -931,6 +937,7 @@ export interface XenApiPgpu {
931
937
  supported_VGPU_types: XenApiVgpuType['$ref'][];
932
938
  uuid: string;
933
939
  }
940
+ export type XenApiPgpuWrapped = WrapperXenApi<XenApiPgpu, 'PGPU'>;
934
941
  export interface XenApiGpuGroup {
935
942
  $ref: Branded<'GPU_group'>;
936
943
  allocation_algorithm: ALLOCATION_ALGORITHM;
@@ -944,6 +951,7 @@ export interface XenApiGpuGroup {
944
951
  uuid: string;
945
952
  VGPUs: XenApiVgpu['$ref'][];
946
953
  }
954
+ export type XenApiGpuGroupWrapped = WrapperXenApi<XenApiGpuGroup, 'gpuGroup'>;
947
955
  export interface XenApiVgpu {
948
956
  $ref: Branded<'VGPU'>;
949
957
  compatibility_metadata?: Record<string, string>;
@@ -979,6 +987,7 @@ export interface XenApiVgpuType {
979
987
  vendor_name: string;
980
988
  VGPUs: XenApiVgpu['$ref'][];
981
989
  }
990
+ export type XenApiVgpuTypeWrapped = WrapperXenApi<XenApiVgpuType, 'vgpuType'>;
982
991
  export interface XenApiPvsSite {
983
992
  $ref: Branded<'PVS_site'>;
984
993
  cache_storage?: XenApiPvsCacheStorage['$ref'][];
@@ -1142,5 +1151,5 @@ export interface XenApiObserver {
1142
1151
  uuid?: string;
1143
1152
  }
1144
1153
  export type XenApiRecord = XenApiSession | XenApiAuth | XenApiSubject | XenApiRole | XenApiTask | XenApiEvent | XenApiPool | XenApiPoolPatch | XenApiPoolUpdate | XenApiVm | XenApiVmMetrics | XenApiVmGuestMetrics | XenApiVmpp | XenApiVmss | XenApiVmAppliance | XenApiDrTask | XenApiHost | XenApiHostCrashdump | XenApiHostPatch | XenApiHostMetrics | XenApiHostCpu | XenApiNetwork | XenApiVif | XenApiVifMetrics | XenApiPif | XenApiPifMetrics | XenApiBond | XenApiVlan | XenApiSm | XenApiSr | XenApiSrStat | XenApiProbeResult | XenApiLvhd | XenApiVdi | XenApiVbd | XenApiVbdMetrics | XenApiPbd | XenApiCrashdump | XenApiVtpm | XenApiConsole | XenApiUser | XenApiDataSource | XenApiBlob | XenApiMessage | XenApiSecret | XenApiTunnel | XenApiNetworkSriov | XenApiPci | XenApiPgpu | XenApiGpuGroup | XenApiVgpu | XenApiVgpuType | XenApiPvsSite | XenApiPvsServer | XenApiPvsProxy | XenApiPvsCacheStorage | XenApiFeature | XenApiSdnController | XenApiVdiNbdServerInfo | XenApiPusb | XenApiUsbGroup | XenApiVusb | XenApiCluster | XenApiClusterHost | XenApiCertificate | XenApiRepository | XenApiObserver;
1145
- export type WrappedXenApiRecord = XenApiHostWrapped | XenApiPifWrapped | XenApiPoolWrapped | XenApiSrWrapped | XenApiVbdWrapped | XenApiVdiWrapped | XenApiVgpuWrapped | XenApiVifWrapped | XenApiVmWrapped | XenApiVtpmWrapped;
1154
+ export type WrappedXenApiRecord = XenApiHostWrapped | XenApiNetworkWrapped | XenApiPifWrapped | XenApiPoolWrapped | XenApiSrWrapped | XenApiVbdWrapped | XenApiVdiWrapped | XenApiVgpuWrapped | XenApiVifWrapped | XenApiVmWrapped | XenApiVtpmWrapped | XenApiPciWrapped | XenApiGpuGroupWrapped | XenApiPgpuWrapped | XenApiVgpuTypeWrapped;
1146
1155
  export {};
package/dist/xo.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Branded, DOMAIN_TYPE, HOST_ALLOWED_OPERATIONS, HOST_POWER_STATE, IP_CONFIGURATION_MODE, IPV6_CONFIGURATION_MODE, NETWORK_OPERATIONS, POOL_ALLOWED_OPERATIONS, PRIMARY_ADDRESS_TYPE, STORAGE_OPERATIONS, VDI_OPERATIONS, VDI_TYPE, VIF_LOCKING_MODE, VM_OPERATIONS, VM_POWER_STATE } from './common.mjs';
1
+ import type { BACKUP_TYPE, Branded, DOMAIN_TYPE, HOST_ALLOWED_OPERATIONS, HOST_POWER_STATE, IP_CONFIGURATION_MODE, IPV6_CONFIGURATION_MODE, NETWORK_OPERATIONS, PGPU_DOM0_ACCESS, POOL_ALLOWED_OPERATIONS, PRIMARY_ADDRESS_TYPE, STORAGE_OPERATIONS, VDI_OPERATIONS, VDI_TYPE, VIF_LOCKING_MODE, VM_OPERATIONS, VM_POWER_STATE } from './common.mjs';
2
2
  type BaseXapiXo = {
3
3
  $pool: XoPool['id'];
4
4
  /**
@@ -48,7 +48,7 @@ type BaseXoVm = BaseXapiXo & {
48
48
  isNestedVirtEnabled: boolean;
49
49
  hasVendorDevice: boolean;
50
50
  high_availability: string;
51
- installTime?: number;
51
+ installTime?: number | null;
52
52
  isFirmwareSupported: boolean;
53
53
  memory: {
54
54
  dynamic: number[];
@@ -74,7 +74,7 @@ type BaseXoVm = BaseXapiXo & {
74
74
  secureBoot: boolean;
75
75
  snapshots: XoVmSnapshot['id'][];
76
76
  startDelay: number;
77
- startTime?: number;
77
+ startTime?: number | null;
78
78
  suspendSr?: XoSr['id'];
79
79
  tags: string[];
80
80
  vga?: string;
@@ -102,6 +102,24 @@ export type XoAlarm = Omit<XoMessage, '$object' | 'body'> & {
102
102
  href?: string;
103
103
  };
104
104
  };
105
+ export type XoBackupRepository = {
106
+ benchmarks?: {
107
+ readRate: number;
108
+ timestamp: number;
109
+ writeRate: number;
110
+ }[];
111
+ enabled: boolean;
112
+ error?: Record<string, unknown>;
113
+ id: Branded<'backup-repository'>;
114
+ name: string;
115
+ options?: string;
116
+ proxy?: XoProxy['id'];
117
+ url: string;
118
+ };
119
+ export type XoGpuGroup = BaseXapiXo & {
120
+ id: Branded<'gpu-group'>;
121
+ type: 'gpuGroup';
122
+ };
105
123
  export type XoGroup = {
106
124
  id: Branded<'group'>;
107
125
  name: string;
@@ -223,12 +241,30 @@ export type XoPbd = BaseXapiXo & {
223
241
  type: 'PBD';
224
242
  };
225
243
  export type XoPci = BaseXapiXo & {
244
+ $host?: XoHost['id'];
245
+ class_name: string;
246
+ device_name: string;
226
247
  id: Branded<'PCI'>;
248
+ pci_id: string;
227
249
  type: 'PCI';
228
250
  };
229
251
  export type XoPgpu = BaseXapiXo & {
252
+ $host: XoHost['id'];
253
+ $vgpus: XoVgpu['id'][];
254
+ dom0Access: PGPU_DOM0_ACCESS;
255
+ enabledVgpuTypes: XoVgpuType['id'][];
256
+ gpuGroup?: XoGpuGroup['id'];
257
+ host: XoHost['id'];
230
258
  id: Branded<'PGPU'>;
259
+ isSystemDisplayDevice: boolean;
260
+ pci?: XoPci['id'];
261
+ /**
262
+ * @deprecated
263
+ */
264
+ supportedVgpuMaxCapcities?: never;
265
+ supportedVgpuTypes: XoVgpuType['id'][];
231
266
  type: 'PGPU';
267
+ vgpus: XoVgpu['id'][];
232
268
  };
233
269
  export type XoPif = BaseXapiXo & {
234
270
  $host: XoHost['id'];
@@ -284,14 +320,80 @@ export type XoPool = BaseXapiXo & {
284
320
  xosanPackInstallationTime: number | null;
285
321
  zstdSupported: boolean;
286
322
  };
287
- export type XoJob = {
323
+ export type XoProxy = {
324
+ id: Branded<'proxy'>;
325
+ };
326
+ type BaseXoJob = {
288
327
  id: Branded<'job'>;
289
328
  };
329
+ export type XoBackupJob = BaseXoJob & {
330
+ compression?: 'native' | 'zstd' | '';
331
+ proxy?: XoProxy['id'];
332
+ mode: 'full' | 'delta';
333
+ name?: string;
334
+ remotes?: {
335
+ id: XoBackupRepository['id'] | {
336
+ __or: XoBackupRepository['id'][];
337
+ };
338
+ };
339
+ vms?: {
340
+ id: XoVm['id'] | {
341
+ __or: XoVm['id'][];
342
+ } | Record<string, unknown>;
343
+ };
344
+ srs: {
345
+ id: XoSr['id'] | {
346
+ __or: XoSr['id'][];
347
+ };
348
+ };
349
+ type: BACKUP_TYPE;
350
+ settings: {
351
+ '': {
352
+ cbtDestroySnapshotData?: boolean;
353
+ concurrency?: number;
354
+ longTermRetention?: {
355
+ daily?: {
356
+ retention: number;
357
+ settings: Record<string, unknown>;
358
+ };
359
+ weekly?: {
360
+ retention: number;
361
+ settings: Record<string, unknown>;
362
+ };
363
+ monthly?: {
364
+ retention: number;
365
+ settings: Record<string, unknown>;
366
+ };
367
+ yearly?: {
368
+ retention: number;
369
+ settings: Record<string, unknown>;
370
+ };
371
+ };
372
+ maxExportRate?: number;
373
+ nbdConcurrency?: number;
374
+ nRetriesVmBackupFailures?: number;
375
+ preferNbd?: boolean;
376
+ timezone?: string;
377
+ [key: string]: unknown;
378
+ };
379
+ [key: XoSchedule['id']]: {
380
+ exportRetention?: number;
381
+ healthCheckSr?: XoSr['id'];
382
+ healthCheckVmsWithTags?: string[];
383
+ fullInterval?: number;
384
+ copyRetention?: number;
385
+ snapshotRetention?: number;
386
+ cbtDestroySnapshotData?: boolean;
387
+ [key: string]: unknown;
388
+ };
389
+ };
390
+ };
391
+ export type XoJob = BaseXoJob & {};
290
392
  export type XoSchedule = {
291
393
  cron: string;
292
- enable: boolean;
394
+ enabled: boolean;
293
395
  id: Branded<'schedule'>;
294
- jobId: XoJob['id'];
396
+ jobId: (XoJob | XoBackupJob)['id'];
295
397
  name?: string;
296
398
  timezone?: string;
297
399
  };
@@ -303,6 +405,7 @@ export type XoServer = {
303
405
  httpProxy?: string;
304
406
  id: Branded<'server'>;
305
407
  label?: string;
408
+ master?: XoHost['id'];
306
409
  poolId?: XoPool['id'];
307
410
  poolNameDescription?: string;
308
411
  poolNameLabel?: string;
@@ -313,7 +416,7 @@ export type XoServer = {
313
416
  export type XoSr = BaseXapiXo & {
314
417
  $PBDs: XoPbd['id'][];
315
418
  $container: XoPool['id'] | XoHost['id'];
316
- VDIs: XoVdi['id'][];
419
+ VDIs: AnyXoVdi['id'][];
317
420
  allocationStrategy: 'thin' | 'thick' | 'unknown';
318
421
  content_type: string;
319
422
  current_operations: Record<string, STORAGE_OPERATIONS>;
@@ -322,15 +425,28 @@ export type XoSr = BaseXapiXo & {
322
425
  name_description: string;
323
426
  name_label: string;
324
427
  other_config: Record<string, string>;
325
- physical_usage: number | null;
428
+ physical_usage: number;
326
429
  shared: boolean;
327
- size: number | null;
430
+ size: number;
328
431
  sm_config: Record<string, string>;
329
432
  SR_type: string;
330
433
  tags: string[];
331
434
  type: 'SR';
332
435
  usage: number;
333
436
  };
437
+ export type XoSm = BaseXapiXo & {
438
+ id: Branded<'SM'>;
439
+ SM_type: string;
440
+ vendor: string;
441
+ name_label: string;
442
+ name_description: string;
443
+ configuration: Record<string, string>;
444
+ features: Record<string, number>;
445
+ driver_filename: string;
446
+ required_cluster_stack: string[];
447
+ supported_image_formats: string[];
448
+ type: 'SM';
449
+ };
334
450
  export type XoUser = {
335
451
  authProviders?: Record<string, string>;
336
452
  email: string;
@@ -350,8 +466,8 @@ export type XoVbd = BaseXapiXo & {
350
466
  position: string;
351
467
  read_only: boolean;
352
468
  type: 'VBD';
353
- VDI: XoVdi['id'];
354
- VM: XoVm['id'];
469
+ VDI: AnyXoVdi['id'];
470
+ VM: AnyXoVm['id'];
355
471
  };
356
472
  type BaseXoVdi = BaseXapiXo & {
357
473
  $SR: XoSr['id'];
@@ -364,6 +480,7 @@ type BaseXoVdi = BaseXapiXo & {
364
480
  name_label: string;
365
481
  other_config: Record<string, string>;
366
482
  parent?: XoVdiUnmanaged['id'];
483
+ image_format?: string;
367
484
  size: number;
368
485
  snapshots: XoVdiSnapshot['id'][];
369
486
  tags: string[];
@@ -385,7 +502,11 @@ export type XoVdiUnmanaged = BaseXoVdi & {
385
502
  };
386
503
  export type XoVgpu = BaseXapiXo & {
387
504
  id: Branded<'VGPU'>;
388
- type: 'VGPU';
505
+ type: 'vgpu';
506
+ };
507
+ export type XoVgpuType = BaseXapiXo & {
508
+ id: Branded<'vgpu-type'>;
509
+ type: 'vgpuType';
389
510
  };
390
511
  export type XoVif = BaseXapiXo & {
391
512
  $VM: XoVm['id'];
@@ -448,7 +569,10 @@ export type XoVtpm = BaseXapiXo & {
448
569
  id: Branded<'VTPM'>;
449
570
  type: 'VTPM';
450
571
  };
451
- export type XapiXoRecord = XoAlarm | XoHost | XoMessage | XoNetwork | XoPif | XoPool | XoSr | XoVbd | XoVdi | XoVdiSnapshot | XoVdiUnmanaged | XoVgpu | XoVif | XoVm | XoVmController | XoVmSnapshot | XoVmTemplate | XoVtpm;
452
- export type NonXapiXoRecord = XoGroup | XoJob | XoSchedule | XoServer | XoUser;
572
+ export type XapiXoRecord = XoAlarm | XoGpuGroup | XoHost | XoMessage | XoNetwork | XoPci | XoPgpu | XoPif | XoPool | XoSr | XoVbd | XoVdi | XoVdiSnapshot | XoVdiUnmanaged | XoVgpu | XoVgpuType | XoVif | XoVm | XoVmController | XoVmSnapshot | XoVmTemplate | XoVtpm | XoSm;
573
+ export type NonXapiXoRecord = XoGroup | XoProxy | XoJob | XoBackupRepository | XoSchedule | XoServer | XoUser;
453
574
  export type XoRecord = XapiXoRecord | NonXapiXoRecord;
575
+ export type AnyXoVm = XoVm | XoVmSnapshot | XoVmTemplate | XoVmController;
576
+ export type AnyXoVdi = XoVdi | XoVdiSnapshot | XoVdiUnmanaged;
577
+ export type AnyXoJob = XoJob | XoBackupJob;
454
578
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vates/types",
3
3
  "private": false,
4
- "version": "1.4.1",
4
+ "version": "1.6.0",
5
5
  "main": "./dist/index.mjs",
6
6
  "exports": {
7
7
  ".": {
@@ -17,6 +17,10 @@
17
17
  "./lib/vates/*": {
18
18
  "default": "./dist/lib/vates-*.mjs",
19
19
  "type": "./dist/lib/vates-*.d.mts"
20
+ },
21
+ "./lib/xen-orchestra/*": {
22
+ "default": "./dist/lib/xen-orchestra-*.mjs",
23
+ "type": "./dist/lib/xen-orchestra-*.d.mts"
20
24
  }
21
25
  },
22
26
  "type": "module",