idrac8

package
v0.5.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BMCType defines the bmc model that is supported by this package
	BMCType = "idrac8"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IDrac8

type IDrac8 struct {
	// contains filtered or unexported fields
}

IDrac8 holds the status and properties of a connection to an iDrac device

func New

func New(ctx context.Context, host string, username string, password string, log logr.Logger) (*IDrac8, error)

New returns a new IDrac8 ready to be used

func NewWithOptions added in v0.5.3

func NewWithOptions(ctx context.Context, host string, username string, password string, log logr.Logger, opts ...IDrac8Option) (*IDrac8, error)

NewWithOptions returns a new IDrac8 with options ready to be used

func (*IDrac8) Bios added in v0.2.3

func (i *IDrac8) Bios(cfg *cfgresources.Bios) (err error)

Bios implements the Configure interface.

func (*IDrac8) BiosVersion

func (i *IDrac8) BiosVersion() (version string, err error)

BiosVersion returns the current version of the bios

func (*IDrac8) CPU

func (i *IDrac8) CPU() (cpu string, cpuCount int, coreCount int, hyperthreadCount int, err error)

CPU return the cpu, cores and hyperthreads the server

func (*IDrac8) ChassisSerial added in v0.2.9

func (i *IDrac8) ChassisSerial() (serial string, err error)

ChassisSerial returns the serial number of the chassis where the blade is attached

func (*IDrac8) CheckCredentials added in v0.1.5

func (i *IDrac8) CheckCredentials() (err error)

CheckCredentials verify whether the credentials are valid or not

func (*IDrac8) CheckFirmwareVersion added in v0.4.14

func (i *IDrac8) CheckFirmwareVersion() (version string, err error)

func (*IDrac8) Close added in v0.1.5

func (i *IDrac8) Close(ctx context.Context) error

Close closes the connection properly

func (*IDrac8) CurrentHTTPSCert added in v0.2.4

func (i *IDrac8) CurrentHTTPSCert() ([]*x509.Certificate, bool, error)

CurrentHTTPSCert returns the current x509 certficates configured on the BMC The bool value returned indicates if the BMC supports CSR generation. CurrentHTTPSCert implements the Configure interface

func (*IDrac8) Disks

func (i *IDrac8) Disks() (disks []*devices.Disk, err error)

Disks returns a list of disks installed on the device

func (*IDrac8) FirmwareUpdateBMC added in v0.4.11

func (i *IDrac8) FirmwareUpdateBMC(ctx context.Context, filePath string) error

Updates the BMC firmware, implements the Firmware interface

func (*IDrac8) GenerateCSR added in v0.2.4

func (i *IDrac8) GenerateCSR(cert *cfgresources.HTTPSCertAttributes) ([]byte, error)

GenerateCSR generates a CSR request on the BMC.

func (*IDrac8) GetBIOSVersion added in v0.4.11

func (i *IDrac8) GetBIOSVersion(ctx context.Context) (string, error)

BiosVersion returns the BIOS version from the BMC, implements the Firmware interface

func (*IDrac8) GetBMCVersion added in v0.4.11

func (i *IDrac8) GetBMCVersion(ctx context.Context) (string, error)

BMCVersion returns the BMC version, implements the Firmware interface

func (*IDrac8) HardwareType added in v0.3.3

func (i *IDrac8) HardwareType() (bmcType string)

HardwareType returns the type of bmc we are talking to

func (*IDrac8) IsBlade

func (i *IDrac8) IsBlade() (isBlade bool, err error)

IsBlade returns if the current hardware is a blade or not

func (*IDrac8) IsOn added in v0.1.5

func (i *IDrac8) IsOn() (bool, error)

IsOn tells if a machine is currently powered on

func (*IDrac8) Ldap added in v0.2.3

func (i *IDrac8) Ldap(cfg *cfgresources.Ldap) error

Ldap applies LDAP configuration params. Ldap implements the Configure interface.

func (*IDrac8) LdapGroups added in v0.4.14

func (i *IDrac8) LdapGroups(cfgGroups []*cfgresources.LdapGroup, cfgLdap *cfgresources.Ldap) (err error)

Applies LDAP Group/Role related configuration. Implements the Configure interface.

func (*IDrac8) License

func (i *IDrac8) License() (name string, licType string, err error)

