cinder/api-ref/source/v3/hosts.inc
lihaijing baf811f20d Api-ref: fix v2/v3 hosts extension api doc
Supplement error response codes and fix parameters problem.

Change-Id: Ia24c6980f437ab6838d64c345bc9c10a100762e1
Closes-Bug: #1715286
2017-09-26 10:33:07 +08:00

90 lines
1.9 KiB
ReStructuredText

.. -*- rst -*-
Hosts extension (os-hosts)
==========================
Administrators only, depending on policy settings.
Lists, shows hosts.
List all hosts for a project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: GET /v3/{admin_project_id}/os-hosts
Lists all hosts summary info that is not disabled.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403)
Request
-------
.. rest_parameters:: parameters.yaml
- admin_project_id: admin_project_id
Response Parameters
-------------------
.. rest_parameters:: parameters.yaml
- hosts: hosts
- service-status: service_status
- service: host_service
- zone: availability_zone_3
- service-state: service_state
- host_name: host_name_1
- last-update: updated_at
Response Example
----------------
.. literalinclude:: ./samples/hosts-list-response.json
:language: javascript
Show Host Details for a project
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. rest_method:: GET /v3/{admin_project_id}/os-hosts/{host_name}
Shows volume and snapshot details for a cinder-volume host.
*Note:* This API is meant specifically for cinder-volume hosts only.
It is not valid against other Cinder service hosts or hosts where the
cinder-volume service has been disabled.
Normal response codes: 200
Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404)
Request
-------
.. rest_parameters:: parameters.yaml
- admin_project_id: admin_project_id
- host_name: hostname
Response
--------
.. rest_parameters:: parameters.yaml
- host: host
- volume_count: total_count
- total_volume_gb: totalGigabytesUsed
- total_snapshot_gb: totalSnapshotsUsed
- project: project_id_2
- host: host_name_1
- snapshot_count: totalSnapshotsUsed
Response Example
----------------
.. literalinclude:: ./samples/hosts-get-response.json
:language: javascript