collector/redfish: collect and parse platform model fallback

This commit is contained in:
2026-02-28 14:54:55 +03:00
parent f35cabac48
commit 1d282c4196
3 changed files with 24 additions and 4 deletions
+10 -2
View File
@@ -56,7 +56,7 @@ func ReplayRedfishFromRawPayloads(rawPayloads map[string]any, emit ProgressFn) (
if len(fruDoc) == 0 {
fruDoc = chassisFRUDoc
}
boardFallbackDocs := r.collectBoardFallbackDocs(chassisPaths)
boardFallbackDocs := r.collectBoardFallbackDocs(systemPaths, chassisPaths)
if emit != nil {
emit(Progress{Status: "running", Progress: 55, Message: "Redfish snapshot: replay CPU/RAM/Storage..."})
@@ -445,7 +445,7 @@ func dedupeStrings(items []string) []string {
return out
}
func (r redfishSnapshotReader) collectBoardFallbackDocs(chassisPaths []string) []map[string]interface{} {
func (r redfishSnapshotReader) collectBoardFallbackDocs(systemPaths, chassisPaths []string) []map[string]interface{} {
out := make([]map[string]interface{}, 0)
for _, chassisPath := range chassisPaths {
for _, suffix := range []string{"/Boards", "/Backplanes"} {
@@ -459,6 +459,14 @@ func (r redfishSnapshotReader) collectBoardFallbackDocs(chassisPaths []string) [
}
}
}
for _, path := range append(append([]string{}, systemPaths...), chassisPaths...) {
for _, suffix := range []string{"/Oem/Public", "/Oem/Public/ThermalConfig", "/ThermalConfig"} {
docPath := joinPath(path, suffix)
if doc, err := r.getJSON(docPath); err == nil && len(doc) > 0 {
out = append(out, doc)
}
}
}
return out
}