c7000

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
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 ACL added in v0.2.4

type ACL struct {
	XMLName xml.Name `xml:"hpoa:acl"`
	Text    string   `xml:",chardata"`
}

ACL struct declares payload to set ACLs

type AddUser

type AddUser struct {
	XMLName  xml.Name `xml:"hpoa:addUser"`
	Username Username
	Password Password
}

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(ip string, username string, password string) (chassis *C7000, err error)

New returns a connection to C7000

func (*C7000) AddBladeBmcAdmin added in v0.2.3

func (c *C7000) AddBladeBmcAdmin(username string, password string) (err error)

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) Blades

func (c *C7000) Blades() (blades []*devices.Blade, err error)

Blades returns all StorageBlades found in this chassis

func (*C7000) BmcType

func (c *C7000) BmcType() (model string)

BmcType returns the model id string - c7000

func (*C7000) ChassisSnapshot

func (c *C7000) ChassisSnapshot() (chassis *devices.Chassis, err error)

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

func (*C7000) CheckCredentials added in v0.1.5

func (c *C7000) CheckCredentials() (err error)

CheckCredentials verify whether the credentials are valid or not

func (*C7000) Close

func (c *C7000) Close() (err error)

Close closes the connection properly

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) Fans added in v0.2.4

func (c *C7000) Fans() (fans []*devices.Fan, err error)

Fans returns all found fans in the device

func (*C7000) FindBladePosition

func (c *C7000) FindBladePosition(serial string) (position int, err error)

FindBladePosition receives a serial and find the position of the blade using it

func (*C7000) FwVersion

func (c *C7000) FwVersion() (version string, err error)

FwVersion returns the current firmware version of the bmc

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) GetCollection added in v0.2.4

func (c *C7000) GetCollection() devices.CmcCollection

GetCollection returns itself as a configure interface to avoid using reflect

func (*C7000) GetConfigure added in v0.2.4

func (c *C7000) GetConfigure() devices.Configure

GetConfigure returns itself as a configure interface to avoid using reflect

func (*C7000) GetFirmwareVersion added in v0.1.6

func (c *C7000) GetFirmwareVersion() (version string, err error)

GetFirmwareVersion returns the chassis firmware version

func (*C7000) GetSetup added in v0.2.4

func (c *C7000) GetSetup() devices.CmcSetup

GetSetup returns itself as a configure interface to avoid using reflect

func (*C7000) IsActive

func (c *C7000) IsActive() bool

IsActive returns health string status from the bmc

func (*C7000) IsOn

func (c *C7000) IsOn() (status bool, err error)

IsOn tells if a machine is currently powered on

func (*C7000) IsOnBlade

func (c *C7000) IsOnBlade(position int) (status bool, err error)

IsOnBlade tells if a machine is currently powered on

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

func (c *C7000) ModBladeBmcUser(username string, password string) (err error)

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) Model

func (c *C7000) Model() (model string, err error)

Model returns the full device model string

func (*C7000) Name

func (c *C7000) Name() (name string, err error)

Name returns the hostname of the machine

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) Nics

func (c *C7000) Nics() (nics []*devices.Nic, err error)

Nics returns all found Nics in the device

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) PassThru

func (c *C7000) PassThru() (passthru string, err error)

PassThru returns the type of switch we have for this chassis

func (*C7000) PowerCycle

func (c *C7000) PowerCycle() (status bool, err error)

PowerCycle reboots the chassis

func (*C7000) PowerCycleBlade

func (c *C7000) PowerCycleBlade(position int) (status bool, err error)

PowerCycleBlade reboots the machine via bmc

func (*C7000) PowerCycleBmcBlade

func (c *C7000) PowerCycleBmcBlade(position int) (status bool, err error)

PowerCycleBmcBlade reboots the bmc we are connected to

func (*C7000) PowerKw

func (c *C7000) PowerKw() (power float64, err error)

PowerKw returns the current power usage in Kw

func (*C7000) PowerOff

func (c *C7000) PowerOff() (status bool, err error)

PowerOff power off the chassis

func (*C7000) PowerOffBlade

func (c *C7000) PowerOffBlade(position int) (status bool, err error)

PowerOffBlade power off the machine via bmc

func (*C7000) PowerOn

func (c *C7000) PowerOn() (status bool, err error)

