Flavor Extra Specs Create #689
Conversation
|
Build succeeded.
|
f0059a6 to
2e8433e
Compare
|
Build succeeded.
|
jtopjian
left a comment
There was a problem hiding this comment.
@dklyle A few minor nits:
- newlines in the docs
- Making the
IDFromNameto be the bottom-most function (not that it's specifically about theIDFromNamebut more keeping all of the "core" types, interfaces, and methods in the same area of the file.
And some other changes:
Can you add a CreateExtraSpecsOptsBuilder interface. Update would have an UpdateExtraSpecsOptsBuilder and it's quite possible delete won't since it looks like the Delete call doesn't have a body?
Finally, could you add a GetExtraSpec to the acc test since it's now possible to retrieve a newly created spec?
Let me know if you have any questions.
| panic(err) | ||
| } | ||
|
|
||
| Example to Create Extra Specs for a Flavor |
There was a problem hiding this comment.
nit: Newline below this line.
|
|
||
| fmt.Printf("%+v", createdExtraSpecs) | ||
|
|
||
| Example to Get Extra Specs for a Flavor |
There was a problem hiding this comment.
nit: Newline below this line.
2e8433e to
d2ff973
Compare
|
Merge Failed. This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset. |
|
I made the suggested changes. The only one I find questionable is the |
d2ff973 to
be3fd78
Compare
|
Build succeeded.
|
|
@dklyle Yeah, the standard comment we leave for the Builder interfaces doesn't make a lot of sense in this case. You're right - there's not much one can do in the way of adding additional parameters here when they can just pass them all in the original map. The edit: Also, using interfaces here matches what's being done with the servers' Metadata. More to that: the metadata |
|
Fair enough. That's an explanation I can buy. I think the singular set of a specific key may need the same limit of only 1 item. |
It looks like this might be required for the Update call, although it looks like the function will accept an arbitrary amount of specs and as long as the key in the URL matches at least one spec, everything else will pass. But I haven't tested that theory. If that's true, though, I would side on passing the entire map to Nova and letting it do the validation. This all looks good, though. Thank you for the updates and definitely thank you for pushing back on suggestions :) |
|
@dklyle Let's finish off ExtraSpecs before RemoveAccess - that should minimize the amount of toes being stepped on :) No rush, though. |
For #540
Links to the line numbers/files in the OpenStack source code that support the
code in this PR:
API reference:
https://developer.openstack.org/api-ref/compute/#create-extra-specs-for-a-flavor
Nova implementation:
https://github.com/openstack/nova/blob/stable/pike/nova/api/openstack/compute/flavors_extraspecs.py#L61
Schema:
https://github.com/openstack/nova/blob/stable/pike/nova/api/openstack/compute/schemas/flavors_extraspecs.py#L24
https://github.com/openstack/nova/blob/stable/pike/nova/api/validation/parameter_types.py#L363-L371