Skip to content

Commit fefddf5

Browse files
committed
Add missing bios interface fields to Ironic API
The bios interface fields are in the Ironic API but were missing from the Ironic API documentation and not included in gophercloud. This change adds in the bios interface to the node create, node list, and node driver validation APIs. For reference, these are the Ironic updates to the api-ref documentation: https://review.opendev.org/c/openstack/ironic/+/757353 https://review.opendev.org/c/openstack/ironic/+/791493 https://review.opendev.org/c/openstack/ironic/+/792210
1 parent 0be823b commit fefddf5

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

openstack/baremetal/v1/nodes/requests.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ type CreateOpts struct {
185185
// Requires microversion 1.47 or later.
186186
AutomatedClean *bool `json:"automated_clean,omitempty"`
187187

188+
// The BIOS interface for a Node, e.g. “redfish”.
189+
BIOSInterface string `json:"bios_interface,omitempty"`
190+
188191
// The boot interface for a Node, e.g. “pxe”.
189192
BootInterface string `json:"boot_interface,omitempty"`
190193

openstack/baremetal/v1/nodes/results.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ type Node struct {
145145
// For more details, see: https://docs.openstack.org/ironic/latest/install/configure-nova-flavors.html
146146
ResourceClass string `json:"resource_class"`
147147

148+
// BIOS interface for a Node, e.g. “redfish”.
149+
BIOSInterface string `json:"bios_interface"`
150+
148151
// Boot interface for a Node, e.g. “pxe”.
149152
BootInterface string `json:"boot_interface"`
150153

@@ -301,6 +304,7 @@ type DriverValidation struct {
301304
// Ironic validates whether the Node’s driver has enough information to manage the Node. This polls each interface on
302305
// the driver, and returns the status of that interface as an DriverValidation struct.
303306
type NodeValidation struct {
307+
BIOS DriverValidation `json:"bios"`
304308
Boot DriverValidation `json:"boot"`
305309
Console DriverValidation `json:"console"`
306310
Deploy DriverValidation `json:"deploy"`

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ var (
638638
CleanStep: map[string]interface{}{},
639639
DeployStep: map[string]interface{}{},
640640
ResourceClass: "",
641+
BIOSInterface: "no-bios",
641642
BootInterface: "pxe",
642643
ConsoleInterface: "no-console",
643644
DeployInterface: "iscsi",
@@ -656,6 +657,10 @@ var (
656657
}
657658

658659
NodeFooValidation = nodes.NodeValidation{
660+
BIOS: nodes.DriverValidation{
661+
Result: false,
662+
Reason: "Driver ipmi does not support bios (disabled or not implemented).",
663+
},
659664
Boot: nodes.DriverValidation{
660665
Result: false,
661666
Reason: "Cannot validate image information for node a62b8495-52e2-407b-b3cb-62775d04c2b8 because one or more parameters are missing from its instance_info and insufficent information is present to boot from a remote volume. Missing are: ['ramdisk', 'kernel', 'image_source']",
@@ -730,6 +735,7 @@ var (
730735
CleanStep: map[string]interface{}{},
731736
DeployStep: map[string]interface{}{},
732737
ResourceClass: "",
738+
BIOSInterface: "no-bios",
733739
BootInterface: "pxe",
734740
ConsoleInterface: "no-console",
735741
DeployInterface: "iscsi",
@@ -773,6 +779,7 @@ var (
773779
CleanStep: map[string]interface{}{},
774780
DeployStep: map[string]interface{}{},
775781
ResourceClass: "",
782+
BIOSInterface: "no-bios",
776783
BootInterface: "pxe",
777784
ConsoleInterface: "no-console",
778785
DeployInterface: "iscsi",

0 commit comments

Comments
 (0)