feat: add standalone server topology view
This commit is contained in:
@@ -23,6 +23,7 @@ type AnalysisResult struct {
|
||||
Sensors []SensorReading `json:"sensors"`
|
||||
Hardware *HardwareConfig `json:"hardware"`
|
||||
PrivacyScan *PrivacyScan `json:"privacy_scan,omitempty"` // customer-data / anonymization scan of the source files
|
||||
TopologyEvidence *TopologyEvidence `json:"-"` // source artifacts used to build the separate topology.json document
|
||||
}
|
||||
|
||||
// PrivacyScan is the result of scanning the source files for customer-identifying
|
||||
@@ -232,7 +233,7 @@ type HardwareDevice struct {
|
||||
InputVoltage float64 `json:"input_voltage,omitempty"`
|
||||
TemperatureC int `json:"temperature_c,omitempty"`
|
||||
RemainingEndurancePct *int `json:"remaining_endurance_pct,omitempty"` // 0-100 %; nil = not reported
|
||||
NUMANode int `json:"numa_node,omitempty"` // 0 = not reported/N/A
|
||||
NUMANode *int `json:"numa_node,omitempty"` // nil = not reported/N/A; 0 is a valid NUMA node
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
StatusCheckedAt *time.Time `json:"status_checked_at,omitempty"`
|
||||
@@ -376,7 +377,7 @@ type PCIeDevice struct {
|
||||
PartNumber string `json:"part_number,omitempty"`
|
||||
SerialNumber string `json:"serial_number,omitempty"`
|
||||
MACAddresses []string `json:"mac_addresses,omitempty"`
|
||||
NUMANode int `json:"numa_node,omitempty"` // 0 = not reported/N/A
|
||||
NUMANode *int `json:"numa_node,omitempty"` // nil = not reported/N/A; 0 is a valid NUMA node
|
||||
Present *bool `json:"present,omitempty"`
|
||||
IOMMUGroup *int `json:"iommu_group,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
@@ -514,7 +515,7 @@ type NetworkAdapter struct {
|
||||
LinkSpeed string `json:"link_speed,omitempty"`
|
||||
MaxLinkWidth int `json:"max_link_width,omitempty"`
|
||||
MaxLinkSpeed string `json:"max_link_speed,omitempty"`
|
||||
NUMANode int `json:"numa_node,omitempty"` // 0 = not reported/N/A
|
||||
NUMANode *int `json:"numa_node,omitempty"` // nil = not reported/N/A; 0 is a valid NUMA node
|
||||
Status string `json:"status,omitempty"`
|
||||
|
||||
StatusCheckedAt *time.Time `json:"status_checked_at,omitempty"`
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package models
|
||||
|
||||
// TopologyEvidence contains static source artifacts which add relationships
|
||||
// that the Reanimator inventory schema cannot express. It is deliberately not
|
||||
// serialized into reanimator.json.
|
||||
type TopologyEvidence struct {
|
||||
DIMMType17 string
|
||||
StorageMap string
|
||||
NVIDIAQueryCSV string
|
||||
NVIDIATopology string
|
||||
NVLinkStatus string
|
||||
NVLinkErrors string
|
||||
}
|
||||
|
||||
// TopologyDocument is the standalone, versioned topology.json contract.
|
||||
// Coordinates are presentation details and are intentionally not persisted.
|
||||
type TopologyDocument struct {
|
||||
Version string `json:"version"`
|
||||
Title string `json:"title,omitempty"`
|
||||
Nodes []TopologyNode `json:"nodes,omitempty"`
|
||||
Edges []TopologyEdge `json:"edges,omitempty"`
|
||||
}
|
||||
|
||||
type TopologyNode struct {
|
||||
ID string `json:"id"`
|
||||
Kind string `json:"kind"`
|
||||
Label string `json:"label"`
|
||||
Model string `json:"model,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Socket *int `json:"socket,omitempty"`
|
||||
NUMANode *int `json:"numa_node,omitempty"`
|
||||
BDF string `json:"bdf,omitempty"`
|
||||
Count int `json:"count,omitempty"`
|
||||
SizeMB int `json:"size_mb,omitempty"`
|
||||
WattageW int `json:"wattage_w,omitempty"`
|
||||
LinkSpeed string `json:"link_speed,omitempty"`
|
||||
MaxLinkSpeed string `json:"max_link_speed,omitempty"`
|
||||
}
|
||||
|
||||
type TopologyEdge struct {
|
||||
From string `json:"from"`
|
||||
To string `json:"to"`
|
||||
Kind string `json:"kind"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Label string `json:"label,omitempty"`
|
||||
Links int `json:"links,omitempty"`
|
||||
}
|
||||
Reference in New Issue
Block a user