ipmi

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ipmi

type Ipmi struct {
	Username string
	Password string
	Host     string
	// contains filtered or unexported fields
}

Ipmi holds the date for an ipmi connection

func New

func New(username string, password string, host string, opts ...Option) (ipmi *Ipmi, err error)

New returns a new ipmi instance

func (*Ipmi) BootDeviceSet

func (i *Ipmi) BootDeviceSet(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)

BootDeviceSet sets the next boot device with options

func (*Ipmi) ForceRestart

func (i *Ipmi) ForceRestart(ctx context.Context) (status bool, err error)

ForceRestart does the chassis power cycle even if the chassis is turned off. From the RedFish spec (https://www.dmtf.org/sites/default/files/standards/documents/DSP2046_2018.1.pdf):

Perform an immediate (non-graceful) shutdown, followed by a restart.

func (*Ipmi) GetCiphers

func (i *Ipmi) GetCiphers(ctx context.Context) (output string, err error)

GetCiphers gets a list of ciphers supported for IPMI.

func (*Ipmi) GetSOLCiphers

func (i *Ipmi) GetSOLCiphers(ctx context.Context) (output string, err error)

GetSOLCiphers gets a list of ciphers supported for SOL.

func (*Ipmi) IsOn

func (i *Ipmi) IsOn(ctx context.Context) (status bool, err error)

IsOn tells if a machine is currently powered on

func (*Ipmi) PowerCycle

func (i *Ipmi) PowerCycle(ctx context.Context) (status bool, err error)

PowerCycle reboots the machine via bmc

func (*Ipmi) PowerCycleBmc

func (i *Ipmi) PowerCycleBmc(ctx context.Context) (status bool, err error)

PowerCycleBmc reboots the bmc we are connected to

func (*Ipmi) PowerOff

func (i *Ipmi) PowerOff(ctx context.Context) (status bool, err error)

PowerOff power off the machine via bmc

func (*Ipmi) PowerOn

func (i *Ipmi) PowerOn(ctx context.Context) (status bool, err error)

PowerOn power on the machine via bmc

func (*Ipmi) PowerOnForce

func (i *Ipmi) PowerOnForce(ctx context.Context) (status bool, err error)

PowerOnForce power on the machine via bmc even when the machine is already on (Thanks HP!)

func (*Ipmi) PowerReset

func (i *Ipmi) PowerReset(ctx context.Context) (status bool, err error)

PowerReset reboots the machine via bmc

func (*Ipmi) PowerResetBmc

func (i *Ipmi) PowerResetBmc(ctx context.Context, resetType string) (ok bool, err error)

PowerResetBmc reboots the bmc we are connected to

func (*Ipmi) PowerSoft

func (i *Ipmi) PowerSoft(ctx context.Context) (status bool, err error)

PowerSoft power off the machine via bmc

func (*Ipmi) PowerState

func (i *Ipmi) PowerState(ctx context.Context) (state string, err error)

PowerState returns the current power state of the machine

func (*Ipmi) PxeOnce

func (i *Ipmi) PxeOnce(ctx context.Context) (status bool, err error)

PxeOnce makes the machine to boot via pxe once using MBR

func (*Ipmi) PxeOnceEfi

func (i *Ipmi) PxeOnceEfi(ctx context.Context) (status bool, err error)

PxeOnceEfi makes the machine to boot via pxe once using EFI

func (*Ipmi) PxeOnceMbr

func (i *Ipmi) PxeOnceMbr(ctx context.Context) (status bool, err error)

PxeOnceMbr makes the machine to boot via pxe once using MBR

func (*Ipmi) ReadUsers

func (i *Ipmi) ReadUsers(ctx context.Context) (users []map[string]string, err error)

ReadUsers list all BMC users

func (*Ipmi) SolActivate

func (i *Ipmi) SolActivate(ctx context.Context, stdin ...byte) (output string, err error)

SolActivate activates and connects to the serial-over-lan interface. It needs stdin, or the connection will be immediately dropped.

func (*Ipmi) SolDeactivate

func (i *Ipmi) SolDeactivate(ctx context.Context) (output string, err error)

SolDeactivate disconnects the serial-over-lan interface.

func (*Ipmi) SolInfo

func (i *Ipmi) SolInfo(ctx context.Context) (info string, err error)

SolInfo gets the status of the serial-over-lan interface.

type Option

type Option func(*Ipmi)

Option for setting optional Ipmi values

func WithCipherSuite

func WithCipherSuite(cipherSuite string) Option

func WithIpmitoolPath

func WithIpmitoolPath(path string) Option

func WithLogger

func WithLogger(log logr.Logger) Option

Jump to

Keyboard shortcuts

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