Documentation ¶
Overview ¶
Package bmclib client.go is intended to be the main the public API. Its purpose is to make interacting with bmclib as friendly as possible.
Package bmclib abstracts various vendor/models of Baseboard Management controllers.
ENV vars ======== export DEBUG_BMCLIB=1 for bmclib to verbose log export BMCLIB_TEST=1 to run on a dummy bmc (dry run).
Scan and connect ----------------
Connect to a BMC - "discover" its model, vendor, for list of supported BMCs see README.md.
connection, err = discover.ScanAndConnect(ip, user, pass) if err != nil { return connection, errors.New("ScanAndConnect attempt unsuccessful.") }
Once a connection is setup, the connection needs to be type asserted, to either a 'Bmc' or 'BmcChassis'.
switch connection.(type) { case devices.Bmc: bmc := connection.(devices.Bmc) // invoke Bmc interface methods here ... bmc.Close() case devices.BmcChassis: chassis := connection.(devices.BmcChassis) // invoke BmcChassis interface methods here ... chassis.Close() default: log.Error("Unknown device") }
Index ¶
- type Auth
- type Client
- func (c *Client) Close(ctx context.Context) (err error)
- func (c *Client) CreateUser(ctx context.Context, user, pass, role string) (ok bool, err error)
- func (c *Client) DeleteUser(ctx context.Context, user string) (ok bool, err error)
- func (c *Client) GetPowerState(ctx context.Context) (state string, err error)
- func (c *Client) Open(ctx context.Context) (err error)
- func (c *Client) ReadUsers(ctx context.Context) (users []map[string]string, err error)
- func (c *Client) ResetBMC(ctx context.Context, resetType string) (ok bool, err error)
- func (c *Client) SetBootDevice(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)
- func (c *Client) SetPowerState(ctx context.Context, state string) (ok bool, err error)
- func (c *Client) UpdateUser(ctx context.Context, user, pass, role string) (ok bool, err error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client for BMC interactions
func (*Client) CreateUser ¶
CreateUser pass through to library function
func (*Client) DeleteUser ¶
DeleteUser pass through to library function
func (*Client) GetPowerState ¶
GetPowerState pass through to library function
func (*Client) SetBootDevice ¶
func (c *Client) SetBootDevice(ctx context.Context, bootDevice string, setPersistent, efiBoot bool) (ok bool, err error)
SetBootDevice pass through to library function
func (*Client) SetPowerState ¶
SetPowerState pass through to library function