Documentation ¶
Index ¶
- Constants
- Variables
- type AlertEnable
- type BiosSettings
- type CSRInfo
- 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) Close() error
- func (i *IDrac9) CurrentHTTPSCert() ([]*x509.Certificate, bool, error)
- func (i *IDrac9) Disks() (disks []*devices.Disk, err error)
- func (i *IDrac9) GenerateCSR(cert *cfgresources.HTTPSCertAttributes) ([]byte, 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) LdapGroup(cfg []*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, 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 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 User
Constants ¶
const (
// BMCType defines the bmc model that is supported by this package
BMCType = "idrac9"
)
Variables ¶
var Timezones = map[string]string{}/* 571 elements not displayed */
Timezones declares all known timezones, taken from the idrac web interface.
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 int this struct are expected to be of type string, for details see diffBiosSettings() This type aliasing tightly couples config resources, maybe theres 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 IDrac9 ¶
type IDrac9 struct {
// contains filtered or unexported fields
}
IDrac9 holds the status and properties of a connection to an iDrac device
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) 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) 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) 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) LdapGroup ¶ added in v0.2.3
func (i *IDrac9) LdapGroup(cfg []*cfgresources.LdapGroup, cfgLdap *cfgresources.Ldap) (err error)
LdapGroup applies LDAP Group/Role related configuration LdapGroup implements the Configure interface. nolint: gocyclo
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 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/marshalled.
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 declares serial over lan 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
}
TargetSettingsURI struct declares parameters to unmarshal TargetSettingsURI. Post Jobs to be done
type Timezone ¶ added in v0.2.2
type Timezone struct {
Timezone string `json:"Timezone"` //CET
}
Timezone declares timezone configuration payload.
type User ¶ added in v0.2.2
type User 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 (SNMPv2) AuthenticationProtocol string `json:"AuthenticationProtocol,omitempty"` //SHA, MD5, None PrivacyProtocol string `json:"PrivacyProtocol,omitempty"` //AES, DES, None }
User struct declares user configuration payload.