Documentation
¶
Index ¶
- func GetBootOrderQualifiers(bootTarget hal.BootTarget, vendor api.Vendor) (uefiQualifier, bootDevQualifier uint8)
- func RawChassisControl(fn ChassisControlFunction) []string
- func RawChassisIdentifyOff() []string
- func RawChassisIdentifyOn() []string
- func RawDisableUser(uid uint8) []string
- func RawEnableUser(uid uint8) []string
- func RawEnableUserSOLPayloadAccess(channelNumber, uid uint8) []string
- func RawSetSystemBootOptions(target hal.BootTarget, vendor api.Vendor) []string
- func RawSetUserName(uid uint8, username string) []string
- func RawSetUserPassword(uid uint8, password string) []string
- func RawUserAccess(channelNumber, uid uint8, privilege api.IpmiPrivilege) []string
- type ApiType
- type BMCDeviceAndMessagingCommand
- type BMCInfo
- type BMCWatchdogTimerCommand
- type Bool
- type BridgeManagementCommand
- type BridgingCommand
- type ChassisControlFunction
- type ChassisDeviceCommand
- type ChassisIdentifyFunction
- type ChassisIdentifyRequest
- type ChassisIdentifyResponse
- type Client
- func (c *Client) SetBootOrder(bootTarget hal.BootTarget, vendor api.Vendor) error
- func (c *Client) SetChassisIdentifyLEDOff() error
- func (c *Client) SetChassisIdentifyLEDOn() error
- func (c *Client) SetChassisIdentifyLEDState(state hal.IdentifyLEDState) error
- func (c *Client) SetSystemBoot(param uint8, data ...uint8) error
- type CommandForwardingCommand
- type DiscoveryCommand
- type EventCommand
- type FRUDeviceCommand
- type FirmwareFirewallConfigurationCommand
- type Fru
- type GlobalDeviceCommand
- type IpmiTool
- type Ipmitool
- func (i *Ipmitool) BMC() (*api.BMC, error)
- func (i *Ipmitool) ChangePassword(user api.BMCUser, newPassword string, apiType ApiType) error
- func (i *Ipmitool) CreateUser(user api.BMCUser, privilege api.IpmiPrivilege, password string, ...) (string, error)
- func (i *Ipmitool) DevicePresent() bool
- func (i *Ipmitool) GetBMCInfo() (BMCInfo, error)
- func (i *Ipmitool) GetFru() (Fru, error)
- func (i *Ipmitool) GetLanConfig() (LanConfig, error)
- func (i *Ipmitool) GetSession() (Session, error)
- func (i *Ipmitool) NewCommand(args ...string) (*exec.Cmd, error)
- func (i *Ipmitool) OpenConsole(s ssh.Session) error
- func (i *Ipmitool) Run(args ...string) (string, error)
- func (i *Ipmitool) SetBootOrder(target hal.BootTarget, vendor api.Vendor) error
- func (i *Ipmitool) SetChassisControl(fn ChassisControlFunction) error
- func (i *Ipmitool) SetChassisIdentifyLEDOff() error
- func (i *Ipmitool) SetChassisIdentifyLEDOn() error
- func (i *Ipmitool) SetChassisIdentifyLEDState(state hal.IdentifyLEDState) error
- func (i *Ipmitool) SetUserEnabled(user api.BMCUser, enabled bool, apiType ApiType) error
- type LANDeviceCommand
- type LanConfig
- type NetworkFunction
- type PEFAndAlertingCommand
- type SDRDeviceCommand
- type SELDeviceCommand
- type SensorDeviceCommand
- type SerialModemDeviceCommand
- type Session
- type SetSystemBootOptionsFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBootOrderQualifiers ¶
func GetBootOrderQualifiers(bootTarget hal.BootTarget, vendor api.Vendor) (uefiQualifier, bootDevQualifier uint8)
GetBootOrderQualifiers returns the qualifiers needed to set the given boot order according to the given vendor
func RawChassisControl ¶
func RawChassisControl(fn ChassisControlFunction) []string
func RawChassisIdentifyOff ¶
func RawChassisIdentifyOff() []string
func RawChassisIdentifyOn ¶
func RawChassisIdentifyOn() []string
func RawDisableUser ¶
func RawEnableUser ¶
func RawSetSystemBootOptions ¶
func RawSetUserName ¶
func RawSetUserPassword ¶
func RawUserAccess ¶
func RawUserAccess(channelNumber, uid uint8, privilege api.IpmiPrivilege) []string
Types ¶
type BMCDeviceAndMessagingCommand ¶
type BMCDeviceAndMessagingCommand = uint8
const ( SetBMCGlobalEnables BMCDeviceAndMessagingCommand = iota + 46 GetBMCGlobalEnables ClearMessageFlags GetMessageFlags EnableMessageChannelReceive GetMessage SendMessage ReadEventMessageBuffer GetBTInterfaceCapabilities GetSystemGUID GetChannelAuthenticationCapabilities GetSessionChallenge ActivateSession SetSessionPrivilegeLevel CloseSession GetSessionInfo GetAuthCode SetChannelAccess GetChannelAccess GetChannelInfo SetUserAccess GetUserAccess SetUserName GetUserName SetUserPassword ActivatePayload DeactivatePayload GetPayloadActivationStatus GetPayloadInstanceInfo SetUserPayloadAccess GetUserPayloadAccess GetChannelPayloadSupport GetChannelPayloadVersion GetChannelOEMPayloadInfo MasterReadWrite GetChannelCipherSuites SuspendResumePayloadEncryption SetChannelSecurityKeys GetSystemInterfaceCapabilities SetSystemInfoParameters GetSystemInfoParameters )
type BMCInfo ¶
type BMCInfo struct {
FirmwareRevision string `ipmitool:"Firmware Revision"`
}
BMCInfo contains the parsed output of 'ipmitool bmc info'
type BMCWatchdogTimerCommand ¶
type BMCWatchdogTimerCommand = uint8
const ( ResetWatchdogTimer BMCWatchdogTimerCommand = iota + 34 SetWatchdogTimer GetWatchdogTimer )
type BridgeManagementCommand ¶
type BridgeManagementCommand = uint8
const ( GetBridgeState BridgeManagementCommand = iota SetBridgeState GetICMBAddress SetICMBAddress SetBridgeProxyAddress GetBridgeStatistics GetICMBCapabilities ClearBridgeStatistics GetBridgeProxyAddress GetICMBConnectorInfo GetICMBConnectionID SendICMBConnectionID ErrorReport BridgeManagementCommand = 255 )
type BridgingCommand ¶
type BridgingCommand = uint8
const ( BridgeRequest BridgingCommand = iota + 32 BridgeMessage )
type ChassisControlFunction ¶
type ChassisControlFunction = uint8
const ( ChassisControlPowerDown ChassisControlFunction = iota ChassisControlPowerUp ChassisControlPowerCycle ChassisControlHardReset ChassisControlPulseDiagnosticInterrupt ChassisControlInitiateSoftShutdownViaOvertemp )
type ChassisDeviceCommand ¶
type ChassisDeviceCommand = uint8
const ( GetChassisCapabilities ChassisDeviceCommand = iota GetChassisStatus ChassisControl ChassisReset ChassisIdentify SetChassisCapabilities SetPowerRestorePolicy GetSystemRestartCause SetSystemBootOptions GetSystemBootOptions SetFrontPanelButtonEnables SetPowerCycleInterval GetPOHCounter )
type ChassisIdentifyFunction ¶
type ChassisIdentifyFunction = uint8
const (
ChassisIdentifyForceOnIndefinitely ChassisIdentifyFunction = iota
)
type ChassisIdentifyRequest ¶
ChassisIdentifyRequest per section 28.5
type ChassisIdentifyResponse ¶
type ChassisIdentifyResponse struct {
goipmi.CompletionCode
}
ChassisIdentifyResponse per section 28.5
type Client ¶
func OpenClientConnection ¶
func (*Client) SetBootOrder ¶
func (*Client) SetChassisIdentifyLEDOff ¶
func (*Client) SetChassisIdentifyLEDOn ¶
func (*Client) SetChassisIdentifyLEDState ¶
type CommandForwardingCommand ¶
type CommandForwardingCommand = uint8
const ( ForwardedCommand CommandForwardingCommand = iota + 48 SetForwardedCommands GetForwardedCommands EnableForwardedCommands )
type DiscoveryCommand ¶
type DiscoveryCommand = uint8
const ( PrepareForDiscovery DiscoveryCommand = iota + 16 GetAddresses SetDiscovered GetChassisDeviceID SetChassisDeviceID )
type EventCommand ¶
type EventCommand = uint8
const ( SetEventReceiver EventCommand = iota GetEventReceiver PlatformEvent )
const ( GetEventCount EventCommand = iota + 48 SetEventDestination SetEventReceptionState SendICMBEventMessage GetEventDestination GetEventReceptionState )
type FRUDeviceCommand ¶
type FRUDeviceCommand = uint8
const ( GetFRUInventoryAreaInfo FRUDeviceCommand = iota + 16 ReadFRUData WriteFRUData )
type FirmwareFirewallConfigurationCommand ¶
type FirmwareFirewallConfigurationCommand = uint8
const ( SetCommandEnables FirmwareFirewallConfigurationCommand = iota + 96 GetCommandEnables SetCommandSubFunctionEnables GetCommandSubFunctionEnables GetOEMNetNnIANASupport )
type Fru ¶
type Fru struct { ChassisPartNumber string `ipmitool:"Chassis Part Number"` ChassisPartSerial string `ipmitool:"Chassis Serial"` BoardMfg string `ipmitool:"Board Mfg"` BoardMfgSerial string `ipmitool:"Board Mfg Serial"` BoardPartNumber string `ipmitool:"Board Part Number"` ProductManufacturer string `ipmitool:"Product Manufacturer"` ProductPartNumber string `ipmitool:"Product Part Number"` ProductSerial string `ipmitool:"Product Serial"` }
Fru contains Field Replaceable Unit information, retrieved with 'ipmitool fru'
type GlobalDeviceCommand ¶
type GlobalDeviceCommand = uint8
const ( GetDeviceID GlobalDeviceCommand = iota + 1 ColdReset WarmReset GetSelfTestResults ManufacturingTestOn SetACPIPowerState GetACPIPowerState GetDeviceGUID GetNetFnSupport GetCommandSupport GetCommandSubFunctionSupport GetConfigurableCommands GetConfigurableCommandSubFunctions )
type IpmiTool ¶
type IpmiTool interface { DevicePresent() bool NewCommand(arg ...string) (*exec.Cmd, error) Run(arg ...string) (string, error) CreateUser(user api.BMCUser, privilege api.IpmiPrivilege, password string, constraints *api.PasswordConstraints, apiType ApiType) (pwd string, err error) ChangePassword(user api.BMCUser, newPassword string, apiType ApiType) error SetUserEnabled(user api.BMCUser, enabled bool, apiType ApiType) error GetLanConfig() (LanConfig, error) SetBootOrder(target hal.BootTarget, vendor api.Vendor) error SetChassisControl(ChassisControlFunction) error SetChassisIdentifyLEDState(hal.IdentifyLEDState) error SetChassisIdentifyLEDOn() error SetChassisIdentifyLEDOff() error GetFru() (Fru, error) GetSession() (Session, error) BMC() (*api.BMC, error) OpenConsole(s ssh.Session) error }
IpmiTool defines methods to interact with IPMI
type Ipmitool ¶
type Ipmitool struct {
// contains filtered or unexported fields
}
Ipmitool is used to query and modify the IPMI based BMC from the host os
func (*Ipmitool) ChangePassword ¶ added in v0.2.0
ChangePassword of the given user
func (*Ipmitool) CreateUser ¶
func (i *Ipmitool) CreateUser(user api.BMCUser, privilege api.IpmiPrivilege, password string, pc *api.PasswordConstraints, apiType ApiType) (string, error)
CreateUser creates an IPMI user with given privilege level and either the given password or - if empty - a generated one with respect to the given password constraints
func (*Ipmitool) DevicePresent ¶
DevicePresent returns true if the IPMI device is present, which is required to talk to the BMC
func (*Ipmitool) GetBMCInfo ¶
GetBMCInfo returns the BMC info
func (*Ipmitool) GetLanConfig ¶
GetLanConfig returns the LAN config
func (*Ipmitool) GetSession ¶
GetSession returns the session
func (*Ipmitool) NewCommand ¶ added in v0.1.11
NewCommand returns a new ipmitool command with the given arguments
func (*Ipmitool) OpenConsole ¶ added in v0.1.11
OpenConsole connect to the serian console and put the in/out into a ssh stream
func (*Ipmitool) SetBootOrder ¶
SetBootOrder persistently sets the boot order to given target
func (*Ipmitool) SetChassisControl ¶
func (i *Ipmitool) SetChassisControl(fn ChassisControlFunction) error
SetChassisControl executes the given chassis control function
func (*Ipmitool) SetChassisIdentifyLEDOff ¶
SetChassisIdentifyLEDOff turns off the chassis identify LED
func (*Ipmitool) SetChassisIdentifyLEDOn ¶
SetChassisIdentifyLEDOn turns on the chassis identify LED
func (*Ipmitool) SetChassisIdentifyLEDState ¶
SetChassisIdentifyLEDState sets the chassis identify LED to given state
type LANDeviceCommand ¶
type LANDeviceCommand = uint8
const ( SetLANConfigurationParameters LANDeviceCommand = iota + 1 GetLANConfigurationParameters SuspendBMCARPs GetIPUDPRMCPStatistics )
type LanConfig ¶
LanConfig contains the config of IPMI. Tag must contain first column name of ipmitool lan print command output to get the second column value be parsed into the field
type NetworkFunction ¶
type NetworkFunction = uint8
const ( ChassisNetworkFunction NetworkFunction = iota ChassisResponse BridgeNetworkFunction BridgeResponse SensorEventNetworkFunction SensorEventResponse AppNetworkFunction AppResponse FirmwareNetworkFunction FirmwareResponse StorageNetworkFunction StorageResponse TransportNetworkFunction TransportResponse )
type PEFAndAlertingCommand ¶
type PEFAndAlertingCommand = uint8
const ( GetPEFCapabilities PEFAndAlertingCommand = iota + 16 ArmPEFPostponeTimer SetPEFConfigurationParameters GetPEFConfigurationParameters SetLastProcessingEventID GetLastProcessingEventID AlertImmediate PETAcknowledge )
type SDRDeviceCommand ¶
type SDRDeviceCommand = uint8
const ( GetSDRRepositoryInfo SDRDeviceCommand = iota + 32 GetSDRRepositoryAllocationInfo ReserveSDRRepository GetSDR AddSDR PartialAddSDR DeleteSDR ClearSDRRepository GetSDRRepositoryTime SetSDRRepositoryTime EnterSDRRepositoryUpdateMode ExitSDRRepositoryUpdateMode RunInitializationAgent )
type SELDeviceCommand ¶
type SELDeviceCommand = uint8
const ( GetSELInfo SELDeviceCommand = iota + 64 GetSELAllocationInfo ReserveSEL GetSELEntry AddSELEntry PartialAddSELEntry DeleteSELEntry ClearSEL GetSELTime SetSELTime )
const ( GetAuxiliaryLogStatus SELDeviceCommand = iota + 90 SetAuxiliaryLogStatus GetSELTimeUTCOffset SetSELTimeUTCOffset )
type SensorDeviceCommand ¶
type SensorDeviceCommand = uint8
const ( GetDeviceSDRInfo SensorDeviceCommand = iota + 32 GetDeviceSDR ReserveDeviceSDRRepository GetSensorReadingFactors SetSensorHysteresis GetSensorHysteresis SetSensorThreshold GetSensorThreshold SetSensorEventEnable GetSensorEventEnable ReArmSensorEvents GetSensorEventStatus GetSensorReading SetSensorType GetSensorType SetSensorReadingAndEventStatus )
type SerialModemDeviceCommand ¶
type SerialModemDeviceCommand = uint8
const ( SetSerialModemConfiguration SerialModemDeviceCommand = iota + 16 GetSerialModemConfiguration SetSerialModemMux GetTAPResponseCodes SetPPPUDPProxyTransmitData GetPPPUDPProxyTransmitData SetPPPUDPProxyPacket GetPPPUDPProxyReceiveData SerialModemConnectionActive Callback SetUserCallbackOptions GetUserCallbackOptions SetSerialRoutingMux SOLActivating SetSOLConfigurationParameters GetSOLConfigurationParameters )
type Session ¶
type Session struct { UserID string `ipmitool:"user id"` Privilege string `ipmitool:"privilege level"` }
Session holds information about the current IPMI session
type SetSystemBootOptionsFunction ¶
type SetSystemBootOptionsFunction = uint8
const ( ServicePartitionSelector SetSystemBootOptionsFunction = iota + 1 ServicePartitionScan ValidBitClearing BootInfoAcknowledge BootFlags InitiatorInfo InitiatorMailbox OEMHasHandledBootInfo SMSHasHandledBootInfo OSServicePartitionHasHandledBootInfo OSLoaderHasHandledBootInfo BIOSPOSTHasHandledBootInfo )