idrac9

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: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BMCType defines the bmc model that is supported by this package
	BMCType = "idrac9"
)

Variables

View Source
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 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 New

func New(ip string, username string, password string) (iDrac *IDrac9, err error)

New returns a new IDrac9 ready to be used

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

func (i *IDrac9) BiosVersion() (version string, err error)

BiosVersion returns the current version of the bios

func (*IDrac9) BmcType

func (i *IDrac9) BmcType() (bmcType string)

BmcType returns the type of bmc we are talking to

func (*IDrac9) BmcVersion

func (i *IDrac9) BmcVersion() (bmcVersion string, err error)

BmcVersion returns the version of the bmc we are running

func (*IDrac9) CPU

func (i *IDrac9) CPU() (cpu string, cpuCount int, coreCount int, hyperthreadCount int, err error)

CPU return the cpu, cores and hyperthreads the server

func (*IDrac9) CheckCredentials added in v0.1.5

func (i *IDrac9) CheckCredentials() (err error)

CheckCredentials verify whether the credentials are valid or not

func (*IDrac9) Close added in v0.1.5

func (i *IDrac9) Close() (err error)

Close closes the connection properly

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

func (i *IDrac9) Disks() (disks []*devices.Disk, err error)

Disks returns a list of disks installed on the device

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

func (i *IDrac9) GetCollection() devices.BmcCollection

GetCollection returns itself as a configure interface to avoid using reflect

func (*IDrac9) GetConfigure added in v0.2.4

func (i *IDrac9) GetConfigure() devices.Configure

GetConfigure returns itself as a configure interface to avoid using reflect

func (*IDrac9) IsBlade

func (i *IDrac9) IsBlade() (isBlade bool, err error)

IsBlade returns if the current hardware is a blade or not

func (*IDrac9) IsOn added in v0.1.5

func (i *IDrac9) IsOn() (status bool, err error)

IsOn tells if a machine is currently powered on

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

func (i *IDrac9) License() (name string, licType string, err error)

License returns the bmc license information

func (*IDrac9) Memory

func (i *IDrac9) Memory() (mem int, err error)

Memory return the total amount of memory of the server

func (*IDrac9) Model

func (i *IDrac9) Model() (model string, err error)

Model returns the device model

func (*IDrac9) Name

func (i *IDrac9) Name() (name string, err error)

Name returns the name of this server from the bmc point of view

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

func (i *IDrac9) Nics() (nics []*devices.Nic, err error)

Nics returns all found Nics in the device

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) PowerCycle added in v0.1.5

func (i *IDrac9) PowerCycle() (status bool, err error)

PowerCycle reboots the machine via bmc

func (*IDrac9) PowerCycleBmc added in v0.1.5

func (i *IDrac9) PowerCycleBmc() (status bool, err error)

PowerCycleBmc reboots the bmc we are connected to

func (*IDrac9) PowerKw

func (i *IDrac9) PowerKw() (power float64, err error)

PowerKw returns the current power usage in Kw

func (*IDrac9) PowerOff added in v0.1.5

func (i *IDrac9) PowerOff() (status bool, err error)

PowerOff power off the machine via bmc

func (*IDrac9) PowerOn added in v0.1.5

func (i *IDrac9) PowerOn() (status bool, err error)

PowerOn power on the machine via bmc

func (*IDrac9) PowerState

func (i *IDrac9) PowerState() (state string, err error)

PowerState returns the current power state of the machine

func (*IDrac9) Psus

func (i *IDrac9) Psus() (psus []*devices.Psu, err error)

Psus returns a list of psus installed on the device

func (*IDrac9) PxeOnce added in v0.1.5

func (i *IDrac9) PxeOnce() (status bool, err error)

PxeOnce makes the machine to boot via pxe once

func (*IDrac9) Resources added in v0.2.3

func (i *IDrac9) Resources() []string

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

func (*IDrac9) Screenshot added in v0.2.2

func (i *IDrac9) Screenshot() (response []byte, extension string, err error)

Screenshot grab screen preview.

func (*IDrac9) Serial

func (i *IDrac9) Serial() (serial string, err error)

Serial returns the device serial

func (*IDrac9) ServerSnapshot

func (i *IDrac9) ServerSnapshot() (server interface{}, err error)

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

func (i *IDrac9) Status() (status string, err error)

Status returns health string status from the bmc

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

func (*IDrac9) TempC

func (i *IDrac9) TempC() (temp int, err error)

TempC returns the current temperature of the machine

func (*IDrac9) UpdateCredentials

func (i *IDrac9) UpdateCredentials(username string, password string)

UpdateCredentials updates login credentials

func (*IDrac9) UpdateFirmware added in v0.2.4

func (i *IDrac9) UpdateFirmware(source, file string) (status bool, err error)

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

func (*IDrac9) Vendor

func (i *IDrac9) Vendor() (vendor string)

Vendor returns bmc's vendor

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 Jobs added in v0.2.2

type Jobs map[string]string

Jobs type is how job payloads are unmarshalled.

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.

Jump to

Keyboard shortcuts

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