2016-04-12 09:03:46 -04:00
|
|
|
.. -*- rst -*-
|
|
|
|
|
|
|
|
==================
|
|
|
|
Hosts (os-hosts)
|
|
|
|
==================
|
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
Manages physical hosts. Some virt drivers do not support all host
|
2016-04-12 09:03:46 -04:00
|
|
|
functions. For more information, see `nova virt support
|
|
|
|
matrix <http://docs.openstack.org/developer/nova/support-matrix.html>`__
|
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
Policy defaults enable only users with the administrative role to perform
|
|
|
|
all os-hosts related operations. Cloud providers can change these permissions
|
|
|
|
through the ``policy.json`` file.
|
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
List Hosts
|
|
|
|
==========
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /os-hosts
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Lists hosts.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Error response codes: unauthorized(401), forbidden(403)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- hosts: hosts
|
|
|
|
- zone: host_zone
|
|
|
|
- host_name: host_name_body
|
|
|
|
- service: host_service
|
|
|
|
|
|
|
|
**Example List Hosts**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-hosts/hosts-list-resp.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Show Host Details
|
|
|
|
=================
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /os-hosts/{host_name}
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Shows details for a host.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host_name: host_name
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host: host_resource_array
|
|
|
|
- resource: host_resource
|
2017-01-04 14:22:55 +09:00
|
|
|
- resource.project: host_project
|
|
|
|
- resource.cpu: host_cpu
|
|
|
|
- resource.memory_mb: host_memory_mb
|
|
|
|
- resource.disk_gb: host_disk_gb
|
|
|
|
- resource.host: host_name_body
|
2016-04-26 12:48:03 +08:00
|
|
|
|
|
|
|
**Example Show Host Details**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-hosts/host-get-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Update Host status
|
|
|
|
==================
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: PUT /os-hosts/{host_name}
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Enables, disables a host or put a host in maintenance or normal mode.
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
|
|
|
|
itemNotFound(404), NotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host_name: host_name
|
2016-04-26 12:48:03 +08:00
|
|
|
- status: host_status_body_in
|
|
|
|
- maintenance_mode: host_maintenance_mode_in
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
**Example Enable Host: JSON request**
|
|
|
|
|
|
|
|
.. literalinclude:: ../../doc/api_samples/os-hosts/host-put-maintenance-req.json
|
|
|
|
:language: javascript
|
|
|
|
|
2016-04-12 09:03:46 -04:00
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host: host_name_body
|
2016-06-02 08:50:03 -04:00
|
|
|
- status: host_status_body
|
2016-04-26 12:48:03 +08:00
|
|
|
- maintenance_mode: host_maintenance_mode
|
|
|
|
|
|
|
|
**Example Enable Host**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-hosts/host-put-maintenance-resp.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Reboot Host
|
|
|
|
===========
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /os-hosts/{host_name}/reboot
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Reboots a host.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
|
|
|
|
itemNotFound(404), NotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host_name: host_name
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host: host_name_body
|
|
|
|
- power_action: host_power_action
|
|
|
|
|
2016-04-19 17:52:18 +09:00
|
|
|
**Example Reboot Host: JSON response**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-03-23 13:58:30 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-hosts/host-get-reboot.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Shut Down Host
|
|
|
|
==============
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /os-hosts/{host_name}/shutdown
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Shuts down a host.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
|
|
|
|
itemNotFound(404), NotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host_name: host_name
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host: host_name_body
|
|
|
|
- power_action: host_power_action
|
|
|
|
|
|
|
|
**Example Shut Down Host**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-03-23 13:58:30 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-hosts/host-get-shutdown.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|
|
|
|
|
|
|
|
Start Host
|
|
|
|
==========
|
|
|
|
|
2016-06-02 08:50:03 -04:00
|
|
|
.. rest_method:: GET /os-hosts/{host_name}/startup
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Starts a host.
|
|
|
|
|
|
|
|
Normal response codes: 200
|
|
|
|
|
2016-04-24 08:06:42 +08:00
|
|
|
Error response codes: badRequest(400), unauthorized(401), forbidden(403),
|
|
|
|
itemNotFound(404), NotImplemented(501)
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
Request
|
2016-04-14 13:10:59 -04:00
|
|
|
-------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host_name: host_name
|
|
|
|
|
|
|
|
Response
|
2016-04-14 13:10:59 -04:00
|
|
|
--------
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-04-26 12:48:03 +08:00
|
|
|
.. rest_parameters:: parameters.yaml
|
|
|
|
|
|
|
|
- host: host_name_body
|
|
|
|
- power_action: host_power_action
|
|
|
|
|
|
|
|
**Example Start Host**
|
2016-04-12 09:03:46 -04:00
|
|
|
|
2016-03-23 13:58:30 +08:00
|
|
|
.. literalinclude:: ../../doc/api_samples/os-hosts/host-get-startup.json
|
2016-04-12 09:03:46 -04:00
|
|
|
:language: javascript
|