Skip to content

Add run server action call to nova client#29

Merged
evemorgen merged 2 commits into
DreamLab:masterfrom
giffels:add_nova_run_action
Aug 19, 2018
Merged

Add run server action call to nova client#29
evemorgen merged 2 commits into
DreamLab:masterfrom
giffels:add_nova_run_action

Conversation

@giffels

@giffels giffels commented Aug 16, 2018

Copy link
Copy Markdown
Contributor

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

@evemorgen evemorgen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making a PR, we appreciate that and willing to merge :)

Comment thread README.rst
vm = await nova.servers.get(server_id)

action_spec = {'os-stop': None}
await nova.servers.run_action(server_id, **action_spec)

@evemorgen evemorgen Aug 17, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@evemorgen evemorgen Aug 18, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 evemorgen requested a review from a team August 18, 2018 10:52
@evemorgen evemorgen merged commit 294eaad into DreamLab:master Aug 19, 2018
@giffels giffels deleted the add_nova_run_action branch February 16, 2022 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants