Skip to content

Commit 1f67ce2

Browse files
committed
api: Drop statistics-style fields from os-hypervisors
Introduce API microversion 2.88, which makes the following changes to a number of 'os-hypervisors'. Specifically, the following fields are dropped from both the '/os-hypervisors/detail' (detailed list) and '/os-hypervisors/{hypervisor_id}' (show) APIs: - current_workload - cpu_info - vcpus - vcpus_used - free_disk_gb - local_gb - local_gb_used - disk_available_least - free_ram_mb - memory_mb - memory_mb_used - running_vms In addition, the '/os-hypervisors/statistics' API, which provided a summary of the above stats but for all hypervisors in the deployment, is dropped entirely. Finally, the '/os-hypervisors/{hypervisor}/uptime' API, which provided a similar response to the '/os-hypervisors/{hypervisor}' API but with an additional 'uptime' field, has been removed in favour of including this field in the primary '/os-hypervisors/{hypervisor}' API. A small tweak to 'tox.ini' that allows us to share some venvs is included. Part of blueprint modernize-os-hypervisors-api Change-Id: I515e484ade6c6455f82a3067940a418a0d7d965a Signed-off-by: Stephen Finucane <[email protected]>
1 parent ef7598a commit 1f67ce2

27 files changed

+722
-149
lines changed

api-ref/source/os-hypervisors.inc

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ for a hypervisor, lists all servers on hypervisors that match the given
1212
``hypervisor_hostname_pattern`` or searches for hypervisors by the given
1313
``hypervisor_hostname_pattern``.
1414

15+
1516
List Hypervisors
1617
================
1718

@@ -64,6 +65,7 @@ Response
6465
.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-with-servers-resp.json
6566
:language: javascript
6667

68+
6769
List Hypervisors Details
6870
========================
6971

@@ -122,6 +124,7 @@ Response
122124
- service.id: service_id_body_2_52
123125
- service.id: service_id_body_2_53
124126
- service.disabled_reason: service_disable_reason
127+
- uptime: hypervisor_uptime
125128
- vcpus: hypervisor_vcpus
126129
- vcpus_used: hypervisor_vcpus_used
127130
- hypervisor_links: hypervisor_links
@@ -136,13 +139,25 @@ Response
136139
.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-detail-resp.json
137140
:language: javascript
138141

139-
Show Hypervisor Statistics
140-
==========================
142+
**Example List Hypervisors Details (v2.88): JSON response**
143+
144+
.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.88/hypervisors-detail-resp.json
145+
:language: javascript
146+
147+
148+
Show Hypervisor Statistics (DEPRECATED)
149+
=======================================
141150

142151
.. rest_method:: GET /os-hypervisors/statistics
152+
max_version: 2.87
143153

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

156+
.. warning::
157+
158+
This API is deprecated and will fail with HTTP 404 starting with microversion
159+
2.88. Use placement to get information on resource usage across hypervisors.
160+
146161
Policy defaults enable only users with the administrative role to perform
147162
this operation. Cloud providers can change these permissions through
148163
the ``policy.json`` file.
@@ -158,7 +173,7 @@ the ``policy.json`` file.
158173

159174
Normal response codes: 200
160175

161-
Error response codes: unauthorized(401), forbidden(403)
176+
Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
162177

163178
Response
164179
--------
@@ -167,7 +182,7 @@ Response
167182

168183
- hypervisor_statistics: hypervisor_statistics
169184
- count: hypervisor_count
170-
- current_workload: current_workload
185+
- current_workload: current_workload_total
171186
- disk_available_least: disk_available_least_total
172187
- free_disk_gb: hypervisor_free_disk_gb_total
173188
- free_ram_mb: free_ram_mb_total
@@ -184,6 +199,7 @@ Response
184199
.. literalinclude:: ../../doc/api_samples/os-hypervisors/hypervisors-statistics-resp.json
185200
:language: javascript
186201

202+
187203
Show Hypervisor Details
188204
=======================
189205

@@ -249,6 +265,7 @@ Response
249265
- service.id: service_id_body_2_52
250266
- service.id: service_id_body_2_53
251267
- service.disabled_reason: service_disable_reason
268+
- uptime: hypervisor_uptime
252269
- vcpus: hypervisor_vcpus
253270
- vcpus_used: hypervisor_vcpus_used
254271

@@ -262,13 +279,26 @@ Response
262279
.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-show-with-servers-resp.json
263280
:language: javascript
264281

265-
Show Hypervisor Uptime
266-
======================
282+
**Example Show Hypervisors Details (v2.88): JSON response**
283+
284+
.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.88/hypervisors-show-with-servers-resp.json
285+
:language: javascript
286+
287+
288+
Show Hypervisor Uptime (DEPRECATED)
289+
===================================
267290

268291
.. rest_method:: GET /os-hypervisors/{hypervisor_id}/uptime
292+
max_version: 2.87
269293

270294
Shows the uptime for a given hypervisor.
271295

