-
Notifications
You must be signed in to change notification settings - Fork 35
/
doc.go
48 lines (32 loc) · 1.07 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// Copyright 2019 The bmclib Authors. All rights reserved.
// Use of this source code is governed by an Apache that can be found in the LICENSE file.
/*
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")
}
*/
package bmclib