Skip to content

Commit 0b1000b

Browse files
baremetal: Add Health field to Node
Add support for the node health field which reports hardware health status from the BMC. Requires Ironic API microversion 1.109. Partially implements metal3-io#2888 Signed-off-by: Jacob Anders <jacob-anders-dev@proton.me> Assisted-by: Claude-4.5-opus-high Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 263aea4 commit 0b1000b

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

openstack/baremetal/v1/nodes/requests.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ type ListOpts struct {
113113
// Filter the list with the specified fault.
114114
Fault string `q:"fault"`
115115

116+
// Filter the list with the specified health status.
117+
// Requires microversion 1.109 or later.
118+
Health string `q:"health"`
119+
116120
// One or more fields to be returned in the response.
117121
Fields []string `q:"fields" format:"comma-separated"`
118122

openstack/baremetal/v1/nodes/results.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ type Node struct {
139139
// node. There are other possible types, e.g., “clean failure” and “rescue abort failure”.
140140
Fault string `json:"fault"`
141141

142+
// Health indicates the hardware health status reported by the BMC.
143+
// Possible values are "OK", "Warning", "Critical", or empty if not available.
144+
// This field is read-only and requires microversion 1.109 or later.
145+
Health string `json:"health"`
146+
142147
// Error from the most recent (last) transaction that started but failed to finish.
143148
LastError string `json:"last_error"`
144149

openstack/baremetal/v1/nodes/testing/fixtures_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const NodeListDetailBody = `
102102
"extra": {},
103103
"fault": null,
104104
"firmware_interface": "no-firmware",
105+
"health": "OK",
105106
"inspect_interface": "no-inspect",
106107
"inspection_finished_at": null,
107108
"inspection_started_at": null,
@@ -417,6 +418,7 @@ const SingleNodeBody = `
417418
"extra": {},
418419
"fault": null,
419420
"firmware_interface": "no-firmware",
421+
"health": "OK",
420422
"inspect_interface": "no-inspect",
421423
"inspection_finished_at": null,
422424
"inspection_started_at": null,
@@ -939,6 +941,7 @@ var (
939941
Maintenance: false,
940942
MaintenanceReason: "",
941943
Fault: "",
944+
Health: "OK",
942945
LastError: "",
943946
Reservation: "",
944947
Driver: "ipmi",

0 commit comments

Comments
 (0)