Documentation ¶
Index ¶
- Constants
- type CapturePreview
- type ConfigDateTime
- type ConfigLdap
- type ConfigPort
- type ConfigSyslog
- type ConfigUser
- type SupermicroX10
- func (s *SupermicroX10) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)
- func (s *SupermicroX10) Bios(cfg *cfgresources.Bios) (err error)
- func (s *SupermicroX10) BiosVersion() (version string, err error)
- func (s *SupermicroX10) BmcType() (model string)
- func (s *SupermicroX10) BmcVersion() (bmcVersion string, err error)
- func (s *SupermicroX10) CPU() (cpu string, cpuCount int, coreCount int, hyperthreadCount int, err error)
- func (s *SupermicroX10) CheckCredentials() (err error)
- func (s *SupermicroX10) Close() (err error)
- func (s *SupermicroX10) CurrentHTTPSCert() ([]*x509.Certificate, bool, error)
- func (s *SupermicroX10) Disks() (disks []*devices.Disk, err error)
- func (s *SupermicroX10) GenerateCSR(cert *cfgresources.HTTPSCertAttributes) ([]byte, error)
- func (s *SupermicroX10) GetCollection() devices.BmcCollection
- func (s *SupermicroX10) GetConfigure() devices.Configure
- func (s *SupermicroX10) IsBlade() (isBlade bool, err error)
- func (s *SupermicroX10) IsOn() (status bool, err error)
- func (s *SupermicroX10) Ldap(cfgLdap *cfgresources.Ldap) error
- func (s *SupermicroX10) LdapGroup(cfgGroup []*cfgresources.LdapGroup, cfgLdap *cfgresources.Ldap) (err error)
- func (s *SupermicroX10) License() (name string, licType string, err error)
- func (s *SupermicroX10) Memory() (mem int, err error)
- func (s *SupermicroX10) Model() (model string, err error)
- func (s *SupermicroX10) Name() (name string, err error)
- func (s *SupermicroX10) Network(cfg *cfgresources.Network) (reset bool, err error)
- func (s *SupermicroX10) Nics() (nics []*devices.Nic, err error)
- func (s *SupermicroX10) Ntp(cfg *cfgresources.Ntp) (err error)
- func (s *SupermicroX10) PowerCycle() (status bool, err error)
- func (s *SupermicroX10) PowerCycleBmc() (status bool, err error)
- func (s *SupermicroX10) PowerKw() (power float64, err error)
- func (s *SupermicroX10) PowerOff() (status bool, err error)
- func (s *SupermicroX10) PowerOn() (status bool, err error)
- func (s *SupermicroX10) PowerState() (state string, err error)
- func (s *SupermicroX10) PxeOnce() (status bool, err error)
- func (s *SupermicroX10) Resources() []string
- func (s *SupermicroX10) Screenshot() (response []byte, extension string, err error)
- func (s *SupermicroX10) Serial() (serial string, err error)
- func (s *SupermicroX10) ServerSnapshot() (server interface{}, err error)
- func (s *SupermicroX10) SetLicense(cfg *cfgresources.License) (err error)
- func (s *SupermicroX10) Status() (health string, err error)
- func (s *SupermicroX10) Syslog(cfg *cfgresources.Syslog) (err error)
- func (s *SupermicroX10) TempC() (temp int, err error)
- func (s *SupermicroX10) UpdateCredentials(username string, password string)
- func (s *SupermicroX10) UpdateFirmware(source, file string) (status bool, err error)
- func (s *SupermicroX10) UploadHTTPSCert(cert []byte, certFileName string, key []byte, keyFileName string) (bool, error)
- func (s *SupermicroX10) User(users []*cfgresources.User) (err error)
- func (s *SupermicroX10) Vendor() (vendor string)
- type URLRedirect
Constants ¶
const (
// BmcType defines the bmc model that is supported by this package
BmcType = "supermicrox10"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CapturePreview ¶ added in v0.2.2
type CapturePreview struct { IkvmPreview string `url:"IKVM_PREVIEW.XML"` //IKVM_PREVIEW.XML=(0,0) TimeStamp string `url:"time_stamp"` //time_stamp=Wed Oct 17 2018 15:56:08 GMT+0200 (CEST) }
CapturePreview declares payload to capture screen previews.
type ConfigDateTime ¶
type ConfigDateTime struct { Op string `url:"op"` //op=config_date_time Timezone int `url:"timezone"` //timezone=-7200 DstEn bool `url:"dst_en,int"` //dst_en=0 Enable string `url:"ntp"` //ntp=on NtpServerPrimary string `url:"ntp_server_pri"` //ntp_server_pri=ntp0.example.com NtpServerSecondary string `url:"ntp_server_2nd"` //ntp_server_2nd=ntp1.example.com Year int `url:"year"` //year=2018 Month int `url:"month"` //month=6 Day int `url:"day"` //day=1 Hour int `url:"hour"` //hour=05 Minute int `url:"min"` //min=49 Second int `url:"sec"` //sec=42 TimeStamp string `url:"time_stamp"` //time_stamp=Fri%20Jun%2001%202018%2009%3A58%3A19%20GMT%2B0200%20(CEST) }
ConfigDateTime declares payload to configure time parameters. /cgi/op.cgi
type ConfigLdap ¶
type ConfigLdap struct { Op string `url:"op"` //op=config_ldap Enable string `url:"en_ldap"` //en_ldap=on EnableSsl bool `url:"enSSL,int"` //enSSL=1 LdapIP string `url:"ldapip"` //ldapip=10.252.13.5 BaseDn string `url:"basedn"` //basedn=cn=Supermicro,cn=bmcUsers LdapPort int `url:"ldapport"` //ldapport=636 BindDn string `url:"bind_dn"` //bind_dn=undefined <- default value BindPassword string `url:"bind_pwd"` //bind_pwd=******** <- default value }
ConfigLdap declares payload to configure LDAP. /cgi/op.cgi
type ConfigPort ¶
type ConfigPort struct { Op string `url:"op"` //op=config_port HTTPPort int `url:"HTTP_PORT"` //HTTP_PORT=80 HTTPSPort int `url:"HTTPS_PORT"` //HTTPS_PORT=443 IkvmPort int `url:"IKVM_PORT"` //IKVM_PORT=5900 VMPort int `url:"VM_PORT"` //VM_PORT=623 <- virtual media port SSHPort int `url:"SSH_PORT"` //SSH_PORT=22 WsmanPort int `url:"WSMAN_PORT"` //WSMAN_PORT=5985 SnmpPort int `url:"SNMP_PORT"` //SNMP_PORT=161 IkvmEnable bool `url:"IKVM_SERVICE,int"` //IKVM_SERVICE=1 VMEnable bool `url:"VM_SERVICE,int"` //VM_SERVICE=1 SSHEnable bool `url:"SSH_SERVICE,int"` //SSH_SERVICE=1 SnmpEnable bool `url:"SNMP_SERVICE,int"` //SNMP_SERVICE=1 WsmanEnable bool `url:"WSMAN_SERVICE,int"` //WSMAN_SERVICE=0 SslRedirectEnable bool `url:"SSL_REDIRECT,int"` //SSL_REDIRECT=1 // contains filtered or unexported fields }
ConfigPort declares payload to configure services.
type ConfigSyslog ¶
type ConfigSyslog struct { Op string `url:"op"` //op=config_syslog SyslogIP1 string `url:"syslogip1"` //syslogip1=10.01.12.1 SyslogIP2 string `url:"syslogip2"` //syslogip1=10.01.12.2 SyslogIP3 string `url:"syslogip3"` //syslogip1=10.01.12.3 SyslogPort1 int `url:"syslogport1"` //syslogport1=514 SyslogPort2 int `url:"syslogport2"` //syslogport2=0 SyslogPort3 int `url:"syslogport3"` //syslogport3=0 Enable bool `url:"enable,int"` //enable=1 }
ConfigSyslog declares payload to configure syslog parameters. /cgi/op.cgi
type ConfigUser ¶
type ConfigUser struct { Username string `url:"username"` UserID int `url:"original_username"` //username integer Password string `url:"password,omitempty"` NewPrivilege int `url:"new_privilege,omitempty"` //4 == administrator, 3 == operator }
ConfigUser declares payload to configure User accounts. /cgi/config_user.cgi
type SupermicroX10 ¶
type SupermicroX10 struct {
// contains filtered or unexported fields
}
SupermicroX10 holds the status and properties of a connection to a supermicro bmc
func New ¶
func New(ip string, username string, password string) (sm *SupermicroX10, err error)
New returns a new SupermicroX10 instance ready to be used
func (*SupermicroX10) ApplyCfg ¶
func (s *SupermicroX10) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)
ApplyCfg implements the Bmc interface this is to be deprecated.
func (*SupermicroX10) Bios ¶ added in v0.2.3
func (s *SupermicroX10) Bios(cfg *cfgresources.Bios) (err error)
Bios implements the Configure interface.
func (*SupermicroX10) BiosVersion ¶
func (s *SupermicroX10) BiosVersion() (version string, err error)
BiosVersion returns the current version of the bios
func (*SupermicroX10) BmcType ¶
func (s *SupermicroX10) BmcType() (model string)
BmcType returns just Model id string - supermicrox10
func (*SupermicroX10) BmcVersion ¶
func (s *SupermicroX10) BmcVersion() (bmcVersion string, err error)
BmcVersion returns the version of the bmc we are running
func (*SupermicroX10) CPU ¶
func (s *SupermicroX10) CPU() (cpu string, cpuCount int, coreCount int, hyperthreadCount int, err error)
CPU returns the cpu, cores and hyperthreads of the server
func (*SupermicroX10) CheckCredentials ¶ added in v0.1.5
func (s *SupermicroX10) CheckCredentials() (err error)
CheckCredentials verify whether the credentials are valid or not
func (*SupermicroX10) Close ¶ added in v0.1.5
func (s *SupermicroX10) Close() (err error)
Close closes the connection properly
func (*SupermicroX10) CurrentHTTPSCert ¶ added in v0.2.4
func (s *SupermicroX10) CurrentHTTPSCert() ([]*x509.Certificate, bool, error)
CurrentHTTPSCert returns the current x509 certficates configured on the BMC the bool value returned is set to true if the BMC support CSR generation. CurrentHTTPSCert implements the Configure interface.
func (*SupermicroX10) Disks ¶
func (s *SupermicroX10) Disks() (disks []*devices.Disk, err error)
Disks returns a list of disks installed on the device
func (*SupermicroX10) GenerateCSR ¶ added in v0.2.4
func (s *SupermicroX10) GenerateCSR(cert *cfgresources.HTTPSCertAttributes) ([]byte, error)
GenerateCSR generates a CSR request on the BMC. GenerateCSR implements the Configure interface.
func (*SupermicroX10) GetCollection ¶ added in v0.2.4
func (s *SupermicroX10) GetCollection() devices.BmcCollection
GetCollection returns itself as a configure interface to avoid using reflect
func (*SupermicroX10) GetConfigure ¶ added in v0.2.4
func (s *SupermicroX10) GetConfigure() devices.Configure
GetConfigure returns itself as a configure interface to avoid using reflect
func (*SupermicroX10) IsBlade ¶
func (s *SupermicroX10) IsBlade() (isBlade bool, err error)
IsBlade returns if the current hardware is a blade or not
func (*SupermicroX10) IsOn ¶ added in v0.1.5
func (s *SupermicroX10) IsOn() (status bool, err error)
IsOn tells if a machine is currently powered on
func (*SupermicroX10) Ldap ¶ added in v0.2.3
func (s *SupermicroX10) Ldap(cfgLdap *cfgresources.Ldap) error
Ldap applies LDAP configuration params. Ldap implements the Configure interface. Configuration for LDAP is applied in the LdapGroup method, since supermicros just support a single LDAP group.
func (*SupermicroX10) LdapGroup ¶ added in v0.2.3
func (s *SupermicroX10) LdapGroup(cfgGroup []*cfgresources.LdapGroup, cfgLdap *cfgresources.Ldap) (err error)
LdapGroup applies LDAP and LDAP Group/Role related configuration, LdapGroup implements the Configure interface. Supermicro does not have any separate configuration for Ldap groups just for generic ldap nolint: gocyclo
func (*SupermicroX10) License ¶
func (s *SupermicroX10) License() (name string, licType string, err error)
License returns the iLO's license information
func (*SupermicroX10) Memory ¶
func (s *SupermicroX10) Memory() (mem int, err error)
Memory returns the total amount of memory of the server
func (*SupermicroX10) Model ¶
func (s *SupermicroX10) Model() (model string, err error)
Model returns the device model
func (*SupermicroX10) Name ¶
func (s *SupermicroX10) Name() (name string, err error)
Name returns the hostname of the machine
func (*SupermicroX10) Network ¶ added in v0.2.3
func (s *SupermicroX10) Network(cfg *cfgresources.Network) (reset bool, err error)
Network method implements the Configure interface applies various network parameters.
func (*SupermicroX10) Nics ¶
func (s *SupermicroX10) Nics() (nics []*devices.Nic, err error)
Nics returns all found Nics in the device
func (*SupermicroX10) Ntp ¶ added in v0.2.3
func (s *SupermicroX10) Ntp(cfg *cfgresources.Ntp) (err error)
Ntp applies NTP configuration params Ntp implements the Configure interface.
func (*SupermicroX10) PowerCycle ¶ added in v0.1.5
func (s *SupermicroX10) PowerCycle() (status bool, err error)
PowerCycle reboots the machine via bmc
func (*SupermicroX10) PowerCycleBmc ¶ added in v0.1.5
func (s *SupermicroX10) PowerCycleBmc() (status bool, err error)
PowerCycleBmc reboots the bmc we are connected to
func (*SupermicroX10) PowerKw ¶
func (s *SupermicroX10) PowerKw() (power float64, err error)
PowerKw returns the current power usage in Kw
func (*SupermicroX10) PowerOff ¶ added in v0.1.5
func (s *SupermicroX10) PowerOff() (status bool, err error)
PowerOff power off the machine via bmc
func (*SupermicroX10) PowerOn ¶ added in v0.1.5
func (s *SupermicroX10) PowerOn() (status bool, err error)
PowerOn power on the machine via bmc
func (*SupermicroX10) PowerState ¶
func (s *SupermicroX10) PowerState() (state string, err error)
PowerState returns the current power state of the machine
func (*SupermicroX10) PxeOnce ¶ added in v0.1.5
func (s *SupermicroX10) PxeOnce() (status bool, err error)
PxeOnce makes the machine to boot via pxe once
func (*SupermicroX10) Resources ¶ added in v0.2.3
func (s *SupermicroX10) Resources() []string
Resources returns a slice of supported resources and the order they are to be applied in.
func (*SupermicroX10) Screenshot ¶ added in v0.2.2
func (s *SupermicroX10) Screenshot() (response []byte, extension string, err error)
Screenshot returns a thumbnail of video display from the bmc. 1. request capture preview. 2. sleep for 3 seconds to give ikvm time to ensure preview was captured 3. request for preview.
func (*SupermicroX10) Serial ¶
func (s *SupermicroX10) Serial() (serial string, err error)
Serial returns the device serial
func (*SupermicroX10) ServerSnapshot ¶
func (s *SupermicroX10) ServerSnapshot() (server interface{}, err error)
ServerSnapshot do best effort to populate the server data and returns a blade or discrete
func (*SupermicroX10) SetLicense ¶ added in v0.2.3
func (s *SupermicroX10) SetLicense(cfg *cfgresources.License) (err error)
SetLicense implements the Configure interface.
func (*SupermicroX10) Status ¶
func (s *SupermicroX10) Status() (health string, err error)
Status returns health string status from the bmc
func (*SupermicroX10) Syslog ¶ added in v0.2.3
func (s *SupermicroX10) Syslog(cfg *cfgresources.Syslog) (err error)
Syslog applies the Syslog configuration resource Syslog implements the Configure interface
func (*SupermicroX10) TempC ¶
func (s *SupermicroX10) TempC() (temp int, err error)
TempC returns the current temperature of the machine
func (*SupermicroX10) UpdateCredentials ¶
func (s *SupermicroX10) UpdateCredentials(username string, password string)
UpdateCredentials updates login credentials
func (*SupermicroX10) UpdateFirmware ¶ added in v0.2.4
func (s *SupermicroX10) UpdateFirmware(source, file string) (status bool, err error)
UpdateFirmware updates the bmc firmware
func (*SupermicroX10) UploadHTTPSCert ¶ added in v0.2.4
func (s *SupermicroX10) UploadHTTPSCert(cert []byte, certFileName string, key []byte, keyFileName string) (bool, error)
UploadHTTPSCert uploads the given CRT cert, UploadHTTPSCert implements the Configure interface. 1. Upload the certificate and key pair 2. delay for a second (to let the BMC process the certificate) 3. Get the BMC to validate the certificate: SSL_VALIDATE.XML (0,0) 4. delay for a second 5. Request for the current: SSL_STATUS.XML (0,0)
func (*SupermicroX10) User ¶ added in v0.2.3
func (s *SupermicroX10) User(users []*cfgresources.User) (err error)
User applies the User configuration resource, if the user exists, it updates the users password, User implements the Configure interface. supermicro user accounts start with 1, account 0 which is a large empty string :\. nolint: gocyclo
func (*SupermicroX10) Vendor ¶
func (s *SupermicroX10) Vendor() (vendor string)
Vendor returns bmc's vendor
type URLRedirect ¶ added in v0.2.4
type URLRedirect struct { URLName string `url:"url_name"` //url_name=Snapshot URLType string `url:"url_type"` //url_type=img TimeStamp string `url:"time_stamp"` //time_stamp=Wed Oct 17 2018 15:56:08 GMT+0200 (CEST) }
URLRedirect declares payload sent when capturing screen previews