[api-ref] Split instance management to states and networks

As we plan to add more sub-element to states and networks, it may
be more clear to split them from instance management in docs

Change-Id: I341bddf1dac81309e2dced16afc64d181e9e9008
This commit is contained in:
Zhenguo Niu 2017-01-23 19:27:31 +08:00
parent aa57478af4
commit 468428dcc0
4 changed files with 106 additions and 94 deletions

View File

@ -8,5 +8,7 @@ Baremetal Compute API V1 (CURRENT)
.. include:: urls.inc .. include:: urls.inc
.. include:: instances.inc .. include:: instances.inc
.. include:: instance_states.inc
.. include:: instance_networks.inc
.. include:: instance_types.inc .. include:: instance_types.inc
.. include:: availability_zones.inc .. include:: availability_zones.inc

View File

@ -0,0 +1,38 @@
.. -*- rst -*-
===================
Instance Networks
===================
Instances Networks can be managed through networks sub-resource.
A Instance can be associated or dissociated with a floating IP by requesting
the floatingip sub-resource.
Instance Network Summary
========================
.. rest_method:: GET /v1/instances/{instance_uuid}/networks
Get a summary of the Instance's networks.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
Response
--------
.. rest_parameters:: parameters.yaml
- ports: network_info
**Example instance network:**
.. literalinclude:: samples/instances/instance-get-network-response.json

View File

@ -0,0 +1,66 @@
.. -*- rst -*-
=================
Instance States
=================
Instances States can be managed through states sub-resource.
A Instance can be rebooted, turned on, or turned off by requesting a change to
its power state.
Instance State Summary
======================
.. rest_method:: GET /v1/instances/{instance_uuid}/states
Get a summary of the Instance's current states.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
Response
--------
.. rest_parameters:: parameters.yaml
- power_state: power_state
- status: instance_status
**Example instance state:**
.. literalinclude:: samples/instances/instance-get-state-response.json
Change Instance Power State
===========================
.. rest_method:: PUT /v1/instances/{instance_uuid}/states/power
Request a change to the Instance's power state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (InvalidState)
- 406 (NotAcceptable)
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- target: power_state
**Example request to power off a Instance:**
.. literalinclude:: samples/instances/instance-set-power-off.json

View File

@ -288,97 +288,3 @@ Response
-------- --------
No body content is returned on a successful DELETE. No body content is returned on a successful DELETE.
===============================
Instance Management (instances)
===============================
Instances can be managed through several sub-resources.
A Instance can be rebooted, turned on, or turned off by requesting a change to
its power state. This is handled asynchronously.
Instance State Summary
======================
.. rest_method:: GET /v1/instances/{instance_uuid}/states
Get a summary of the Instance's current states.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
Response
--------
.. rest_parameters:: parameters.yaml
- power_state: power_state
- status: instance_status
**Example instance state:**
.. literalinclude:: samples/instances/instance-get-state-response.json
Change Instance Power State
===========================
.. rest_method:: PUT /v1/instances/{instance_uuid}/states/power
Request a change to the Instance's power state.
Normal response code: 202
Error codes:
- 409 (ClientError)
- 400 (InvalidState)
- 406 (NotAcceptable)
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
- target: power_state
**Example request to power off a Instance:**
.. literalinclude:: samples/instances/instance-set-power-off.json
Instance Network Summary
========================
.. rest_method:: GET /v1/instances/{instance_uuid}/networks
Get a summary of the Instance's networks.
Normal response code: 200
Request
-------
.. rest_parameters:: parameters.yaml
- instance_uuid: instance_ident
Response
--------
.. rest_parameters:: parameters.yaml
- ports: network_info
**Example instance network:**
.. literalinclude:: samples/instances/instance-get-network-response.json