Documentation ¶
Index ¶
- Constants
- Variables
- type AlertEnable
- type BiosSettings
- type CSRInfo
- type Conn
- func (c *Conn) Close(ctx context.Context) error
- func (c *Conn) Compatible(ctx context.Context) bool
- func (c *Conn) Name() string
- func (c *Conn) Open(ctx context.Context) error
- func (c *Conn) UserCreate(ctx context.Context, user, pass, role string) (ok bool, err error)
- func (c *Conn) UserDelete(ctx context.Context, user string) (ok bool, err error)
- func (c *Conn) UserRead(ctx context.Context) (users []map[string]string, err error)
- func (c *Conn) UserUpdate(ctx context.Context, user, pass, role string) (ok bool, err error)
- type ConnOption
- type IDrac9
- func (i *IDrac9) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)
- func (i *IDrac9) Bios(cfg *cfgresources.Bios) (err error)
- func (i *IDrac9) BiosVersion() (version string, err error)
- func (i *IDrac9) CPU() (cpu string, cpuCount int, coreCount int, hyperthreadCount int, err error)
- func (i *IDrac9) ChassisSerial() (serial string, err error)
- func (i *IDrac9) CheckCredentials() (err error)
- func (i *IDrac9) CheckFirmwareVersion() (version string, err error)
- func (i *IDrac9) Close(ctx context.Context) error
- func (i *IDrac9) CurrentHTTPSCert() ([]*x509.Certificate, bool, error)
- func (i *IDrac9) Disks() (disks []*devices.Disk, err error)
- func (i *IDrac9) FirmwareUpdateBMC(ctx context.Context, filePath string) error
- func (i *IDrac9) GenerateCSR(cert *cfgresources.HTTPSCertAttributes) ([]byte, error)
- func (i *IDrac9) GetBIOSVersion(ctx context.Context) (string, error)
- func (i *IDrac9) GetBMCVersion(ctx context.Context) (string, error)
- func (i *IDrac9) HardwareType() (bmcType string)
- func (i *IDrac9) IsBlade() (isBlade bool, err error)
- func (i *IDrac9) IsOn() (status bool, err error)
- func (i *IDrac9) Ldap(cfg *cfgresources.Ldap) (err error)
- func (i *IDrac9) LdapGroups(cfgGroups []*cfgresources.LdapGroup, cfgLdap *cfgresources.Ldap) (err error)
- func (i *IDrac9) License() (name string, licType string, err error)
- func (i *IDrac9) Memory() (mem int, err error)
- func (i *IDrac9) Model() (model string, err error)
- func (i *IDrac9) Name() (name string, err error)
- func (i *IDrac9) Network(cfg *cfgresources.Network) (reset bool, err error)
- func (i *IDrac9) Nics() (nics []*devices.Nic, err error)
- func (i *IDrac9) Ntp(cfg *cfgresources.Ntp) (err error)
- func (i *IDrac9) Power(cfg *cfgresources.Power) (err error)
- func (i *IDrac9) PowerCycle() (bool, error)
- func (i *IDrac9) PowerCycleBmc() (bool, error)
- func (i *IDrac9) PowerKw() (power float64, err error)
- func (i *IDrac9) PowerOff() (bool, error)
- func (i *IDrac9) PowerOn() (bool, error)
- func (i *IDrac9) PowerState() (state string, err error)
- func (i *IDrac9) Psus() (psus []*devices.Psu, err error)
- func (i *IDrac9) PxeOnce() (bool, error)
- func (i *IDrac9) Resources() []string
- func (i *IDrac9) Screenshot() (response []byte, extension string, err error)
- func (i *IDrac9) Serial() (serial string, err error)
- func (i *IDrac9) ServerSnapshot() (server interface{}, err error)
- func (i *IDrac9) SetLicense(cfg *cfgresources.License) (err error)
- func (i *IDrac9) Slot() (slot int, err error)
- func (i *IDrac9) Status() (status string, err error)
- func (i *IDrac9) Syslog(cfg *cfgresources.Syslog) (err error)
- func (i *IDrac9) TempC() (temp int, err error)
- func (i *IDrac9) UpdateCredentials(username string, password string)
- func (i *IDrac9) UpdateFirmware(source, file string) (bool, string, error)
- func (i *IDrac9) UploadHTTPSCert(cert []byte, certFileName string, key []byte, keyFileName string) (bool, error)
- func (i *IDrac9) User(cfgUsers []*cfgresources.User) (err error)
- func (i *IDrac9) Vendor() (vendor string)
- func (i *IDrac9) Version() (bmcVersion string, err error)
- type IDrac9Option
- type IdracUsers
- type IpmiOverLan
- type Ipv4
- type Jobs
- type Ldap
- type LdapRoleGroup
- type LdapRoleGroups
- type NtpConfig
- type Odata
- type SerialOverLan
- type SerialRedirection
- type Syslog
- type TargetSettingsURI
- type Timezone
- type UserInfo
- type UsersInfo
Constants ¶
const ( ProviderName = "idrac9" ProviderProtocol = "webgui" )
const (
// BMCType defines the bmc model that is supported by this package
BMCType = "idrac9"
)
Variables ¶
var Features = registrar.Features{ providers.FeatureUserCreate, providers.FeatureUserUpdate, providers.FeatureUserRead, providers.FeatureUserDelete, }
Features implemented by Dell's idrac9 provider:
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) Compatible ¶ added in v0.4.12
Compatible tests whether a BMC is compatible with the idrac9 provider
func (*Conn) UserCreate ¶ added in v0.4.12
func (*Conn) UserDelete ¶ added in v0.4.12
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 ¶
BiosVersion returns the current version of the bios
func (*IDrac9) ChassisSerial ¶ added in v0.2.9
ChassisSerial returns the serial number of the chassis where the blade is attached
func (*IDrac9) CheckCredentials ¶ added in v0.1.5
CheckCredentials verify whether the credentials are valid or not
func (*IDrac9) CheckFirmwareVersion ¶ added in v0.4.14
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) FirmwareUpdateBMC ¶ added in v0.4.11
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
BiosVersion returns the BIOS version from the BMC, implements the Firmware interface
func (*IDrac9) GetBMCVersion ¶ added in v0.4.11
BMCVersion returns the BMC version, implements the Firmware interface
func (*IDrac9) HardwareType ¶ added in v0.3.3
HardwareType returns the type of bmc we are talking to
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) 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) 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
PowerCycle reboots the machine via bmc
func (*IDrac9) PowerCycleBmc ¶ added in v0.1.5
PowerCycleBmc reboots the bmc we are connected to
func (*IDrac9) PowerState ¶
PowerState returns the current power state of the machine
func (*IDrac9) Resources ¶ added in v0.2.3
Resources returns a slice of supported resources and the order they are to be applied in.
func (*IDrac9) Screenshot ¶ added in v0.2.2
Screenshot grab screen preview.
func (*IDrac9) ServerSnapshot ¶
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) 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) UpdateCredentials ¶
UpdateCredentials updates login credentials
func (*IDrac9) UpdateFirmware ¶ added in v0.2.4
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
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 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 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.