idrac9

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: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderName     = "idrac9"
	ProviderProtocol = "webgui"
)
View Source
const (
	// BMCType defines the bmc model that is supported by this package
	BMCType = "idrac9"
)

Variables

Features implemented by Dell's idrac9 provider:

View Source
var Timezones = map[string]string{}/* 571 elements not displayed */

Timezones declares all known timezones, taken from the idrac web interface. nolint: spell

Functions

This section is empty.

Types

type AlertEnable added in v0.3.5

type AlertEnable struct {
	Enabled string `json:"AlertEnable"`
}

AlertEnable is the payload to enable/disable Alerts

type BiosSettings added in v0.2.2

type BiosSettings = cfgresources.Idrac9BiosSettings

BiosSettings is an alias type of cfgresources.Idrac9BiosSettings. All supported BIOS settings can be queried from through redfish/v1/Systems/System.Embedded.1/Bios. NOTE: All fields in this struct are expected to be of type string, for details see diffBiosSettings(). This type aliasing tightly couples config resources, maybe there's another aproach here.

type CSRInfo added in v0.2.4

type CSRInfo struct {
	CommonName       string `json:"CsrCommonName"`
	CountryCode      string `json:"CsrCountryCode"`
	LocalityName     string `json:"CsrLocalityName"`
	OrganizationName string `json:"CsrOrganizationName"`
	OrganizationUnit string `json:"CsrOrganizationUnit"`
	StateName        string `json:"CsrStateName"`
	EmailAddr        string `json:"CsrEmailAddr"`
	SubjectAltName   string `json:"CsrSubjectAltName"`
}

CSRInfo declares SSL/TLS CSR request payloads.

type Conn added in v0.4.12

type Conn struct {
	Host string
	Port string
	User string
	Pass string
	Log  logr.Logger
	// contains filtered or unexported fields
}

Conn for dell idrac9 connections

func NewConn added in v0.5.3

func NewConn(host, port, user, pass string, log logr.Logger, opts ...ConnOption) *Conn

func (*Conn) Close added in v0.4.12

func (c *Conn) Close(ctx context.Context) error

func (*Conn) Compatible added in v0.4.12

func (c *Conn) Compatible(ctx context.Context) bool

Compatible tests whether a BMC is compatible with the idrac9 provider

func (*Conn) Name added in v0.4.12

func (c *Conn) Name() string

func (*Conn) Open added in v0.4.12

func (c *Conn) Open(ctx context.Context) error

func (*Conn) UserCreate added in v0.4.12

func (c *Conn) UserCreate(ctx context.Context, user, pass, role string) (ok bool, err error)

func (*Conn) UserDelete added in v0.4.12

func (c *Conn) UserDelete(ctx context.Context, user string) (ok bool, err error)

func (*Conn) UserRead added in v0.4.12

func (c *Conn) UserRead(ctx context.Context) (users []map[string]string, err error)

func (*Conn) UserUpdate added in v0.4.12

func (c *Conn) UserUpdate(ctx context.Context, user, pass, role string) (ok bool, err error)

type ConnOption added in v0.5.3

type ConnOption func(*Conn)

ConnOption sets connection options

func WithHTTPClientConnOption added in v0.5.3

func WithHTTPClientConnOption(cli *http.Client) ConnOption

type IDrac9

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

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

func New

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

New returns a new IDrac9 ready to be used

func NewWithOptions added in v0.5.3

func NewWithOptions(ctx context.Context, host, httpHost string, username string, password string, log logr.Logger, opts ...IDrac9Option) (*IDrac9, error)

NewWithOptions returns a new IDrac9 with options ready to be used

func (*IDrac9) ApplyCfg

func (i *IDrac9) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)

ApplyCfg implements the Bmc interface

func (*IDrac9) Bios added in v0.2.3

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

Bios sets up Bios configuration Bios implements the Configure interface

func (*IDrac9) BiosVersion

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

BiosVersion returns the current version of the bios

func (*IDrac9) CPU

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

CPU return the cpu, cores and hyperthreads the server

func (*IDrac9) ChassisSerial added in v0.2.9

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

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

func (*IDrac9) CheckCredentials added in v0.1.5

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

CheckCredentials verify whether the credentials are valid or not

func (*IDrac9) CheckFirmwareVersion added in v0.4.14

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

func (*IDrac9) Close added in v0.1.5

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

Close closes the connection properly

func (*IDrac9) CurrentHTTPSCert added in v0.2.4

func (i *IDrac9) 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 (*IDrac9) Disks

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

Disks returns a list of disks installed on the device

func (*IDrac9) FirmwareUpdateBMC added in v0.4.11

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

Updates the BMC firmware, implements the Firmware interface

