mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
chore: added power control odata.id to cralwer output
This commit is contained in:
parent
cb1d90b840
commit
e170787958
1 changed files with 20 additions and 6 deletions
|
|
@ -68,6 +68,7 @@ type Power struct {
|
||||||
State string `json:"state,omitempty"`
|
State string `json:"state,omitempty"`
|
||||||
Mode string `json:"mode,omitempty"`
|
Mode string `json:"mode,omitempty"`
|
||||||
RestorePolicy string `json:"restore_policy"`
|
RestorePolicy string `json:"restore_policy"`
|
||||||
|
PowerControlIDs []string `json:"power_control_ids`
|
||||||
}
|
}
|
||||||
|
|
||||||
type InventoryDetail struct {
|
type InventoryDetail struct {
|
||||||
|
|
@ -293,6 +294,18 @@ func walkSystems(rf_systems []*redfish.ComputerSystem, rf_chassis *redfish.Chass
|
||||||
actions = append(actions, string(action))
|
actions = append(actions, string(action))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// get power-related details from rf_chassis
|
||||||
|
power, err := rf_chassis.Power()
|
||||||
|
if err != nil {
|
||||||
|
log.Warn().Err(err).Str("id", rf_computersystem.ID).
|
||||||
|
Str("system", rf_computersystem.Name).Msg("failed to get power-related details from chassis")
|
||||||
|
}
|
||||||
|
// extract the power control odata.id resource
|
||||||
|
powercontrolIDs := []string{}
|
||||||
|
for _, rf_powercontrol := range power.PowerControl {
|
||||||
|
powercontrolIDs = append(powercontrolIDs, rf_powercontrol.ODataID)
|
||||||
|
}
|
||||||
|
|
||||||
// get all of the links to the chassis
|
// get all of the links to the chassis
|
||||||
system := InventoryDetail{
|
system := InventoryDetail{
|
||||||
URI: baseURI + "/redfish/v1/Systems/" + rf_computersystem.ID,
|
URI: baseURI + "/redfish/v1/Systems/" + rf_computersystem.ID,
|
||||||
|
|
@ -311,6 +324,7 @@ func walkSystems(rf_systems []*redfish.ComputerSystem, rf_chassis *redfish.Chass
|
||||||
Mode: string(rf_computersystem.PowerMode),
|
Mode: string(rf_computersystem.PowerMode),
|
||||||
State: string(rf_computersystem.PowerState),
|
State: string(rf_computersystem.PowerState),
|
||||||
RestorePolicy: string(rf_computersystem.PowerRestorePolicy),
|
RestorePolicy: string(rf_computersystem.PowerRestorePolicy),
|
||||||
|
PowerControlIDs: powercontrolIDs,
|
||||||
},
|
},
|
||||||
Actions: actions,
|
Actions: actions,
|
||||||
ProcessorCount: rf_computersystem.ProcessorSummary.Count,
|
ProcessorCount: rf_computersystem.ProcessorSummary.Count,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue