diff options
| author | Lee Yarwood <lyarwood@redhat.com> | 2021-08-12 11:27:17 +0100 |
|---|---|---|
| committer | Lee Yarwood <lyarwood@redhat.com> | 2021-09-02 14:35:17 +0100 |
| commit | 51ee17a94dccd297101725593b223f01c4f9b906 (patch) | |
| tree | 0fca6a2e240b6e98fc619fdce6f12fc1060d9c43 /openstackclient/compute | |
| parent | 6ce7da8aeb7e5d1347940433e087036e8e43eaa6 (diff) | |
| download | python-openstackclient-51ee17a94dccd297101725593b223f01c4f9b906.tar.gz | |
compute: Add support for microversion 2.89
This microversion drops the duplicate ``id`` field while adding
``attachment_id`` and ``bdm_uuid`` to the output of the
os-volume_attachments API reflected within osc by the ``openstack server
volume list $server``command.
Depends-On: https://review.opendev.org/c/openstack/nova/+/804275
Change-Id: I8a7002d8d65d7795e106b768df868198ab8b8143
Diffstat (limited to 'openstackclient/compute')
| -rw-r--r-- | openstackclient/compute/v2/server_volume.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/openstackclient/compute/v2/server_volume.py b/openstackclient/compute/v2/server_volume.py index b53c92fe..d53cec93 100644 --- a/openstackclient/compute/v2/server_volume.py +++ b/openstackclient/compute/v2/server_volume.py @@ -44,18 +44,24 @@ class ListServerVolume(command.Lister): volumes = compute_client.volumes.get_server_volumes(server.id) - columns = ( - 'id', + columns = () + column_headers = () + + if compute_client.api_version < api_versions.APIVersion('2.89'): + columns += ('id',) + column_headers += ('ID',) + + columns += ( 'device', 'serverId', 'volumeId', ) - column_headers = ( - 'ID', + column_headers += ( 'Device', 'Server ID', 'Volume ID', ) + if compute_client.api_version >= api_versions.APIVersion('2.70'): columns += ('tag',) column_headers += ('Tag',) @@ -64,6 +70,10 @@ class ListServerVolume(command.Lister): columns += ('delete_on_termination',) column_headers += ('Delete On Termination?',) + if compute_client.api_version >= api_versions.APIVersion('2.89'): + columns += ('attachment_id', 'bdm_uuid') + column_headers += ('Attachment ID', 'BlockDeviceMapping UUID') + return ( column_headers, ( |
