Documentation ¶
Index ¶
- type ACPI
- type Actions
- type InputRanges
- type PowerControl
- type PowerHMC
- type PowerLimit
- type PowerMetrics
- type PowerPowerSupplyReset
- type PowerSupplies
- type RedFishClient
- type RedfishAccessInfo
- type RedfishPowerModel
- type RedfishSystemModel
- type RedfishSystemPowerResult
- type RelatedItem
- type Status
- type Voltages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACPI ¶
type ACPI struct { CollectEnergy bool // contains filtered or unexported fields }
Advanced Configuration and Power Interface (APCI) makes the system hardware sensor status information available to the operating system via hwmon in sysfs.
func NewACPIPowerMeter ¶
func NewACPIPowerMeter() *ACPI
func (*ACPI) GetAbsEnergyFromPlatform ¶
GetEnergyFromHost returns the accumulated energy consumption
func (*ACPI) GetCPUCoreFrequency ¶
func (*ACPI) IsHWMONCollectionSupported ¶
func (*ACPI) IsSystemCollectionSupported ¶
type Actions ¶
type Actions struct {
PowerPowerSupplyReset PowerPowerSupplyReset `json:"#Power.PowerSupplyReset,omitempty"`
}
type InputRanges ¶
type PowerControl ¶
type PowerControl struct { OdataID string `json:"@odata.id,omitempty"` MemberID string `json:"MemberId,omitempty"` Name string `json:"Name,omitempty"` PowerConsumedWatts int `json:"PowerConsumedWatts,omitempty"` PowerRequestedWatts int `json:"PowerRequestedWatts,omitempty"` PowerAvailableWatts int `json:"PowerAvailableWatts,omitempty"` PowerCapacityWatts int `json:"PowerCapacityWatts,omitempty"` PowerAllocatedWatts int `json:"PowerAllocatedWatts,omitempty"` PowerMetrics PowerMetrics `json:"PowerMetrics,omitempty"` PowerLimit PowerLimit `json:"PowerLimit,omitempty"` RelatedItem []RelatedItem `json:"RelatedItem,omitempty"` Status Status `json:"Status,omitempty"` }
type PowerHMC ¶
type PowerHMC struct{}
func (*PowerHMC) GetAbsEnergyFromPlatform ¶
GetEnergyFromHost returns the accumulated energy consumption
func (*PowerHMC) IsSystemCollectionSupported ¶
type PowerLimit ¶
type PowerMetrics ¶
type PowerPowerSupplyReset ¶
type PowerPowerSupplyReset struct {
Target string `json:"target,omitempty"`
}
type PowerSupplies ¶
type PowerSupplies struct { OdataID string `json:"@odata.id,omitempty"` MemberID string `json:"MemberId,omitempty"` Name string `json:"Name,omitempty"` Status Status `json:"Status,omitempty"` PowerSupplyType string `json:"PowerSupplyType,omitempty"` LineInputVoltageType string `json:"LineInputVoltageType,omitempty"` LineInputVoltage int `json:"LineInputVoltage,omitempty"` PowerCapacityWatts int `json:"PowerCapacityWatts,omitempty"` LastPowerOutputWatts int `json:"LastPowerOutputWatts,omitempty"` Model string `json:"Model,omitempty"` Manufacturer string `json:"Manufacturer,omitempty"` FirmwareVersion string `json:"FirmwareVersion,omitempty"` SerialNumber string `json:"SerialNumber,omitempty"` PartNumber string `json:"PartNumber,omitempty"` SparePartNumber string `json:"SparePartNumber,omitempty"` InputRanges []InputRanges `json:"InputRanges,omitempty"` RelatedItem []RelatedItem `json:"RelatedItem,omitempty"` }
type RedFishClient ¶
type RedFishClient struct {
// contains filtered or unexported fields
}
func NewRedfishClient ¶
func NewRedfishClient() *RedFishClient
func (*RedFishClient) GetAbsEnergyFromPlatform ¶
func (rf *RedFishClient) GetAbsEnergyFromPlatform() (map[string]float64, error)
GetAbsEnergyFromPlatform returns the power consumption in Watt
func (*RedFishClient) GetName ¶
func (*RedFishClient) GetName() string
func (*RedFishClient) IsSystemCollectionSupported ¶
func (rf *RedFishClient) IsSystemCollectionSupported() bool
func (*RedFishClient) StopPower ¶
func (rf *RedFishClient) StopPower()
StopPower stops the power collection timer
type RedfishAccessInfo ¶
type RedfishAccessInfo struct { Username string `json:"username"` Password string `json:"password"` Host string `json:"host"` }
RedfishAccessInfo is the struct for the access model
type RedfishPowerModel ¶
type RedfishPowerModel struct { OdataType string `json:"@odata.type,omitempty"` ID string `json:"Id,omitempty"` Name string `json:"Name,omitempty"` PowerControl []PowerControl `json:"PowerControl,omitempty"` Voltages []Voltages `json:"Voltages,omitempty"` PowerSupplies []PowerSupplies `json:"PowerSupplies,omitempty"` Actions Actions `json:"Actions,omitempty"` OdataID string `json:"@odata.id,omitempty"` }
RedfishPowerModel is the struct for the power model this is generated via the following command: redfishtool raw GET /redfish/v1/Chassis/System.Embedded.1/Power#/PowerControl, where "System.Embedded.1" is the system ID from the RedfishSystemModel the output is then formatted via https://mholt.github.io/json-to-go/ based on sample output from https://www.dmtf.org/sites/default/files/standards/documents/DSP2046_2023.1.pdf
type RedfishSystemModel ¶
type RedfishSystemModel struct { OdataContext string `json:"@odata.context"` OdataID string `json:"@odata.id"` OdataType string `json:"@odata.type"` Description string `json:"Description"` Members []struct { OdataID string `json:"@odata.id"` } `json:"Members"` MembersOdataCount int `json:"Members@odata.count"` Name string `json:"Name"` }
RedfishSystemModel is the struct for the system model this is generated via the following command: redfishtool Systems
type RedfishSystemPowerResult ¶
type RedfishSystemPowerResult struct {
// contains filtered or unexported fields
}
RedfishSystemPowerResult is the system power query result
type RelatedItem ¶
type RelatedItem struct {
OdataID string `json:"@odata.id,omitempty"`
}
type Voltages ¶
type Voltages struct { OdataID string `json:"@odata.id,omitempty"` MemberID string `json:"MemberId,omitempty"` Name string `json:"Name,omitempty"` SensorNumber int `json:"SensorNumber,omitempty"` Status Status `json:"Status,omitempty"` ReadingVolts int `json:"ReadingVolts,omitempty"` UpperThresholdNonCritical float64 `json:"UpperThresholdNonCritical,omitempty"` UpperThresholdCritical int `json:"UpperThresholdCritical,omitempty"` UpperThresholdFatal int `json:"UpperThresholdFatal,omitempty"` LowerThresholdNonCritical float64 `json:"LowerThresholdNonCritical,omitempty"` LowerThresholdCritical int `json:"LowerThresholdCritical,omitempty"` LowerThresholdFatal int `json:"LowerThresholdFatal,omitempty"` MinReadingRange int `json:"MinReadingRange,omitempty"` MaxReadingRange int `json:"MaxReadingRange,omitempty"` PhysicalContext string `json:"PhysicalContext,omitempty"` RelatedItem []RelatedItem `json:"RelatedItem,omitempty"` }