Add run server action call to nova client#29
Merged
Conversation
evemorgen
reviewed
Aug 17, 2018
evemorgen
left a comment
Contributor
There was a problem hiding this comment.
Thanks for making a PR, we appreciate that and willing to merge :)
| vm = await nova.servers.get(server_id) | ||
|
|
||
| action_spec = {'os-stop': None} | ||
| await nova.servers.run_action(server_id, **action_spec) |
Contributor
There was a problem hiding this comment.
Maybe I'm missing the point, but I don't think unpacking action_spec to kwargs is desirable behavior here. Maybe you meant action=action_spec as stated later?
Contributor
Author
There was a problem hiding this comment.
The problem is that await nova.servers.run_action(server_id, os-stop=None) is not valid Python. Unpacking does the trick. Somehow ugly, but the only way to send {'os-stop': null} to OpenStack.
Contributor
There was a problem hiding this comment.
Gotcha, I though it would be similar to volumes api, that you pass whole chunk to one action kwarg or something, didn't read the docs tho 😉 Looks good to me then
evemorgen
approved these changes
Aug 18, 2018
tarfik
approved these changes
Aug 18, 2018
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.
Hi folks,
I have add support to run server action calls (https://developer.openstack.org/api-ref/compute/#servers-run-an-action-servers-action) to the nova client api and added documentation about how to use this feature.
I would really appreciate if you consider to merge this request.
Thanks and best regards,
Manuel