License returns the bmc license information

func (*IDrac8) Memory

func (i *IDrac8) Memory() (mem int, err error)

Memory return the total amount of memory of the server

func (*IDrac8) Model

func (i *IDrac8) Model() (model string, err error)

Model returns the device model

func (*IDrac8) Name

func (i *IDrac8) Name() (name string, err error)

Name returns the name of this server from the bmc point of view

func (*IDrac8) Network added in v0.2.3

func (i *IDrac8) Network(cfg *cfgresources.Network) (reset bool, err error)

Network method implements the Configure interface applies various network parameters.

func (*IDrac8) Nics

func (i *IDrac8) Nics() (nics []*devices.Nic, err error)

Nics returns all found Nics in the device

func (*IDrac8) Ntp added in v0.2.3

func (i *IDrac8) Ntp(cfg *cfgresources.Ntp) (err error)

Ntp applies NTP configuration params Ntp implements the Configure interface.

func (*IDrac8) Power added in v0.3.5

func (i *IDrac8) Power(cfg *cfgresources.Power) error

Power implemented the Configure interface

func (*IDrac8) PowerCycle added in v0.1.5

func (i *IDrac8) PowerCycle() (bool, error)

PowerCycle reboots the machine via bmc

func (*IDrac8) PowerCycleBmc added in v0.1.5

func (i *IDrac8) PowerCycleBmc() (bool, error)

PowerCycleBmc reboots the bmc we are connected to

func (*IDrac8) PowerKw

func (i *IDrac8) PowerKw() (power float64, err error)

PowerKw returns the current power usage in Kw

func (*IDrac8) PowerOff added in v0.1.5

func (i *IDrac8) PowerOff() (bool, error)

PowerOff power off the machine via bmc

func (*IDrac8) PowerOn added in v0.1.5

func (i *IDrac8) PowerOn() (bool, error)

PowerOn power on the machine via bmc

func (*IDrac8) PowerState

func (i *IDrac8) PowerState() (state string, err error)

PowerState returns the current power state of the machine

func (*IDrac8) Psus

func (i *IDrac8) Psus() (psus []*devices.Psu, err error)

Psus returns a list of psus installed on the device

func (*IDrac8) PxeOnce added in v0.1.5

func (i *IDrac8) PxeOnce() (bool, error)

PxeOnce makes the machine to boot via pxe once

func (*IDrac8) Resources added in v0.2.3

func (i *IDrac8) Resources() []string

Resources returns a slice of supported resources and the order they are to be applied in.

func (*IDrac8) Screenshot added in v0.2.2

func (i *IDrac8) Screenshot() (response []byte, extension string, err error)

Screenshot Grab screen preview.

func (*IDrac8) Serial

func (i *IDrac8) Serial() (serial string, err error)

Serial returns the device serial

func (*IDrac8) ServerSnapshot

func (i *IDrac8) ServerSnapshot() (server interface{}, err error)

ServerSnapshot do best effort to populate the server data and returns a blade or discrete

func (*IDrac8) SetLicense added in v0.2.3

func (i *IDrac8) SetLicense(cfg *cfgresources.License) (err error)

SetLicense implements the Configure interface.

func (*IDrac8) Slot added in v0.2.9

func (i *IDrac8) Slot() (slot int, err error)

Slot returns the current slot within the chassis

func (*IDrac8) Status

func (i *IDrac8) Status() (status string, err error)

Status returns health string status from the bmc

func (*IDrac8) Syslog added in v0.2.3

func (i *IDrac8) Syslog(cfg *cfgresources.Syslog) (err error)

Syslog applies the Syslog configuration resource Syslog implements the Configure interface

As part of Syslog we enable alerts and alert filters to syslog, the iDrac will not send out any messages over syslog unless this is enabled, and since not all BMCs currently support configuring filtering for alerts, for now the configuration for alert filters/enabling is managed through this method.

func (*IDrac8) TempC

func (i *IDrac8) TempC() (temp int, err error)

TempC returns the current temperature of the machine

func (*IDrac8) UpdateCredentials

func (i *IDrac8) UpdateCredentials(username string, password string)

UpdateCredentials updates login credentials

func (*IDrac8) UpdateFirmware added in v0.2.4

func (i *IDrac8) UpdateFirmware(source, file string) (bool, string, error)

UpdateFirmware updates the bmc firmware

func (*IDrac8) UploadHTTPSCert added in v0.2.4

func (i *IDrac8) UploadHTTPSCert(cert []byte, certFileName string, key []byte, keyFileName string) (bool, error)

UploadHTTPSCert uploads the given CRT cert, returns true if the BMC needs a reset. 1. POST upload signed x509 cert in multipart form. 2. POST returned resource URI

func (*IDrac8) User added in v0.2.3

func (i *IDrac8) User(cfgUsers []*cfgresources.User) (err error)

Applies the User configuration resource, obliterating any existing users. Implements the Configure interface. TODO: Forgives any errors happening (just logs though). Maybe that's not what we want?

func (*IDrac8) Vendor

func (i *IDrac8) Vendor() (vendor string)

Vendor returns bmc's vendor

func (*IDrac8) Version added in v0.3.3

func (i *IDrac8) Version() (bmcVersion string, err error)

Version returns the version of the bmc we are running

type IDrac8Option added in v0.5.3

type IDrac8Option func(*IDrac8)

IDrac8Option is a type that can configure an *IDrac8

func WithSecureTLS added in v0.5.3

func WithSecureTLS(rootCAs *x509.CertPool) IDrac8Option

WithSecureTLS enforces trusted TLS connections, with an optional CA certificate pool. Using this option with an nil pool uses the system CAs.

type NtpServer

type NtpServer struct {
	Enable  bool   `url:"tm_ntp_int_opmode,int"`
	Server1 string `url:"tm_ntp_str_server1"`
	Server2 string `url:"tm_ntp_str_server2"`
	Server3 string `url:"tm_ntp_str_server3"`
}

NtpServer struct holds NTP configuration payload GET - params as query string https://10.193.251.10/data?set=tm_ntp_int_opmode:1,tm_ntp_str_server1:ntp0.lhr4.example.com,tm_ntp_str_server2:ntp0.ams4.example.com,tm_ntp_str_server3:ntp0.fra4.example.com

type Syslog

type Syslog struct {
	Port    string `json:"Port"`
	Enable  string `json:"SysLogEnable"`
	Server1 string `json:"Server1"`
	Server2 string `json:"Server2"`
	Server3 string `json:"Server3"`
}

Syslog struct holds syslog configuration payload https://10.193.251.5/sysmgmt/2012/server/configgroup/iDRAC.SysLog

type UserInfo added in v0.2.2

type UserInfo struct {
	UserName         string `json:"UserName"`
	Password         string `json:"Password"`
	Enable           string `json:"Enable"`
	Privilege        string `json:"Privilege"`
	IpmiLanPrivilege string `json:"IpmiLanPrivilege"`
	SolEnable        string `json:"SolEnable"`
	SNMPv3Enable     string `json:"SNMPv3Enable"`
}

User struct holds user account configuration payload https://10.193.251.5/sysmgmt/2012/server/configgroup/iDRAC.Users.3

type UsersInfo added in v0.4.14

type UsersInfo map[int]UserInfo

UserInfo type is used to unmarshal user accounts payload.

type XMLRoot added in v0.2.4

type XMLRoot struct {
	XMLName        xml.Name         `xml:"root"`
	Text           string           `xml:",chardata"`
	XMLUserAccount []XMLUserAccount `xml:"user"`
	Status         string           `xml:"status"`
}

XMLRoot is used to unmarshal XML response payloads.

type XMLUserAccount added in v0.2.4

type XMLUserAccount struct {
	Name          string `xml:"name"`
	ID            int    `xml:"id"`
	Privileges    int    `xml:"privileges"` // 511 = Administrator, 0 = None,
	Enabled       int    `xml:"enabled"`
	LanPriv       int    `xml:"lanPriv"`    // 4 = Administrator, 3 = Operator, 2 = User, 15 = None
	SerialPriv    int    `xml:"serialPriv"` // 4 = Administrator, 3 = Operator, 2 = User, 15 = None
	SolEnabled    int    `xml:"solEnabled"`
	SnmpV3Enabled int    `xml:"SNMPV3Enabled"`
	SnmpPrivType  int    `xml:"snmpPrivType"`
}

XMLUserAccount is used to unmarshal XML user account response payloads.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL