summaryrefslogtreecommitdiff
path: root/api-ref/source/os-hypervisors.inc
blob: 6363b409b402939d92e68beed0a73080ebb3e970 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
.. -*- rst -*-

.. _os-hypervisors:

==============================
 Hypervisors (os-hypervisors)
==============================

Lists all hypervisors, shows summary statistics for all hypervisors over
all compute nodes, shows details for a hypervisor, shows the uptime
for a hypervisor, lists all servers on hypervisors that match the given
``hypervisor_hostname_pattern`` or searches for hypervisors by the given
``hypervisor_hostname_pattern``.


List Hypervisors
================

.. rest_method:: GET /os-hypervisors

Lists hypervisors.

Policy defaults enable only users with the administrative role to perform
this operation. Cloud providers can change these permissions through
the ``policy.json`` file.

Normal response codes: 200

Error response codes: badRequest(400), unauthorized(401), forbidden(403)

Request
-------

.. rest_parameters:: parameters.yaml

  - limit: hypervisor_limit
  - marker: hypervisor_marker
  - marker: hypervisor_marker_uuid
  - hypervisor_hostname_pattern: hypervisor_hostname_pattern_query
  - with_servers: hypervisor_with_servers_query

Response
--------

.. rest_parameters:: parameters.yaml

  - hypervisors: hypervisors
  - hypervisor_hostname: hypervisor_hostname
  - id: hypervisor_id_body
  - id: hypervisor_id_body_uuid
  - state: hypervisor_state
  - status: hypervisor_status
  - hypervisor_links: hypervisor_links
  - servers: hypervisor_servers
  - servers.uuid: hypervisor_servers_uuid
  - servers.name: hypervisor_servers_name

**Example List Hypervisors (v2.33): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.33/hypervisors-list-resp.json
   :language: javascript

**Example List Hypervisors With Servers (v2.53): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-with-servers-resp.json
   :language: javascript


List Hypervisors Details
========================

.. rest_method:: GET /os-hypervisors/detail

Lists hypervisors details.

Policy defaults enable only users with the administrative role to perform
this operation. Cloud providers can change these permissions through
the ``policy.json`` file.

Normal response codes: 200

Error response codes: badRequest(400), unauthorized(401), forbidden(403)

Request
-------

.. rest_parameters:: parameters.yaml

  - limit: hypervisor_limit
  - marker: hypervisor_marker
  - marker: hypervisor_marker_uuid
  - hypervisor_hostname_pattern: hypervisor_hostname_pattern_query
  - with_servers: hypervisor_with_servers_query

Response
--------

.. rest_parameters:: parameters.yaml

  - hypervisors: hypervisors
  - cpu_info: cpu_info
  - current_workload: current_workload
  - status: hypervisor_status
  - state: hypervisor_state
  - disk_available_least: disk_available_least
  - host_ip: host_ip
  - free_disk_gb: hypervisor_free_disk_gb
  - free_ram_mb: free_ram_mb
  - hypervisor_hostname: hypervisor_hostname
  - hypervisor_type: hypervisor_type_body
  - hypervisor_version: hypervisor_version
  - id: hypervisor_id_body
  - id: hypervisor_id_body_uuid
  - local_gb: local_gb
  - local_gb_used: local_gb_used
  - memory_mb: memory_mb
  - memory_mb_used: memory_mb_used
  - running_vms: running_vms
  - servers: hypervisor_servers
  - servers.uuid: hypervisor_servers_uuid
  - servers.name: hypervisor_servers_name
  - service: hypervisor_service
  - service.host: host_name_body
  - service.id: service_id_body_2_52
  - service.id: service_id_body_2_53
  - service.disabled_reason: service_disable_reason
  - uptime: hypervisor_uptime
  - vcpus: hypervisor_vcpus
  - vcpus_used: hypervisor_vcpus_used
  - hypervisor_links: hypervisor_links

**Example List Hypervisors Details (v2.33): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.33/hypervisors-detail-resp.json
   :language: javascript

**Example List Hypervisors Details (v2.53): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json
   :language: javascript

**Example List Hypervisors Details (v2.88): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.88/hypervisors-detail-resp.json
   :language: javascript


Show Hypervisor Statistics (DEPRECATED)
=======================================

.. rest_method:: GET /os-hypervisors/statistics
   max_version: 2.87

Shows summary statistics for all enabled hypervisors over all compute nodes.

.. warning::

   This API is deprecated and will fail with HTTP 404 starting with microversion
   2.88. Use placement to get information on resource usage across hypervisors.

Policy defaults enable only users with the administrative role to perform
this operation. Cloud providers can change these permissions through
the ``policy.json`` file.

.. note::

   As noted, some of the parameters in the response representing totals do not
   take allocation ratios into account. This can result in a disparity between
   the totals and the usages. A more accurate representation of state can be
   obtained using `placement`__.

   __ https://docs.openstack.org/api-ref/placement/#list-resource-provider-usages

Normal response codes: 200

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)

Response
--------

.. rest_parameters:: parameters.yaml

  - hypervisor_statistics: hypervisor_statistics
  - count: hypervisor_count
  - current_workload: current_workload_total
  - disk_available_least: disk_available_least_total
  - free_disk_gb: hypervisor_free_disk_gb_total
  - free_ram_mb: free_ram_mb_total
  - local_gb: local_gb_total
  - local_gb_used: local_gb_used_total
  - memory_mb: memory_mb_total
  - memory_mb_used: memory_mb_used_total
  - running_vms: running_vms_total
  - vcpus: hypervisor_vcpus_total
  - vcpus_used: hypervisor_vcpus_used_total

**Example Show Hypervisor Statistics: JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/hypervisors-statistics-resp.json
   :language: javascript


Show Hypervisor Details
=======================

.. rest_method:: GET /os-hypervisors/{hypervisor_id}

Shows details for a given hypervisor.

Policy defaults enable only users with the administrative role to perform
this operation. Cloud providers can change these permissions through
the ``policy.json`` file.

.. note::

   As noted, some of the parameters in the response representing totals do not
   take allocation ratios into account. This can result in a disparity between
   the totals and the usages. A more accurate representation of state can be
   obtained using `placement`__.

   __ https://docs.openstack.org/api-ref/placement/#show-resource-provider-usages

Normal response codes: 200

Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404)

Request
-------

.. rest_parameters:: parameters.yaml

  - hypervisor_id: hypervisor_id
  - hypervisor_id: hypervisor_id_uuid
  - with_servers: hypervisor_with_servers_query

Response
--------

.. rest_parameters:: parameters.yaml

  - hypervisor: hypervisor
  - cpu_info: cpu_info
  - state: hypervisor_state
  - status: hypervisor_status
  - current_workload: current_workload
  - disk_available_least: disk_available_least
  - host_ip: host_ip
  - free_disk_gb: hypervisor_free_disk_gb
  - free_ram_mb: free_ram_mb
  - hypervisor_hostname: hypervisor_hostname
  - hypervisor_type: hypervisor_type_body
  - hypervisor_version: hypervisor_version
  - id: hypervisor_id_body
  - id: hypervisor_id_body_uuid
  - local_gb: local_gb
  - local_gb_used: local_gb_used
  - memory_mb: memory_mb
  - memory_mb_used: memory_mb_used
  - running_vms: running_vms
  - servers: hypervisor_servers
  - servers.uuid: hypervisor_servers_uuid
  - servers.name: hypervisor_servers_name
  - service: hypervisor_service
  - service.host: host_name_body
  - service.id: service_id_body_2_52
  - service.id: service_id_body_2_53
  - service.disabled_reason: service_disable_reason
  - uptime: hypervisor_uptime
  - vcpus: hypervisor_vcpus
  - vcpus_used: hypervisor_vcpus_used

**Example Show Hypervisor Details (v2.28): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.28/hypervisors-show-resp.json
   :language: javascript

