@vates/types 1.25.1 → 1.26.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.
@@ -1,7 +1,56 @@
1
1
  import { WrappedXenApiRecord, XenApiHost, XenApiHostWrapped, XenApiNetwork, XenApiNetworkWrapped, XenApiRecord, XenApiSr, XenApiTask, XenApiVbd, XenApiVdi, XenApiVif, XenApiVm, XenApiVmWrapped, XenApiVtpm } from '../xen-api.mjs';
2
- import type { BOND_MODE, OPAQUE_REF_NULL, SUPPORTED_VDI_FORMAT, VBD_MODE, VBD_TYPE, VDI_TYPE, VIF_LOCKING_MODE } from '../common.mjs';
2
+ import type { BOND_MODE, OPAQUE_REF_NULL, SUPPORTED_VDI_FORMAT, VBD_MODE, VBD_TYPE, VDI_TYPE, VIF_LOCKING_MODE, VM_OPERATIONS } from '../common.mjs';
3
3
  import type { PassThrough, Readable } from 'node:stream';
4
4
  import type { XapiXoRecord, XoGpuGroup, XoHost, XoNetwork, XoPif, XoSr, XoUser, XoVdi, XoVgpuType, XoVm, XoVmTemplate, XoVif, XoVmSnapshot } from '../xo.mjs';
5
+ /**
6
+ * Properties accepted by {@link Xapi.editVm}.
7
+ *
8
+ * Field names match the canonical (camelCase) properties defined by the
9
+ * underlying `_editVm` (via `makeEditObject`). `_editVm` still resolves the
10
+ * snake_case and legacy aliases, but the canonical names are used here.
11
+ */
12
+ export interface EditVmProps {
13
+ affinityHost?: string | null;
14
+ autoPoweron?: boolean;
15
+ blockedOperations?: Partial<Record<VM_OPERATIONS, boolean | string | null>>;
16
+ coresPerSocket?: number | string | null;
17
+ cpuCap?: number | null;
18
+ cpuMask?: number[];
19
+ cpuWeight?: number | null;
20
+ cpus?: number;
21
+ cpusStaticMax?: number | string;
22
+ /**
23
+ * Update VM creation metadata stored under `other_config.xo:*`. The object is
24
+ * merged with the existing data.
25
+ */
26
+ creation?: {
27
+ user?: string;
28
+ };
29
+ expNestedHvm?: boolean;
30
+ hasVendorDevice?: boolean;
31
+ highAvailability?: 'best-effort' | 'restart' | '';
32
+ hvmBootFirmware?: string | null;
33
+ memory?: number | string;
34
+ memoryMax?: number | string;
35
+ memoryMin?: number | string;
36
+ memoryStaticMax?: number | string;
37
+ nameDescription?: string;
38
+ nameLabel?: string;
39
+ nestedVirt?: boolean;
40
+ nicType?: string | null;
41
+ notes?: string | null;
42
+ PV_args?: string;
43
+ secureBoot?: boolean;
44
+ startDelay?: number;
45
+ suspendSr?: string | null;
46
+ tags?: string[];
47
+ uefiMode?: 'setup' | 'user';
48
+ vga?: 'std' | 'cirrus';
49
+ videoram?: 1 | 2 | 4 | 8 | 16;
50
+ viridian?: boolean;
51
+ virtualizationMode?: 'pv' | 'hvm';
52
+ xenStoreData?: Record<string, string | null>;
53
+ }
5
54
  export type XcpPatches = {
6
55
  changelog?: {
7
56
  author: string;
@@ -105,6 +154,7 @@ export interface Xapi {
105
154
  xenstore_data?: Record<string, string>;
106
155
  }): Promise<XenApiVdi['$ref']>;
107
156
  SR_reclaimSpace(ref: XenApiSr['$ref']): Promise<void>;
157
+ editVm(id: XoVm['id'], props: EditVmProps, checkLimits?: (limits: Record<string, number>, vm: XenApiVmWrapped) => Promise<void>): Promise<void>;
108
158
  startVm(id: XoVm['id'], opts?: {
109
159
  bypassMacAddressesCheck?: boolean;
110
160
  force?: boolean;
package/dist/xo-app.d.mts CHANGED
@@ -269,6 +269,8 @@ export type XoApp = {
269
269
  rebootVm?: boolean;
270
270
  parentTask?: VatesTask;
271
271
  }): Promise<void>;
272
+ setVmResourceSet(vmId: XoVm['id'], resourceSetId: string | null, force?: boolean): Promise<void>;
273
+ shareVmResourceSet(vmId: XoVm['id']): Promise<void>;
272
274
  removeUserFromGroup(userId: XoUser['id'], id: XoGroup['id']): Promise<void>;
273
275
  runJob(job: AnyXoJob, schedule: XoSchedule): void;
274
276
  runWithApiContext: (user: XoUser | undefined, fn: () => void) => Promise<unknown>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vates/types",
3
3
  "private": false,
4
- "version": "1.25.1",
4
+ "version": "1.26.0",
5
5
  "main": "./dist/index.mjs",
6
6
  "exports": {
7
7
  ".": {