Skip to content

Commit 9ffd71e

Browse files
committed
web: Types based on the storage proposal schema
1 parent 9516fae commit 9ffd71e

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

web/src/api/storage/proposal.ts

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
/* eslint-disable */
2+
/**
3+
* This file was automatically generated by json-schema-to-typescript.
4+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5+
* and run json-schema-to-typescript to regenerate this file.
6+
*/
7+
8+
export type MDLevel = "raid0" | "raid1" | "raid5" | "raid6" | "raid10";
9+
10+
/**
11+
* API description of the storage proposal.
12+
*/
13+
export interface Proposal {
14+
/**
15+
* Expected layout of the system after the commit phase.
16+
*/
17+
devices?: StorageDevice[];
18+
/**
19+
* Sorted list of actions to execute during the commit phase.
20+
*/
21+
actions?: Action[];
22+
}
23+
/**
24+
* Schema to describe a device both in 'system' and 'proposal'.
25+
*/
26+
export interface StorageDevice {
27+
sid: number;
28+
name: string;
29+
description?: string;
30+
block?: Block;
31+
drive?: Drive;
32+
filesystem?: Filesystem;
33+
md?: Md;
34+
multipath?: Multipath;
35+
partitionTable?: PartitionTable;
36+
partition?: Partition;
37+
partitions?: StorageDevice[];
38+
volumeGroup?: VolumeGroup;
39+
logicalVolumes?: StorageDevice[];
40+
}
41+
export interface Block {
42+
start: number;
43+
size: number;
44+
active?: boolean;
45+
encrypted?: boolean;
46+
udevIds?: string[];
47+
udevPaths?: string[];
48+
systems?: string[];
49+
shrinking: ShrinkingSupported | ShrinkingUnsupported;
50+
}
51+
export interface ShrinkingSupported {
52+
supported?: number;
53+
}
54+
export interface ShrinkingUnsupported {
55+
unsupported?: string[];
56+
}
57+
export interface Drive {
58+
type?: "disk" | "raid" | "multipath" | "dasd";
59+
vendor?: string;
60+
model?: string;
61+
transport?: string;
62+
bus?: string;
63+
busId?: string;
64+
driver?: string[];
65+
info?: DriveInfo;
66+
}
67+
export interface DriveInfo {
68+
sdCard?: boolean;
69+
dellBoss?: boolean;
70+
}
71+
export interface Filesystem {
72+
sid: number;
73+
type:
74+
| "bcachefs"
75+
| "btrfs"
76+
| "exfat"
77+
| "ext2"
78+
| "ext3"
79+
| "ext4"
80+
| "f2fs"
81+
| "jfs"
82+
| "nfs"
83+
| "nilfs2"
84+
| "ntfs"
85+
| "reiserfs"
86+
| "swap"
87+
| "tmpfs"
88+
| "vfat"
89+
| "xfs";
90+
mountPath?: string;
91+
label?: string;
92+
}
93+
export interface Md {
94+
level: MDLevel;
95+
devices: number[];
96+
uuid?: string;
97+
}
98+
export interface Multipath {
99+
wireNames: string[];
100+
}
101+
export interface PartitionTable {
102+
type: "gpt" | "msdos" | "dasd";
103+
unusedSlots: number[][];
104+
}
105+
export interface Partition {
106+
efi: boolean;
107+
}
108+
export interface VolumeGroup {
109+
size: number;
110+
physicalVolumes: number[];
111+
}
112+
export interface Action {
113+
device: number;
114+
text: string;
115+
subvol?: boolean;
116+
delete?: boolean;
117+
resize?: boolean;
118+
}

0 commit comments

Comments
 (0)