Documentation ¶
Index ¶
- Constants
- type ACL
- type AddUser
- type Body
- type C7000
- func (c *C7000) AddBladeBmcAdmin(username string, password string) error
- func (c *C7000) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)
- func (c *C7000) Bios(cfg *cfgresources.Bios) error
- func (c *C7000) Blades() (blades []*devices.Blade, err error)
- func (c *C7000) ChassisSnapshot() (chassis *devices.Chassis, err error)
- func (c *C7000) CheckCredentials() (err error)
- func (c *C7000) Close() error
- func (c *C7000) CurrentHTTPSCert() (x []*x509.Certificate, b bool, e error)
- func (c *C7000) Fans() (fans []*devices.Fan, err error)
- func (c *C7000) FindBladePosition(serial string) (int, error)
- func (c *C7000) GenerateCSR(cert *cfgresources.HTTPSCertAttributes) ([]byte, error)
- func (c *C7000) HardwareType() (model string)
- func (c *C7000) IsActive() bool
- func (c *C7000) IsOn() (bool, error)
- func (c *C7000) IsOnBlade(position int) (bool, error)
- func (c *C7000) IsPsuRedundant() (state bool, err error)
- func (c *C7000) Ldap(cfg *cfgresources.Ldap) (err error)
- func (c *C7000) LdapGroup(cfg []*cfgresources.LdapGroup, cfgLdap *cfgresources.Ldap) (err error)
- func (c *C7000) ModBladeBmcUser(username string, password string) error
- func (c *C7000) Model() (model string, err error)
- func (c *C7000) Name() (name string, err error)
- func (c *C7000) Network(cfg *cfgresources.Network) (bool, error)
- func (c *C7000) Nics() (nics []*devices.Nic, err error)
- func (c *C7000) Ntp(cfg *cfgresources.Ntp) (err error)
- func (c *C7000) PassThru() (passthru string, err error)
- func (c *C7000) Power(cfg *cfgresources.Power) (err error)
- func (c *C7000) PowerCycle() (bool, error)
- func (c *C7000) PowerCycleBlade(position int) (bool, error)
- func (c *C7000) PowerCycleBmcBlade(position int) (bool, error)
- func (c *C7000) PowerKw() (power float64, err error)
- func (c *C7000) PowerOff() (bool, error)
- func (c *C7000) PowerOffBlade(position int) (bool, error)
- func (c *C7000) PowerOn() (bool, error)
- func (c *C7000) PowerOnBlade(position int) (bool, error)
- func (c *C7000) PsuRedundancyMode() (mode string, err error)
- func (c *C7000) Psus() (psus []*devices.Psu, err error)
- func (c *C7000) PxeOnceBlade(position int) (bool, error)
- func (c *C7000) RemoveBladeBmcUser(username string) error
- func (c *C7000) ReseatBlade(position int) (bool, error)
- func (c *C7000) Resources() []string
- func (c *C7000) ResourcesSetup() []string
- func (c *C7000) Serial() (serial string, err error)
- func (c *C7000) SetDynamicPower(enable bool) (bool, error)
- func (c *C7000) SetFlexAddressState(_ int, _ bool) (bool, error)
- func (c *C7000) SetIpmiOverLan(_ int, _ bool) (bool, error)
- func (c *C7000) SetLicense(*cfgresources.License) error
- func (c *C7000) Status() (status string, err error)
- func (c *C7000) StorageBlades() (storageBlades []*devices.StorageBlade, err error)
- func (c *C7000) Syslog(cfg *cfgresources.Syslog) (err error)
- func (c *C7000) TempC() (temp int, err error)
- func (c *C7000) UpdateCredentials(username string, password string)
- func (c *C7000) UpdateFirmware(source, file string) (bool, error)
- func (c *C7000) UploadHTTPSCert(cert []byte, certFileName string, key []byte, keyFileName string) (bool, error)
- func (c *C7000) User(users []*cfgresources.User) (err error)
- func (c *C7000) Vendor() (vendor string)
- func (c *C7000) Version() (version string, err error)
- type Envelope
- type EnvelopeLoginResponse
- type Header
- type HpOaSessionKeyToken
- type NtpPoll
- type NtpPrimary
- type NtpSecondary
- type OaSessionKey
- type Password
- type RemoveUser
- type SearchContext
- type SearchContexts
- type Security
- type Server
- type SetRemoteSyslogEnabled
- type SetRemoteSyslogPort
- type SetRemoteSyslogServer
- type SetUserBayACL
- type SetUserPassword
- type UserLogIn
- type UserLogout
- type Username
Constants ¶
const (
// BMCType defines the bmc model that is supported by this package
BMCType = "c7000"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddUser ¶
AddUser to marshal User account payloads. <hpoa:addUser>
<hpoa:username>Test</hpoa:username> <hpoa:password>foobar</hpoa:password>
</hpoa:addUser>
type Body ¶
type Body struct { XMLName xml.Name `xml:"SOAP-ENV:Body"` Text string `xml:",chardata"` Content interface{} `xml:",any"` }
Body struct to Un/Marshal XML Body payload.
type C7000 ¶
type C7000 struct { XMLToken string //required to send SOAP XML payloads Rimp *hp.Rimp // contains filtered or unexported fields }
C7000 holds the status and properties of a connection to a BladeSystem device
func New ¶
func New(ctx context.Context, host string, username string, password string, log logr.Logger) (*C7000, error)
New returns a connection to C7000
func (*C7000) AddBladeBmcAdmin ¶ added in v0.2.3
AddBladeBmcAdmin configures BMC Admin user accounts through the chassis. this method will attempt to add the user to all BMCs in a chassis.
func (*C7000) ApplyCfg ¶
func (c *C7000) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)
ApplyCfg implements the Cmc interface
func (*C7000) Bios ¶ added in v0.2.3
func (c *C7000) Bios(cfg *cfgresources.Bios) error
Bios method implements the Configure interface
func (*C7000) ChassisSnapshot ¶
ChassisSnapshot do best effort to populate the server data and returns a blade or discrete
func (*C7000) CheckCredentials ¶ added in v0.1.5
CheckCredentials verify whether the credentials are valid or not
func (*C7000) CurrentHTTPSCert ¶ added in v0.2.4
func (c *C7000) CurrentHTTPSCert() (x []*x509.Certificate, b bool, e 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 (*C7000) FindBladePosition ¶
FindBladePosition receives a serial and find the position of the blade using it
func (*C7000) GenerateCSR ¶ added in v0.2.4
func (c *C7000) GenerateCSR(cert *cfgresources.HTTPSCertAttributes) ([]byte, error)
GenerateCSR generates a CSR request on the BMC. GenerateCSR implements the Configure interface.
func (*C7000) HardwareType ¶ added in v0.3.3
HardwareType returns the model id string - c7000
func (*C7000) IsPsuRedundant ¶ added in v0.2.7
IsPsuRedundant informs whether or not the power is currently redundant
func (*C7000) Ldap ¶ added in v0.2.3
func (c *C7000) Ldap(cfg *cfgresources.Ldap) (err error)
Ldap applies LDAP configuration params. Ldap implements the Configure interface. 1. apply ldap group params 2. enable ldap auth 3. apply ldap server params
func (*C7000) LdapGroup ¶ added in v0.2.3
func (c *C7000) LdapGroup(cfg []*cfgresources.LdapGroup, cfgLdap *cfgresources.Ldap) (err error)
LdapGroup applies LDAP Group/Role related configuration LdapGroup implements the Configure interface. Actions carried out in order 1. addLdapGroup 2. setLdapGroupBayACL 3. addLdapGroupBayAccess (done)
func (*C7000) ModBladeBmcUser ¶ added in v0.2.3
ModBladeBmcUser modfies BMC Admin user account password through the chassis, this method will attempt to modify a user account on all BMCs in a chassis.
func (*C7000) Network ¶ added in v0.2.3
func (c *C7000) Network(cfg *cfgresources.Network) (bool, error)
Network method implements the Configure interface
func (*C7000) Ntp ¶ added in v0.2.3
func (c *C7000) Ntp(cfg *cfgresources.Ntp) (err error)
Ntp applies NTP configuration params Ntp implements the Configure interface.
1. SOAP call to set the NTP server params 2. SOAP call to set TZ 1. <hpoa:configureNtp>
<hpoa:ntpPrimary>ntp0.example.com</hpoa:ntpPrimary> <hpoa:ntpSecondary>ntp1.example.com</hpoa:ntpSecondary> <hpoa:ntpPoll>720</hpoa:ntpPoll> </hpoa:configureNtp>
2. <hpoa:setEnclosureTimeZone>
<hpoa:timeZone>CET</hpoa:timeZone>
</hpoa:setEnclosureTimeZone>
func (*C7000) Power ¶ added in v0.3.5
func (c *C7000) Power(cfg *cfgresources.Power) (err error)
Power implemented the Configure interface
func (*C7000) PowerCycle ¶
PowerCycle reboots the chassis
func (*C7000) PowerCycleBlade ¶
PowerCycleBlade reboots the machine via bmc
func (*C7000) PowerCycleBmcBlade ¶
PowerCycleBmcBlade reboots the bmc we are connected to
func (*C7000) PowerOffBlade ¶
PowerOffBlade power off the machine via bmc
func (*C7000) PowerOnBlade ¶
PowerOnBlade power on the machine via bmc
func (*C7000) PsuRedundancyMode ¶ added in v0.2.7
PsuRedundancyMode returns the current redundancy mode is configured for the chassis
func (*C7000) PxeOnceBlade ¶
PxeOnceBlade makes the machine to boot via pxe once
func (*C7000) RemoveBladeBmcUser ¶ added in v0.2.3
RemoveBladeBmcUser removes the user account from all BMCs through the chassis.
func (*C7000) ReseatBlade ¶
ReseatBlade reboots the machine via bmc
func (*C7000) Resources ¶ added in v0.2.3
Resources returns a slice of supported resources and the order they are to be applied in.
func (*C7000) ResourcesSetup ¶ added in v0.2.4
ResourcesSetup returns
- slice of supported one time setup resources, in the order they must be applied
ResourcesSetup implements the CmcSetup interface see cfgresources.SetupChassis for list of setup resources.
func (*C7000) SetDynamicPower ¶
SetDynamicPower configure the dynamic power behaviour
func (*C7000) SetFlexAddressState ¶
SetFlexAddressState Enable/Disable FlexAddress disables flex Addresses for blades FlexAddress is a virtual addressing scheme
func (*C7000) SetIpmiOverLan ¶
SetIpmiOverLan Enable/Disable IPMI over lan parameter per blade in chassis
func (*C7000) SetLicense ¶ added in v0.2.3
func (c *C7000) SetLicense(*cfgresources.License) error
SetLicense implements the Configure interface
func (*C7000) StorageBlades ¶
func (c *C7000) StorageBlades() (storageBlades []*devices.StorageBlade, err error)
StorageBlades returns all StorageBlades found in this chassis
func (*C7000) Syslog ¶ added in v0.2.3
func (c *C7000) Syslog(cfg *cfgresources.Syslog) (err error)
Syslog applies the Syslog configuration resource Syslog implements the Configure interface Applies syslog parameters 1. set syslog server 2. set syslog port 3. enable syslog theres no option to set the port
func (*C7000) UpdateCredentials ¶
UpdateCredentials updates login credentials
func (*C7000) UpdateFirmware ¶ added in v0.1.6
UpdateFirmware updates the chassis firmware
func (*C7000) UploadHTTPSCert ¶ added in v0.2.4
func (c *C7000) UploadHTTPSCert(cert []byte, certFileName string, key []byte, keyFileName string) (bool, error)
UploadHTTPSCert uploads the given CRT cert, UploadHTTPSCert implements the Configure interface.
type Envelope ¶
type Envelope struct { XMLName xml.Name `xml:"SOAP-ENV:Envelope"` Text string `xml:",chardata"` SOAPENV string `xml:"xmlns:SOAP-ENV,attr"` Xsi string `xml:"xmlns:xsi,attr"` Xsd string `xml:"xmlns:xsd,attr"` Wsu string `xml:"xmlns:wsu,attr"` Wsse string `xml:"xmlns:wsse,attr"` Hpoa string `xml:"xmlns:hpoa,attr"` Header Header Body Body }
Envelope to marshal XML body and header payloads.
type EnvelopeLoginResponse ¶
type EnvelopeLoginResponse struct { XMLName xml.Name `xml:"Envelope"` Text string `xml:",chardata"` SOAPENV string `xml:"SOAP-ENV,attr"` SOAPENC string `xml:"SOAP-ENC,attr"` Xsi string `xml:"xsi,attr"` Xsd string `xml:"xsd,attr"` Wsu string `xml:"wsu,attr"` Wsse string `xml:"wsse,attr"` Hpoa string `xml:"hpoa,attr"` Body struct { UserLogInResponse struct { HpOaSessionKeyToken struct { OaSessionKey struct { Text string `xml:",chardata"` } `xml:"oaSessionKey"` } `xml:"HpOaSessionKeyToken"` } `xml:"userLogInResponse"` } `xml:"Body"` }
EnvelopeLoginResponse struct to Unmarshal login response.
type HpOaSessionKeyToken ¶
type HpOaSessionKeyToken struct { XMLName xml.Name `xml:"hpoa:HpOaSessionKeyToken"` OaSessionKey OaSessionKey }
HpOaSessionKeyToken struct to Un/marshal HP session key tokens.
type NtpPrimary ¶
NtpPrimary to marshal NTP primary config payloads.
type NtpSecondary ¶
type NtpSecondary struct { XMLName xml.Name `xml:"hpoa:ntpSecondary"` Text string `xml:",chardata"` }
NtpSecondary to marshal NTP secondary config payloads.
type OaSessionKey ¶
type OaSessionKey struct { XMLName xml.Name `xml:"hpoa:oaSessionKey"` Text string `xml:",chardata"` }
OaSessionKey struct to Un/marshal OA session key payload.
type RemoveUser ¶ added in v0.2.2
RemoveUser to marshal User account removal payloads. <hpoa:removeUser>
<hpoa:username>psm</hpoa:username>
</hpoa:removeUser>
type SearchContext ¶
type SearchContext struct { XMLName xml.Name `xml:"hpoa:searchContext"` Text string `xml:",chardata"` }
SearchContext declares a LDAP search context payload.
type SearchContexts ¶
type SearchContexts struct { XMLName xml.Name `xml:"hpoa:searchContexts"` Hpoa string `xml:"xmlns:hpoa,attr"` SearchContext []SearchContext }
SearchContexts declares multiple LDAP search context payloads.
type Security ¶
type Security struct { XMLName xml.Name `xml:"wsse:Security"` MustUnderstand string `xml:"SOAP-ENV:mustUnderstand,attr"` HpOaSessionKeyToken HpOaSessionKeyToken }
Security to Un/marshal Security payload.
type SetRemoteSyslogEnabled ¶
type SetRemoteSyslogEnabled struct { XMLName xml.Name `xml:"hpoa:setRemoteSyslogEnabled"` Enabled bool `xml:"hpoa:enabled"` }
SetRemoteSyslogEnabled to Un/marshal Syslog enable/disable payload.
type SetRemoteSyslogPort ¶
type SetRemoteSyslogPort struct { XMLName xml.Name `xml:"hpoa:setRemoteSyslogPort"` Port int `xml:"hpoa:port"` }
SetRemoteSyslogPort to Un/marshal Syslog port config payload.
type SetRemoteSyslogServer ¶
type SetRemoteSyslogServer struct { XMLName xml.Name `xml:"hpoa:setRemoteSyslogServer"` Server string `xml:"hpoa:server"` }
SetRemoteSyslogServer to Un/marshal Syslog config payload.
type SetUserBayACL ¶ added in v0.2.4
SetUserBayACL to marshal User account ACL payloads. <hpoa:setUserBayAcl>
<hpoa:username>psm</hpoa:username> <hpoa:acl>ADMINISTRATOR</hpoa:acl> </hpoa:setUserBayAcl>
type SetUserPassword ¶
type SetUserPassword struct { XMLName xml.Name `xml:"hpoa:setUserPassword"` Username Username Password Password }
SetUserPassword to marshal User password payloads. <hpoa:setUserPassword>
<hpoa:username>Administrator</hpoa:username> <hpoa:password>foobar</hpoa:password>
</hpoa:setUserPassword>
type UserLogIn ¶
type UserLogIn struct { XMLName xml.Name `xml:"hpoa:userLogIn"` Text string `xml:",chardata"` Username Username Password Password }
UserLogIn struct to Un/Marshal UserLogin payload.
type UserLogout ¶ added in v0.1.5
UserLogout declares payload to log out.