Skip to content

Commit

Permalink
Merge pull request #380 from bmc-toolbox/openbmc-smc-bmcreset
Browse files Browse the repository at this point in the history
openbmc, supermicro: implement BMCResetter interface
  • Loading branch information
joelrebel authored Dec 6, 2023
2 parents 4d960aa + 91cfd91 commit 1063371
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions providers/openbmc/openbmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
Features = registrar.Features{
providers.FeaturePowerState,
providers.FeaturePowerSet,
providers.FeatureBmcReset,
providers.FeatureFirmwareInstallSteps,
providers.FeatureFirmwareUploadInitiateInstall,
providers.FeatureFirmwareTaskStatus,
Expand Down Expand Up @@ -178,3 +179,8 @@ func (c *Conn) PowerSet(ctx context.Context, state string) (ok bool, err error)
func (c *Conn) Inventory(ctx context.Context) (device *common.Device, err error) {
return c.redfishwrapper.Inventory(ctx, false)
}

// BmcReset power cycles the BMC
func (c *Conn) BmcReset(ctx context.Context, resetType string) (ok bool, err error) {
return c.redfishwrapper.BMCReset(ctx, resetType)
}
10 changes: 10 additions & 0 deletions providers/supermicro/supermicro.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ var (
providers.FeatureInventoryRead,
providers.FeaturePowerSet,
providers.FeaturePowerState,
providers.FeatureBmcReset,
}
)

Expand Down Expand Up @@ -210,6 +211,15 @@ func (c *Client) PowerSet(ctx context.Context, state string) (ok bool, err error
return c.serviceClient.redfish.PowerSet(ctx, state)
}

// BmcReset power cycles the BMC
func (c *Client) BmcReset(ctx context.Context, resetType string) (ok bool, err error) {
if c.serviceClient == nil || c.serviceClient.redfish == nil {
return false, errors.Wrap(bmclibErrs.ErrLoginFailed, "client not initialized")
}

return c.serviceClient.redfish.BMCReset(ctx, resetType)
}

// Inventory collects hardware inventory and install firmware information
func (c *Client) Inventory(ctx context.Context) (device *common.Device, err error) {
if c.serviceClient == nil || c.serviceClient.redfish == nil {
Expand Down

0 comments on commit 1063371

Please sign in to comment.