Add support for baremetal bios endpoint#2171
Merged
jtopjian merged 1 commit intogophercloud:masterfrom May 26, 2021
Merged
Conversation
|
Build failed.
|
Contributor
|
Looks reasonable to me :) |
jtopjian
requested changes
May 25, 2021
| var s BIOSSettings | ||
| err := r.ExtractInto(&s) | ||
| return &s.Settings, err | ||
| } |
Contributor
There was a problem hiding this comment.
What you have works, but I think the following version more closely matches other functions within Gophercloud:
// Extract interprets a BIOSSettingsResult as an array of BIOSSetting structs, if possible.
func (r BIOSSettingsResult) Extract() ([]BIOSSetting, error) {
var s struct {
Settings []BIOSSetting `json:"bios"`
}
err := r.ExtractInto(&s)
return s.Settings, err
}You can then remove the BIOSSettings type as it's no longer used.
This change will require an update to the unit tests, but it's a small update.
Contributor
Author
There was a problem hiding this comment.
Thanks, that's a good change. Updated.
jtopjian
reviewed
May 25, 2021
| } | ||
|
|
||
| // Get one BIOS Setting for the given Node. | ||
| func GetSingleBIOSSetting(client *gophercloud.ServiceClient, id string, setting string) (r SingleBIOSSettingResult) { |
Contributor
There was a problem hiding this comment.
Total nit pick: How about GetBIOSSetting? The use of "Get" (instead of "List") and the singular use of "Setting" implies that a single item will be returned. This is not a required change, though.
Contributor
Author
There was a problem hiding this comment.
Yes, that naming is more clear. Fixed.
For gophercloud#2165. The baremetal bios endpoint has been available in the Ironic API since version 1.40 and is documented in the API reference here - https://docs.openstack.org/api-ref/baremetal/?expanded=#node-bios-nodes. It provides a list of all bios settings by node or a particular setting on a node. The ironic API code is here: https://github.com/openstack/ironic/blob/master/ironic/api/controllers/v1/bios.py#L57
3bbc8be to
fb569ec
Compare
|
Build failed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For #2165.
The baremetal bios endpoint has been available in the Ironic API since
version 1.40 and is documented in the API reference here -
https://docs.openstack.org/api-ref/baremetal/?expanded=#node-bios-nodes.
It provides a list of all bios settings by node or a particular setting on a node.
The ironic API code is here:
https://github.com/openstack/ironic/blob/master/ironic/api/controllers/v1/bios.py#L57