99 "fmt"
1010
1111 "github.com/stmcginnis/gofish"
12- "github.com/stmcginnis/gofish/common"
13- "github.com/stmcginnis/gofish/redfish"
12+ "github.com/stmcginnis/gofish/schemas"
1413 "k8s.io/apimachinery/pkg/api/resource"
1514
1615 "github.com/ironcore-dev/metal-operator/bmc/oem"
@@ -37,7 +36,7 @@ type BMC interface {
3736 ForcePowerOff (ctx context.Context , systemURI string ) error
3837
3938 // Reset performs a reset on the system.
40- Reset (ctx context.Context , systemURI string , resetType redfish .ResetType ) error
39+ Reset (ctx context.Context , systemURI string , resetType schemas .ResetType ) error
4140
4241 // SetPXEBootOnce sets the boot device for the next system boot.
4342 SetPXEBootOnce (ctx context.Context , systemURI string ) error
@@ -52,37 +51,37 @@ type BMC interface {
5251 GetSystems (ctx context.Context ) ([]Server , error )
5352
5453 // GetManager returns the manager
55- GetManager (UUID string ) (* redfish .Manager , error )
54+ GetManager (UUID string ) (* schemas .Manager , error )
5655
5756 // ResetManager performs a reset on the Manager.
58- ResetManager (ctx context.Context , UUID string , resetType redfish .ResetType ) error
57+ ResetManager (ctx context.Context , UUID string , resetType schemas .ResetType ) error
5958
6059 // GetBootOrder retrieves the boot order for the system.
6160 GetBootOrder (ctx context.Context , systemURI string ) ([]string , error )
6261
6362 // GetBiosAttributeValues retrieves BIOS attribute values for the system.
64- GetBiosAttributeValues (ctx context.Context , systemURI string , attributes []string ) (redfish .SettingsAttributes , error )
63+ GetBiosAttributeValues (ctx context.Context , systemURI string , attributes []string ) (schemas .SettingsAttributes , error )
6564
6665 // GetBiosPendingAttributeValues retrieves pending BIOS attribute values for the system.
67- GetBiosPendingAttributeValues (ctx context.Context , systemURI string ) (redfish .SettingsAttributes , error )
66+ GetBiosPendingAttributeValues (ctx context.Context , systemURI string ) (schemas .SettingsAttributes , error )
6867
6968 // GetBMCAttributeValues retrieves BMC attribute values for the system.
70- GetBMCAttributeValues (ctx context.Context , UUID string , attributes map [string ]string ) (redfish .SettingsAttributes , error )
69+ GetBMCAttributeValues (ctx context.Context , UUID string , attributes map [string ]string ) (schemas .SettingsAttributes , error )
7170
7271 // GetBMCPendingAttributeValues retrieves pending BMC attribute values for the system.
73- GetBMCPendingAttributeValues (ctx context.Context , UUID string ) (result redfish .SettingsAttributes , err error )
72+ GetBMCPendingAttributeValues (ctx context.Context , UUID string ) (result schemas .SettingsAttributes , err error )
7473
7574 // CheckBiosAttributes checks if the BIOS attributes are valid and returns whether a reset is required.
76- CheckBiosAttributes (attrs redfish .SettingsAttributes ) (reset bool , err error )
75+ CheckBiosAttributes (attrs schemas .SettingsAttributes ) (reset bool , err error )
7776
7877 // CheckBMCAttributes checks if the BMC attributes are valid and returns whether a reset is required.
79- CheckBMCAttributes (ctx context.Context , UUID string , attrs redfish .SettingsAttributes ) (reset bool , err error )
78+ CheckBMCAttributes (ctx context.Context , UUID string , attrs schemas .SettingsAttributes ) (reset bool , err error )
8079
8180 // SetBiosAttributesOnReset sets BIOS attributes on the system and applies them on the next reset.
82- SetBiosAttributesOnReset (ctx context.Context , systemURI string , attributes redfish .SettingsAttributes ) (err error )
81+ SetBiosAttributesOnReset (ctx context.Context , systemURI string , attributes schemas .SettingsAttributes ) (err error )
8382
8483 // SetBMCAttributesImmediately sets BMC attributes on the system and applies them immediately.
85- SetBMCAttributesImmediately (ctx context.Context , UUID string , attributes redfish .SettingsAttributes ) (err error )
84+ SetBMCAttributesImmediately (ctx context.Context , UUID string , attributes schemas .SettingsAttributes ) (err error )
8685
8786 // GetBiosVersion retrieves the BIOS version for the system.
8887 GetBiosVersion (ctx context.Context , systemURI string ) (string , error )
@@ -100,19 +99,19 @@ type BMC interface {
10099 GetProcessors (ctx context.Context , systemURI string ) ([]Processor , error )
101100
102101 // UpgradeBiosVersion upgrades the BIOS version for the system.
103- UpgradeBiosVersion (ctx context.Context , manufacturer string , parameters * redfish. SimpleUpdateParameters ) (string , bool , error )
102+ UpgradeBiosVersion (ctx context.Context , manufacturer string , parameters * schemas. UpdateServiceSimpleUpdateParameters ) (string , bool , error )
104103
105104 // GetBiosUpgradeTask retrieves the task for the BIOS upgrade.
106- GetBiosUpgradeTask (ctx context.Context , manufacturer string , taskURI string ) (* redfish .Task , error )
105+ GetBiosUpgradeTask (ctx context.Context , manufacturer string , taskURI string ) (* schemas .Task , error )
107106
108107 // WaitForServerPowerState waits for the server to reach the specified power state.
109- WaitForServerPowerState (ctx context.Context , systemURI string , powerState redfish .PowerState ) error
108+ WaitForServerPowerState (ctx context.Context , systemURI string , powerState schemas .PowerState ) error
110109
111110 // UpgradeBMCVersion upgrades the BMC version for the system.
112- UpgradeBMCVersion (ctx context.Context , manufacturer string , parameters * redfish. SimpleUpdateParameters ) (string , bool , error )
111+ UpgradeBMCVersion (ctx context.Context , manufacturer string , parameters * schemas. UpdateServiceSimpleUpdateParameters ) (string , bool , error )
113112
114113 // GetBMCUpgradeTask retrieves the task for the BMC upgrade.
115- GetBMCUpgradeTask (ctx context.Context , manufacturer string , taskURI string ) (* redfish .Task , error )
114+ GetBMCUpgradeTask (ctx context.Context , manufacturer string , taskURI string ) (* schemas .Task , error )
116115
117116 // CreateOrUpdateAccount creates or updates a BMC user account.
118117 CreateOrUpdateAccount (ctx context.Context , userName , role , password string , enabled bool ) error
@@ -121,10 +120,10 @@ type BMC interface {
121120 DeleteAccount (ctx context.Context , userName , id string ) error
122121
123122 // GetAccounts retrieves all BMC user accounts.
124- GetAccounts () ([]* redfish .ManagerAccount , error )
123+ GetAccounts () ([]* schemas .ManagerAccount , error )
125124
126125 // GetAccountService retrieves the account service.
127- GetAccountService () (* redfish .AccountService , error )
126+ GetAccountService () (* schemas .AccountService , error )
128127}
129128
130129type Entity struct {
@@ -163,7 +162,7 @@ type RegistryEntry struct {
163162
164163// Registry describes the Message Registry file locator Resource.
165164type Registry struct {
166- common .Entity
165+ schemas .Entity
167166 // ODataContext is the odata context.
168167 ODataContext string `json:"@odata.context"`
169168 // ODataType is the odata type.
@@ -189,7 +188,7 @@ type Server struct {
189188 URI string
190189 Model string
191190 Manufacturer string
192- PowerState redfish .PowerState
191+ PowerState schemas .PowerState
193192 SerialNumber string
194193}
195194
@@ -199,9 +198,9 @@ type Volume struct {
199198 // CapacityBytes specifies the capacity of the volume in bytes.
200199 SizeBytes int64 `json:"sizeBytes,omitempty"`
201200 // Status specifies the status of the volume.
202- State common .State `json:"state,omitempty"`
201+ State schemas .State `json:"state,omitempty"`
203202 // RAIDType specifies the RAID type of the associated Volume.
204- RAIDType redfish .RAIDType `json:"raidType,omitempty"`
203+ RAIDType schemas .RAIDType `json:"raidType,omitempty"`
205204 // VolumeUsage specifies the volume usage type for the Volume.
206205 VolumeUsage string `json:"volumeUsage,omitempty"`
207206}
@@ -212,22 +211,22 @@ type Drive struct {
212211 // MediaType specifies the media type of the storage device.
213212 MediaType string `json:"mediaType,omitempty"`
214213 // Type specifies the type of the storage device.
215- Type redfish .FormFactor `json:"type,omitempty"`
214+ Type schemas .FormFactor `json:"type,omitempty"`
216215 // SizeBytes specifies the size of the storage device in bytes.
217216 SizeBytes int64 `json:"sizeBytes,omitempty"`
218217 // Vendor specifies the vendor of the storage device.
219218 Vendor string `json:"vendor,omitempty"`
220219 // Model specifies the model of the storage device.
221220 Model string `json:"model,omitempty"`
222221 // State specifies the state of the storage device.
223- State common .State `json:"state,omitempty"`
222+ State schemas .State `json:"state,omitempty"`
224223}
225224
226225// Storage represents a storage resource.
227226type Storage struct {
228227 Entity
229228 // State specifies the state of the storage.
230- State common .State `json:"state,omitempty"`
229+ State schemas .State `json:"state,omitempty"`
231230 // Drives is a collection of drives associated with this storage.
232231 Drives []Drive `json:"drives,omitempty"`
233232 // Volumes is a collection of volumes associated with this storage.
@@ -260,8 +259,8 @@ type Processor struct {
260259type SystemInfo struct {
261260 Manufacturer string
262261 Model string
263- Status common .Status
264- PowerState redfish .PowerState
262+ Status schemas .Status
263+ PowerState schemas .PowerState
265264 TotalSystemMemory resource.Quantity
266265 SystemURI string
267266 SystemUUID string
@@ -285,7 +284,7 @@ type Manager struct {
285284 OemLinks json.RawMessage
286285}
287286
288- func NewOEMManager (manager * redfish .Manager , service * gofish.Service ) (oem.ManagerInterface , error ) {
287+ func NewOEMManager (manager * schemas .Manager , service * gofish.Service ) (oem.ManagerInterface , error ) {
289288 var OEMManager oem.ManagerInterface
290289 switch manager .Manufacturer {
291290 case string (ManufacturerDell ):
0 commit comments