func (*IDrac9) GenerateCSR added in v0.2.4

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

GenerateCSR generates a CSR request on the BMC and returns the CSR. GenerateCSR implements the Configure interface. 1. PUT CSR info based on configuration 2. POST sysmgmt/2012/server/network/ssl/csr which returns a base64encoded CSR.

func (*IDrac9) GetBIOSVersion added in v0.4.11

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

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

func (*IDrac9) GetBMCVersion added in v0.4.11

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

BMCVersion returns the BMC version, implements the Firmware interface

func (*IDrac9) HardwareType added in v0.3.3

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

HardwareType returns the type of bmc we are talking to

func (*IDrac9) IsBlade

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

IsBlade returns if the current hardware is a blade or not

func (*IDrac9) IsOn added in v0.1.5

func (i *IDrac9) IsOn() (status bool, err error)

IsOn tells if a machine is currently powered on

func (*IDrac9) Ldap added in v0.2.3

func (i *IDrac9) Ldap(cfg *cfgresources.Ldap) (err error)

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

func (*IDrac9) LdapGroups added in v0.4.14

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

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

func (*IDrac9) License

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

License returns the bmc license information

func (*IDrac9) Memory

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

Memory return the total amount of memory of the server

func (*IDrac9) Model

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

Returns the device model or an empty string in case it doesn't find it.

func (*IDrac9) Name

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

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

func (*IDrac9) Network added in v0.2.3

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

Network method implements the Configure interface applies various network parameters.

func (*IDrac9) Nics

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

Nics returns all found Nics in the device

func (*IDrac9) Ntp added in v0.2.3

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

Ntp applies NTP configuration params Ntp implements the Configure interface.

func (*IDrac9) Power added in v0.3.5

func (i *IDrac9) Power(cfg *cfgresources.Power) (err error)

Power implemented the Configure interface

func (*IDrac9) PowerCycle added in v0.1.5

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

PowerCycle reboots the machine via bmc

func (*IDrac9) PowerCycleBmc added in v0.1.5

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

PowerCycleBmc reboots the bmc we are connected to

func (*IDrac9) PowerKw

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

PowerKw returns the current power usage in Kw

func (*IDrac9) PowerOff added in v0.1.5

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

PowerOff power off the machine via bmc

func (*IDrac9) PowerOn added in v0.1.5

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

PowerOn power on the machine via bmc

func (*IDrac9) PowerState

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

PowerState returns the current power state of the machine

func (*IDrac9) Psus

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

Psus returns a list of psus installed on the device

func (*IDrac9) PxeOnce added in v0.1.5

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

PxeOnce makes the machine to boot via pxe once

func (*IDrac9) Resources added in v0.2.3

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

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

func (*IDrac9) Screenshot added in v0.2.2

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

Screenshot grab screen preview.

func (*IDrac9) Serial

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

Returns the device serial or an empty string in case it doesn't find it.

func (*IDrac9) ServerSnapshot

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

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

func (*IDrac9) SetLicense added in v0.2.3

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

SetLicense implements the Configure interface.

func (*IDrac9) Slot added in v0.2.9

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

Slot returns the current slot within the chassis

func (*IDrac9) Status

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

Status returns health string status from the bmc

func (*IDrac9) Syslog added in v0.2.3

func (i *IDrac9) 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 (*IDrac9) TempC

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

TempC returns the current temperature of the machine

func (*IDrac9) UpdateCredentials

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

UpdateCredentials updates login credentials

func (*IDrac9) UpdateFirmware added in v0.2.4

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

UpdateFirmware updates the bmc firmware

func (*IDrac9) UploadHTTPSCert added in v0.2.4

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

UploadHTTPSCert implements the Configure interface. 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 (*IDrac9) User added in v0.2.3

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

User applies the User configuration resource, if the user exists, it updates the users password, User implements the Configure interface. Iterate over iDrac users and adds/removes/modifies user accounts nolint: gocyclo

func (*IDrac9) Vendor

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

Vendor returns bmc's vendor

func (*IDrac9) Version added in v0.3.3

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

Version returns the version of the bmc we are running

type IDrac9Option added in v0.5.3

type IDrac9Option func(*IDrac9)

IDrac9Option is a type that can configure an *IDrac9

func WithHTTPClient added in v0.5.3

func WithHTTPClient(c *http.Client) IDrac9Option

WithHTTPClient sets an HTTP client on an *IDrac9

func WithSecureTLS added in v0.5.3

func WithSecureTLS(rootCAs *x509.CertPool) IDrac9Option

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

type IdracUsers added in v0.4.14

type IdracUsers map[string]UsersInfo

type IpmiOverLan added in v0.2.2

