Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Sensors data #238

Open
wants to merge 9 commits into
base: v1
Choose a base branch
from
8 changes: 8 additions & 0 deletions providers/providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ const (
FeatureBmcFirmwareUpdate registrar.Feature = "bmcfirwareupdate"
// FeatureBiosFirmwareUpdate means an implementation that updates the BIOS firmware
FeatureBiosFirmwareUpdate registrar.Feature = "biosfirwareupdate"
// FeaturePowersensors indicates an implementation that returns Power sensor information
FeaturePowersensors registrar.Feature = "powersensors"
// FeatureTemperatureSensors indicates an implementation that returns Temperature sensor information
FeatureTemperatureSensors registrar.Feature = "temperaturesensors"
// FeatureFanSensors indicates an implementation that returns Fan sensor information
FeatureFanSensors registrar.Feature = "fansensors"
// FeatureChassisHealth indicates an implementation that returns ChassisHealth information
FeatureChassisHealth registrar.Feature = "chassishealth"
)
30 changes: 24 additions & 6 deletions providers/redfish/redfish.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,35 @@ var (
Features = registrar.Features{
providers.FeaturePowerSet,
providers.FeaturePowerState,
providers.FeaturePowersensors,
joelrebel marked this conversation as resolved.
Show resolved Hide resolved
providers.FeatureTemperatureSensors,
providers.FeatureFanSensors,
providers.FeatureChassisHealth,
}

// Supported Chassis Odata IDs
chassisOdataIdURLs = []string{
// Dells
"/redfish/v1/Chassis/System.Embedded.1",
// Supermicro
"/redfish/v1/Chassis/1",
// MegaRAC
"/redfish/v1/Chassis/Self",
}

ErrRedfishChassisOdataID = errors.New("no compatible chassis Odata IDs identified")
ErrRedfishServiceNil = errors.New("redfish connection returned a nil redfish Service object")
)

// Conn details for redfish client
type Conn struct {
Host string
Port string
User string
Pass string
conn *gofish.APIClient
Log logr.Logger
Host string
Port string
User string
Pass string
Vendor string
conn *gofish.APIClient
Log logr.Logger
}

// Open a connection to a BMC via redfish
Expand Down