@vates/types 1.6.0 → 1.8.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 +49 -41
- package/dist/lib/xen-orchestra-xapi.d.mts +11 -4
- package/package.json +1 -1
package/dist/common.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { XoHost } from './xo.mjs';
|
|
1
2
|
declare const __brand: unique symbol;
|
|
2
3
|
export type Branded<TBrand extends string, TType = string> = TType & {
|
|
3
4
|
[__brand]: TBrand;
|
|
@@ -528,65 +529,72 @@ type XapiStatsResponse<T> = {
|
|
|
528
529
|
interval: number;
|
|
529
530
|
stats: T;
|
|
530
531
|
};
|
|
532
|
+
type StatValues = (number | null)[];
|
|
533
|
+
type RecordStatValues = Record<string, StatValues>;
|
|
531
534
|
export type XapiStatsGranularity = 'seconds' | 'minutes' | 'hours' | 'days';
|
|
532
|
-
export type
|
|
533
|
-
cpus?:
|
|
535
|
+
export type XapiHostStatsRaw = {
|
|
536
|
+
cpus?: RecordStatValues;
|
|
534
537
|
ioThroughput?: {
|
|
535
|
-
r:
|
|
536
|
-
w:
|
|
538
|
+
r: RecordStatValues;
|
|
539
|
+
w: RecordStatValues;
|
|
537
540
|
};
|
|
538
541
|
iops?: {
|
|
539
|
-
r:
|
|
540
|
-
w:
|
|
542
|
+
r: RecordStatValues;
|
|
543
|
+
w: RecordStatValues;
|
|
541
544
|
};
|
|
542
|
-
iowait?:
|
|
545
|
+
iowait?: RecordStatValues;
|
|
543
546
|
latency?: {
|
|
544
|
-
r:
|
|
545
|
-
w:
|
|
547
|
+
r: RecordStatValues;
|
|
548
|
+
w: RecordStatValues;
|
|
546
549
|
};
|
|
547
|
-
load?:
|
|
548
|
-
memory?:
|
|
549
|
-
memoryFree?:
|
|
550
|
+
load?: StatValues;
|
|
551
|
+
memory?: StatValues;
|
|
552
|
+
memoryFree?: StatValues;
|
|
550
553
|
pifs?: {
|
|
551
|
-
rx:
|
|
552
|
-
tx:
|
|
554
|
+
rx: RecordStatValues;
|
|
555
|
+
tx: RecordStatValues;
|
|
553
556
|
};
|
|
554
|
-
}
|
|
555
|
-
export type
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
557
|
+
};
|
|
558
|
+
export type XapiHostStats = XapiStatsResponse<XapiHostStatsRaw>;
|
|
559
|
+
export type XapiVmStatsRaw = {
|
|
560
|
+
cpus?: RecordStatValues;
|
|
561
|
+
cpuUsage?: StatValues;
|
|
562
|
+
runstateFullrun?: StatValues;
|
|
563
|
+
runstateFullContention?: StatValues;
|
|
564
|
+
runstatePartialRun?: StatValues;
|
|
565
|
+
runstatePartialContention?: StatValues;
|
|
566
|
+
runstateConcurrencyHazard?: StatValues;
|
|
567
|
+
runstateBlocked?: StatValues;
|
|
564
568
|
iops?: {
|
|
565
|
-
r:
|
|
566
|
-
w:
|
|
569
|
+
r: RecordStatValues;
|
|
570
|
+
w: RecordStatValues;
|
|
567
571
|
};
|
|
568
|
-
memory?:
|
|
569
|
-
memoryFree?:
|
|
570
|
-
memoryTarget?:
|
|
572
|
+
memory?: StatValues;
|
|
573
|
+
memoryFree?: StatValues;
|
|
574
|
+
memoryTarget?: StatValues;
|
|
571
575
|
vifs?: {
|
|
572
|
-
rx:
|
|
573
|
-
tx:
|
|
576
|
+
rx: RecordStatValues;
|
|
577
|
+
tx: RecordStatValues;
|
|
574
578
|
};
|
|
575
579
|
vifErrors?: {
|
|
576
|
-
rx:
|
|
577
|
-
tx:
|
|
580
|
+
rx: RecordStatValues;
|
|
581
|
+
tx: RecordStatValues;
|
|
578
582
|
};
|
|
579
583
|
xvds?: {
|
|
580
|
-
w?:
|
|
581
|
-
r?:
|
|
582
|
-
total?:
|
|
584
|
+
w?: RecordStatValues;
|
|
585
|
+
r?: RecordStatValues;
|
|
586
|
+
total?: RecordStatValues;
|
|
583
587
|
};
|
|
584
588
|
vbdLatency?: {
|
|
585
|
-
w:
|
|
586
|
-
r:
|
|
589
|
+
w: RecordStatValues;
|
|
590
|
+
r: RecordStatValues;
|
|
587
591
|
};
|
|
588
|
-
vbdIowait?:
|
|
589
|
-
vbdInflight?:
|
|
590
|
-
vbdAvgquSz?:
|
|
592
|
+
vbdIowait?: RecordStatValues;
|
|
593
|
+
vbdInflight?: RecordStatValues;
|
|
594
|
+
vbdAvgquSz?: RecordStatValues;
|
|
595
|
+
};
|
|
596
|
+
export type XapiVmStats = XapiStatsResponse<XapiVmStatsRaw>;
|
|
597
|
+
export type XapiPoolStats = Record<XoHost['id'], XapiHostStats | {
|
|
598
|
+
error: Record<string, unknown>;
|
|
591
599
|
}>;
|
|
592
600
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WrappedXenApiRecord, XenApiNetworkWrapped, XenApiRecord, XenApiSr, XenApiVdi, XenApiVm, XenApiVmWrapped } from '../xen-api.mjs';
|
|
1
|
+
import { WrappedXenApiRecord, XenApiHost, XenApiNetworkWrapped, XenApiRecord, XenApiSr, XenApiTask, XenApiVdi, XenApiVm, XenApiVmWrapped } from '../xen-api.mjs';
|
|
2
2
|
import type { Readable } from 'node:stream';
|
|
3
3
|
import type { XoGpuGroup, XoVgpuType, XoHost, XoNetwork, XoPif, XoSr, XoUser, XoVdi, XoVm, XoVmTemplate } from '../xo.mjs';
|
|
4
4
|
type XcpPatches = {
|
|
@@ -56,9 +56,9 @@ export interface Xapi {
|
|
|
56
56
|
/**
|
|
57
57
|
* if startOnly is true and the VM is not halted, throw VM_BAD_POWER_STATE
|
|
58
58
|
* otherwise, unpause/resume the VM
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
*
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
62
|
startOnly?: boolean;
|
|
63
63
|
}): Promise<void>;
|
|
64
64
|
VM_import(stream: Readable, srRef?: XenApiSr['$ref'], onVmCreation?: null | ((vm: XenApiVm) => unknown)): Promise<XenApiVm['$ref']>;
|
|
@@ -117,5 +117,12 @@ export interface Xapi {
|
|
|
117
117
|
bypassBlockedOperation?: boolean;
|
|
118
118
|
forceDeleteDefaultTemplate?: boolean;
|
|
119
119
|
}): Promise<void>;
|
|
120
|
+
getResource(pathname: string, params?: {
|
|
121
|
+
host?: XenApiHost;
|
|
122
|
+
query?: Record<string, unknown>;
|
|
123
|
+
task?: boolean | XenApiTask['$ref'];
|
|
124
|
+
}): Promise<{
|
|
125
|
+
body: Readable;
|
|
126
|
+
}>;
|
|
120
127
|
}
|
|
121
128
|
export {};
|