c7000

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: Apache-2.0 Imports: 19 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 AddUser

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

<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"`
}

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

func (c *C7000) ApplyCfg(config *cfgresources.ResourcesConfig) (err error)

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

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

Nics returns all found Nics in the device

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 machine via bmc

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 machine via bmc

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 machine via bmc

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

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

ReseatBlade reboots the machine via bmc

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)

func (*C7000) SetFlexAddressState

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

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)

Enable/Disable IPMI over lan parameter per blade in chassis

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

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

type HpOaSessionKeyToken

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

type NtpPoll

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

type NtpPrimary

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

type NtpSecondary

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

type OaSessionKey

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

type Password

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

type SearchContext

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

type SearchContexts

type SearchContexts struct {
	XMLName       xml.Name `xml:"hpoa:searchContexts"`
	Hpoa          string   `xml:"xmlns:hpoa,attr"`
	SearchContext []SearchContext
}

type Security

type Security struct {
	XMLName             xml.Name `xml:"wsse:Security"`
	MustUnderstand      string   `xml:"SOAP-ENV:mustUnderstand,attr"`
	HpOaSessionKeyToken HpOaSessionKeyToken
}

type Server

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

type SetRemoteSyslogEnabled

type SetRemoteSyslogEnabled struct {
	XMLName xml.Name `xml:"hpoa:setRemoteSyslogEnabled"`
	Enabled bool     `xml:"hpoa:enabled"`
}

type SetRemoteSyslogPort

type SetRemoteSyslogPort struct {
	XMLName xml.Name `xml:"hpoa:setRemoteSyslogPort"`
	Port    int      `xml:"hpoa:port"`
}

type SetRemoteSyslogServer

type SetRemoteSyslogServer struct {
	XMLName xml.Name `xml:"hpoa:setRemoteSyslogServer"`
	Server  string   `xml:"hpoa:server"`
}

type SetUserPassword

type SetUserPassword struct {
	XMLName  xml.Name `xml:"hpoa:setUserPassword"`
	Username Username
	Password Password
}

<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
}

type UserLogout added in v0.1.5

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

UserLogout is requied to logout the session

type Username

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

Jump to

Keyboard shortcuts

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