mogan/api-ref/source/v1/server_states.inc
liusheng 7d0f8ab360 Rename instance to server and instance type to flavor
Change-Id: I35a7fb0b4f3fa9e09f2fc2c739c0a9b39a8576ab
2017-04-28 14:23:22 +08:00

141 lines
2.6 KiB
ReStructuredText

.. -*- rst -*-
=================
Server States
=================
Servers States can be managed through states sub-resource.
A Server can be rebooted, turned on, or turned off by requesting a change to
its power state.
Server State Summary
======================
.. rest_method:: GET /v1/servers/{server_uuid}/states
Get a summary of the Server's current states.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
Response
--------
.. rest_parameters:: parameters.yaml
- power_state: power_state
- locked: lock_state
- status: server_status
**Example server state:**
.. literalinclude:: samples/server_states/server-get-state-response.json
Change Server Power State
===========================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/power
Request a change to the Server's power state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (InvalidState)
- 406 (NotAcceptable)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: power_state_target
**Example request to power off a Server:**
.. literalinclude:: samples/server_states/server-set-power-off.json
Response
--------
If successful, this method does not return content in the response body.
Change Server Lock State
===========================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/lock
Request a change to the Server's lockstate.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: lock_state
**Example request to lock a Server:**
.. literalinclude:: samples/server_states/lock-server.json
**Example request to unlock a Server:**
.. literalinclude:: samples/server_states/unlock-server.json
Response
--------
If successful, this method does not return content in the response body.
Change Server Provision State
===============================
.. rest_method:: PUT /v1/servers/{server_uuid}/states/provision
Request a change to the Server's provision state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (BadRequest)
- 403 (Forbidden)
Request
-------
.. rest_parameters:: parameters.yaml
- server_uuid: server_ident
- target: provision_state
**Example request to rebuild a Server:**
.. literalinclude:: samples/server_states/rebuild-server.json
Response
--------
If successful, this method does not return content in the response body.