-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/model: Add Action, Step types and related methods
This change adds the Steps object to replace the stateswitch.Transition* types. It also adds struct tags for all the fields so they can be serialized to be stored in the KV. Moves DeviceQueryor interface into its own package for easier import without conflicts.
- Loading branch information
Showing
10 changed files
with
1,147 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package device | ||
|
||
import ( | ||
"context" | ||
"os" | ||
|
||
"github.com/bmc-toolbox/common" | ||
|
||
bconsts "github.com/bmc-toolbox/bmclib/v2/constants" | ||
) | ||
|
||
//go:generate mockgen -source model.go -destination=../fixtures/mock.go -package=fixtures | ||
|
||
// Queryor interface defines methods to query a device. | ||
// | ||
// This is common interface to the ironlib and bmclib libraries. | ||
type Queryor interface { | ||
// Open opens the connection to the device. | ||
Open(ctx context.Context) error | ||
|
||
// Close closes the connection to the device. | ||
Close(ctx context.Context) error | ||
|
||
PowerStatus(ctx context.Context) (status string, err error) | ||
|
||
SetPowerState(ctx context.Context, state string) error | ||
|
||
ResetBMC(ctx context.Context) error | ||
|
||
// Reinitializes the underlying device queryor client to purge old session information. | ||
ReinitializeClient(ctx context.Context) | ||
|
||
// Inventory returns the device inventory | ||
Inventory(ctx context.Context) (*common.Device, error) | ||
|
||
FirmwareInstallSteps(ctx context.Context, component string) ([]bconsts.FirmwareInstallStep, error) | ||
|
||
FirmwareUpload(ctx context.Context, component string, reader *os.File) (uploadVerifyTaskID string, err error) | ||
|
||
FirmwareTaskStatus(ctx context.Context, kind bconsts.FirmwareInstallStep, component, taskID, installVersion string) (state bconsts.TaskState, status string, err error) | ||
|
||
FirmwareInstallUploaded(ctx context.Context, component, uploadVerifyTaskID string) (installTaskID string, err error) | ||
|
||
FirmwareInstallUploadAndInitiate(ctx context.Context, component string, file *os.File) (taskID string, err error) | ||
} |
Oops, something went wrong.