-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
326 lines (287 loc) · 8.08 KB
/
types.ts
File metadata and controls
326 lines (287 loc) · 8.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
import {BootSourceOverrideEnabledType, DeviceType} from './enums';
/**
* Redfish API 的返回数据结构
*/
type UUID = string;
export type Action = { target: string };
export interface RedfishRoot {
Id: string; // 根资源的唯一标识符
Name: string; // 根资源的友好名称
Description?: string; // 根资源的描述,注意华为等厂商可能没有此属性
RedfishVersion: string; // Redfish版本
UUID?: UUID; // 根资源的 UUID,注意 Dell 等厂商可能没有此属性
Product?: string; // 产品名称,华为等厂商可能没有此属性
ProductName?: string; // 产品名称,Dell 等厂商可能没有此属性
Links: { // 根资源的关联资源链接
Sessions: { '@odata.id': string; }; // 指向会话资源的引用
};
Oem?: Record<string, object>;
}
export interface RedfishSession {
Id: string;
}
export interface Systems {
Members: Array<{ '@odata.id': string }>;
"Members@odata.count": number;
Name: string;
}
export interface SystemInfo {
"@odata.id": string;
Id: string;
Name: string;
Model: string;
Manufacturer: string;
SerialNumber: string;
HostName: string;
Memory: { '@odata.id': string };
MemorySummary: {
TotalSystemMemoryGiB: number;
Status: {
State: string;
Health: string;
HealthRollup: string;
}
};
UUID?: string;
PowerState: 'On' | 'Off';
PCIeDevices?: Array<{ '@odata.id': string }>;
Processors: { '@odata.id': string };
Actions: Record<string, Action>;
Boot: {
BootOptions?: {
"@odata.id": string;
};
BootOrder?: Array<string>;
BootSourceOverrideTarget: string;
BootSourceOverrideEnabled: BootSourceOverrideEnabledType;
BootSourceOverrideMode: string;
'BootSourceOverrideTarget@Redfish.AllowableValues': Array<string>;
};
Links: {
ManagedBy?: Array<{ '@odata.id': string }>;
Managers?: Array<{ '@odata.id': string }>;
Chassis: Array<{ '@odata.id': string }>;
}
VirtualMedia?: { '@odata.id': string };
Etag?: string; // ETag 属性,iBMC 中使用
}
export interface Manager {
Id: string;
ManagerType: string;
PowerState: string;
Actions: Record<string, Action> & { Oem?: Record<string, Action> };
VirtualMedia: { '@odata.id': string };
}
export interface ProcessorsCollection {
Members: Array<{ "@odata.id": string; }>;
"Members@odata.count": number;
}
export interface Processor {
Id: string;
InstructionSet: string;
Manufacturer: string;
MaxSpeedMHz: number;
Model: string;
ProcessorArchitecture: string;
ProcessorType: string;
Socket: string;
Status: {
State: string;
Health: string;
};
TotalCores: number;
TotalThreads: number;
}
interface PCIeDeviceStatus {
State?: string; // 资源的状态
Health?: string; // 资源的健康状态
HealthRollup?: string; // 所有下级资源的聚合健康状态
}
export interface PCIeDevice {
// 基本资源属性
Id: string;
Name: string;
Description?: string;
// PCIe设备制造信息
Manufacturer?: string; // 制造商名称
Model?: string; // 型号
SKU?: string; // 库存单位编号
SerialNumber?: string; // 序列号
PartNumber?: string; // 部件号
AssetTag?: string; // 用户分配的资产标签(可读写)
// 设备特性
DeviceType: DeviceType; // 设备类型(单功能/多功能/模拟)
FirmwareVersion?: string; // 固件版本
// 状态和链接
Status: PCIeDeviceStatus; // 设备状态
Links: {
// 包含该PCIe设备的机箱数组
Chassis: Array<{ '@odata.id': string; }>; // 指向Chassis资源的引用
'Chassis@odata.count'?: number; // Chassis集合计数(可选)
// 该设备公开的PCIe功能数组
PCIeFunctions: Array<{ '@odata.id': string; }>; // 指向PCIeFunction资源的引用
'PCIeFunctions@odata.count'?: number; // PCIeFunctions集合计数(可选)
// 允许的OEM特定链接
Oem?: any;
}; // 关联资源链接
// 允许OEM扩展
Oem?: any;
}
export interface MemoryCollection {
Members: Array<{ '@odata.id': string }>;
"Members@odata.count": number;
}
export interface Memory {
Id: string;
Name: string;
Manufacturer: string;
PartNumber: string;
CapacityMiB: number;
OperatingSpeedMhz: number;
MemoryDeviceType: string;
Status: {
State: string;
Health: string;
};
}
export interface RedfishError {
error?: {
'@Message.ExtendedInfo': Array<{
Message: string;
MessageId: string;
Resolution: string;
Severity: string;
}>
};
code?: number;
}
export interface VirtualMediaCollection {
Members: Array<{ '@odata.id': string }>;
}
export interface VirtualMediaMember {
'@odata.id': string
}
export interface VirtualMedia {
'@odata.id': string
MediaTypes: Array<string>
Inserted: boolean;
Image: string;
ImageName: string;
Actions?: Record<string, Action>;
Oem?: Record<string, any>;
}
export interface Message {
Message: string;
MessageID?: string;
Severity?: string;
MessageArgs?: any[];
"MessageArgs@odata.count"?: number;
MessageId?: string;
}
export interface Task {
"@odata.id": string;
Description: string;
EndTime: Date;
Id: string;
Messages: Message[];
"Messages@odata.count": number;
Name: string;
PercentComplete: number;
StartTime: Date;
TaskState: string;
TaskStatus: string;
}
export interface Chassis {
Id: string;
Name: string;
ChassisType: string;
SerialNumber: string;
PartNumber: string;
AssetTag: string;
IndicatorLED: string;
PowerState: string;
Status: {
State: string;
Health: string;
HealthRollup: string;
};
Power: { '@odata.id': string };
PCIeDevices: { '@odata.id': string };
Thermal: { '@odata.id': string };
NetworkAdapters: { '@odata.id': string };
PCIeSlots: { '@odata.id': string };
Sensors: { '@odata.id': string };
Memory: { '@odata.id': string };
}
export interface Collection {
Members: Array<{ '@odata.id': string }>;
"Members@odata.count"?: number;
}
export interface NetworkAdapter {
Id: string;
Name: string;
Manufacturer: string;
Model: string;
NetworkPorts: { '@odata.id': string };
Status: {
State: string;
Health: string;
HealthRollup: string;
};
}
export interface NetworkPort {
Id: string;
AssociatedNetworkAddresses: string[];
LinkStatus: "Down" | "Up" | "Starting" | "Training";
CurrentLinkSpeedMbps?: number;
}
/**
* Redfish Client 的返回数据结构
*/
export interface CPUInfo {
id: string; // 处理器ID
manufacturer: string; // 制造商
model: string; // 型号
architecture: string; // 处理器架构
cores: number; // 核心数
threads: number; // 线程数
speedMHz: number; // 最大频率(MHz)
socket: string; // 插槽
status: string; // 状态
}
export interface PCIeInfo { // 返回的 PCIe 设备信息
id: string; // 设备ID
manufacturer: string; // 制造商
model: string; // 型号
type: DeviceType; // 设备类型
health: string; // 健康状态
}
export interface MemoryInfo {
id: string;
manufacturer: string;
model: string;
capacityMiB: number;
speedMHz: number;
type: string;
status: string;
}
export interface NetworkPortInfo {
macAddress: string; // MAC 地址
linkStatus: "Down" | "Up" | "Starting" | "Training"; // 连接状态
speedMbps: number; // 链路速度(Mbps),若未获取到返回 -1
speedDisplay: string; // 链路速度显示,在 iBMC 中使用,返回的值为字符串
}
export interface NetworkCardInfo {
id: string; // 网络适配器ID
manufacturer: string; // 制造商
model: string; // 型号
ports: NetworkPortInfo[]; // 网络端口信息
status: string; // 健康状态
}
export interface InsertMediaRequest {
Image: string;
Inserted?: boolean;
WriteProtected?: boolean;
TransferProtocolType?: 'CIFS' | 'FTP' | 'SFTP' | 'HTTP' | 'HTTPS' | 'NFS' | 'OEM' | 'TFTP';
TransferMethod?: 'Stream' | 'Upload';
}