296+
.. warning::
297+
298+
This API is deprecated and will fail with HTTP 404 starting with
299+
microversion 2.88. Use `Show Hypervisor Details`_ with microversion 2.88
300+
and later to get this information.
301+
272302
Policy defaults enable only users with the administrative role to perform
273303
this operation. Cloud providers can change these permissions through
274304
the ``policy.json`` file.
@@ -308,8 +338,9 @@ Response
308338
.. literalinclude:: ../../doc/api_samples/os-hypervisors/v2.53/hypervisors-uptime-resp.json
309339
:language: javascript
310340

311-
Search Hypervisor
312-
=================
341+
342+
Search Hypervisor (DEPRECATED)
343+
==============================
313344

314345
.. rest_method:: GET /os-hypervisors/{hypervisor_hostname_pattern}/search
315346
max_version: 2.52
@@ -351,8 +382,9 @@ Response
351382
.. literalinclude:: ../../doc/api_samples/os-hypervisors/hypervisors-search-resp.json
352383
:language: javascript
353384

354-
List Hypervisor Servers
355-
=======================
385+
386+
List Hypervisor Servers (DEPRECATED)
387+
====================================
356388

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

api-ref/source/parameters.yaml

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2226,6 +2226,7 @@ cpu_info:
22262226
in: body
22272227
required: true
22282228
type: object
2229+
max_version: 2.87
22292230
create_info:
22302231
description: |
22312232
Information for snapshot creation.
@@ -2280,9 +2281,20 @@ createImage:
22802281
type: object
22812282
current_workload:
22822283
description: |
2283-
The current_workload is the number of tasks the hypervisor is responsible for. This will be
2284-
equal or greater than the number of active VMs on the system (it can be greater when VMs
2285-
are being deleted and the hypervisor is still cleaning up).
2284+
The current_workload is the number of tasks the hypervisor is responsible
2285+
for. This will be equal or greater than the number of active VMs on the
2286+
system (it can be greater when VMs are being deleted and the hypervisor is
2287+
still cleaning up).
2288+
in: body
2289+
required: true
2290+
type: integer
2291+
max_version: 2.87
2292+
current_workload_total:
2293+
description: |
2294+
The current_workload is the number of tasks the hypervisors are responsible
2295+
for. This will be equal or greater than the number of active VMs on the
2296+
systems (it can be greater when VMs are being deleted and a hypervisor is
2297+
still cleaning up).
22862298
in: body
22872299
required: true
22882300
type: integer
@@ -2504,6 +2516,7 @@ disk_available_least:
25042516
in: body
25052517
required: true
25062518
type: integer
2519+
max_version: 2.87
25072520
disk_available_least_total:
25082521
description: |
25092522
The actual free disk on all hypervisors(in GiB). If allocation ratios used
@@ -3438,6 +3451,7 @@ free_ram_mb:
34383451
in: body
34393452
required: true
34403453
type: integer
3454+
max_version: 2.87
34413455
free_ram_mb_total:
34423456
description: |
34433457
The free RAM on all hypervisors(in MiB). This does not take allocation
@@ -3742,6 +3756,7 @@ hypervisor_free_disk_gb:
37423756
in: body
37433757
required: true
37443758
type: integer
3759+
max_version: 2.87
37453760
hypervisor_free_disk_gb_total:
37463761
description: |
37473762
The free disk remaining on all hypervisors(in GiB). This does not take
@@ -3752,8 +3767,8 @@ hypervisor_free_disk_gb_total:
37523767
type: integer
37533768
hypervisor_hostname:
37543769
description: |
3755-
The hypervisor host name provided by the Nova virt driver. For the Ironic driver,
3756-
it is the Ironic node uuid.
3770+
The hypervisor host name provided by the Nova virt driver. For the Ironic
3771+
driver, it is the Ironic node uuid.
37573772
in: body
37583773
required: true
37593774
type: string
@@ -3853,31 +3868,41 @@ hypervisor_type_body:
38533868
in: body
38543869
required: true
38553870
type: string
3871+
hypervisor_uptime:
3872+
description: |
3873+
The total uptime of the hypervisor and information about average load. Only
3874+
reported for active hosts where the virt driver supports this feature.
3875+
in: body
3876+
required: true
3877+
type: string
3878+
min_version: 2.88
38563879
hypervisor_vcpus:
38573880
description: |
3858-
The number of vcpu in this hypervisor. This does not take allocation
3881+
The number of vCPU in this hypervisor. This does not take allocation
38593882
ratios used for overcommit into account so there may be disparity between
38603883
this and the used count.
38613884
in: body
38623885
required: true
38633886
type: integer
3887+
max_version: 2.87
38643888
hypervisor_vcpus_total:
38653889
description: |
3866-
The number of vcpu on all hypervisors. This does not take allocation
3890+
The number of vCPU on all hypervisors. This does not take allocation
38673891
ratios used for overcommit into account so there may be disparity between
38683892
this and the used count.
38693893
in: body
38703894
required: true
38713895
type: integer
38723896
hypervisor_vcpus_used:
38733897
description: |
3874-
The number of vcpu used in this hypervisor.
3898+
The number of vCPU used in this hypervisor.
38753899
in: body
38763900
required: true
38773901
type: integer
3902+
max_version: 2.87
38783903
hypervisor_vcpus_used_total:
38793904
description: |
3880-
The number of vcpu used on all hypervisors.
3905+
The number of vCPU used on all hypervisors.
38813906
in: body
38823907
required: true
38833908
type: integer
@@ -4480,12 +4505,13 @@ links:
44804505
type: array
44814506
local_gb:
44824507
description: |
4483-
The disk in this hypervisor(in GiB). This does not take allocation
4508+
The disk in this hypervisor (in GiB). This does not take allocation
44844509
ratios used for overcommit into account so there may be disparity between
44854510
this and the used count.
44864511
in: body
44874512
required: true
44884513
type: integer
4514+
max_version: 2.87
44894515
local_gb_simple_tenant_usage:
44904516
description: |
44914517
The sum of the root disk size of the server and
@@ -4502,21 +4528,22 @@ local_gb_simple_tenant_usage_optional:
45024528
type: integer
45034529
local_gb_total:
45044530
description: |
4505-
The disk on all hypervisors(in GiB). This does not take allocation
4531+
The disk on all hypervisors (in GiB). This does not take allocation
45064532
ratios used for overcommit into account so there may be disparity between
45074533
this and the used count.
45084534
in: body
45094535
required: true
45104536
type: integer
45114537
local_gb_used:
45124538
description: |
4513-
The disk used in this hypervisor(in GiB).
4539+
The disk used in this hypervisor (in GiB).
45144540
in: body
45154541
required: true
45164542
type: integer
4543+
max_version: 2.87
45174544
local_gb_used_total:
45184545
description: |
4519-
The disk used on all hypervisors(in GiB).
4546+
The disk used on all hypervisors (in GiB).
45204547
in: body
45214548
required: true
45224549
type: integer
@@ -4600,12 +4627,13 @@ memory_details_diagnostics:
46004627
min_version: 2.48
46014628
memory_mb:
46024629
description: |
4603-
The memory of this hypervisor(in MiB). This does not take allocation
4630+
The memory of this hypervisor (in MiB). This does not take allocation
46044631
ratios used for overcommit into account so there may be disparity between
46054632
this and the used count.
46064633
in: body
46074634
required: true
46084635
type: integer
4636+
max_version: 2.87
46094637
memory_mb_simple_tenant_usage:
46104638
description: |
46114639
The memory size of the server (in MiB).
@@ -4620,18 +4648,19 @@ memory_mb_simple_tenant_usage_optional:
46204648
type: integer
46214649
memory_mb_total:
46224650
description: |
4623-
The memory of all hypervisors(in MiB). This does not take allocation
4651+
The memory of all hypervisors (in MiB). This does not take allocation
46244652
ratios used for overcommit into account so there may be disparity between
46254653
this and the used count.
46264654
in: body
46274655
required: true
46284656
type: integer
46294657
memory_mb_used:
46304658
description: |
4631-
The memory used in this hypervisor(in MiB).
4659+
The memory used in this hypervisor (in MiB).
46324660
in: body
46334661
required: true
46344662
type: integer
4663+
max_version: 2.87
46354664
memory_mb_used_total:
46364665
description: |
46374666
The memory used on all hypervisors(in MiB).
@@ -6020,13 +6049,14 @@ rules:
60206049
type: array
60216050
running_vms:
60226051
description: |
6023-
The number of running vms on this hypervisor.
6052+
The number of running VMs on this hypervisor.
60246053
in: body
60256054
required: true
60266055
type: integer
6056+
max_version: 2.87
60276057
running_vms_total:
60286058
description: |
6029-
The total number of running vms on all hypervisors.
6059+
The total number of running VMs on all hypervisors.
60306060
in: body
60316061
required: true
60326062
type: integer
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"hypervisors": [
3+
{
4+
"host_ip": "192.168.1.135",
5+
"hypervisor_hostname": "host2",
6+
"hypervisor_type": "fake",
7+
"hypervisor_version": 1000,
8+
"id": "f6d28711-9c10-470e-8b31-c03f498b0032",
9+
"service": {
10+
"disabled_reason": null,
11+
"host": "host2",
12+
"id": "21bbb5fb-ec98-48b3-89cf-c94402c55611"
13+
},
14+
"state": "up",
15+
"status": "enabled",
16+
"uptime": null
17+
}
18+
],
19+
"hypervisors_links": [
20+
{
21+
"href": "http://openstack.example.com/v2.1/6f70656e737461636b20342065766572/os-hypervisors/detail?limit=1&marker=f6d28711-9c10-470e-8b31-c03f498b0032",
22+
"rel": "next"
23+
}
24+
]
25+
}

0 commit comments

Comments
 (0)