devices

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2020 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// Unknown is the constant that defines unknown things
	Unknown = "Unknown"

	// HP is the constant that defines the vendor HP
	HP = "HP"
	// Dell is the constant that defines the vendor Dell
	Dell = "Dell"
	// Supermicro is the constant that defines the vendor Supermicro
	Supermicro = "Supermicro"
	// Cloudline is the constant that defines the cloudlines
	Cloudline = "Cloudline"
	// Common is the constant of thinks we could use across multiple vendors
	Common = "Common"

	// Grid describes the power redundancy mode when using grid redundancy
	Grid = "Grid"

	// PowerSupply describes the power redundancy mode when using power supply redundancy
	PowerSupply = "PowerSupply"

	// NoRedundancy describes the power redundancy mode we don't have redundancy
	NoRedundancy = "NoRedundancy"

	// BladeHwType is the constant defining the blade hw type
	BladeHwType = "blade"
	// DiscreteHwType is the constant defining the Discrete hw type
	DiscreteHwType = "discrete"
	// ChassisHwType is the constant defining the chassis hw type
	ChassisHwType = "chassis"

	// IDrac8 is the constant for iDRAC8 bmc
	IDrac8 = "iDRAC8"
	// IDrac9 is the constant for iDRAC9 bmc
	IDrac9 = "iDRAC9"
	// Ilo2 is the constant for Ilo2 bmc
	Ilo2 = "iLO2"
	// Ilo3 is the constant for iLO3 bmc
	Ilo3 = "iLO3"
	// Ilo4 is the constant for iLO4 bmc
	Ilo4 = "iLO4"
	// Ilo5 is the constant for iLO5 bmc
	Ilo5 = "iLO5"
	//AtenSM is the constant for AtenSM bmc
	AtenSM = "AtenSM"
)

Variables

This section is empty.

Functions

func ListSupportedVendors added in v0.2.7

func ListSupportedVendors() []string

ListSupportedVendors returns a list of supported vendors

Types

type Blade

type Blade struct {
	Serial               string
	Name                 string
	BiosVersion          string
	BmcType              string
	BmcAddress           string
	BmcVersion           string
	BmcLicenceType       string
	BmcLicenceStatus     string
	Disks                []*Disk
	Nics                 []*Nic
	BladePosition        int
	Model                string
	PowerState           string
	TempC                int
	PowerKw              float64
	Status               string
	Vendor               string
	ChassisSerial        string
	Processor            string
	ProcessorCount       int
	ProcessorCoreCount   int
	ProcessorThreadCount int
	StorageBlade         StorageBlade
	Memory               int
	FlexAddressEnabled   bool
}

Blade contains all the blade information we will expose across different vendors

type Bmc

type Bmc interface {
	// Configure interface
	Configure

	// BmcCollection interface
	BmcCollection

	CheckCredentials() error
	Close() error
	PowerOn() (bool, error)
	PowerOff() (bool, error)
	PxeOnce() (bool, error)
	PowerCycleBmc() (bool, error)
	PowerCycle() (bool, error)
	UpdateCredentials(string, string)
	UpdateFirmware(string, string) (bool, error)
}

Bmc represents all the required bmc items

type BmcCollection added in v0.2.4

type BmcCollection interface {
	BiosVersion() (string, error)
	HardwareType() string
	Version() (string, error)
	CPU() (string, int, int, int, error)
	Disks() ([]*Disk, error)
	IsBlade() (bool, error)
	License() (string, string, error)
	Memory() (int, error)
	Model() (string, error)
	Name() (string, error)
	Nics() ([]*Nic, error)
	PowerKw() (float64, error)
	PowerState() (string, error)
	IsOn() (bool, error)
	Serial() (string, error)
	Status() (string, error)
	TempC() (int, error)
	Vendor() string
	Slot() (int, error)
	Screenshot() ([]byte, string, error)
	ServerSnapshot() (interface{}, error)
	ChassisSerial() (string, error)
}

BmcCollection represents the requirement of items to be collected a server

type Chassis

type Chassis struct {
	Serial            string
	Name              string
	BmcAddress        string
	Blades            []*Blade
	StorageBlades     []*StorageBlade
	Fans              []*Fan
	Nics              []*Nic
	Psus              []*Psu
	PsuRedundancyMode string
	IsPsuRedundant    bool
	TempC             int
	PassThru          string
	Status            string
	PowerKw           float64
	Model             string
	Vendor            string
	FwVersion         string
}

Chassis contains all the chassis the information we will expose across different vendors

type Cmc added in v0.2.4

type Cmc interface {
	//  Configure interface
	Configure

	// CmcSetup interface
	CmcSetup

	// CmcCollection Interface
	CmcCollection

	ApplyCfg(*cfgresources.ResourcesConfig) error
	ChassisSnapshot() (*Chassis, error)
	CheckCredentials() error
	Close() error
	PowerCycle() (bool, error)
	PowerCycleBlade(int) (bool, error)
	PowerCycleBmcBlade(int) (bool, error)
	PowerOff() (bool, error)
	PowerOffBlade(int) (bool, error)
	PowerOn() (bool, error)
	PowerOnBlade(int) (bool, error)
	PxeOnceBlade(int) (bool, error)
	ReseatBlade(int) (bool, error)
	UpdateCredentials(string, string)
	UpdateFirmware(string, string) (bool, error)
}

Cmc represents all the required cmc items

type CmcCollection added in v0.2.4

type CmcCollection interface {
	Blades() ([]*Blade, error)
	HardwareType() string
	FindBladePosition(string) (int, error)
	Version() (string, error)
	Fans() ([]*Fan, error)
	IsActive() bool
	IsOn() (bool, error)
	IsOnBlade(int) (bool, error)
	Model() (string, error)
	Name() (string, error)
	Nics() ([]*Nic, error)
	PassThru() (string, error)
	PowerKw() (float64, error)
	Psus() ([]*Psu, error)
	Serial() (string, error)
	Status() (string, error)
	IsPsuRedundant() (bool, error)
	PsuRedundancyMode() (string, error)
	StorageBlades() ([]*StorageBlade, error)
	TempC() (int, error)
	Vendor() string
}

CmcCollection represents the requirement of items to be collected from a chassis

type CmcSetup added in v0.2.4

type CmcSetup interface {
	ResourcesSetup() []string
	RemoveBladeBmcUser(string) error
	AddBladeBmcAdmin(string, string) error
	ModBladeBmcUser(string, string) error
	SetDynamicPower(bool) (bool, error)
	SetIpmiOverLan(int, bool) (bool, error)
	SetFlexAddressState(int, bool) (bool, error)
}

CmcSetup interface declares methods that are used to apply one time configuration to a Chassis.

type Configure added in v0.2.3

type Configure interface {
	Resources() []string
	User([]*cfgresources.User) error
	Syslog(*cfgresources.Syslog) error
	Ntp(*cfgresources.Ntp) error
	Ldap(*cfgresources.Ldap) error
	LdapGroup([]*cfgresources.LdapGroup, *cfgresources.Ldap) error
	Network(*cfgresources.Network) (bool, error)
	SetLicense(*cfgresources.License) error
	Bios(*cfgresources.Bios) error
	Power(*cfgresources.Power) error
	CurrentHTTPSCert() ([]*x509.Certificate, bool, error)
	GenerateCSR(*cfgresources.HTTPSCertAttributes) ([]byte, error)
	UploadHTTPSCert([]byte, string, []byte, string) (bool, error)
}

Configure interface declares methods implemented to apply configuration to BMCs.

type Discrete

type Discrete struct {
	Serial               string
	Name                 string
	BiosVersion          string
	BmcType              string
	BmcAddress           string
	BmcVersion           string
	BmcSSHReachable      bool
	BmcWEBReachable      bool
	BmcIpmiReachable     bool
	BmcLicenceType       string
	BmcLicenceStatus     string
	BmcAuth              bool
	Disks                []*Disk
	Nics                 []*Nic
	Psus                 []*Psu
	Model                string
	TempC                int
	PowerKw              float64
	PowerState           string
	Status               string
	Vendor               string
	Processor            string
	ProcessorCount       int
	ProcessorCoreCount   int
	ProcessorThreadCount int
	Memory               int
}

Discrete contains all the blade information we will expose across different vendors

type Disk

type Disk struct {
	Status    string
	Serial    string
	Type      string
	Size      string
	Model     string
	Location  string
	FwVersion string
}

Disk represents a disk device

type Fan added in v0.2.4

type Fan struct {
	Serial     string
	Status     string
	Position   int
	Model      string
	CurrentRPM int64
	PowerKw    float64
}

Fan represents que current status a fan

type Nic

type Nic struct {
	MacAddress string
	Name       string
	Up         bool
	Speed      string
}

Nic represents a network interface devices

type Psu

type Psu struct {
	Serial     string
	CapacityKw float64
	PowerKw    float64
	Status     string
	PartNumber string
	Position   int
}

Psu represents a power supply device

type StorageBlade

type StorageBlade struct {
	Serial        string
	FwVersion     string
	BladePosition int
	Model         string
	TempC         int
	PowerKw       float64
	Status        string
	Vendor        string
	ChassisSerial string
	BladeSerial   string
}

StorageBlade contains all the storage blade information we will expose across different vendors

Jump to

Keyboard shortcuts

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