mirror of
https://github.com/bmc-toolbox/bmclib.git
synced 2025-06-03 05:14:43 +00:00
examples/status: include WithRedfishBasicAuth() and purge inventory collection
since that has its own example.
This commit is contained in:
parent
14bb69da6f
commit
ed551a60a8
@ -30,7 +30,10 @@ func main() {
|
||||
l.Fatal("required host/user/pass parameters not defined")
|
||||
}
|
||||
|
||||
clientOpts := []bmclib.Option{bmclib.WithLogger(logger)}
|
||||
clientOpts := []bmclib.Option{
|
||||
bmclib.WithLogger(logger),
|
||||
bmclib.WithRedfishBasicAuth(),
|
||||
}
|
||||
|
||||
if *withSecureTLS {
|
||||
var pool *x509.CertPool
|
||||
@ -58,18 +61,9 @@ func main() {
|
||||
}
|
||||
defer cl.Close(ctx)
|
||||
|
||||
inventory, err := cl.Inventory(ctx)
|
||||
if err != nil {
|
||||
l.Fatal(err)
|
||||
}
|
||||
|
||||
l.WithField("bmc-version", inventory.BMC.Firmware.Installed).Info()
|
||||
|
||||
state, err := cl.GetPowerState(ctx)
|
||||
if err != nil {
|
||||
l.WithError(err).Error()
|
||||
}
|
||||
l.WithField("power-state", state).Info()
|
||||
|
||||
l.WithField("bios-version", inventory.BIOS.Firmware.Installed).Info()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user