bmc

package
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BMCResetter

type BMCResetter interface {
	BmcReset(ctx context.Context, resetType string) (ok bool, err error)
}

BMCResetter for resetting a BMC. resetType: "warm" resets the management console without rebooting the BMC resetType: "cold" reboots the BMC

type BootDeviceSetter

type BootDeviceSetter interface {
	BootDeviceSet(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)
}

BootDeviceSetter sets the next boot device for a machine

type Closer added in v0.4.8

type Closer interface {
	Close(ctx context.Context) error
}

Closer interface for closing a connection to a BMC

type FirmwareInstallVerifier added in v0.5.3

type FirmwareInstallVerifier interface {
	// FirmwareInstallStatus returns the status of the firmware install process.
	//
	// parameters:
	// installVersion (required) - the version this method should check is installed.
	// component (optional) - the component slug for the component update being installed.
	// taskID (optional) - the task identifier.
	//
	// return values:
	// status - returns one of the FirmwareInstall statuses (see devices/constants.go).
	FirmwareInstallStatus(ctx context.Context, installVersion, component, taskID string) (status string, err error)
}

FirmwareInstallVerifier defines an interface to check firmware install status

type FirmwareInstaller added in v0.5.3

type FirmwareInstaller interface {
	// FirmwareInstall uploads firmware update payload to the BMC returning the task ID
	//
	// parameters:
	// component - the component slug for the component update being installed.
	// applyAt - one of "Immediate", "OnReset".
	// forceInstall - purge the install task queued/scheduled firmware install BMC task (if any).
	// reader - the io.reader to the firmware update file.
	//
	// return values:
	// taskID - A taskID is returned if the update process on the BMC returns an identifier for the update process.
	FirmwareInstall(ctx context.Context, component, applyAt string, forceInstall bool, reader io.Reader) (taskID string, err error)
}

FirmwareInstaller defines an interface to install firmware updates

type InventoryGetter added in v0.5.3

type InventoryGetter interface {
	Inventory(ctx context.Context) (device *devices.Device, err error)
}

InventoryGetter defines methods to retrieve device hardware and firmware inventory

type Metadata added in v0.4.11

type Metadata struct {
	// SuccessfulProvider is the name of the provider that successfully executed
	SuccessfulProvider string
	// ProvidersAttempted is a slice of all providers that were attempt to execute
	ProvidersAttempted []string
	// SuccessfulOpenConns is a slice of provider names that were opened successfully
	SuccessfulOpenConns []string
	// SuccessfulCloseConns is a slice of provider names that were closed successfully
	SuccessfulCloseConns []string
}

Metadata represents details about a bmc method

func CloseConnection added in v0.4.8

func CloseConnection(ctx context.Context, c []connectionProviders) (metadata Metadata, err error)

CloseConnection closes a connection to a BMC, trying all interface implementations passed in

func CloseConnectionFromInterfaces added in v0.4.8

func CloseConnectionFromInterfaces(ctx context.Context, generic []interface{}) (metadata Metadata, err error)

CloseConnectionFromInterfaces pass through to library function

func CreateUser

func CreateUser(ctx context.Context, user, pass, role string, u []userProviders) (ok bool, metadata Metadata, err error)

CreateUser creates a user using the passed in implementation if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func CreateUserFromInterfaces

func CreateUserFromInterfaces(ctx context.Context, user, pass, role string, generic []interface{}) (ok bool, metadata Metadata, err error)

CreateUserFromInterfaces pass through to library function if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func DeleteUser

func DeleteUser(ctx context.Context, user string, u []userProviders) (ok bool, metadata Metadata, err error)

DeleteUser deletes a user from a BMC if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func DeleteUserFromInterfaces

func DeleteUserFromInterfaces(ctx context.Context, user string, generic []interface{}) (ok bool, metadata Metadata, err error)

DeleteUserFromInterfaces pass through to library function if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func FirmwareInstallFromInterfaces added in v0.5.3

func FirmwareInstallFromInterfaces(ctx context.Context, component, applyAt string, forceInstall bool, reader io.Reader, generic []interface{}) (taskID string, metadata Metadata, err error)

FirmwareInstallFromInterfaces pass through to library function

func FirmwareInstallStatusFromInterfaces added in v0.5.3

func FirmwareInstallStatusFromInterfaces(ctx context.Context, installVersion, component, taskID string, generic []interface{}) (status string, metadata Metadata, err error)

FirmwareInstallStatusFromInterfaces pass through to library function

func GetInventoryFromInterfaces added in v0.5.3

func GetInventoryFromInterfaces(ctx context.Context, generic []interface{}) (device *devices.Device, metadata Metadata, err error)

GetInventoryFromInterfaces is a pass through to library function

func GetPostCodeInterfaces added in v0.5.3

func GetPostCodeInterfaces(ctx context.Context, generic []interface{}) (status string, code int, metadata Metadata, err error)

GetPostCodeFromInterfaces is a pass through to library function

func GetPowerState

func GetPowerState(ctx context.Context, p []powerProviders) (state string, metadata Metadata, err error)

GetPowerState sets the power state for a BMC, trying all interface implementations passed in if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func GetPowerStateFromInterfaces

func GetPowerStateFromInterfaces(ctx context.Context, generic []interface{}) (state string, metadata Metadata, err error)

GetPowerStateFromInterfaces pass through to library function if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func OpenConnectionFromInterfaces added in v0.4.8

func OpenConnectionFromInterfaces(ctx context.Context, generic []interface{}) (opened []interface{}, metadata Metadata, err error)

OpenConnectionFromInterfaces will try all opener interfaces and remove failed ones. The reason failed ones need to be removed is so that when other methods are called (like powerstate) implementations that have connections wont nil pointer error when their connection fails.

func ReadUsers

func ReadUsers(ctx context.Context, u []userProviders) (users []map[string]string, metadata Metadata, err error)

ReadUsers returns all users from a BMC if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func ReadUsersFromInterfaces

func ReadUsersFromInterfaces(ctx context.Context, generic []interface{}) (users []map[string]string, metadata Metadata, err error)

ReadUsersFromInterfaces pass through to library function if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func ResetBMC

func ResetBMC(ctx context.Context, resetType string, b []bmcProviders) (ok bool, metadata Metadata, err error)

ResetBMC tries all implementations for a success BMC reset if a successfulProviderName is passed in, it will be updated to be the name of the provider that successfully executed

func ResetBMCFromInterfaces

func ResetBMCFromInterfaces(ctx context.Context, resetType string, generic []interface{}) (ok bool, metadata Metadata, err error)

ResetBMCFromInterfaces pass through to library function if a successfulProviderName is passed in, it will be updated to be the name of the provider that successfully executed

func SetBootDevice

func SetBootDevice(ctx context.Context, bootDevice string, setPersistent, efiBoot bool, b []bootDeviceProviders) (ok bool, metadata Metadata, err error)

SetBootDevice sets the boot device. Next boot only unless setPersistent=true if a successfulProviderName is passed in, it will be updated to be the name of the provider that successfully executed

func SetBootDeviceFromInterfaces

func SetBootDeviceFromInterfaces(ctx context.Context, bootDevice string, setPersistent, efiBoot bool, generic []interface{}) (ok bool, metadata Metadata, err error)

SetBootDeviceFromInterfaces pass through to library function if a successfulProviderName is passed in, it will be updated to be the name of the provider that successfully executed

func SetPowerState

func SetPowerState(ctx context.Context, state string, p []powerProviders) (ok bool, metadata Metadata, err error)

SetPowerState sets the power state for a BMC, trying all interface implementations passed in if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func SetPowerStateFromInterfaces

func SetPowerStateFromInterfaces(ctx context.Context, state string, generic []interface{}) (ok bool, metadata Metadata, err error)

SetPowerStateFromInterfaces pass through to library function if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func UpdateUser

func UpdateUser(ctx context.Context, user, pass, role string, u []userProviders) (ok bool, metadata Metadata, err error)

UpdateUser updates a user's settings if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

func UpdateUserFromInterfaces

func UpdateUserFromInterfaces(ctx context.Context, user, pass, role string, generic []interface{}) (ok bool, metadata Metadata, err error)

UpdateUserFromInterfaces pass through to library function if a metadata is passed in, it will be updated to be the name of the provider that successfully executed

type Opener added in v0.4.8

type Opener interface {
	Open(ctx context.Context) error
}

Opener interface for opening a connection to a BMC

type PostCodeGetter added in v0.5.3

type PostCodeGetter interface {
	// PostCode retrieves the BIOS/UEFI POST code from a device
	//
	// returns 'status' which is a (bmclib specific) string identifier for the POST code
	// and 'code' with the actual POST code returned to bmclib by the device
	PostCode(ctx context.Context) (status string, code int, err error)
}

PostCodeGetter defines methods to retrieve device BIOS/UEFI POST code

type PowerSetter

type PowerSetter interface {
	// PowerSet sets the power state of a Machine through a BMC.
	// While the state's accepted are ultimately up to what the implementation
	// expects, implementations should generally try to provide support for the following
	// states, modeled after the functionality available in `ipmitool chassis power`.
	//
	// "on": Power up chassis. should not error if the machine is already on
	// "off": Hard powers down chassis. should not error if the machine is already off
	// "soft": Initiate a soft-shutdown of OS via ACPI.
	// "reset": soft down and then power on. simulates a reboot from the host OS.
	// "cycle": hard power down followed by a power on. simulates pressing a power button
	// to turn the machine off then pressing the button again to turn it on.
	PowerSet(ctx context.Context, state string) (ok bool, err error)
}

PowerSetter sets the power state of a BMC

type PowerStateGetter

type PowerStateGetter interface {
	PowerStateGet(ctx context.Context) (state string, err error)
}

PowerStateGetter gets the power state of a BMC

type Provider added in v0.4.11

type Provider interface {
	// Name of the provider
	Name() string
}

Provider interface describes details about a provider

type UserCreator

type UserCreator interface {
	UserCreate(ctx context.Context, user, pass, role string) (ok bool, err error)
}

UserCreator creates a user on a BMC

type UserDeleter

type UserDeleter interface {
	UserDelete(ctx context.Context, user string) (ok bool, err error)
}

UserDeleter deletes a user on a BMC

type UserReader

type UserReader interface {
	UserRead(ctx context.Context) (users []map[string]string, err error)
}

UserReader lists all users on a BMC

type UserUpdater

type UserUpdater interface {
	UserUpdate(ctx context.Context, user, pass, role string) (ok bool, err error)
}

UserUpdater updates a user on a BMC

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL