Documentation
¶
Index ¶
- type Blade
- type Chassis
- func (c *Chassis) Diff(chassis *Chassis) (differences []string)
- func (c Chassis) GetID() string
- func (c Chassis) GetReferencedIDs() []jsonapi.ReferenceID
- func (c Chassis) GetReferences() []jsonapi.Reference
- func (c *Chassis) HasBlade(serial string) bool
- func (c *Chassis) HasNic(macAddress string) bool
- func (c *Chassis) HasPsu(serial string) bool
- func (c *Chassis) HasStorageBlade(serial string) bool
- type DiscoverHint
- type Discrete
- func (d *Discrete) Diff(discrete *Discrete) (differences []string)
- func (d Discrete) GetID() string
- func (d Discrete) GetReferencedIDs() []jsonapi.ReferenceID
- func (d Discrete) GetReferences() []jsonapi.Reference
- func (d *Discrete) HasNic(macAddress string) bool
- func (d *Discrete) HasPsu(serial string) bool
- type Disk
- type Fan
- type Nic
- type Psu
- type ScannedPort
- type StorageBlade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blade ¶
type Blade struct {
Serial string `json:"serial" gorm:"primary_key"`
Name string `json:"name"`
BiosVersion string `json:"bios_version"`
BmcType string `json:"bmc_type"`
BmcAddress string `json:"bmc_address"`
BmcVersion string `json:"bmc_version"`
BmcSSHReachable bool `json:"bmc_ssh_reachable"`
BmcWEBReachable bool `json:"bmc_web_reachable"`
BmcIpmiReachable bool `json:"bmc_ipmi_reachable"`
BmcLicenceType string `json:"bmc_licence_type"`
BmcLicenceStatus string `json:"bmc_licence_status"`
BmcAuth bool `json:"bmc_auth"`
Disks []*Disk `json:"-" gorm:"ForeignKey:BladeSerial"`
Nics []*Nic `json:"-" gorm:"ForeignKey:BladeSerial"`
BladePosition int `json:"blade_position"`
Model string `json:"model"`
TempC int `json:"temp_c"`
PowerKw float64 `json:"power_kw"`
PowerState string `json:"power_state"`
Status string `json:"status"`
Vendor string `json:"vendor"`
ChassisSerial string `json:"-"`
Processor string `json:"processor"`
ProcessorCount int `json:"processor_count"`
ProcessorCoreCount int `json:"processor_core_count"`
ProcessorThreadCount int `json:"processor_thread_count"`
StorageBlade StorageBlade `json:"-" gorm:"ForeignKey:BladeSerial"`
Memory int `json:"memory_in_gb"`
UpdatedAt time.Time `json:"updated_at"`
}
Blade contains all the blade information we will expose across different vendors
func NewBladeFromDevice ¶
NewBladeFromDevice will create a new object coming from the bmc blade devices
func (Blade) GetReferencedIDs ¶
func (b Blade) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Blade) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
type Chassis ¶
type Chassis struct {
Serial string `json:"serial" gorm:"primary_key"`
Name string `json:"name"`
BmcAddress string `json:"bmc_address"`
BmcSSHReachable bool `json:"bmc_ssh_reachable"`
BmcWEBReachable bool `json:"bmc_web_reachable"`
BmcAuth bool `json:"bmc_auth"`
Blades []*Blade `json:"-" gorm:"ForeignKey:ChassisSerial"`
FaultySlots pq.Int64Array `json:"faulty_slots" gorm:"type:integer[2]"`
StorageBlades []*StorageBlade `json:"-" gorm:"ForeignKey:ChassisSerial"`
Nics []*Nic `json:"-" gorm:"ForeignKey:ChassisSerial"`
Psus []*Psu `json:"-" gorm:"ForeignKey:ChassisSerial"`
Fans []*Fan `json:"-" gorm:"ForeignKey:ChassisSerial"`
PsuRedundancyMode string `json:"psu_redundancy_mode"`
IsPsuRedundant bool `json:"is_psu_redundant"`
TempC int `json:"temp_c"`
PassThru string `json:"pass_thru"`
Status string `json:"status"`
PowerKw float64 `json:"power_kw"`
Model string `json:"model"`
Vendor string `json:"vendor"`
FwVersion string `json:"fw_version"`
UpdatedAt time.Time `json:"updated_at"`
Managed bool `json:"managed"`
}
Chassis contains all the chassis the information we will expose across different vendors
func NewChassisFromDevice ¶
NewChassisFromDevice will create a new object coming from the bmc discrete devices
func (Chassis) GetReferencedIDs ¶
func (c Chassis) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Chassis) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
func (*Chassis) HasStorageBlade ¶
HasStorageBlade checks whether a storageblade is connected to the chassis
type DiscoverHint ¶
type Discrete ¶
type Discrete struct {
Serial string `json:"serial" gorm:"primary_key"`
Name string `json:"name"`
BiosVersion string `json:"bios_version"`
BmcType string `json:"bmc_type"`
BmcAddress string `json:"bmc_address"`
BmcVersion string `json:"bmc_version"`
BmcSSHReachable bool `json:"bmc_ssh_reachable"`
BmcWEBReachable bool `json:"bmc_web_reachable"`
BmcIpmiReachable bool `json:"bmc_ipmi_reachable"`
BmcLicenceType string `json:"bmc_licence_type"`
BmcLicenceStatus string `json:"bmc_licence_status"`
BmcAuth bool `json:"bmc_auth"`
Disks []*Disk `json:"-" gorm:"ForeignKey:BladeSerial"`
Nics []*Nic `json:"-" gorm:"ForeignKey:DiscreteSerial"`
Psus []*Psu `json:"-" gorm:"ForeignKey:DiscreteSerial"`
Model string `json:"model"`
TempC int `json:"temp_c"`
PowerKw float64 `json:"power_kw"`
PowerState string `json:"power_state"`
Status string `json:"status"`
Vendor string `json:"vendor"`
Processor string `json:"processor"`
ProcessorCount int `json:"processor_count"`
ProcessorCoreCount int `json:"processor_core_count"`
ProcessorThreadCount int `json:"processor_thread_count"`
Memory int `json:"memory_in_gb"`
UpdatedAt time.Time `json:"updated_at"`
}
Discrete contains all the discrete information we will expose across different vendors
func NewDiscreteFromDevice ¶
NewDiscreteFromDevice will create a new object coming from the bmc discrete devices
func (Discrete) GetReferencedIDs ¶
func (d Discrete) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Discrete) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
type Disk ¶
type Disk struct {
Serial string `json:"serial" gorm:"primary_key"`
Status string `json:"status"`
Type string `json:"type"`
Size string `json:"size"`
Model string `json:"model"`
Location string `json:"location"`
FwVersion string `json:"fw_version"`
UpdatedAt time.Time `json:"updated_at"`
BladeSerial string `json:"-"`
DiscreteSerial string `json:"-"`
}
Disk represents a disk device
func (Disk) GetReferencedIDs ¶
func (d Disk) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Disk) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
type Fan ¶
type Fan struct {
Serial string `json:"serial" gorm:"primary_key"`
Status string `json:"status"`
Position int `json:"position"`
Model string `json:"model"`
CurrentRPM int64 `json:"current_rpm"`
PowerKw float64 `json:"power_kw"`
ChassisSerial string `json:"-"`
UpdatedAt time.Time `json:"updated_at"`
}
Fan contains the network information of the cards attached to blades or chassis
func (Fan) GetReferencedIDs ¶
func (p Fan) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Fan) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
type Nic ¶
type Nic struct {
MacAddress string `json:"mac_address" gorm:"primary_key"`
Name string `json:"name"`
Speed string `json:"speed"`
UpdatedAt time.Time `json:"updated_at"`
BladeSerial string `json:"-"`
DiscreteSerial string `json:"-"`
ChassisSerial string `json:"-"`
}
Nic contains the network information of the cards attached to blades or chassis
func (Nic) GetReferencedIDs ¶
func (n Nic) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Nic) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
type Psu ¶
type Psu struct {
Serial string `json:"serial" gorm:"primary_key"`
CapacityKw float64 `json:"capacity_kw"`
PowerKw float64 `json:"power_kw"`
Status string `json:"status"`
PartNumber string `json:"part_number"`
UpdatedAt time.Time `json:"updated_at"`
DiscreteSerial string `json:"-"`
ChassisSerial string `json:"-"`
}
Psu contains the network information of the cards attached to blades or chassis
func (Psu) GetReferencedIDs ¶
func (p Psu) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (Psu) GetReferences ¶
GetReferences to satisfy the jsonapi.MarshalReferences interface
type ScannedPort ¶
type ScannedPort struct {
ID string `gorm:"primary_key" json:"-"`
Site string `gorm:"unique_index:scanned_result" json:"site"`
CIDR string `gorm:"unique_index:scanned_result;column:cidr" json:"cidr"`
IP string `gorm:"unique_index:scanned_result" json:"ip"`
Port int `gorm:"unique_index:scanned_result" json:"port"`
Protocol string `gorm:"unique_index:scanned_result" json:"protocol"`
ScannedBy string `gorm:"unique_index:scanned_result" json:"scanned_by"`
State string `json:"state"`
UpdatedAt time.Time `json:"updated_at"`
}
ScannedPort contains all ports found by the scanner
func (*ScannedPort) BeforeCreate ¶
func (s *ScannedPort) BeforeCreate(scope *gorm.Scope) (err error)
BeforeCreate run all operations before creating the object
func (*ScannedPort) GenID ¶
func (s *ScannedPort) GenID() string
GenID generates the ID based on the date we have
func (ScannedPort) GetID ¶
func (s ScannedPort) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (ScannedPort) GetName ¶
func (s ScannedPort) GetName() string
GetName to satisfy jsonapi naming schema
type StorageBlade ¶
type StorageBlade struct {
Serial string `json:"serial" gorm:"primary_key"`
FwVersion string `json:"fw_version"`
BladePosition int `json:"blade_position"`
Model string `json:"model"`
TempC int `json:"temp_c"`
PowerKw float64 `json:"power_kw"`
Status string `json:"status"`
Vendor string `json:"vendor"`
ChassisSerial string `json:"-"`
BladeSerial string `json:"-"`
UpdatedAt time.Time `json:"updated_at"`
}
StorageBlade contains all the storage blade information we will expose across different vendors
func NewStorageBladeFromDevice ¶
func NewStorageBladeFromDevice(b *devices.StorageBlade) (blade *StorageBlade)
NewStorageBladeFromDevice will create a new object coming from the bmc blade devices
func (*StorageBlade) Diff ¶
func (s *StorageBlade) Diff(storageBlade *StorageBlade) (differences []string)
Diff compare to objects and return list of string with their differences
func (StorageBlade) GetID ¶
func (s StorageBlade) GetID() string
GetID to satisfy jsonapi.MarshalIdentifier interface
func (StorageBlade) GetName ¶
func (s StorageBlade) GetName() string
GetName to satisfy jsonapi naming schema
func (StorageBlade) GetReferencedIDs ¶
func (s StorageBlade) GetReferencedIDs() []jsonapi.ReferenceID
GetReferencedIDs to satisfy the jsonapi.MarshalLinkedRelations interface
func (StorageBlade) GetReferences ¶
func (s StorageBlade) GetReferences() []jsonapi.Reference
GetReferences to satisfy the jsonapi.MarshalReferences interface