Documentation ¶
Index ¶
- type CIMCSession
- type PowerState
- type Session
- func (cs *Session) Close(ctx context.Context) error
- func (cs *Session) CloseConsole(ctx context.Context) error
- func (cs *Session) GetPowerState(ctx context.Context) (PowerState, error)
- func (cs *Session) OpenConsole(ctx context.Context) (*goexpect.GExpect, error)
- func (cs *Session) PowerCycle(ctx context.Context) error
- func (cs *Session) PowerOff(ctx context.Context) error
- func (cs *Session) PowerOn(ctx context.Context) error
- func (cs *Session) SendCmd(ctx context.Context, msg string) (string, error)
- func (cs Session) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CIMCSession ¶
type CIMCSession interface { // PowerOn powers on the connected host PowerOn(context.Context) error // PowerOff powers off the connected host PowerOff(context.Context) error // PowerCycle powers off and then on the connected host PowerCycle(context.Context) error // GetPowerState gets the power state of the connected host GetPowerState(context.Context) (PowerState, error) // OpenConsole opens a console to the connected host OpenConsole(context.Context) (*goexpect.GExpect, error) // CloseConsole opens a console to the connected host CloseConsole(context.Context) error // SendCmd sends a command to the connected host SendCmd(context.Context, string) (string, error) // Close closes the session Close(context.Context) error }
func NewSession ¶
func NewSession(addr, user, pass string) (CIMCSession, error)
NewSession - return a Session, logging in with password and user@addr
For example NewSession("10.0.0.1", "admin", "password")
type PowerState ¶
type PowerState int
const ( Unknown PowerState = iota Off On )
func (PowerState) String ¶
func (p PowerState) String() string
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session - object holding info for the cimc session.
func (*Session) CloseConsole ¶
CloseConsole - exit from the host console, back to the cimc shell.
func (*Session) GetPowerState ¶
func (cs *Session) GetPowerState(ctx context.Context) (PowerState, error)
GetPowerState - return power state of system.
func (*Session) OpenConsole ¶
OpenConsole - return a expect.GExpect that is hooked up to the host's console. as you would get if you typed 'connect host'
func (*Session) PowerCycle ¶
PowerCycle - Turn power off, if off and then back on.
Click to show internal directories.
Click to hide internal directories.