python-openstackclient 9.0.0__py3-none-any.whl → 10.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +58 -42
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +14 -6
- openstackclient/common/pagination.py +8 -2
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +13 -7
- openstackclient/common/quota.py +97 -99
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +39 -21
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +14 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +29 -14
- openstackclient/compute/v2/server.py +249 -169
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +21 -12
- openstackclient/compute/v2/server_group.py +21 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +24 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +10 -4
- openstackclient/compute/v2/service.py +14 -7
- openstackclient/compute/v2/usage.py +26 -21
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +78 -47
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +23 -11
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +26 -12
- openstackclient/identity/v3/application_credential.py +59 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +36 -16
- openstackclient/identity/v3/domain.py +37 -18
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +42 -20
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +38 -16
- openstackclient/identity/v3/group.py +55 -32
- openstackclient/identity/v3/identity_provider.py +92 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +38 -16
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +43 -23
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +40 -16
- openstackclient/identity/v3/role.py +61 -31
- openstackclient/identity/v3/role_assignment.py +23 -6
- openstackclient/identity/v3/service.py +36 -16
- openstackclient/identity/v3/service_provider.py +37 -15
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +32 -14
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +49 -26
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +14 -9
- openstackclient/image/v2/image.py +74 -48
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +109 -13
- openstackclient/image/v2/metadef_objects.py +28 -15
- openstackclient/image/v2/metadef_properties.py +24 -13
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +15 -6
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +36 -22
- openstackclient/network/v2/address_group.py +27 -16
- openstackclient/network/v2/address_scope.py +24 -13
- openstackclient/network/v2/bgpvpn/bgpvpn.py +463 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +214 -0
- openstackclient/network/v2/bgpvpn/port_association.py +490 -0
- openstackclient/network/v2/bgpvpn/router_association.py +288 -0
- openstackclient/network/v2/default_security_group_rule.py +19 -10
- openstackclient/network/v2/floating_ip.py +110 -159
- openstackclient/network/v2/floating_ip_port_forwarding.py +30 -18
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +466 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +574 -0
- openstackclient/network/v2/ip_availability.py +13 -5
- openstackclient/network/v2/l3_conntrack_helper.py +22 -13
- openstackclient/network/v2/local_ip.py +24 -13
- openstackclient/network/v2/local_ip_association.py +14 -7
- openstackclient/network/v2/ndp_proxy.py +20 -11
- openstackclient/network/v2/network.py +129 -196
- openstackclient/network/v2/network_agent.py +46 -25
- openstackclient/network/v2/network_auto_allocated_topology.py +22 -11
- openstackclient/network/v2/network_flavor.py +27 -16
- openstackclient/network/v2/network_flavor_profile.py +23 -12
- openstackclient/network/v2/network_meter.py +21 -10
- openstackclient/network/v2/network_meter_rule.py +21 -11
- openstackclient/network/v2/network_qos_policy.py +25 -15
- openstackclient/network/v2/network_qos_rule.py +32 -17
- openstackclient/network/v2/network_qos_rule_type.py +13 -5
- openstackclient/network/v2/network_rbac.py +23 -12
- openstackclient/network/v2/network_segment.py +20 -11
- openstackclient/network/v2/network_segment_range.py +56 -29
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +38 -22
- openstackclient/network/v2/port.py +54 -29
- openstackclient/network/v2/router.py +75 -52
- openstackclient/network/v2/security_group.py +87 -157
- openstackclient/network/v2/security_group_rule.py +100 -280
- openstackclient/network/v2/subnet.py +49 -28
- openstackclient/network/v2/subnet_pool.py +30 -17
- openstackclient/network/v2/taas/tap_flow.py +22 -11
- openstackclient/network/v2/taas/tap_mirror.py +22 -11
- openstackclient/network/v2/taas/tap_service.py +23 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +25 -15
- openstackclient/object/v1/object.py +25 -15
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +25 -19
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +11 -7
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_module.py +12 -7
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +6 -26
- openstackclient/tests/unit/compute/v2/fakes.py +25 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +28 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +6 -6
- openstackclient/tests/unit/compute/v2/test_server.py +11 -96
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/identity/v3/fakes.py +3 -0
- openstackclient/tests/unit/identity/v3/test_group.py +4 -14
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +11 -11
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +897 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +980 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +2 -2
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +3 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_agent.py +8 -4
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_rbac.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +7 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_router.py +8 -9
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +1 -20
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +7 -41
- openstackclient/tests/unit/network/v2/test_subnet.py +2 -1
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +2 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +1 -0
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +2 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +1 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +55 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +29 -17
- openstackclient/volume/v2/consistency_group_snapshot.py +25 -10
- openstackclient/volume/v2/qos_specs.py +28 -17
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +57 -29
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +46 -20
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +50 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +89 -39
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +53 -24
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +32 -13
- openstackclient/volume/v3/volume_group_type.py +26 -13
- openstackclient/volume/v3/volume_message.py +15 -7
- openstackclient/volume/v3/volume_snapshot.py +69 -32
- openstackclient/volume/v3/volume_transfer_request.py +31 -13
- openstackclient/volume/v3/volume_type.py +42 -24
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +271 -260
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +4 -0
- python_openstackclient-10.0.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-9.0.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
import argparse
|
|
14
|
+
from collections.abc import Iterable, Sequence
|
|
13
15
|
import logging
|
|
16
|
+
from typing import Any
|
|
14
17
|
|
|
15
18
|
from cinderclient import api_versions
|
|
16
19
|
from osc_lib.cli import format_columns
|
|
@@ -24,7 +27,7 @@ from openstackclient.i18n import _
|
|
|
24
27
|
LOG = logging.getLogger(__name__)
|
|
25
28
|
|
|
26
29
|
|
|
27
|
-
def _format_group_type(group):
|
|
30
|
+
def _format_group_type(group: Any) -> tuple[Sequence[str], Iterable[Any]]:
|
|
28
31
|
columns = (
|
|
29
32
|
'id',
|
|
30
33
|
'name',
|
|
@@ -60,7 +63,7 @@ class CreateVolumeGroupType(command.ShowOne):
|
|
|
60
63
|
This command requires ``--os-volume-api-version`` 3.11 or greater.
|
|
61
64
|
"""
|
|
62
65
|
|
|
63
|
-
def get_parser(self, prog_name):
|
|
66
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
64
67
|
parser = super().get_parser(prog_name)
|
|
65
68
|
parser.add_argument(
|
|
66
69
|
'name',
|
|
@@ -90,7 +93,9 @@ class CreateVolumeGroupType(command.ShowOne):
|
|
|
90
93
|
)
|
|
91
94
|
return parser
|
|
92
95
|
|
|
93
|
-
def take_action(
|
|
96
|
+
def take_action(
|
|
97
|
+
self, parsed_args: argparse.Namespace
|
|
98
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
94
99
|
volume_client = self.app.client_manager.volume
|
|
95
100
|
|
|
96
101
|
if volume_client.api_version < api_versions.APIVersion('3.11'):
|
|
@@ -113,7 +118,7 @@ class DeleteVolumeGroupType(command.Command):
|
|
|
113
118
|
This command requires ``--os-volume-api-version`` 3.11 or greater.
|
|
114
119
|
"""
|
|
115
120
|
|
|
116
|
-
def get_parser(self, prog_name):
|
|
121
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
117
122
|
parser = super().get_parser(prog_name)
|
|
118
123
|
parser.add_argument(
|
|
119
124
|
'group_type',
|
|
@@ -122,7 +127,7 @@ class DeleteVolumeGroupType(command.Command):
|
|
|
122
127
|
)
|
|
123
128
|
return parser
|
|
124
129
|
|
|
125
|
-
def take_action(self, parsed_args):
|
|
130
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
126
131
|
volume_client = self.app.client_manager.volume
|
|
127
132
|
|
|
128
133
|
if volume_client.api_version < api_versions.APIVersion('3.11'):
|
|
@@ -146,7 +151,7 @@ class SetVolumeGroupType(command.ShowOne):
|
|
|
146
151
|
This command requires ``--os-volume-api-version`` 3.11 or greater.
|
|
147
152
|
"""
|
|
148
153
|
|
|
149
|
-
def get_parser(self, prog_name):
|
|
154
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
150
155
|
parser = super().get_parser(prog_name)
|
|
151
156
|
parser.add_argument(
|
|
152
157
|
'group_type',
|
|
@@ -199,7 +204,9 @@ class SetVolumeGroupType(command.ShowOne):
|
|
|
199
204
|
)
|
|
200
205
|
return parser
|
|
201
206
|
|
|
202
|
-
def take_action(
|
|
207
|
+
def take_action(
|
|
208
|
+
self, parsed_args: argparse.Namespace
|
|
209
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
203
210
|
volume_client = self.app.client_manager.volume
|
|
204
211
|
|
|
205
212
|
if volume_client.api_version < api_versions.APIVersion('3.11'):
|
|
@@ -263,7 +270,7 @@ class UnsetVolumeGroupType(command.ShowOne):
|
|
|
263
270
|
This command requires ``--os-volume-api-version`` 3.11 or greater.
|
|
264
271
|
"""
|
|
265
272
|
|
|
266
|
-
def get_parser(self, prog_name):
|
|
273
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
267
274
|
parser = super().get_parser(prog_name)
|
|
268
275
|
parser.add_argument(
|
|
269
276
|
'group_type',
|
|
@@ -282,7 +289,9 @@ class UnsetVolumeGroupType(command.ShowOne):
|
|
|
282
289
|
)
|
|
283
290
|
return parser
|
|
284
291
|
|
|
285
|
-
def take_action(
|
|
292
|
+
def take_action(
|
|
293
|
+
self, parsed_args: argparse.Namespace
|
|
294
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
286
295
|
volume_client = self.app.client_manager.volume
|
|
287
296
|
|
|
288
297
|
if volume_client.api_version < api_versions.APIVersion('3.11'):
|
|
@@ -313,7 +322,7 @@ class ListVolumeGroupType(command.Lister):
|
|
|
313
322
|
This command requires ``--os-volume-api-version`` 3.11 or greater.
|
|
314
323
|
"""
|
|
315
324
|
|
|
316
|
-
def get_parser(self, prog_name):
|
|
325
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
317
326
|
parser = super().get_parser(prog_name)
|
|
318
327
|
parser.add_argument(
|
|
319
328
|
'--default',
|
|
@@ -338,7 +347,9 @@ class ListVolumeGroupType(command.Lister):
|
|
|
338
347
|
# )
|
|
339
348
|
return parser
|
|
340
349
|
|
|
341
|
-
def take_action(
|
|
350
|
+
def take_action(
|
|
351
|
+
self, parsed_args: argparse.Namespace
|
|
352
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
342
353
|
volume_client = self.app.client_manager.volume
|
|
343
354
|
|
|
344
355
|
if volume_client.api_version < api_versions.APIVersion('3.11'):
|
|
@@ -378,7 +389,7 @@ class ShowVolumeGroupType(command.ShowOne):
|
|
|
378
389
|
This command requires ``--os-volume-api-version`` 3.11 or greater.
|
|
379
390
|
"""
|
|
380
391
|
|
|
381
|
-
def get_parser(self, prog_name):
|
|
392
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
382
393
|
parser = super().get_parser(prog_name)
|
|
383
394
|
parser.add_argument(
|
|
384
395
|
'group_type',
|
|
@@ -387,7 +398,9 @@ class ShowVolumeGroupType(command.ShowOne):
|
|
|
387
398
|
)
|
|
388
399
|
return parser
|
|
389
400
|
|
|
390
|
-
def take_action(
|
|
401
|
+
def take_action(
|
|
402
|
+
self, parsed_args: argparse.Namespace
|
|
403
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
391
404
|
volume_client = self.app.client_manager.volume
|
|
392
405
|
|
|
393
406
|
if volume_client.api_version < api_versions.APIVersion('3.11'):
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume V3 Messages implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
17
19
|
import logging as LOG
|
|
20
|
+
from typing import Any
|
|
18
21
|
|
|
19
22
|
from cinderclient import api_versions
|
|
20
23
|
from osc_lib import exceptions
|
|
@@ -29,7 +32,7 @@ from openstackclient.identity import common as identity_common
|
|
|
29
32
|
class DeleteMessage(command.Command):
|
|
30
33
|
_description = _('Delete a volume failure message')
|
|
31
34
|
|
|
32
|
-
def get_parser(self, prog_name):
|
|
35
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
33
36
|
parser = super().get_parser(prog_name)
|
|
34
37
|
parser.add_argument(
|
|
35
38
|
'message_ids',
|
|
@@ -40,7 +43,7 @@ class DeleteMessage(command.Command):
|
|
|
40
43
|
|
|
41
44
|
return parser
|
|
42
45
|
|
|
43
|
-
def take_action(self, parsed_args):
|
|
46
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
44
47
|
volume_client = self.app.client_manager.volume
|
|
45
48
|
|
|
46
49
|
if volume_client.api_version < api_versions.APIVersion('3.3'):
|
|
@@ -70,7 +73,7 @@ class DeleteMessage(command.Command):
|
|
|
70
73
|
class ListMessages(command.Lister):
|
|
71
74
|
_description = _('List volume failure messages')
|
|
72
75
|
|
|
73
|
-
def get_parser(self, prog_name):
|
|
76
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
74
77
|
parser = super().get_parser(prog_name)
|
|
75
78
|
|
|
76
79
|
parser.add_argument(
|
|
@@ -83,7 +86,9 @@ class ListMessages(command.Lister):
|
|
|
83
86
|
|
|
84
87
|
return parser
|
|
85
88
|
|
|
86
|
-
def take_action(
|
|
89
|
+
def take_action(
|
|
90
|
+
self, parsed_args: argparse.Namespace
|
|
91
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
87
92
|
volume_client = self.app.client_manager.volume
|
|
88
93
|
identity_client = self.app.client_manager.identity
|
|
89
94
|
|
|
@@ -132,7 +137,7 @@ class ListMessages(command.Lister):
|
|
|
132
137
|
class ShowMessage(command.ShowOne):
|
|
133
138
|
_description = _('Show a volume failure message')
|
|
134
139
|
|
|
135
|
-
def get_parser(self, prog_name):
|
|
140
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
136
141
|
parser = super().get_parser(prog_name)
|
|
137
142
|
parser.add_argument(
|
|
138
143
|
'message_id',
|
|
@@ -142,7 +147,9 @@ class ShowMessage(command.ShowOne):
|
|
|
142
147
|
|
|
143
148
|
return parser
|
|
144
149
|
|
|
145
|
-
def take_action(
|
|
150
|
+
def take_action(
|
|
151
|
+
self, parsed_args: argparse.Namespace
|
|
152
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
146
153
|
volume_client = self.app.client_manager.volume
|
|
147
154
|
|
|
148
155
|
if volume_client.api_version < api_versions.APIVersion('3.3'):
|
|
@@ -154,4 +161,5 @@ class ShowMessage(command.ShowOne):
|
|
|
154
161
|
|
|
155
162
|
message = volume_client.messages.get(parsed_args.message_id)
|
|
156
163
|
|
|
157
|
-
|
|
164
|
+
col_headers, col_data = zip(*sorted(message._info.items()))
|
|
165
|
+
return col_headers, col_data
|
|
@@ -14,12 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v3 snapshot action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
17
19
|
import functools
|
|
18
20
|
import logging
|
|
19
|
-
|
|
21
|
+
from typing import Any
|
|
20
22
|
|
|
21
23
|
from cliff import columns as cliff_columns
|
|
22
24
|
from openstack.block_storage.v3 import snapshot as _snapshot
|
|
25
|
+
from openstack import utils as sdk_utils
|
|
23
26
|
from osc_lib.cli import format_columns
|
|
24
27
|
from osc_lib.cli import parseractions
|
|
25
28
|
from osc_lib import exceptions
|
|
@@ -44,11 +47,13 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
44
47
|
``functools.partial(VolumeIdColumn, volume_cache)``.
|
|
45
48
|
"""
|
|
46
49
|
|
|
47
|
-
def __init__(
|
|
50
|
+
def __init__(
|
|
51
|
+
self, value: str, volume_cache: dict[str, Any] | None = None
|
|
52
|
+
) -> None:
|
|
48
53
|
super().__init__(value)
|
|
49
54
|
self._volume_cache = volume_cache or {}
|
|
50
55
|
|
|
51
|
-
def human_readable(self):
|
|
56
|
+
def human_readable(self) -> str:
|
|
52
57
|
"""Return a volume name if available
|
|
53
58
|
|
|
54
59
|
:rtype: either the volume ID or name
|
|
@@ -60,7 +65,7 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
60
65
|
return volume
|
|
61
66
|
|
|
62
67
|
|
|
63
|
-
def _format_snapshot(snapshot: _snapshot.Snapshot) -> dict[str,
|
|
68
|
+
def _format_snapshot(snapshot: _snapshot.Snapshot) -> dict[str, Any]:
|
|
64
69
|
# Some columns returned by openstacksdk should not be shown because they're
|
|
65
70
|
# either irrelevant or duplicates
|
|
66
71
|
ignored_columns = {
|
|
@@ -99,7 +104,7 @@ def _format_snapshot(snapshot: _snapshot.Snapshot) -> dict[str, ty.Any]:
|
|
|
99
104
|
class CreateVolumeSnapshot(command.ShowOne):
|
|
100
105
|
_description = _("Create new volume snapshot")
|
|
101
106
|
|
|
102
|
-
def get_parser(self, prog_name):
|
|
107
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
103
108
|
parser = super().get_parser(prog_name)
|
|
104
109
|
parser.add_argument(
|
|
105
110
|
"snapshot_name",
|
|
@@ -123,7 +128,9 @@ class CreateVolumeSnapshot(command.ShowOne):
|
|
|
123
128
|
action="store_true",
|
|
124
129
|
default=False,
|
|
125
130
|
help=_(
|
|
126
|
-
"
|
|
131
|
+
"Allow snapshot of in-use (attached) volume. "
|
|
132
|
+
"Only needed for microversions prior to 3.66; "
|
|
133
|
+
"ignored for 3.66+"
|
|
127
134
|
),
|
|
128
135
|
)
|
|
129
136
|
parser.add_argument(
|
|
@@ -149,8 +156,12 @@ class CreateVolumeSnapshot(command.ShowOne):
|
|
|
149
156
|
)
|
|
150
157
|
return parser
|
|
151
158
|
|
|
152
|
-
def take_action(
|
|
153
|
-
|
|
159
|
+
def take_action(
|
|
160
|
+
self, parsed_args: argparse.Namespace
|
|
161
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
162
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
163
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
164
|
+
)
|
|
154
165
|
|
|
155
166
|
volume = parsed_args.volume
|
|
156
167
|
if not parsed_args.volume:
|
|
@@ -176,22 +187,33 @@ class CreateVolumeSnapshot(command.ShowOne):
|
|
|
176
187
|
)
|
|
177
188
|
else:
|
|
178
189
|
# Create a new snapshot from scratch
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
# only for microversion < 3.66, pass force parameter
|
|
191
|
+
# for backward compatibility
|
|
192
|
+
if not sdk_utils.supports_microversion(volume_client, '3.66'):
|
|
193
|
+
snapshot = volume_client.create_snapshot(
|
|
194
|
+
volume_id=volume_id,
|
|
195
|
+
force=parsed_args.force,
|
|
196
|
+
name=parsed_args.snapshot_name,
|
|
197
|
+
description=parsed_args.description,
|
|
198
|
+
metadata=parsed_args.properties,
|
|
199
|
+
)
|
|
200
|
+
else:
|
|
201
|
+
snapshot = volume_client.create_snapshot(
|
|
202
|
+
volume_id=volume_id,
|
|
203
|
+
name=parsed_args.snapshot_name,
|
|
204
|
+
description=parsed_args.description,
|
|
205
|
+
metadata=parsed_args.properties,
|
|
206
|
+
)
|
|
186
207
|
|
|
187
208
|
data = _format_snapshot(snapshot)
|
|
188
|
-
|
|
209
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
210
|
+
return col_headers, col_data
|
|
189
211
|
|
|
190
212
|
|
|
191
213
|
class DeleteVolumeSnapshot(command.Command):
|
|
192
214
|
_description = _("Delete volume snapshot(s)")
|
|
193
215
|
|
|
194
|
-
def get_parser(self, prog_name):
|
|
216
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
195
217
|
parser = super().get_parser(prog_name)
|
|
196
218
|
parser.add_argument(
|
|
197
219
|
"snapshots",
|
|
@@ -217,8 +239,10 @@ class DeleteVolumeSnapshot(command.Command):
|
|
|
217
239
|
)
|
|
218
240
|
return parser
|
|
219
241
|
|
|
220
|
-
def take_action(self, parsed_args):
|
|
221
|
-
volume_client =
|
|
242
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
243
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
244
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
245
|
+
)
|
|
222
246
|
result = 0
|
|
223
247
|
|
|
224
248
|
if parsed_args.remote:
|
|
@@ -262,7 +286,7 @@ class DeleteVolumeSnapshot(command.Command):
|
|
|
262
286
|
class ListVolumeSnapshot(command.Lister):
|
|
263
287
|
_description = _("List volume snapshots")
|
|
264
288
|
|
|
265
|
-
def get_parser(self, prog_name):
|
|
289
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
266
290
|
parser = super().get_parser(prog_name)
|
|
267
291
|
parser.add_argument(
|
|
268
292
|
'--all-projects',
|
|
@@ -313,8 +337,12 @@ class ListVolumeSnapshot(command.Lister):
|
|
|
313
337
|
pagination.add_marker_pagination_option_to_parser(parser)
|
|
314
338
|
return parser
|
|
315
339
|
|
|
316
|
-
def take_action(
|
|
317
|
-
|
|
340
|
+
def take_action(
|
|
341
|
+
self, parsed_args: argparse.Namespace
|
|
342
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
343
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
344
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
345
|
+
)
|
|
318
346
|
identity_client = self.app.client_manager.identity
|
|
319
347
|
|
|
320
348
|
columns: tuple[str, ...] = (
|
|
@@ -402,7 +430,7 @@ class ListVolumeSnapshot(command.Lister):
|
|
|
402
430
|
class SetVolumeSnapshot(command.Command):
|
|
403
431
|
_description = _("Set volume snapshot properties")
|
|
404
432
|
|
|
405
|
-
def get_parser(self, prog_name):
|
|
433
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
406
434
|
parser = super().get_parser(prog_name)
|
|
407
435
|
parser.add_argument(
|
|
408
436
|
'snapshot',
|
|
@@ -458,8 +486,10 @@ class SetVolumeSnapshot(command.Command):
|
|
|
458
486
|
)
|
|
459
487
|
return parser
|
|
460
488
|
|
|
461
|
-
def take_action(self, parsed_args):
|
|
462
|
-
volume_client =
|
|
489
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
490
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
491
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
492
|
+
)
|
|
463
493
|
|
|
464
494
|
snapshot = volume_client.find_snapshot(
|
|
465
495
|
parsed_args.snapshot, ignore_missing=False
|
|
@@ -517,7 +547,7 @@ class SetVolumeSnapshot(command.Command):
|
|
|
517
547
|
class ShowVolumeSnapshot(command.ShowOne):
|
|
518
548
|
_description = _("Display volume snapshot details")
|
|
519
549
|
|
|
520
|
-
def get_parser(self, prog_name):
|
|
550
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
521
551
|
parser = super().get_parser(prog_name)
|
|
522
552
|
parser.add_argument(
|
|
523
553
|
"snapshot",
|
|
@@ -526,21 +556,26 @@ class ShowVolumeSnapshot(command.ShowOne):
|
|
|
526
556
|
)
|
|
527
557
|
return parser
|
|
528
558
|
|
|
529
|
-
def take_action(
|
|
530
|
-
|
|
559
|
+
def take_action(
|
|
560
|
+
self, parsed_args: argparse.Namespace
|
|
561
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
562
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
563
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
564
|
+
)
|
|
531
565
|
|
|
532
566
|
snapshot = volume_client.find_snapshot(
|
|
533
567
|
parsed_args.snapshot, ignore_missing=False
|
|
534
568
|
)
|
|
535
569
|
|
|
536
570
|
data = _format_snapshot(snapshot)
|
|
537
|
-
|
|
571
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
572
|
+
return col_headers, col_data
|
|
538
573
|
|
|
539
574
|
|
|
540
575
|
class UnsetVolumeSnapshot(command.Command):
|
|
541
576
|
_description = _("Unset volume snapshot properties")
|
|
542
577
|
|
|
543
|
-
def get_parser(self, prog_name):
|
|
578
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
544
579
|
parser = super().get_parser(prog_name)
|
|
545
580
|
parser.add_argument(
|
|
546
581
|
'snapshot',
|
|
@@ -560,8 +595,10 @@ class UnsetVolumeSnapshot(command.Command):
|
|
|
560
595
|
)
|
|
561
596
|
return parser
|
|
562
597
|
|
|
563
|
-
def take_action(self, parsed_args):
|
|
564
|
-
volume_client =
|
|
598
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
599
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
600
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
601
|
+
)
|
|
565
602
|
|
|
566
603
|
snapshot = volume_client.find_snapshot(
|
|
567
604
|
parsed_args.snapshot, ignore_missing=False
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v3 transfer action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
17
19
|
import logging
|
|
20
|
+
from typing import Any
|
|
18
21
|
|
|
19
22
|
from cinderclient import api_versions
|
|
20
23
|
from osc_lib import exceptions
|
|
@@ -30,7 +33,7 @@ LOG = logging.getLogger(__name__)
|
|
|
30
33
|
class AcceptTransferRequest(command.ShowOne):
|
|
31
34
|
_description = _("Accept volume transfer request.")
|
|
32
35
|
|
|
33
|
-
def get_parser(self, prog_name):
|
|
36
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
34
37
|
parser = super().get_parser(prog_name)
|
|
35
38
|
parser.add_argument(
|
|
36
39
|
'transfer_request',
|
|
@@ -45,7 +48,9 @@ class AcceptTransferRequest(command.ShowOne):
|
|
|
45
48
|
)
|
|
46
49
|
return parser
|
|
47
50
|
|
|
48
|
-
def take_action(
|
|
51
|
+
def take_action(
|
|
52
|
+
self, parsed_args: argparse.Namespace
|
|
53
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
49
54
|
volume_client = self.app.client_manager.volume
|
|
50
55
|
|
|
51
56
|
try:
|
|
@@ -63,13 +68,14 @@ class AcceptTransferRequest(command.ShowOne):
|
|
|
63
68
|
)
|
|
64
69
|
transfer_accept._info.pop("links", None)
|
|
65
70
|
|
|
66
|
-
|
|
71
|
+
col_headers, col_data = zip(*sorted(transfer_accept._info.items()))
|
|
72
|
+
return col_headers, col_data
|
|
67
73
|
|
|
68
74
|
|
|
69
75
|
class CreateTransferRequest(command.ShowOne):
|
|
70
76
|
_description = _("Create volume transfer request.")
|
|
71
77
|
|
|
72
|
-
def get_parser(self, prog_name):
|
|
78
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
73
79
|
parser = super().get_parser(prog_name)
|
|
74
80
|
parser.add_argument(
|
|
75
81
|
'--name',
|
|
@@ -102,7 +108,9 @@ class CreateTransferRequest(command.ShowOne):
|
|
|
102
108
|
)
|
|
103
109
|
return parser
|
|
104
110
|
|
|
105
|
-
def take_action(
|
|
111
|
+
def take_action(
|
|
112
|
+
self, parsed_args: argparse.Namespace
|
|
113
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
106
114
|
volume_client = self.app.client_manager.volume
|
|
107
115
|
|
|
108
116
|
kwargs = {}
|
|
@@ -130,13 +138,16 @@ class CreateTransferRequest(command.ShowOne):
|
|
|
130
138
|
)
|
|
131
139
|
volume_transfer_request._info.pop("links", None)
|
|
132
140
|
|
|
133
|
-
|
|
141
|
+
col_headers, col_data = zip(
|
|
142
|
+
*sorted(volume_transfer_request._info.items())
|
|
143
|
+
)
|
|
144
|
+
return col_headers, col_data
|
|
134
145
|
|
|
135
146
|
|
|
136
147
|
class DeleteTransferRequest(command.Command):
|
|
137
148
|
_description = _("Delete volume transfer request(s).")
|
|
138
149
|
|
|
139
|
-
def get_parser(self, prog_name):
|
|
150
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
140
151
|
parser = super().get_parser(prog_name)
|
|
141
152
|
parser.add_argument(
|
|
142
153
|
'transfer_request',
|
|
@@ -146,7 +157,7 @@ class DeleteTransferRequest(command.Command):
|
|
|
146
157
|
)
|
|
147
158
|
return parser
|
|
148
159
|
|
|
149
|
-
def take_action(self, parsed_args):
|
|
160
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
150
161
|
volume_client = self.app.client_manager.volume
|
|
151
162
|
result = 0
|
|
152
163
|
|
|
@@ -179,7 +190,7 @@ class DeleteTransferRequest(command.Command):
|
|
|
179
190
|
class ListTransferRequest(command.Lister):
|
|
180
191
|
_description = _("Lists all volume transfer requests.")
|
|
181
192
|
|
|
182
|
-
def get_parser(self, prog_name):
|
|
193
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
183
194
|
parser = super().get_parser(prog_name)
|
|
184
195
|
parser.add_argument(
|
|
185
196
|
'--all-projects',
|
|
@@ -190,7 +201,9 @@ class ListTransferRequest(command.Lister):
|
|
|
190
201
|
)
|
|
191
202
|
return parser
|
|
192
203
|
|
|
193
|
-
def take_action(
|
|
204
|
+
def take_action(
|
|
205
|
+
self, parsed_args: argparse.Namespace
|
|
206
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
194
207
|
columns = ['ID', 'Name', 'Volume ID']
|
|
195
208
|
column_headers = ['ID', 'Name', 'Volume']
|
|
196
209
|
|
|
@@ -213,7 +226,7 @@ class ListTransferRequest(command.Lister):
|
|
|
213
226
|
class ShowTransferRequest(command.ShowOne):
|
|
214
227
|
_description = _("Show volume transfer request details.")
|
|
215
228
|
|
|
216
|
-
def get_parser(self, prog_name):
|
|
229
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
217
230
|
parser = super().get_parser(prog_name)
|
|
218
231
|
parser.add_argument(
|
|
219
232
|
'transfer_request',
|
|
@@ -222,7 +235,9 @@ class ShowTransferRequest(command.ShowOne):
|
|
|
222
235
|
)
|
|
223
236
|
return parser
|
|
224
237
|
|
|
225
|
-
def take_action(
|
|
238
|
+
def take_action(
|
|
239
|
+
self, parsed_args: argparse.Namespace
|
|
240
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
226
241
|
volume_client = self.app.client_manager.volume
|
|
227
242
|
volume_transfer_request = utils.find_resource(
|
|
228
243
|
volume_client.transfers,
|
|
@@ -230,4 +245,7 @@ class ShowTransferRequest(command.ShowOne):
|
|
|
230
245
|
)
|
|
231
246
|
volume_transfer_request._info.pop("links", None)
|
|
232
247
|
|
|
233
|
-
|
|
248
|
+
col_headers, col_data = zip(
|
|
249
|
+
*sorted(volume_transfer_request._info.items())
|
|
250
|
+
)
|
|
251
|
+
return col_headers, col_data
|