python-openstackclient 9.0.0__py3-none-any.whl → 10.1.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 +59 -43
- 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 +36 -34
- openstackclient/common/pagination.py +50 -6
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +11 -6
- openstackclient/common/quota.py +105 -103
- 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 +42 -22
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +16 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +35 -16
- openstackclient/compute/v2/server.py +268 -179
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +28 -12
- openstackclient/compute/v2/server_group.py +23 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +27 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +13 -5
- openstackclient/compute/v2/service.py +17 -8
- openstackclient/compute/v2/usage.py +28 -23
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +82 -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 +32 -12
- openstackclient/identity/v3/application_credential.py +66 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +39 -17
- openstackclient/identity/v3/domain.py +40 -19
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +98 -64
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +44 -20
- openstackclient/identity/v3/group.py +64 -40
- openstackclient/identity/v3/identity_provider.py +95 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +42 -17
- openstackclient/identity/v3/mapping.py +58 -28
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +59 -26
- openstackclient/identity/v3/region.py +39 -17
- openstackclient/identity/v3/registered_limit.py +41 -16
- openstackclient/identity/v3/role.py +62 -31
- openstackclient/identity/v3/role_assignment.py +25 -7
- openstackclient/identity/v3/service.py +39 -17
- openstackclient/identity/v3/service_provider.py +40 -16
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +39 -18
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +86 -36
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +16 -11
- openstackclient/image/v2/image.py +88 -56
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +117 -20
- openstackclient/image/v2/metadef_objects.py +32 -19
- openstackclient/image/v2/metadef_properties.py +30 -16
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +25 -27
- 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 +27 -54
- openstackclient/network/v2/address_group.py +39 -16
- openstackclient/network/v2/address_scope.py +36 -20
- openstackclient/network/v2/bgpvpn/bgpvpn.py +477 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +226 -0
- openstackclient/network/v2/bgpvpn/port_association.py +504 -0
- openstackclient/network/v2/bgpvpn/router_association.py +301 -0
- openstackclient/network/v2/default_security_group_rule.py +31 -14
- openstackclient/network/v2/floating_ip.py +121 -162
- openstackclient/network/v2/floating_ip_port_forwarding.py +41 -19
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +499 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +610 -0
- openstackclient/network/v2/ip_availability.py +25 -8
- openstackclient/network/v2/l3_conntrack_helper.py +35 -13
- openstackclient/network/v2/local_ip.py +27 -13
- openstackclient/network/v2/local_ip_association.py +17 -7
- openstackclient/network/v2/ndp_proxy.py +23 -11
- openstackclient/network/v2/network.py +213 -213
- openstackclient/network/v2/network_agent.py +77 -34
- openstackclient/network/v2/network_auto_allocated_topology.py +27 -15
- openstackclient/network/v2/network_flavor.py +45 -21
- openstackclient/network/v2/network_flavor_profile.py +42 -17
- openstackclient/network/v2/network_meter.py +39 -15
- openstackclient/network/v2/network_meter_rule.py +40 -12
- openstackclient/network/v2/network_qos_policy.py +39 -21
- openstackclient/network/v2/network_qos_rule.py +48 -18
- openstackclient/network/v2/network_qos_rule_type.py +28 -9
- openstackclient/network/v2/network_rbac.py +34 -16
- openstackclient/network/v2/network_segment.py +32 -11
- openstackclient/network/v2/network_segment_range.py +70 -31
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +41 -22
- openstackclient/network/v2/port.py +141 -40
- openstackclient/network/v2/router.py +101 -67
- openstackclient/network/v2/security_group.py +97 -198
- openstackclient/network/v2/security_group_rule.py +115 -282
- openstackclient/network/v2/subnet.py +63 -34
- openstackclient/network/v2/subnet_pool.py +42 -24
- openstackclient/network/v2/taas/tap_flow.py +35 -14
- openstackclient/network/v2/taas/tap_mirror.py +28 -14
- openstackclient/network/v2/taas/tap_service.py +26 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +28 -16
- openstackclient/object/v1/object.py +28 -16
- 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 +59 -19
- openstackclient/tests/functional/identity/v3/test_application_credential.py +1 -1
- 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_mapping.py +81 -0
- 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_group.py +163 -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_limits.py +1 -1
- openstackclient/tests/unit/common/test_module.py +82 -44
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +15 -26
- openstackclient/tests/unit/compute/v2/fakes.py +26 -57
- openstackclient/tests/unit/compute/v2/test_agent.py +4 -4
- openstackclient/tests/unit/compute/v2/test_aggregate.py +1 -1
- openstackclient/tests/unit/compute/v2/test_console.py +2 -2
- openstackclient/tests/unit/compute/v2/test_console_connection.py +1 -1
- openstackclient/tests/unit/compute/v2/test_flavor.py +29 -3
- openstackclient/tests/unit/compute/v2/test_host.py +3 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +2 -2
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +7 -7
- openstackclient/tests/unit/compute/v2/test_server.py +26 -111
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_group.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_image.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/compute/v2/test_server_volume.py +2 -2
- openstackclient/tests/unit/compute/v2/test_service.py +3 -3
- openstackclient/tests/unit/compute/v2/test_usage.py +1 -1
- openstackclient/tests/unit/identity/v2_0/fakes.py +3 -7
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_project.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_service.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_token.py +2 -2
- openstackclient/tests/unit/identity/v2_0/test_user.py +1 -1
- openstackclient/tests/unit/identity/v3/fakes.py +8 -38
- openstackclient/tests/unit/identity/v3/test_access_rule.py +3 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +4 -4
- openstackclient/tests/unit/identity/v3/test_credential.py +5 -5
- openstackclient/tests/unit/identity/v3/test_domain.py +5 -5
- openstackclient/tests/unit/identity/v3/test_endpoint.py +6 -6
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +12 -22
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_implied_role.py +1 -1
- openstackclient/tests/unit/identity/v3/test_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_mappings.py +163 -79
- openstackclient/tests/unit/identity/v3/test_project.py +28 -5
- openstackclient/tests/unit/identity/v3/test_protocol.py +3 -3
- openstackclient/tests/unit/identity/v3/test_region.py +5 -5
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_role.py +8 -8
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v3/test_service.py +5 -5
- openstackclient/tests/unit/identity/v3/test_token.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +77 -10
- 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/fakes.py +5 -77
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +923 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +1005 -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 +26 -2
- openstackclient/tests/unit/network/v2/test_address_scope.py +24 -0
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +27 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +37 -13
- openstackclient/tests/unit/network/v2/test_ip_availability.py +25 -0
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +29 -3
- openstackclient/tests/unit/network/v2/test_network.py +74 -12
- openstackclient/tests/unit/network/v2/test_network_agent.py +58 -5
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +26 -2
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_meter.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_rbac.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +31 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_port.py +166 -0
- openstackclient/tests/unit/network/v2/test_router.py +36 -16
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +11 -8
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +28 -37
- openstackclient/tests/unit/network/v2/test_subnet.py +30 -5
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +26 -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 +21 -140
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +8 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +205 -100
- openstackclient/tests/unit/volume/v3/test_backup_record.py +114 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group.py +720 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group_snapshot.py +354 -0
- openstackclient/tests/unit/volume/v3/test_qos_specs.py +455 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -1
- openstackclient/tests/unit/volume/v3/test_volume_backend.py +158 -0
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +65 -0
- openstackclient/tests/unit/volume/v3/test_volume_host.py +115 -0
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +61 -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 +60 -30
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -23
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +49 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/backup_record.py +94 -0
- 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/consistency_group.py +400 -0
- openstackclient/volume/v3/consistency_group_snapshot.py +225 -0
- openstackclient/volume/v3/qos_specs.py +389 -0
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +92 -40
- openstackclient/volume/v3/volume_attachment.py +47 -21
- openstackclient/volume/v3/volume_backend.py +130 -0
- openstackclient/volume/v3/volume_backup.py +55 -27
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +34 -17
- openstackclient/volume/v3/volume_group_type.py +27 -14
- openstackclient/volume/v3/volume_host.py +74 -0
- openstackclient/volume/v3/volume_message.py +18 -8
- openstackclient/volume/v3/volume_snapshot.py +70 -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.1.0.dist-info}/METADATA +7 -8
- python_openstackclient-10.1.0.dist-info/RECORD +524 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/entry_points.txt +77 -25
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.1.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/RECORD +0 -499
- 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.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/top_level.txt +0 -0
|
@@ -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',
|
|
@@ -377,6 +394,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
377
394
|
all_tenants=all_tenants,
|
|
378
395
|
marker=marker_backup_id,
|
|
379
396
|
limit=parsed_args.limit,
|
|
397
|
+
max_items=parsed_args.max_items,
|
|
380
398
|
project_id=project_id,
|
|
381
399
|
)
|
|
382
400
|
|
|
@@ -396,7 +414,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
396
414
|
class RestoreVolumeBackup(command.ShowOne):
|
|
397
415
|
_description = _("Restore volume backup")
|
|
398
416
|
|
|
399
|
-
def get_parser(self, prog_name):
|
|
417
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
400
418
|
parser = super().get_parser(prog_name)
|
|
401
419
|
parser.add_argument(
|
|
402
420
|
"backup",
|
|
@@ -422,8 +440,12 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
422
440
|
)
|
|
423
441
|
return parser
|
|
424
442
|
|
|
425
|
-
def take_action(
|
|
426
|
-
|
|
443
|
+
def take_action(
|
|
444
|
+
self, parsed_args: argparse.Namespace
|
|
445
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
446
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
447
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
448
|
+
)
|
|
427
449
|
|
|
428
450
|
columns: tuple[str, ...] = (
|
|
429
451
|
'id',
|
|
@@ -456,9 +478,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
456
478
|
raise exceptions.CommandError(msg % parsed_args.volume)
|
|
457
479
|
|
|
458
480
|
restore = volume_client.restore_backup(
|
|
459
|
-
backup.id,
|
|
460
|
-
volume_id=volume_id,
|
|
461
|
-
name=volume_name,
|
|
481
|
+
backup.id, volume=volume_id, name=volume_name
|
|
462
482
|
)
|
|
463
483
|
|
|
464
484
|
data = utils.get_dict_properties(restore, columns)
|
|
@@ -468,7 +488,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
468
488
|
class SetVolumeBackup(command.Command):
|
|
469
489
|
_description = _("Set volume backup properties")
|
|
470
490
|
|
|
471
|
-
def get_parser(self, prog_name):
|
|
491
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
472
492
|
parser = super().get_parser(prog_name)
|
|
473
493
|
parser.add_argument(
|
|
474
494
|
"backup",
|
|
@@ -525,8 +545,10 @@ class SetVolumeBackup(command.Command):
|
|
|
525
545
|
)
|
|
526
546
|
return parser
|
|
527
547
|
|
|
528
|
-
def take_action(self, parsed_args):
|
|
529
|
-
volume_client =
|
|
548
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
549
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
550
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
551
|
+
)
|
|
530
552
|
|
|
531
553
|
backup = volume_client.find_backup(
|
|
532
554
|
parsed_args.backup,
|
|
@@ -608,7 +630,7 @@ class UnsetVolumeBackup(command.Command):
|
|
|
608
630
|
This command requires ``--os-volume-api-version`` 3.43 or greater.
|
|
609
631
|
"""
|
|
610
632
|
|
|
611
|
-
def get_parser(self, prog_name):
|
|
633
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
612
634
|
parser = super().get_parser(prog_name)
|
|
613
635
|
parser.add_argument(
|
|
614
636
|
'backup',
|
|
@@ -627,8 +649,10 @@ class UnsetVolumeBackup(command.Command):
|
|
|
627
649
|
)
|
|
628
650
|
return parser
|
|
629
651
|
|
|
630
|
-
def take_action(self, parsed_args):
|
|
631
|
-
volume_client =
|
|
652
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
653
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
654
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
655
|
+
)
|
|
632
656
|
|
|
633
657
|
if not sdk_utils.supports_microversion(volume_client, '3.43'):
|
|
634
658
|
msg = _(
|
|
@@ -660,7 +684,7 @@ class UnsetVolumeBackup(command.Command):
|
|
|
660
684
|
class ShowVolumeBackup(command.ShowOne):
|
|
661
685
|
_description = _("Display volume backup details")
|
|
662
686
|
|
|
663
|
-
def get_parser(self, prog_name):
|
|
687
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
664
688
|
parser = super().get_parser(prog_name)
|
|
665
689
|
parser.add_argument(
|
|
666
690
|
"backup",
|
|
@@ -669,8 +693,12 @@ class ShowVolumeBackup(command.ShowOne):
|
|
|
669
693
|
)
|
|
670
694
|
return parser
|
|
671
695
|
|
|
672
|
-
def take_action(
|
|
673
|
-
|
|
696
|
+
def take_action(
|
|
697
|
+
self, parsed_args: argparse.Namespace
|
|
698
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
699
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
700
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
701
|
+
)
|
|
674
702
|
backup = volume_client.find_backup(
|
|
675
703
|
parsed_args.backup, ignore_missing=False
|
|
676
704
|
)
|
|
@@ -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,8 +10,12 @@
|
|
|
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
|
|
|
18
|
+
from openstack.block_storage.v3 import group_snapshot as _group_snapshot
|
|
15
19
|
from openstack import utils as sdk_utils
|
|
16
20
|
from osc_lib import exceptions
|
|
17
21
|
from osc_lib import utils
|
|
@@ -23,7 +27,9 @@ from openstackclient.i18n import _
|
|
|
23
27
|
LOG = logging.getLogger(__name__)
|
|
24
28
|
|
|
25
29
|
|
|
26
|
-
def _format_group_snapshot(
|
|
30
|
+
def _format_group_snapshot(
|
|
31
|
+
snapshot: _group_snapshot.GroupSnapshot,
|
|
32
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
27
33
|
columns = (
|
|
28
34
|
'id',
|
|
29
35
|
'status',
|
|
@@ -43,10 +49,7 @@ def _format_group_snapshot(snapshot):
|
|
|
43
49
|
|
|
44
50
|
return (
|
|
45
51
|
column_headers,
|
|
46
|
-
utils.get_item_properties(
|
|
47
|
-
snapshot,
|
|
48
|
-
columns,
|
|
49
|
-
),
|
|
52
|
+
utils.get_item_properties(snapshot, columns),
|
|
50
53
|
)
|
|
51
54
|
|
|
52
55
|
|
|
@@ -56,7 +59,7 @@ class CreateVolumeGroupSnapshot(command.ShowOne):
|
|
|
56
59
|
This command requires ``--os-volume-api-version`` 3.13 or greater.
|
|
57
60
|
"""
|
|
58
61
|
|
|
59
|
-
def get_parser(self, prog_name):
|
|
62
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
60
63
|
parser = super().get_parser(prog_name)
|
|
61
64
|
parser.add_argument(
|
|
62
65
|
'volume_group',
|
|
@@ -75,8 +78,12 @@ class CreateVolumeGroupSnapshot(command.ShowOne):
|
|
|
75
78
|
)
|
|
76
79
|
return parser
|
|
77
80
|
|
|
78
|
-
def take_action(
|
|
79
|
-
|
|
81
|
+
def take_action(
|
|
82
|
+
self, parsed_args: argparse.Namespace
|
|
83
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
84
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
85
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
86
|
+
)
|
|
80
87
|
|
|
81
88
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
82
89
|
msg = _(
|
|
@@ -106,7 +113,7 @@ class DeleteVolumeGroupSnapshot(command.Command):
|
|
|
106
113
|
This command requires ``--os-volume-api-version`` 3.14 or greater.
|
|
107
114
|
"""
|
|
108
115
|
|
|
109
|
-
def get_parser(self, prog_name):
|
|
116
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
110
117
|
parser = super().get_parser(prog_name)
|
|
111
118
|
parser.add_argument(
|
|
112
119
|
'snapshot',
|
|
@@ -115,8 +122,10 @@ class DeleteVolumeGroupSnapshot(command.Command):
|
|
|
115
122
|
)
|
|
116
123
|
return parser
|
|
117
124
|
|
|
118
|
-
def take_action(self, parsed_args):
|
|
119
|
-
volume_client =
|
|
125
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
126
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
127
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
128
|
+
)
|
|
120
129
|
|
|
121
130
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
122
131
|
msg = _(
|
|
@@ -140,7 +149,7 @@ class ListVolumeGroupSnapshot(command.Lister):
|
|
|
140
149
|
This command requires ``--os-volume-api-version`` 3.14 or greater.
|
|
141
150
|
"""
|
|
142
151
|
|
|
143
|
-
def get_parser(self, prog_name):
|
|
152
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
144
153
|
parser = super().get_parser(prog_name)
|
|
145
154
|
parser.add_argument(
|
|
146
155
|
'--all-projects',
|
|
@@ -165,8 +174,12 @@ class ListVolumeGroupSnapshot(command.Lister):
|
|
|
165
174
|
# )
|
|
166
175
|
return parser
|
|
167
176
|
|
|
168
|
-
def take_action(
|
|
169
|
-
|
|
177
|
+
def take_action(
|
|
178
|
+
self, parsed_args: argparse.Namespace
|
|
179
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
180
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
181
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
182
|
+
)
|
|
170
183
|
|
|
171
184
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
172
185
|
msg = _(
|
|
@@ -202,7 +215,7 @@ class ShowVolumeGroupSnapshot(command.ShowOne):
|
|
|
202
215
|
This command requires ``--os-volume-api-version`` 3.14 or greater.
|
|
203
216
|
"""
|
|
204
217
|
|
|
205
|
-
def get_parser(self, prog_name):
|
|
218
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
206
219
|
parser = super().get_parser(prog_name)
|
|
207
220
|
parser.add_argument(
|
|
208
221
|
'snapshot',
|
|
@@ -211,8 +224,12 @@ class ShowVolumeGroupSnapshot(command.ShowOne):
|
|
|
211
224
|
)
|
|
212
225
|
return parser
|
|
213
226
|
|
|
214
|
-
def take_action(
|
|
215
|
-
|
|
227
|
+
def take_action(
|
|
228
|
+
self, parsed_args: argparse.Namespace
|
|
229
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
230
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
231
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
232
|
+
)
|
|
216
233
|
|
|
217
234
|
if not sdk_utils.supports_microversion(volume_client, '3.14'):
|
|
218
235
|
msg = _(
|
|
@@ -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'):
|
|
@@ -399,7 +412,7 @@ class ShowVolumeGroupType(command.ShowOne):
|
|
|
399
412
|
|
|
400
413
|
group_type = utils.find_resource(
|
|
401
414
|
volume_client.group_types,
|
|
402
|
-
parsed_args.
|
|
415
|
+
parsed_args.group_type,
|
|
403
416
|
)
|
|
404
417
|
|
|
405
418
|
return _format_group_type(group_type)
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
3
|
+
# not use this file except in compliance with the License. You may obtain
|
|
4
|
+
# a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
+
# License for the specific language governing permissions and limitations
|
|
12
|
+
# under the License.
|
|
13
|
+
|
|
14
|
+
"""Volume v3 host action implementations"""
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
|
|
18
|
+
from openstackclient import command
|
|
19
|
+
from openstackclient.i18n import _
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class FailoverVolumeHost(command.Command):
|
|
23
|
+
_description = _("Failover volume host to different backend")
|
|
24
|
+
|
|
25
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
26
|
+
parser = super().get_parser(prog_name)
|
|
27
|
+
parser.add_argument(
|
|
28
|
+
"host", metavar="<host-name>", help=_("Name of volume host")
|
|
29
|
+
)
|
|
30
|
+
parser.add_argument(
|
|
31
|
+
"--volume-backend",
|
|
32
|
+
metavar="<backend-id>",
|
|
33
|
+
required=True,
|
|
34
|
+
help=_(
|
|
35
|
+
"The ID of the volume backend replication "
|
|
36
|
+
"target where the host will failover to (required)"
|
|
37
|
+
),
|
|
38
|
+
)
|
|
39
|
+
return parser
|
|
40
|
+
|
|
41
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
42
|
+
service_client = self.app.client_manager.volume
|
|
43
|
+
service_client.services.failover_host(
|
|
44
|
+
parsed_args.host, parsed_args.volume_backend
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class SetVolumeHost(command.Command):
|
|
49
|
+
_description = _("Set volume host properties")
|
|
50
|
+
|
|
51
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
52
|
+
parser = super().get_parser(prog_name)
|
|
53
|
+
parser.add_argument(
|
|
54
|
+
"host", metavar="<host-name>", help=_("Name of volume host")
|
|
55
|
+
)
|
|
56
|
+
enabled_group = parser.add_mutually_exclusive_group()
|
|
57
|
+
enabled_group.add_argument(
|
|
58
|
+
"--disable",
|
|
59
|
+
action="store_true",
|
|
60
|
+
help=_("Freeze and disable the specified volume host"),
|
|
61
|
+
)
|
|
62
|
+
enabled_group.add_argument(
|
|
63
|
+
"--enable",
|
|
64
|
+
action="store_true",
|
|
65
|
+
help=_("Thaw and enable the specified volume host"),
|
|
66
|
+
)
|
|
67
|
+
return parser
|
|
68
|
+
|
|
69
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
70
|
+
service_client = self.app.client_manager.volume
|
|
71
|
+
if parsed_args.enable:
|
|
72
|
+
service_client.services.thaw_host(parsed_args.host)
|
|
73
|
+
if parsed_args.disable:
|
|
74
|
+
service_client.services.freeze_host(parsed_args.host)
|