Hardware ingest contract v2.1: sensors, MAC addresses, device_class expansion
- Add HardwareSensors to JSON contract: fans, power, temperatures, other - Add machine_sensor_readings table (migration 0022) with upsert in ingest service - Add mac_addresses []string to HardwarePCIeDevice - Expand device_class examples: VideoController, ProcessingAccelerator, EthernetController, FibreChannelController, StorageController - Add distributable hardware-ingest-contract.md v2.1 with versioning, changelog, field tables, and canonical URL - Add governance rule: contract doc must be updated with every parser change - Update data-model.md to document machine_sensor_readings projection - Update both import-example-full.json files with sensors and new PCIe entries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -359,8 +359,189 @@
|
||||
"serial_number": "N/A",
|
||||
"firmware": null,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"slot": "PCIeCard5",
|
||||
"vendor_id": 4318,
|
||||
"device_id": 1824,
|
||||
"bdf": "0000:41:00.0",
|
||||
"device_class": "VideoController",
|
||||
"manufacturer": "NVIDIA",
|
||||
"model": "Tesla T4",
|
||||
"link_width": 16,
|
||||
"link_speed": "Gen3",
|
||||
"max_link_width": 16,
|
||||
"max_link_speed": "Gen3",
|
||||
"serial_number": "1325020185012",
|
||||
"firmware": "90.04.96.00.01",
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"slot": "PCIeCard6",
|
||||
"vendor_id": 4318,
|
||||
"device_id": 9482,
|
||||
"bdf": "0000:61:00.0",
|
||||
"device_class": "ProcessingAccelerator",
|
||||
"manufacturer": "NVIDIA",
|
||||
"model": "A100 SXM4 80GB",
|
||||
"link_width": 16,
|
||||
"link_speed": "Gen4",
|
||||
"max_link_width": 16,
|
||||
"max_link_speed": "Gen4",
|
||||
"serial_number": "1324021003462",
|
||||
"firmware": "92.00.3c.00.03",
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"slot": "PCIeCard7",
|
||||
"vendor_id": 32902,
|
||||
"device_id": 5528,
|
||||
"bdf": "0000:19:00.0",
|
||||
"device_class": "EthernetController",
|
||||
"manufacturer": "Intel",
|
||||
"model": "X710 10GbE",
|
||||
"link_width": 8,
|
||||
"link_speed": "Gen3",
|
||||
"max_link_width": 8,
|
||||
"max_link_speed": "Gen3",
|
||||
"serial_number": "K65472-003",
|
||||
"firmware": "9.20 0x8000d4ae",
|
||||
"mac_addresses": ["3c:fd:fe:aa:bb:cc", "3c:fd:fe:aa:bb:cd"],
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"slot": "PCIeCard8",
|
||||
"vendor_id": 4096,
|
||||
"device_id": 8200,
|
||||
"bdf": "0000:21:00.0",
|
||||
"device_class": "FibreChannelController",
|
||||
"manufacturer": "Marvell",
|
||||
"model": "QLE2742 32Gb FC",
|
||||
"link_width": 8,
|
||||
"link_speed": "Gen3",
|
||||
"max_link_width": 8,
|
||||
"max_link_speed": "Gen3",
|
||||
"serial_number": "RFD1234M67890",
|
||||
"firmware": "9.08.02",
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"slot": "PCIeCard9",
|
||||
"vendor_id": 4358,
|
||||
"device_id": 1617,
|
||||
"bdf": "0000:22:00.0",
|
||||
"device_class": "StorageController",
|
||||
"manufacturer": "Broadcom",
|
||||
"model": "SAS 9400-8i",
|
||||
"link_width": 8,
|
||||
"link_speed": "Gen3",
|
||||
"max_link_width": 8,
|
||||
"max_link_speed": "Gen3",
|
||||
"serial_number": "SP331206C6",
|
||||
"firmware": "16.00.11.00",
|
||||
"status": "OK"
|
||||
}
|
||||
],
|
||||
"sensors": {
|
||||
"fans": [
|
||||
{
|
||||
"name": "FAN1",
|
||||
"location": "Front",
|
||||
"rpm": 4200,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "FAN2",
|
||||
"location": "Front",
|
||||
"rpm": 4150,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "FAN_CPU0",
|
||||
"location": "CPU0",
|
||||
"rpm": 5600,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "FAN_CPU1",
|
||||
"location": "CPU1",
|
||||
"rpm": 5550,
|
||||
"status": "OK"
|
||||
}
|
||||
],
|
||||
"power": [
|
||||
{
|
||||
"name": "PSU0 Input",
|
||||
"location": "PSU0",
|
||||
"voltage_v": 215.25,
|
||||
"current_a": 0.64,
|
||||
"power_w": 137.0,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "PSU1 Input",
|
||||
"location": "PSU1",
|
||||
"voltage_v": 222.5,
|
||||
"current_a": 0.62,
|
||||
"power_w": 137.0,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "12V Rail",
|
||||
"location": "Mainboard",
|
||||
"voltage_v": 12.06,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "3.3V Rail",
|
||||
"location": "Mainboard",
|
||||
"voltage_v": 3.31,
|
||||
"status": "OK"
|
||||
}
|
||||
],
|
||||
"temperatures": [
|
||||
{
|
||||
"name": "CPU0 Temp",
|
||||
"location": "CPU0",
|
||||
"celsius": 46.0,
|
||||
"threshold_warning_celsius": 80.0,
|
||||
"threshold_critical_celsius": 95.0,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "CPU1 Temp",
|
||||
"location": "CPU1",
|
||||
"celsius": 44.0,
|
||||
"threshold_warning_celsius": 80.0,
|
||||
"threshold_critical_celsius": 95.0,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "Inlet Temp",
|
||||
"location": "Front",
|
||||
"celsius": 22.0,
|
||||
"threshold_warning_celsius": 40.0,
|
||||
"threshold_critical_celsius": 50.0,
|
||||
"status": "OK"
|
||||
},
|
||||
{
|
||||
"name": "Outlet Temp",
|
||||
"location": "Rear",
|
||||
"celsius": 35.0,
|
||||
"threshold_warning_celsius": 60.0,
|
||||
"threshold_critical_celsius": 70.0,
|
||||
"status": "OK"
|
||||
}
|
||||
],
|
||||
"other": [
|
||||
{
|
||||
"name": "System Humidity",
|
||||
"value": 38.5,
|
||||
"unit": "%",
|
||||
"status": "OK"
|
||||
}
|
||||
]
|
||||
},
|
||||
"power_supplies": [
|
||||
{
|
||||
"slot": "0",
|
||||
|
||||
@@ -213,6 +213,7 @@ func (h ingestHandlers) handleHardware(w http.ResponseWriter, r *http.Request) {
|
||||
Board: req.Hardware.Board,
|
||||
Components: components,
|
||||
Firmware: firmware,
|
||||
Sensors: req.Hardware.Sensors,
|
||||
}
|
||||
|
||||
job := h.jsonJobs.create(boardSerial)
|
||||
|
||||
Reference in New Issue
Block a user