type IpmiOverLan struct {
	Enable        string `json:"Enable"`        // Enabled
	PrivLimit     string `json:"PrivLimit"`     // Administrator
	EncryptionKey string `json:"EncryptionKey"` // 0000000000000000000000000000000000000000
}

IpmiOverLan declares IpmiOverLan configuration payload.

type Ipv4 added in v0.2.2

type Ipv4 struct {
	Enable      string `json:"Enable"`      // Enabled
	DHCPEnable  string `json:"DHCPEnable"`  // Enabled
	DNSFromDHCP string `json:"DNSFromDHCP"` // Enabled
}

Ipv4 declares IPv4 configuration payload.

type Jobs added in v0.2.2

type Jobs map[string]string

Jobs type is how job payloads are unmarshalled.

type Ldap added in v0.2.2

type Ldap struct {
	BaseDN               string `json:"BaseDN"`               // dell
	BindDN               string `json:"BindDN"`               // cn=dell
	CertValidationEnable string `json:"CertValidationEnable"` // Disabled
	Enable               string `json:"Enable"`               // Enabled
	GroupAttribute       string `json:"GroupAttribute"`       // memberUid
	GroupAttributeIsDN   string `json:"GroupAttributeIsDN"`   // Enabled
	Port                 string `json:"Port"`                 // 636
	SearchFilter         string `json:"SearchFilter"`         // objectClass=posixAccount
	Server               string `json:"Server"`               // ldap.example.com"
	UserAttribute        string `json:"UserAttribute"`        // uid
}

Ldap struct declares Ldap configuration payload.

type LdapRoleGroup added in v0.2.2

type LdapRoleGroup struct {
	DN        string `json:"DN"`        // cn=dell,cn=bmcAdmins
	Privilege string `json:"Privilege"` // 511 (Administrator), 499 (Operator)
}

LdapRoleGroup declares Ldap role group configuration payload.

type LdapRoleGroups added in v0.2.2

type LdapRoleGroups map[string]LdapRoleGroup

LdapRoleGroups declares the format in which LDAP role groups are (un)marshaled.

type NtpConfig added in v0.2.2

type NtpConfig struct {
	Enable string `json:"NTPEnable"` // Enabled
	NTP1   string `json:"NTP1"`      // example0.ntp.com
	NTP2   string `json:"NTP2"`      // example1.ntp.com
	NTP3   string `json:"NTP3"`      // example2.ntp.com
}

NtpConfig declares NTP configuration payload.

type Odata added in v0.2.2

type Odata struct {
	Attributes   *BiosSettings       `json:"Attributes,omitempty"`
	Members      []map[string]string `json:"Members,omitempty"`
	MembersCount int                 `json:"Members@odata.count,omitempty"`
	JobType      string              `json:"JobType,omitempty"`
	JobState     string              `json:"JobState,omitempty"`
}

Odata struct declares parameters for redfish odata payload.

type SerialOverLan added in v0.2.2

type SerialOverLan struct {
	Enable       string `json:"Enable"`       // Enabled
	BaudRate     string `json:"BaudRate"`     // 115200
	MinPrivilege string `json:"MinPrivilege"` // Administrator
}

SerialOverLan configuration payload.

type SerialRedirection added in v0.2.2

type SerialRedirection struct {
	Enable  string `json:"Enable"`  // Enabled
	QuitKey string `json:"QuitKey"` //^\\
}

SerialRedirection declares serial console configuration payload.

type Syslog added in v0.2.2

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

Syslog declares syslog configuration payload.

type TargetSettingsURI added in v0.2.4

type TargetSettingsURI struct {
	TargetSettingsURI string `json:"TargetSettingsURI"` // e.g. /redfish/v1/Systems/System.Embedded.1/Bios/Settings
}

type Timezone added in v0.2.2

type Timezone struct {
	Timezone string `json:"Timezone"` // CET
}

Timezone declares timezone configuration payload.

type UserInfo added in v0.4.14

type UserInfo struct {
	UserName         string `json:"UserName,omitempty"`
	Password         string `json:"Password,omitempty"`
	Enable           string `json:"Enable,omitempty"`           // Enabled, Disabled
	Privilege        string `json:"Privilege,omitempty"`        // 511, 499
	IpmiLanPrivilege string `json:"IpmiLanPrivilege,omitempty"` // Administrator, Operator
	SolEnable        string `json:"SolEnable,omitempty"`        // Disabled, Enabled
	ProtocolEnable   string `json:"ProtocolEnable,omitempty"`   // Disabled, Enabled (SNMPv3)
}

User struct declares user configuration payload.

type UsersInfo added in v0.4.14

type UsersInfo map[int]UserInfo

Jump to

Keyboard shortcuts

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