**Example Show Hypervisor Details With Servers (v2.53): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json
   :language: javascript

**Example Show Hypervisors Details (v2.88): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.88/hypervisors-show-with-servers-resp.json
   :language: javascript


Show Hypervisor Uptime (DEPRECATED)
===================================

.. rest_method:: GET /os-hypervisors/{hypervisor_id}/uptime
   max_version: 2.87

Shows the uptime for a given hypervisor.

.. warning::

    This API is deprecated and will fail with HTTP 404 starting with
    microversion 2.88. Use `Show Hypervisor Details`_ with microversion 2.88
    and later to get this information.

Policy defaults enable only users with the administrative role to perform
this operation. Cloud providers can change these permissions through
the ``policy.json`` file.

Normal response codes: 200

Error response codes: badRequest(400), unauthorized(401), forbidden(403), itemNotFound(404), NotImplemented(501)

Request
-------

.. rest_parameters:: parameters.yaml

  - hypervisor_id: hypervisor_id
  - hypervisor_id: hypervisor_id_uuid

Response
--------

.. rest_parameters:: parameters.yaml

  - hypervisor: hypervisor
  - hypervisor_hostname: hypervisor_hostname
  - id: hypervisor_id_body
  - id: hypervisor_id_body_uuid
  - state: hypervisor_state
  - status: hypervisor_status
  - uptime: uptime

**Example Show Hypervisor Uptime: JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/hypervisors-uptime-resp.json
   :language: javascript

**Example Show Hypervisor Uptime (v2.53): JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-uptime-resp.json
   :language: javascript


Search Hypervisor (DEPRECATED)
==============================

.. rest_method:: GET /os-hypervisors/{hypervisor_hostname_pattern}/search
   max_version: 2.52

Search hypervisor by a given hypervisor host name or portion of it.

.. warning:: This API is deprecated starting with microversion 2.53. Use
    `List Hypervisors`_ with the ``hypervisor_hostname_pattern`` query
    parameter with microversion 2.53 and later.

Policy defaults enable only users with the administrative role to perform
this operation. Cloud providers can change these permissions through
the ``policy.json`` file.

Normal response code: 200

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)

Request
-------

.. rest_parameters:: parameters.yaml

  - hypervisor_hostname_pattern: hypervisor_hostname_pattern

Response
--------

.. rest_parameters:: parameters.yaml

  - hypervisors: hypervisors
  - hypervisor_hostname: hypervisor_hostname
  - id: hypervisor_id_body_no_version
  - state: hypervisor_state
  - status: hypervisor_status

**Example Search Hypervisor: JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/hypervisors-search-resp.json
   :language: javascript


List Hypervisor Servers (DEPRECATED)
====================================

.. rest_method:: GET /os-hypervisors/{hypervisor_hostname_pattern}/servers
   max_version: 2.52

List all servers belong to each hypervisor whose host name is matching
a given hypervisor host name or portion of it.

.. warning:: This API is deprecated starting with microversion 2.53. Use
    `List Hypervisors`_ with the ``hypervisor_hostname_pattern`` and
    ``with_servers`` query parameters with microversion 2.53 and later.

Policy defaults enable only users with the administrative role to perform
this operation. Cloud providers can change these permissions through
the ``policy.json`` file.

Normal response code: 200

Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)

Request
-------

.. rest_parameters:: parameters.yaml

  - hypervisor_hostname_pattern: hypervisor_hostname_pattern

Response
--------

.. rest_parameters:: parameters.yaml

  - hypervisors: hypervisors
  - hypervisor_hostname: hypervisor_hostname
  - id: hypervisor_id_body_no_version
  - state: hypervisor_state
  - status: hypervisor_status
  - servers: servers
  - servers.uuid: server_uuid
  - servers.name: server_name

**Example List Hypervisor Servers: JSON response**

.. literalinclude:: ../../doc/api_samples/os-hypervisors/hypervisors-with-servers-resp.json
   :language: javascript