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,8 +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
|
|
14
|
-
|
|
16
|
+
from typing import Any
|
|
15
17
|
|
|
16
18
|
from openstack import utils as sdk_utils
|
|
17
19
|
from osc_lib.cli import format_columns
|
|
@@ -32,7 +34,7 @@ _FILTER_DEPRECATED = _(
|
|
|
32
34
|
)
|
|
33
35
|
|
|
34
36
|
|
|
35
|
-
def _format_attachment(attachment):
|
|
37
|
+
def _format_attachment(attachment: Any) -> tuple[tuple[str, ...], Any]:
|
|
36
38
|
columns = (
|
|
37
39
|
'id',
|
|
38
40
|
'volume_id',
|
|
@@ -57,7 +59,7 @@ def _format_attachment(attachment):
|
|
|
57
59
|
# VolumeAttachmentManager.create returns a dict while everything else
|
|
58
60
|
# returns a VolumeAttachment object
|
|
59
61
|
if isinstance(attachment, dict):
|
|
60
|
-
data: tuple[
|
|
62
|
+
data: tuple[Any, ...] = ()
|
|
61
63
|
for column in columns:
|
|
62
64
|
if column == 'connection_info':
|
|
63
65
|
data += (format_columns.DictColumn(attachment[column]),)
|
|
@@ -88,7 +90,7 @@ class CreateVolumeAttachment(command.ShowOne):
|
|
|
88
90
|
add volume' command should be preferred.
|
|
89
91
|
"""
|
|
90
92
|
|
|
91
|
-
def get_parser(self, prog_name):
|
|
93
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
92
94
|
parser = super().get_parser(prog_name)
|
|
93
95
|
parser.add_argument(
|
|
94
96
|
'volume',
|
|
@@ -171,8 +173,12 @@ class CreateVolumeAttachment(command.ShowOne):
|
|
|
171
173
|
)
|
|
172
174
|
return parser
|
|
173
175
|
|
|
174
|
-
def take_action(
|
|
175
|
-
|
|
176
|
+
def take_action(
|
|
177
|
+
self, parsed_args: argparse.Namespace
|
|
178
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
179
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
180
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
181
|
+
)
|
|
176
182
|
compute_client = self.app.client_manager.compute
|
|
177
183
|
|
|
178
184
|
if not sdk_utils.supports_microversion(volume_client, '3.27'):
|
|
@@ -249,7 +255,7 @@ class DeleteVolumeAttachment(command.Command):
|
|
|
249
255
|
remove' command should be preferred.
|
|
250
256
|
"""
|
|
251
257
|
|
|
252
|
-
def get_parser(self, prog_name):
|
|
258
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
253
259
|
parser = super().get_parser(prog_name)
|
|
254
260
|
parser.add_argument(
|
|
255
261
|
'attachment',
|
|
@@ -258,8 +264,10 @@ class DeleteVolumeAttachment(command.Command):
|
|
|
258
264
|
)
|
|
259
265
|
return parser
|
|
260
266
|
|
|
261
|
-
def take_action(self, parsed_args):
|
|
262
|
-
volume_client =
|
|
267
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
268
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
269
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
270
|
+
)
|
|
263
271
|
|
|
264
272
|
if not sdk_utils.supports_microversion(volume_client, '3.27'):
|
|
265
273
|
msg = _(
|
|
@@ -280,7 +288,7 @@ class SetVolumeAttachment(command.ShowOne):
|
|
|
280
288
|
connected to.
|
|
281
289
|
"""
|
|
282
290
|
|
|
283
|
-
def get_parser(self, prog_name):
|
|
291
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
284
292
|
parser = super().get_parser(prog_name)
|
|
285
293
|
parser.add_argument(
|
|
286
294
|
'attachment',
|
|
@@ -332,8 +340,12 @@ class SetVolumeAttachment(command.ShowOne):
|
|
|
332
340
|
)
|
|
333
341
|
return parser
|
|
334
342
|
|
|
335
|
-
def take_action(
|
|
336
|
-
|
|
343
|
+
def take_action(
|
|
344
|
+
self, parsed_args: argparse.Namespace
|
|
345
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
346
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
347
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
348
|
+
)
|
|
337
349
|
|
|
338
350
|
if not sdk_utils.supports_microversion(volume_client, '3.27'):
|
|
339
351
|
msg = _(
|
|
@@ -363,7 +375,7 @@ class SetVolumeAttachment(command.ShowOne):
|
|
|
363
375
|
class CompleteVolumeAttachment(command.Command):
|
|
364
376
|
"""Complete an attachment for a volume."""
|
|
365
377
|
|
|
366
|
-
def get_parser(self, prog_name):
|
|
378
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
367
379
|
parser = super().get_parser(prog_name)
|
|
368
380
|
parser.add_argument(
|
|
369
381
|
'attachment',
|
|
@@ -372,8 +384,10 @@ class CompleteVolumeAttachment(command.Command):
|
|
|
372
384
|
)
|
|
373
385
|
return parser
|
|
374
386
|
|
|
375
|
-
def take_action(self, parsed_args):
|
|
376
|
-
volume_client =
|
|
387
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
388
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
389
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
390
|
+
)
|
|
377
391
|
|
|
378
392
|
if not sdk_utils.supports_microversion(volume_client, '3.44'):
|
|
379
393
|
msg = _(
|
|
@@ -388,7 +402,7 @@ class CompleteVolumeAttachment(command.Command):
|
|
|
388
402
|
class ListVolumeAttachment(command.Lister):
|
|
389
403
|
"""Lists all volume attachments."""
|
|
390
404
|
|
|
391
|
-
def get_parser(self, prog_name):
|
|
405
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
392
406
|
parser = super().get_parser(prog_name)
|
|
393
407
|
parser.add_argument(
|
|
394
408
|
'--project',
|
|
@@ -432,8 +446,12 @@ class ListVolumeAttachment(command.Lister):
|
|
|
432
446
|
# )
|
|
433
447
|
return parser
|
|
434
448
|
|
|
435
|
-
def take_action(
|
|
436
|
-
|
|
449
|
+
def take_action(
|
|
450
|
+
self, parsed_args: argparse.Namespace
|
|
451
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
452
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
453
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
454
|
+
)
|
|
437
455
|
identity_client = self.app.client_manager.identity
|
|
438
456
|
|
|
439
457
|
if not sdk_utils.supports_microversion(volume_client, '3.27'):
|
|
@@ -490,7 +508,7 @@ class ListVolumeAttachment(command.Lister):
|
|
|
490
508
|
class ShowVolumeAttachment(command.ShowOne):
|
|
491
509
|
"""Show detailed information for a volume attachment."""
|
|
492
510
|
|
|
493
|
-
def get_parser(self, prog_name):
|
|
511
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
494
512
|
parser = super().get_parser(prog_name)
|
|
495
513
|
parser.add_argument(
|
|
496
514
|
'attachment',
|
|
@@ -499,8 +517,12 @@ class ShowVolumeAttachment(command.ShowOne):
|
|
|
499
517
|
)
|
|
500
518
|
return parser
|
|
501
519
|
|
|
502
|
-
def take_action(
|
|
503
|
-
|
|
520
|
+
def take_action(
|
|
521
|
+
self, parsed_args: argparse.Namespace
|
|
522
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
523
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
524
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
525
|
+
)
|
|
504
526
|
|
|
505
527
|
if not sdk_utils.supports_microversion(volume_client, '3.27'):
|
|
506
528
|
msg = _(
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v3 Backup action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
17
19
|
import copy
|
|
18
20
|
import functools
|
|
19
21
|
import logging
|
|
22
|
+
from typing import Any
|
|
20
23
|
|
|
21
24
|
from cliff import columns as cliff_columns
|
|
22
25
|
from openstack import utils as sdk_utils
|
|
@@ -42,11 +45,13 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
42
45
|
``functools.partial(VolumeIdColumn, volume_cache)``.
|
|
43
46
|
"""
|
|
44
47
|
|
|
45
|
-
def __init__(
|
|
48
|
+
def __init__(
|
|
49
|
+
self, value: str, volume_cache: dict[str, Any] | None = None
|
|
50
|
+
) -> None:
|
|
46
51
|
super().__init__(value)
|
|
47
52
|
self._volume_cache = volume_cache or {}
|
|
48
53
|
|
|
49
|
-
def human_readable(self):
|
|
54
|
+
def human_readable(self) -> str:
|
|
50
55
|
"""Return a volume name if available
|
|
51
56
|
|
|
52
57
|
:rtype: either the volume ID or name
|
|
@@ -61,7 +66,7 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
61
66
|
class CreateVolumeBackup(command.ShowOne):
|
|
62
67
|
_description = _("Create new volume backup")
|
|
63
68
|
|
|
64
|
-
def get_parser(self, prog_name):
|
|
69
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
65
70
|
parser = super().get_parser(prog_name)
|
|
66
71
|
parser.add_argument(
|
|
67
72
|
"volume",
|
|
@@ -125,8 +130,12 @@ class CreateVolumeBackup(command.ShowOne):
|
|
|
125
130
|
)
|
|
126
131
|
return parser
|
|
127
132
|
|
|
128
|
-
def take_action(
|
|
129
|
-
|
|
133
|
+
def take_action(
|
|
134
|
+
self, parsed_args: argparse.Namespace
|
|
135
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
136
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
137
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
138
|
+
)
|
|
130
139
|
|
|
131
140
|
volume_id = volume_client.find_volume(
|
|
132
141
|
parsed_args.volume,
|
|
@@ -182,7 +191,7 @@ class CreateVolumeBackup(command.ShowOne):
|
|
|
182
191
|
class DeleteVolumeBackup(command.Command):
|
|
183
192
|
_description = _("Delete volume backup(s)")
|
|
184
193
|
|
|
185
|
-
def get_parser(self, prog_name):
|
|
194
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
186
195
|
parser = super().get_parser(prog_name)
|
|
187
196
|
parser.add_argument(
|
|
188
197
|
"backups",
|
|
@@ -198,8 +207,10 @@ class DeleteVolumeBackup(command.Command):
|
|
|
198
207
|
)
|
|
199
208
|
return parser
|
|
200
209
|
|
|
201
|
-
def take_action(self, parsed_args):
|
|
202
|
-
volume_client =
|
|
210
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
211
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
212
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
213
|
+
)
|
|
203
214
|
result = 0
|
|
204
215
|
|
|
205
216
|
for backup in parsed_args.backups:
|
|
@@ -234,7 +245,7 @@ class DeleteVolumeBackup(command.Command):
|
|
|
234
245
|
class ListVolumeBackup(command.Lister):
|
|
235
246
|
_description = _("List volume backups")
|
|
236
247
|
|
|
237
|
-
def get_parser(self, prog_name):
|
|
248
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
238
249
|
parser = super().get_parser(prog_name)
|
|
239
250
|
parser.add_argument(
|
|
240
251
|
'--project',
|
|
@@ -299,9 +310,15 @@ class ListVolumeBackup(command.Lister):
|
|
|
299
310
|
# )
|
|
300
311
|
return parser
|
|
301
312
|
|
|
302
|
-
def take_action(
|
|
303
|
-
|
|
304
|
-
|
|
313
|
+
def take_action(
|
|
314
|
+
self, parsed_args: argparse.Namespace
|
|
315
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
316
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
317
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
318
|
+
)
|
|
319
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
320
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
321
|
+
)
|
|
305
322
|
|
|
306
323
|
columns: tuple[str, ...] = (
|
|
307
324
|
'id',
|
|
@@ -396,7 +413,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
396
413
|
class RestoreVolumeBackup(command.ShowOne):
|
|
397
414
|
_description = _("Restore volume backup")
|
|
398
415
|
|
|
399
|
-
def get_parser(self, prog_name):
|
|
416
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
400
417
|
parser = super().get_parser(prog_name)
|
|
401
418
|
parser.add_argument(
|
|
402
419
|
"backup",
|
|
@@ -422,8 +439,12 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
422
439
|
)
|
|
423
440
|
return parser
|
|
424
441
|
|
|
425
|
-
def take_action(
|
|
426
|
-
|
|
442
|
+
def take_action(
|
|
443
|
+
self, parsed_args: argparse.Namespace
|
|
444
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
445
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
446
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
447
|
+
)
|
|
427
448
|
|
|
428
449
|
columns: tuple[str, ...] = (
|
|
429
450
|
'id',
|
|
@@ -468,7 +489,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
468
489
|
class SetVolumeBackup(command.Command):
|
|
469
490
|
_description = _("Set volume backup properties")
|
|
470
491
|
|
|
471
|
-
def get_parser(self, prog_name):
|
|
492
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
472
493
|
parser = super().get_parser(prog_name)
|
|
473
494
|
parser.add_argument(
|
|
474
495
|
"backup",
|
|
@@ -525,8 +546,10 @@ class SetVolumeBackup(command.Command):
|
|
|
525
546
|
)
|
|
526
547
|
return parser
|
|
527
548
|
|
|
528
|
-
def take_action(self, parsed_args):
|
|
529
|
-
volume_client =
|
|
549
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
550
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
551
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
552
|
+
)
|
|
530
553
|
|
|
531
554
|
backup = volume_client.find_backup(
|
|
532
555
|
parsed_args.backup,
|
|
@@ -608,7 +631,7 @@ class UnsetVolumeBackup(command.Command):
|
|
|
608
631
|
This command requires ``--os-volume-api-version`` 3.43 or greater.
|
|
609
632
|
"""
|
|
610
633
|
|
|
611
|
-
def get_parser(self, prog_name):
|
|
634
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
612
635
|
parser = super().get_parser(prog_name)
|
|
613
636
|
parser.add_argument(
|
|
614
637
|
'backup',
|
|
@@ -627,8 +650,10 @@ class UnsetVolumeBackup(command.Command):
|
|
|
627
650
|
)
|
|
628
651
|
return parser
|
|
629
652
|
|
|
630
|
-
def take_action(self, parsed_args):
|
|
631
|
-
volume_client =
|
|
653
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
654
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
655
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
656
|
+
)
|
|
632
657
|
|
|
633
658
|
if not sdk_utils.supports_microversion(volume_client, '3.43'):
|
|
634
659
|
msg = _(
|
|
@@ -660,7 +685,7 @@ class UnsetVolumeBackup(command.Command):
|
|
|
660
685
|
class ShowVolumeBackup(command.ShowOne):
|
|
661
686
|
_description = _("Display volume backup details")
|
|
662
687
|
|
|
663
|
-
def get_parser(self, prog_name):
|
|
688
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
664
689
|
parser = super().get_parser(prog_name)
|
|
665
690
|
parser.add_argument(
|
|
666
691
|
"backup",
|
|
@@ -669,8 +694,12 @@ class ShowVolumeBackup(command.ShowOne):
|
|
|
669
694
|
)
|
|
670
695
|
return parser
|
|
671
696
|
|
|
672
|
-
def take_action(
|
|
673
|
-
|
|
697
|
+
def take_action(
|
|
698
|
+
self, parsed_args: argparse.Namespace
|
|
699
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
700
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
701
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
702
|
+
)
|
|
674
703
|
backup = volume_client.find_backup(
|
|
675
704
|
parsed_args.backup, ignore_missing=False
|
|
676
705
|
)
|
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
13
|
import argparse
|
|
14
|
+
from collections.abc import Iterable, Sequence
|
|
15
|
+
from typing import Any
|
|
14
16
|
|
|
15
17
|
from cinderclient import api_versions
|
|
16
18
|
from osc_lib import exceptions
|
|
@@ -21,7 +23,7 @@ from openstackclient.common import envvars
|
|
|
21
23
|
from openstackclient.i18n import _
|
|
22
24
|
|
|
23
25
|
|
|
24
|
-
def _format_group(group):
|
|
26
|
+
def _format_group(group: Any) -> tuple[Sequence[str], Iterable[Any]]:
|
|
25
27
|
columns = (
|
|
26
28
|
'id',
|
|
27
29
|
'status',
|
|
@@ -79,7 +81,7 @@ class CreateVolumeGroup(command.ShowOne):
|
|
|
79
81
|
This command requires ``--os-volume-api-version`` 3.13 or greater.
|
|
80
82
|
"""
|
|
81
83
|
|
|
82
|
-
def get_parser(self, prog_name):
|
|
84
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
83
85
|
parser = super().get_parser(prog_name)
|
|
84
86
|
# This is a bit complicated. We accept two patterns: a legacy pattern
|
|
85
87
|
#
|
|
@@ -168,7 +170,9 @@ class CreateVolumeGroup(command.ShowOne):
|
|
|
168
170
|
)
|
|
169
171
|
return parser
|
|
170
172
|
|
|
171
|
-
def take_action(
|
|
173
|
+
def take_action(
|
|
174
|
+
self, parsed_args: argparse.Namespace
|
|
175
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
172
176
|
volume_client = self.app.client_manager.volume
|
|
173
177
|
|
|
174
178
|
if parsed_args.volume_group_type_legacy:
|
|
@@ -276,7 +280,7 @@ class DeleteVolumeGroup(command.Command):
|
|
|
276
280
|
This command requires ``--os-volume-api-version`` 3.13 or greater.
|
|
277
281
|
"""
|
|
278
282
|
|
|
279
|
-
def get_parser(self, prog_name):
|
|
283
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
280
284
|
parser = super().get_parser(prog_name)
|
|
281
285
|
parser.add_argument(
|
|
282
286
|
'group',
|
|
@@ -294,7 +298,7 @@ class DeleteVolumeGroup(command.Command):
|
|
|
294
298
|
)
|
|
295
299
|
return parser
|
|
296
300
|
|
|
297
|
-
def take_action(self, parsed_args):
|
|
301
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
298
302
|
volume_client = self.app.client_manager.volume
|
|
299
303
|
|
|
300
304
|
if volume_client.api_version < api_versions.APIVersion('3.13'):
|
|
@@ -318,7 +322,7 @@ class SetVolumeGroup(command.ShowOne):
|
|
|
318
322
|
This command requires ``--os-volume-api-version`` 3.13 or greater.
|
|
319
323
|
"""
|
|
320
324
|
|
|
321
|
-
def get_parser(self, prog_name):
|
|
325
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
322
326
|
parser = super().get_parser(prog_name)
|
|
323
327
|
parser.add_argument(
|
|
324
328
|
'group',
|
|
@@ -356,7 +360,9 @@ class SetVolumeGroup(command.ShowOne):
|
|
|
356
360
|
)
|
|
357
361
|
return parser
|
|
358
362
|
|
|
359
|
-
def take_action(
|
|
363
|
+
def take_action(
|
|
364
|
+
self, parsed_args: argparse.Namespace
|
|
365
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
360
366
|
volume_client = self.app.client_manager.volume
|
|
361
367
|
|
|
362
368
|
if volume_client.api_version < api_versions.APIVersion('3.13'):
|
|
@@ -405,7 +411,7 @@ class ListVolumeGroup(command.Lister):
|
|
|
405
411
|
This command requires ``--os-volume-api-version`` 3.13 or greater.
|
|
406
412
|
"""
|
|
407
413
|
|
|
408
|
-
def get_parser(self, prog_name):
|
|
414
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
409
415
|
parser = super().get_parser(prog_name)
|
|
410
416
|
parser.add_argument(
|
|
411
417
|
'--all-projects',
|
|
@@ -430,7 +436,9 @@ class ListVolumeGroup(command.Lister):
|
|
|
430
436
|
# )
|
|
431
437
|
return parser
|
|
432
438
|
|
|
433
|
-
def take_action(
|
|
439
|
+
def take_action(
|
|
440
|
+
self, parsed_args: argparse.Namespace
|
|
441
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
434
442
|
volume_client = self.app.client_manager.volume
|
|
435
443
|
|
|
436
444
|
if volume_client.api_version < api_versions.APIVersion('3.13'):
|
|
@@ -469,7 +477,7 @@ class ShowVolumeGroup(command.ShowOne):
|
|
|
469
477
|
This command requires ``--os-volume-api-version`` 3.13 or greater.
|
|
470
478
|
"""
|
|
471
479
|
|
|
472
|
-
def get_parser(self, prog_name):
|
|
480
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
473
481
|
parser = super().get_parser(prog_name)
|
|
474
482
|
parser.add_argument(
|
|
475
483
|
'group',
|
|
@@ -517,7 +525,9 @@ class ShowVolumeGroup(command.ShowOne):
|
|
|
517
525
|
|
|
518
526
|
return parser
|
|
519
527
|
|
|
520
|
-
def take_action(
|
|
528
|
+
def take_action(
|
|
529
|
+
self, parsed_args: argparse.Namespace
|
|
530
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
521
531
|
volume_client = self.app.client_manager.volume
|
|
522
532
|
|
|
523
533
|
if volume_client.api_version < api_versions.APIVersion('3.13'):
|
|
@@ -571,7 +581,7 @@ class FailoverVolumeGroup(command.Command):
|
|
|
571
581
|
This command requires ``--os-volume-api-version`` 3.38 or greater.
|
|
572
582
|
"""
|
|
573
583
|
|
|
574
|
-
def get_parser(self, prog_name):
|
|
584
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
575
585
|
parser = super().get_parser(prog_name)
|
|
576
586
|
parser.add_argument(
|
|
577
587
|
'group',
|
|
@@ -599,7 +609,7 @@ class FailoverVolumeGroup(command.Command):
|
|
|
599
609
|
)
|
|
600
610
|
return parser
|
|
601
611
|
|
|
602
|
-
def take_action(self, parsed_args):
|
|
612
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
603
613
|
volume_client = self.app.client_manager.volume
|
|
604
614
|
|
|
605
615
|
if volume_client.api_version < api_versions.APIVersion('3.38'):
|
|
@@ -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 openstack import utils as sdk_utils
|
|
16
19
|
from osc_lib import exceptions
|
|
@@ -23,7 +26,9 @@ from openstackclient.i18n import _
|
|
|
23
26
|
LOG = logging.getLogger(__name__)
|
|
24
27
|
|
|
25
28
|
|
|
26
|
-
def _format_group_snapshot(
|
|
29
|
+
def _format_group_snapshot(
|
|
30
|
+
snapshot: Any,
|
|
31
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
27
32
|
columns = (
|
|
28
33
|
'id',
|
|
29
34
|
'status',
|
|
@@ -56,7 +61,7 @@ class CreateVolumeGroupSnapshot(command.ShowOne):
|
|
|
56
61
|
This command requires ``--os-volume-api-version`` 3.13 or greater.
|
|
57
62
|
"""
|
|
58
63
|
|
|
59
|
-
def get_parser(self, prog_name):
|
|
64
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
60
65
|
parser = super().get_parser(prog_name)
|
|
61
66
|
parser.add_argument(
|
|
62
67
|
'volume_group',
|
|
@@ -75,8 +80,12 @@ class CreateVolumeGroupSnapshot(command.ShowOne):
|
|
|
75
80
|
)
|
|
76
81
|
return parser
|
|
77
82
|
|
|
78
|
-
def take_action(
|
|
79
|
-
|
|
83
|
+
def take_action(
|
|
84
|
+
self, parsed_args: argparse.Namespace
|
|
85
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
86
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
87
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
88
|
+
)
|
|
80
89
|
|
|
81
90
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
82
91
|
msg = _(
|
|
@@ -106,7 +115,7 @@ class DeleteVolumeGroupSnapshot(command.Command):
|
|
|
106
115
|
This command requires ``--os-volume-api-version`` 3.14 or greater.
|
|
107
116
|
"""
|
|
108
117
|
|
|
109
|
-
def get_parser(self, prog_name):
|
|
118
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
110
119
|
parser = super().get_parser(prog_name)
|
|
111
120
|
parser.add_argument(
|
|
112
121
|
'snapshot',
|
|
@@ -115,8 +124,10 @@ class DeleteVolumeGroupSnapshot(command.Command):
|
|
|
115
124
|
)
|
|
116
125
|
return parser
|
|
117
126
|
|
|
118
|
-
def take_action(self, parsed_args):
|
|
119
|
-
volume_client =
|
|
127
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
128
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
129
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
130
|
+
)
|
|
120
131
|
|
|
121
132
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
122
133
|
msg = _(
|
|
@@ -140,7 +151,7 @@ class ListVolumeGroupSnapshot(command.Lister):
|
|
|
140
151
|
This command requires ``--os-volume-api-version`` 3.14 or greater.
|
|
141
152
|
"""
|
|
142
153
|
|
|
143
|
-
def get_parser(self, prog_name):
|
|
154
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
144
155
|
parser = super().get_parser(prog_name)
|
|
145
156
|
parser.add_argument(
|
|
146
157
|
'--all-projects',
|
|
@@ -165,8 +176,12 @@ class ListVolumeGroupSnapshot(command.Lister):
|
|
|
165
176
|
# )
|
|
166
177
|
return parser
|
|
167
178
|
|
|
168
|
-
def take_action(
|
|
169
|
-
|
|
179
|
+
def take_action(
|
|
180
|
+
self, parsed_args: argparse.Namespace
|
|
181
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
182
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
183
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
184
|
+
)
|
|
170
185
|
|
|
171
186
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
172
187
|
msg = _(
|
|
@@ -202,7 +217,7 @@ class ShowVolumeGroupSnapshot(command.ShowOne):
|
|
|
202
217
|
This command requires ``--os-volume-api-version`` 3.14 or greater.
|
|
203
218
|
"""
|
|
204
219
|
|
|
205
|
-
def get_parser(self, prog_name):
|
|
220
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
206
221
|
parser = super().get_parser(prog_name)
|
|
207
222
|
parser.add_argument(
|
|
208
223
|
'snapshot',
|
|
@@ -211,8 +226,12 @@ class ShowVolumeGroupSnapshot(command.ShowOne):
|
|
|
211
226
|
)
|
|
212
227
|
return parser
|
|
213
228
|
|
|
214
|
-
def take_action(
|
|
215
|
-
|
|
229
|
+
def take_action(
|
|
230
|
+
self, parsed_args: argparse.Namespace
|
|
231
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
232
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
233
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
234
|
+
)
|
|
216
235
|
|
|
217
236
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
218
237
|
msg = _(
|