diff options
author | Matt Riedemann <mriedem.os@gmail.com> | 2018-05-03 15:00:02 -0400 |
---|---|---|
committer | Matt Riedemann <mriedem.os@gmail.com> | 2018-05-03 16:30:46 -0400 |
commit | 3437baedf646c7cd3da43440368edc194a880db8 (patch) | |
tree | c0618ef18724286ba7e0c76e7156faa6de7eab8d /api-ref/source/servers-actions.inc | |
parent | 21939c102921409ddb19a8cdf2cc4c1c2177fcea (diff) | |
download | nova-3437baedf646c7cd3da43440368edc194a880db8.tar.gz |
Fix being able to hard reboot a pausing instance
The allowed task states for a hard reboot include 'pausing'
but the instance.save(expected_task_states) doesn't include
'pausing', so if you try to hard reboot a pausing instance
it will fail with UnexpectedTaskStateError.
This makes the expected_task_states passed to Instance.save
use the same list of allowed task states that we use in the
check_instance_state decorator, and re-writes the unit test
to use an actual database to verify the Instance.save()
behavior and task state check in the DB API.
While we're at it, the API reference is updated to indicate
the allowed states for each type of reboot.
Change-Id: I5a21350e48a637e581d269fb567bb96c1899e174
Closes-Bug: #1768927
Diffstat (limited to 'api-ref/source/servers-actions.inc')
-rw-r--r-- | api-ref/source/servers-actions.inc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/api-ref/source/servers-actions.inc b/api-ref/source/servers-actions.inc index 037c273645..23354bb8f1 100644 --- a/api-ref/source/servers-actions.inc +++ b/api-ref/source/servers-actions.inc @@ -423,6 +423,29 @@ Reboots a server. Specify the ``reboot`` action in the request body. +**Preconditions** + +The preconditions for rebooting a server depend on the type of reboot. + +You can only *SOFT* reboot a server when its status is ``ACTIVE``. + +You can only *HARD* reboot a server when its status is one of: + +* ``ACTIVE`` +* ``ERROR`` +* ``HARD_REBOOT`` +* ``PAUSED`` +* ``REBOOT`` +* ``SHUTOFF`` +* ``SUSPENDED`` + +If the server is locked, you must have administrator privileges +to reboot the server. + +**Asynchronous Postconditions** + +After you successfully reboot a server, its status changes to ``ACTIVE``. + Normal response codes: 202 Error response codes: unauthorized(401), forbidden(403), itemNotFound(404), |