Skip to content

Commit 8cd2988

Browse files
committed
web: Types based on the storage system schema
1 parent d9381bf commit 8cd2988

File tree

2 files changed

+163
-0
lines changed

2 files changed

+163
-0
lines changed

web/src/api/storage/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@
2323
export * from "./types/openapi";
2424
export * as config from "./types/config";
2525
export * as apiModel from "./types/model";
26+
export * as system from "./types/system";
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
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 FilesystemType =
9+
| "bcachefs"
10+
| "btrfs"
11+
| "exfat"
12+
| "ext2"
13+
| "ext3"
14+
| "ext4"
15+
| "f2fs"
16+
| "jfs"
17+
| "nfs"
18+
| "nilfs2"
19+
| "ntfs"
20+
| "reiserfs"
21+
| "swap"
22+
| "tmpfs"
23+
| "vfat"
24+
| "xfs";
25+
export type MDLevel = "raid0" | "raid1" | "raid5" | "raid6" | "raid10";
26+
export type PtableType = "gpt" | "msdos" | "dasd";
27+
28+
/**
29+
* API description of the system
30+
*/
31+
export interface System {
32+
/**
33+
* All relevant devices on the system
34+
*/
35+
devices?: Device[];
36+
/**
37+
* SIDs of the available drives
38+
*/
39+
availableDrives?: number[];
40+
/**
41+
* SIDs of the available MD RAIDs
42+
*/
43+
availableMdRaids?: number[];
44+
/**
45+
* SIDs of the drives that are candidate for installation
46+
*/
47+
candidateDrives?: number[];
48+
/**
49+
* SIDs of the MD RAIDs that are candidate for installation
50+
*/
51+
candidateMdRaids?: number[];
52+
/**
53+
* Meaningful mount points for the current product
54+
*/
55+
productMountPoints?: string[];
56+
/**
57+
* Possible encryption methods for the current system and product
58+
*/
59+
encryptionMethods?: string[];
60+
/**
61+
* Volumes defined by the product as templates
62+
*/
63+
volumeTemplates?: Volume[];
64+
issues?: Issue[];
65+
}
66+
export interface Device {
67+
sid: number;
68+
name: string;
69+
description?: string;
70+
block?: Block;
71+
drive?: Drive;
72+
filesystem?: Filesystem;
73+
md?: Md;
74+
multipath?: Multipath;
75+
partitionTable?: PartitionTable;
76+
partition?: Partition;
77+
partitions?: Device[];
78+
volumeGroup?: VolumeGroup;
79+
logicalVolumes?: Device[];
80+
}
81+
export interface Block {
82+
start: number;
83+
size: number;
84+
active?: boolean;
85+
encrypted?: boolean;
86+
udevIds?: string[];
87+
udevPaths?: string[];
88+
systems?: string[];
89+
shrinking: ShrinkingSupported | ShrinkingUnsupported;
90+
}
91+
export interface ShrinkingSupported {
92+
supported?: number;
93+
}
94+
export interface ShrinkingUnsupported {
95+
unsupported?: string[];
96+
}
97+
export interface Drive {
98+
type?: "disk" | "raid" | "multipath" | "dasd";
99+
vendor?: string;
100+
model?: string;
101+
transport?: string;
102+
bus?: string;
103+
busId?: string;
104+
driver?: string[];
105+
info?: DriveInfo;
106+
}
107+
export interface DriveInfo {
108+
sdCard?: boolean;
109+
dellBoss?: boolean;
110+
}
111+
export interface Filesystem {
112+
sid: number;
113+
type: FilesystemType;
114+
mountPath?: string;
115+
label?: string;
116+
}
117+
export interface Md {
118+
level: MDLevel;
119+
devices: number[];
120+
uuid?: string;
121+
}
122+
export interface Multipath {
123+
wireNames: string[];
124+
}
125+
export interface PartitionTable {
126+
type: PtableType;
127+
unusedSlots: number[][];
128+
}
129+
export interface Partition {
130+
efi: boolean;
131+
}
132+
export interface VolumeGroup {
133+
size: number;
134+
physicalVolumes: number[];
135+
}
136+
export interface Volume {
137+
mountPath: string;
138+
mountOptions?: string[];
139+
fsType?: FilesystemType;
140+
autoSize: boolean;
141+
minSize: number;
142+
maxSize?: number;
143+
snapshots?: boolean;
144+
transactional?: boolean;
145+
outline?: VolumeOutline;
146+
}
147+
export interface VolumeOutline {
148+
required: boolean;
149+
supportAutoSize: boolean;
150+
fsTypes?: FilesystemType[];
151+
adjustByRam?: boolean;
152+
snapshotsConfigurable?: boolean;
153+
snapshotsAffectSizes?: boolean;
154+
sizeRelevantVolumes?: string[];
155+
}
156+
export interface Issue {
157+
description: string;
158+
class?: string;
159+
details?: string;
160+
source?: "config" | "system";
161+
severity?: "warn" | "error";
162+
}

0 commit comments

Comments
 (0)