PowerOn power on the chassis

func (*C7000) PowerOnBlade

func (c *C7000) PowerOnBlade(position int) (status bool, err error)

PowerOnBlade power on the machine via bmc

func (*C7000) Psus

func (c *C7000) Psus() (psus []*devices.Psu, err error)

Psus returns a list of psus installed on the device

func (*C7000) PxeOnceBlade

func (c *C7000) PxeOnceBlade(position int) (status bool, err error)

PxeOnceBlade makes the machine to boot via pxe once

func (*C7000) RemoveBladeBmcUser added in v0.2.3

func (c *C7000) RemoveBladeBmcUser(username string) (err error)

RemoveBladeBmcUser removes the user account from all BMCs through the chassis.

func (*C7000) ReseatBlade

func (c *C7000) ReseatBlade(position int) (status bool, err error)

ReseatBlade reboots the machine via bmc

func (*C7000) Resources added in v0.2.3

func (c *C7000) Resources() []string

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

func (*C7000) ResourcesSetup added in v0.2.4

func (c *C7000) ResourcesSetup() []string

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) Serial

func (c *C7000) Serial() (serial string, err error)

Serial returns the device serial

func (*C7000) SetDynamicPower

func (c *C7000) SetDynamicPower(enable bool) (status bool, err error)

SetDynamicPower configure the dynamic power behaviour

func (*C7000) SetFlexAddressState

func (c *C7000) SetFlexAddressState(position int, enable bool) (status bool, err error)

SetFlexAddressState Enable/Disable FlexAddress disables flex Addresses for blades FlexAddress is a virtual addressing scheme

func (*C7000) SetIpmiOverLan

func (c *C7000) SetIpmiOverLan(position int, enable bool) (status bool, err error)

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) Status

func (c *C7000) Status() (status string, err error)

Status returns health string status from the bmc

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) TempC

func (c *C7000) TempC() (temp int, err error)

TempC returns the current temperature of the machine

func (*C7000) UpdateCredentials

func (c *C7000) UpdateCredentials(username string, password string)

UpdateCredentials updates login credentials

func (*C7000) UpdateFirmware added in v0.1.6

func (c *C7000) UpdateFirmware(source, file string) (status bool, err error)

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.

func (*C7000) User added in v0.2.3

func (c *C7000) 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.

func (*C7000) Vendor

func (c *C7000) Vendor() (vendor string)

Vendor returns bmc's vendor

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 Header struct {
	XMLName  xml.Name `xml:"SOAP-ENV:Header,omitempty"`
	Security Security
}

Header to Un/marshal Header payload.

type HpOaSessionKeyToken

type HpOaSessionKeyToken struct {
	XMLName      xml.Name `xml:"hpoa:HpOaSessionKeyToken"`
	OaSessionKey OaSessionKey
}

HpOaSessionKeyToken struct to Un/marshal HP session key tokens.

type NtpPoll

type NtpPoll struct {
	XMLName xml.Name `xml:"hpoa:ntpPoll"`
	Text    string   `xml:",chardata"`
}

NtpPoll to marshal NTP polling config payloads.

type NtpPrimary

type NtpPrimary struct {
	XMLName xml.Name `xml:"hpoa:ntpPrimary"`
	Text    string   `xml:",chardata"`
}

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 Password

type Password struct {
	XMLName xml.Name `xml:"hpoa:password"`
	Text    string   `xml:",chardata"`
}

Password struct to Un/Marshal Password payload.

type RemoveUser added in v0.2.2

type RemoveUser struct {
	XMLName  xml.Name `xml:"hpoa:removeUser"`
	Username Username
}

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 Server

type Server struct {
	XMLName xml.Name `xml:"hpoa:server"`
	Text    string   `xml:",chardata"`
}

Server to Un/marshal Server 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

type SetUserBayACL struct {
	XMLName  xml.Name `xml:"hpoa:setUserBayAcl"`
	Username Username
	ACL      ACL
}

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

type UserLogout struct {
	XMLName xml.Name `xml:"hpoa:userLogOut"`
}

UserLogout declares payload to log out.

type Username

type Username struct {
	XMLName xml.Name `xml:"hpoa:username"`
	Text    string   `xml:",chardata"`
}

Username struct to Un/Marshal Username payload.

Jump to

Keyboard shortcuts

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