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
|
@@ -18,11 +18,13 @@ import argparse
|
|
|
18
18
|
import copy
|
|
19
19
|
import functools
|
|
20
20
|
import logging
|
|
21
|
-
import
|
|
21
|
+
from collections.abc import Iterable, Sequence
|
|
22
|
+
from typing import Any
|
|
22
23
|
|
|
23
24
|
from cliff import columns as cliff_columns
|
|
24
25
|
from openstack.block_storage.v2 import volume as _volume
|
|
25
26
|
from openstack import exceptions as sdk_exceptions
|
|
27
|
+
from openstack import utils as sdk_utils
|
|
26
28
|
from osc_lib.cli import format_columns
|
|
27
29
|
from osc_lib.cli import parseractions
|
|
28
30
|
from osc_lib import exceptions
|
|
@@ -43,14 +45,20 @@ class KeyValueHintAction(argparse.Action):
|
|
|
43
45
|
|
|
44
46
|
APPEND_KEYS = ('same_host', 'different_host')
|
|
45
47
|
|
|
46
|
-
def __init__(self, *args, **kwargs):
|
|
48
|
+
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
47
49
|
self._key_value_action = parseractions.KeyValueAction(*args, **kwargs)
|
|
48
50
|
self._key_value_append_action = parseractions.KeyValueAppendAction(
|
|
49
51
|
*args, **kwargs
|
|
50
52
|
)
|
|
51
53
|
super().__init__(*args, **kwargs)
|
|
52
54
|
|
|
53
|
-
def __call__(
|
|
55
|
+
def __call__(
|
|
56
|
+
self,
|
|
57
|
+
parser: argparse.ArgumentParser,
|
|
58
|
+
namespace: argparse.Namespace,
|
|
59
|
+
values: Any,
|
|
60
|
+
option_string: str | None = None,
|
|
61
|
+
) -> None:
|
|
54
62
|
if values.startswith(self.APPEND_KEYS):
|
|
55
63
|
self._key_value_append_action(
|
|
56
64
|
parser, namespace, values, option_string=option_string
|
|
@@ -61,7 +69,7 @@ class KeyValueHintAction(argparse.Action):
|
|
|
61
69
|
)
|
|
62
70
|
|
|
63
71
|
|
|
64
|
-
class AttachmentsColumn(cliff_columns.FormattableColumn[list[
|
|
72
|
+
class AttachmentsColumn(cliff_columns.FormattableColumn[list[Any]]):
|
|
65
73
|
"""Formattable column for attachments column.
|
|
66
74
|
|
|
67
75
|
Unlike the parent FormattableColumn class, the initializer of the
|
|
@@ -72,11 +80,13 @@ class AttachmentsColumn(cliff_columns.FormattableColumn[list[ty.Any]]):
|
|
|
72
80
|
``functools.partial(AttachmentsColumn, server_cache)``.
|
|
73
81
|
"""
|
|
74
82
|
|
|
75
|
-
def __init__(
|
|
83
|
+
def __init__(
|
|
84
|
+
self, value: list[Any], server_cache: dict[str, Any] | None = None
|
|
85
|
+
) -> None:
|
|
76
86
|
super().__init__(value)
|
|
77
87
|
self._server_cache = server_cache or {}
|
|
78
88
|
|
|
79
|
-
def human_readable(self):
|
|
89
|
+
def human_readable(self) -> str:
|
|
80
90
|
"""Return a formatted string of a volume's attached instances
|
|
81
91
|
|
|
82
92
|
:rtype: a string of formatted instances
|
|
@@ -92,7 +102,7 @@ class AttachmentsColumn(cliff_columns.FormattableColumn[list[ty.Any]]):
|
|
|
92
102
|
return msg
|
|
93
103
|
|
|
94
104
|
|
|
95
|
-
def _format_volume(volume: _volume.Volume) -> dict[str,
|
|
105
|
+
def _format_volume(volume: _volume.Volume) -> dict[str, object]:
|
|
96
106
|
# Some columns returned by openstacksdk should not be shown because they're
|
|
97
107
|
# either irrelevant or duplicates
|
|
98
108
|
ignored_columns = {
|
|
@@ -137,7 +147,7 @@ class CreateVolume(command.ShowOne):
|
|
|
137
147
|
_description = _("Create new volume")
|
|
138
148
|
|
|
139
149
|
@staticmethod
|
|
140
|
-
def _check_size_arg(args):
|
|
150
|
+
def _check_size_arg(args: argparse.Namespace) -> None:
|
|
141
151
|
"""Check whether --size option is required or not.
|
|
142
152
|
|
|
143
153
|
Require size parameter only in case when snapshot or source
|
|
@@ -151,7 +161,7 @@ class CreateVolume(command.ShowOne):
|
|
|
151
161
|
)
|
|
152
162
|
raise exceptions.CommandError(msg)
|
|
153
163
|
|
|
154
|
-
def get_parser(self, prog_name):
|
|
164
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
155
165
|
parser = super().get_parser(prog_name)
|
|
156
166
|
parser.add_argument(
|
|
157
167
|
"name",
|
|
@@ -262,7 +272,9 @@ class CreateVolume(command.ShowOne):
|
|
|
262
272
|
)
|
|
263
273
|
return parser
|
|
264
274
|
|
|
265
|
-
def take_action(
|
|
275
|
+
def take_action(
|
|
276
|
+
self, parsed_args: argparse.Namespace
|
|
277
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
266
278
|
self._check_size_arg(parsed_args)
|
|
267
279
|
# size is validated in the above call to
|
|
268
280
|
# _check_size_arg where we check that size
|
|
@@ -270,7 +282,9 @@ class CreateVolume(command.ShowOne):
|
|
|
270
282
|
# volume from snapshot or source volume
|
|
271
283
|
size = parsed_args.size
|
|
272
284
|
|
|
273
|
-
volume_client =
|
|
285
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
286
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
287
|
+
)
|
|
274
288
|
image_client = self.app.client_manager.image
|
|
275
289
|
|
|
276
290
|
source_volume = None
|
|
@@ -366,13 +380,14 @@ class CreateVolume(command.ShowOne):
|
|
|
366
380
|
)
|
|
367
381
|
|
|
368
382
|
data = _format_volume(volume)
|
|
369
|
-
|
|
383
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
384
|
+
return col_headers, col_data
|
|
370
385
|
|
|
371
386
|
|
|
372
387
|
class DeleteVolume(command.Command):
|
|
373
388
|
_description = _("Delete volume(s)")
|
|
374
389
|
|
|
375
|
-
def get_parser(self, prog_name):
|
|
390
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
376
391
|
parser = super().get_parser(prog_name)
|
|
377
392
|
parser.add_argument(
|
|
378
393
|
"volumes",
|
|
@@ -405,8 +420,10 @@ class DeleteVolume(command.Command):
|
|
|
405
420
|
)
|
|
406
421
|
return parser
|
|
407
422
|
|
|
408
|
-
def take_action(self, parsed_args):
|
|
409
|
-
volume_client =
|
|
423
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
424
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
425
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
426
|
+
)
|
|
410
427
|
result = 0
|
|
411
428
|
|
|
412
429
|
for volume in parsed_args.volumes:
|
|
@@ -441,7 +458,7 @@ class DeleteVolume(command.Command):
|
|
|
441
458
|
class ListVolume(command.Lister):
|
|
442
459
|
_description = _("List volumes")
|
|
443
460
|
|
|
444
|
-
def get_parser(self, prog_name):
|
|
461
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
445
462
|
parser = super().get_parser(prog_name)
|
|
446
463
|
parser.add_argument(
|
|
447
464
|
'--project',
|
|
@@ -477,10 +494,14 @@ class ListVolume(command.Lister):
|
|
|
477
494
|
default=False,
|
|
478
495
|
help=_('List additional fields in output'),
|
|
479
496
|
)
|
|
480
|
-
pagination.add_marker_pagination_option_to_parser(
|
|
497
|
+
pagination.add_marker_pagination_option_to_parser(
|
|
498
|
+
parser, include_max_items=False
|
|
499
|
+
)
|
|
481
500
|
return parser
|
|
482
501
|
|
|
483
|
-
def take_action(
|
|
502
|
+
def take_action(
|
|
503
|
+
self, parsed_args: argparse.Namespace
|
|
504
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
484
505
|
volume_client = self.app.client_manager.volume
|
|
485
506
|
identity_client = self.app.client_manager.identity
|
|
486
507
|
|
|
@@ -555,7 +576,7 @@ class ListVolume(command.Lister):
|
|
|
555
576
|
compute_client = self.app.client_manager.compute
|
|
556
577
|
for s in compute_client.servers():
|
|
557
578
|
server_cache[s.id] = s
|
|
558
|
-
except sdk_exceptions.SDKException:
|
|
579
|
+
except sdk_exceptions.SDKException:
|
|
559
580
|
# Just forget it if there's any trouble
|
|
560
581
|
pass
|
|
561
582
|
AttachmentsColumnWithCache = functools.partial(
|
|
@@ -585,7 +606,7 @@ class ListVolume(command.Lister):
|
|
|
585
606
|
class MigrateVolume(command.Command):
|
|
586
607
|
_description = _("Migrate volume to a new host")
|
|
587
608
|
|
|
588
|
-
def get_parser(self, prog_name):
|
|
609
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
589
610
|
parser = super().get_parser(prog_name)
|
|
590
611
|
parser.add_argument(
|
|
591
612
|
'volume',
|
|
@@ -619,8 +640,11 @@ class MigrateVolume(command.Command):
|
|
|
619
640
|
)
|
|
620
641
|
return parser
|
|
621
642
|
|
|
622
|
-
def take_action(self, parsed_args):
|
|
623
|
-
volume_client =
|
|
643
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
644
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
645
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
646
|
+
)
|
|
647
|
+
|
|
624
648
|
volume = volume_client.find_volume(
|
|
625
649
|
parsed_args.volume, ignore_missing=False
|
|
626
650
|
)
|
|
@@ -635,7 +659,7 @@ class MigrateVolume(command.Command):
|
|
|
635
659
|
class SetVolume(command.Command):
|
|
636
660
|
_description = _("Set volume properties")
|
|
637
661
|
|
|
638
|
-
def get_parser(self, prog_name):
|
|
662
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
639
663
|
parser = super().get_parser(prog_name)
|
|
640
664
|
parser.add_argument(
|
|
641
665
|
'volume',
|
|
@@ -788,7 +812,7 @@ class SetVolume(command.Command):
|
|
|
788
812
|
)
|
|
789
813
|
return parser
|
|
790
814
|
|
|
791
|
-
def take_action(self, parsed_args):
|
|
815
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
792
816
|
volume_client = self.app.client_manager.volume
|
|
793
817
|
volume = utils.find_resource(volume_client.volumes, parsed_args.volume)
|
|
794
818
|
|
|
@@ -952,7 +976,7 @@ class SetVolume(command.Command):
|
|
|
952
976
|
class ShowVolume(command.ShowOne):
|
|
953
977
|
_description = _("Display volume details")
|
|
954
978
|
|
|
955
|
-
def get_parser(self, prog_name):
|
|
979
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
956
980
|
parser = super().get_parser(prog_name)
|
|
957
981
|
parser.add_argument(
|
|
958
982
|
'volume',
|
|
@@ -961,20 +985,26 @@ class ShowVolume(command.ShowOne):
|
|
|
961
985
|
)
|
|
962
986
|
return parser
|
|
963
987
|
|
|
964
|
-
def take_action(
|
|
965
|
-
|
|
988
|
+
def take_action(
|
|
989
|
+
self, parsed_args: argparse.Namespace
|
|
990
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
991
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
992
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
993
|
+
)
|
|
994
|
+
|
|
966
995
|
volume = volume_client.find_volume(
|
|
967
996
|
parsed_args.volume, ignore_missing=False
|
|
968
997
|
)
|
|
969
998
|
|
|
970
999
|
data = _format_volume(volume)
|
|
971
|
-
|
|
1000
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
1001
|
+
return col_headers, col_data
|
|
972
1002
|
|
|
973
1003
|
|
|
974
1004
|
class UnsetVolume(command.Command):
|
|
975
1005
|
_description = _("Unset volume properties")
|
|
976
1006
|
|
|
977
|
-
def get_parser(self, prog_name):
|
|
1007
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
978
1008
|
parser = super().get_parser(prog_name)
|
|
979
1009
|
parser.add_argument(
|
|
980
1010
|
'volume',
|
|
@@ -1003,7 +1033,7 @@ class UnsetVolume(command.Command):
|
|
|
1003
1033
|
)
|
|
1004
1034
|
return parser
|
|
1005
1035
|
|
|
1006
|
-
def take_action(self, parsed_args):
|
|
1036
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
1007
1037
|
volume_client = self.app.client_manager.volume
|
|
1008
1038
|
volume = utils.find_resource(volume_client.volumes, parsed_args.volume)
|
|
1009
1039
|
|
|
@@ -14,6 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
"""Storage backend action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
21
|
+
from openstack import utils as sdk_utils
|
|
17
22
|
from osc_lib.cli import format_columns
|
|
18
23
|
from osc_lib import utils
|
|
19
24
|
|
|
@@ -24,7 +29,7 @@ from openstackclient.i18n import _
|
|
|
24
29
|
class ShowCapability(command.Lister):
|
|
25
30
|
_description = _("Show capability command")
|
|
26
31
|
|
|
27
|
-
def get_parser(self, prog_name):
|
|
32
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
28
33
|
parser = super().get_parser(prog_name)
|
|
29
34
|
parser.add_argument(
|
|
30
35
|
"host",
|
|
@@ -33,8 +38,12 @@ class ShowCapability(command.Lister):
|
|
|
33
38
|
)
|
|
34
39
|
return parser
|
|
35
40
|
|
|
36
|
-
def take_action(
|
|
37
|
-
|
|
41
|
+
def take_action(
|
|
42
|
+
self, parsed_args: argparse.Namespace
|
|
43
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
44
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
45
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
46
|
+
)
|
|
38
47
|
|
|
39
48
|
columns = [
|
|
40
49
|
'Title',
|
|
@@ -71,7 +80,7 @@ class ShowCapability(command.Lister):
|
|
|
71
80
|
class ListPool(command.Lister):
|
|
72
81
|
_description = _("List pool command")
|
|
73
82
|
|
|
74
|
-
def get_parser(self, prog_name):
|
|
83
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
75
84
|
parser = super().get_parser(prog_name)
|
|
76
85
|
parser.add_argument(
|
|
77
86
|
"--long",
|
|
@@ -83,8 +92,12 @@ class ListPool(command.Lister):
|
|
|
83
92
|
# able to pass in --filters with a <key>=<value> pair to filter on.
|
|
84
93
|
return parser
|
|
85
94
|
|
|
86
|
-
def take_action(
|
|
87
|
-
|
|
95
|
+
def take_action(
|
|
96
|
+
self, parsed_args: argparse.Namespace
|
|
97
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
98
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
99
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
100
|
+
)
|
|
88
101
|
|
|
89
102
|
if parsed_args.long:
|
|
90
103
|
columns = [
|
|
@@ -14,10 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v2 Backup action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
17
18
|
import functools
|
|
18
19
|
import logging
|
|
20
|
+
from collections.abc import Iterable, Sequence
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from cliff import columns as cliff_columns
|
|
24
|
+
from openstack import utils as sdk_utils
|
|
21
25
|
from osc_lib import exceptions
|
|
22
26
|
from osc_lib import utils
|
|
23
27
|
|
|
@@ -39,11 +43,13 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
39
43
|
``functools.partial(VolumeIdColumn, volume_cache)``.
|
|
40
44
|
"""
|
|
41
45
|
|
|
42
|
-
def __init__(
|
|
46
|
+
def __init__(
|
|
47
|
+
self, value: str, volume_cache: dict[str, Any] | None = None
|
|
48
|
+
) -> None:
|
|
43
49
|
super().__init__(value)
|
|
44
50
|
self._volume_cache = volume_cache or {}
|
|
45
51
|
|
|
46
|
-
def human_readable(self):
|
|
52
|
+
def human_readable(self) -> str:
|
|
47
53
|
"""Return a volume name if available
|
|
48
54
|
|
|
49
55
|
:rtype: either the volume ID or name
|
|
@@ -58,7 +64,7 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
58
64
|
class CreateVolumeBackup(command.ShowOne):
|
|
59
65
|
_description = _("Create new volume backup")
|
|
60
66
|
|
|
61
|
-
def get_parser(self, prog_name):
|
|
67
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
62
68
|
parser = super().get_parser(prog_name)
|
|
63
69
|
parser.add_argument(
|
|
64
70
|
"volume",
|
|
@@ -102,8 +108,12 @@ class CreateVolumeBackup(command.ShowOne):
|
|
|
102
108
|
)
|
|
103
109
|
return parser
|
|
104
110
|
|
|
105
|
-
def take_action(
|
|
106
|
-
|
|
111
|
+
def take_action(
|
|
112
|
+
self, parsed_args: argparse.Namespace
|
|
113
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
114
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
115
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
116
|
+
)
|
|
107
117
|
|
|
108
118
|
volume_id = volume_client.find_volume(
|
|
109
119
|
parsed_args.volume,
|
|
@@ -139,7 +149,7 @@ class CreateVolumeBackup(command.ShowOne):
|
|
|
139
149
|
class DeleteVolumeBackup(command.Command):
|
|
140
150
|
_description = _("Delete volume backup(s)")
|
|
141
151
|
|
|
142
|
-
def get_parser(self, prog_name):
|
|
152
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
143
153
|
parser = super().get_parser(prog_name)
|
|
144
154
|
parser.add_argument(
|
|
145
155
|
"backups",
|
|
@@ -155,8 +165,10 @@ class DeleteVolumeBackup(command.Command):
|
|
|
155
165
|
)
|
|
156
166
|
return parser
|
|
157
167
|
|
|
158
|
-
def take_action(self, parsed_args):
|
|
159
|
-
volume_client =
|
|
168
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
169
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
170
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
171
|
+
)
|
|
160
172
|
result = 0
|
|
161
173
|
|
|
162
174
|
for backup in parsed_args.backups:
|
|
@@ -191,7 +203,7 @@ class DeleteVolumeBackup(command.Command):
|
|
|
191
203
|
class ListVolumeBackup(command.Lister):
|
|
192
204
|
_description = _("List volume backups")
|
|
193
205
|
|
|
194
|
-
def get_parser(self, prog_name):
|
|
206
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
195
207
|
parser = super().get_parser(prog_name)
|
|
196
208
|
parser.add_argument(
|
|
197
209
|
"--long",
|
|
@@ -237,8 +249,12 @@ class ListVolumeBackup(command.Lister):
|
|
|
237
249
|
)
|
|
238
250
|
return parser
|
|
239
251
|
|
|
240
|
-
def take_action(
|
|
241
|
-
|
|
252
|
+
def take_action(
|
|
253
|
+
self, parsed_args: argparse.Namespace
|
|
254
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
255
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
256
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
257
|
+
)
|
|
242
258
|
|
|
243
259
|
columns: tuple[str, ...] = (
|
|
244
260
|
'id',
|
|
@@ -306,6 +322,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
306
322
|
all_tenants=parsed_args.all_projects,
|
|
307
323
|
marker=marker_backup_id,
|
|
308
324
|
limit=parsed_args.limit,
|
|
325
|
+
max_items=parsed_args.max_items,
|
|
309
326
|
)
|
|
310
327
|
|
|
311
328
|
return (
|
|
@@ -324,7 +341,7 @@ class ListVolumeBackup(command.Lister):
|
|
|
324
341
|
class RestoreVolumeBackup(command.ShowOne):
|
|
325
342
|
_description = _("Restore volume backup")
|
|
326
343
|
|
|
327
|
-
def get_parser(self, prog_name):
|
|
344
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
328
345
|
parser = super().get_parser(prog_name)
|
|
329
346
|
parser.add_argument(
|
|
330
347
|
"backup",
|
|
@@ -350,8 +367,12 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
350
367
|
)
|
|
351
368
|
return parser
|
|
352
369
|
|
|
353
|
-
def take_action(
|
|
354
|
-
|
|
370
|
+
def take_action(
|
|
371
|
+
self, parsed_args: argparse.Namespace
|
|
372
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
373
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
374
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
375
|
+
)
|
|
355
376
|
|
|
356
377
|
backup = volume_client.find_backup(
|
|
357
378
|
parsed_args.backup,
|
|
@@ -384,9 +405,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
384
405
|
raise exceptions.CommandError(msg % parsed_args.volume)
|
|
385
406
|
|
|
386
407
|
restore = volume_client.restore_backup(
|
|
387
|
-
backup.id,
|
|
388
|
-
volume_id=volume_id,
|
|
389
|
-
name=volume_name,
|
|
408
|
+
backup.id, volume=volume_id, name=volume_name
|
|
390
409
|
)
|
|
391
410
|
|
|
392
411
|
data = utils.get_dict_properties(restore, columns)
|
|
@@ -396,7 +415,7 @@ class RestoreVolumeBackup(command.ShowOne):
|
|
|
396
415
|
class SetVolumeBackup(command.Command):
|
|
397
416
|
_description = _("Set volume backup properties")
|
|
398
417
|
|
|
399
|
-
def get_parser(self, prog_name):
|
|
418
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
400
419
|
parser = super().get_parser(prog_name)
|
|
401
420
|
parser.add_argument(
|
|
402
421
|
"backup",
|
|
@@ -416,8 +435,10 @@ class SetVolumeBackup(command.Command):
|
|
|
416
435
|
)
|
|
417
436
|
return parser
|
|
418
437
|
|
|
419
|
-
def take_action(self, parsed_args):
|
|
420
|
-
volume_client =
|
|
438
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
439
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
440
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
441
|
+
)
|
|
421
442
|
|
|
422
443
|
backup = volume_client.find_backup(
|
|
423
444
|
parsed_args.backup,
|
|
@@ -442,7 +463,7 @@ class SetVolumeBackup(command.Command):
|
|
|
442
463
|
class ShowVolumeBackup(command.ShowOne):
|
|
443
464
|
_description = _("Display volume backup details")
|
|
444
465
|
|
|
445
|
-
def get_parser(self, prog_name):
|
|
466
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
446
467
|
parser = super().get_parser(prog_name)
|
|
447
468
|
parser.add_argument(
|
|
448
469
|
"backup",
|
|
@@ -451,8 +472,12 @@ class ShowVolumeBackup(command.ShowOne):
|
|
|
451
472
|
)
|
|
452
473
|
return parser
|
|
453
474
|
|
|
454
|
-
def take_action(
|
|
455
|
-
|
|
475
|
+
def take_action(
|
|
476
|
+
self, parsed_args: argparse.Namespace
|
|
477
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
478
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
479
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
480
|
+
)
|
|
456
481
|
backup = volume_client.find_backup(
|
|
457
482
|
parsed_args.backup, ignore_missing=False
|
|
458
483
|
)
|
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v2 host action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
|
|
17
19
|
from openstackclient import command
|
|
18
20
|
from openstackclient.i18n import _
|
|
19
21
|
|
|
@@ -21,7 +23,7 @@ from openstackclient.i18n import _
|
|
|
21
23
|
class FailoverVolumeHost(command.Command):
|
|
22
24
|
_description = _("Failover volume host to different backend")
|
|
23
25
|
|
|
24
|
-
def get_parser(self, prog_name):
|
|
26
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
25
27
|
parser = super().get_parser(prog_name)
|
|
26
28
|
parser.add_argument(
|
|
27
29
|
"host", metavar="<host-name>", help=_("Name of volume host")
|
|
@@ -37,7 +39,7 @@ class FailoverVolumeHost(command.Command):
|
|
|
37
39
|
)
|
|
38
40
|
return parser
|
|
39
41
|
|
|
40
|
-
def take_action(self, parsed_args):
|
|
42
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
41
43
|
service_client = self.app.client_manager.volume
|
|
42
44
|
service_client.services.failover_host(
|
|
43
45
|
parsed_args.host, parsed_args.volume_backend
|
|
@@ -47,7 +49,7 @@ class FailoverVolumeHost(command.Command):
|
|
|
47
49
|
class SetVolumeHost(command.Command):
|
|
48
50
|
_description = _("Set volume host properties")
|
|
49
51
|
|
|
50
|
-
def get_parser(self, prog_name):
|
|
52
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
51
53
|
parser = super().get_parser(prog_name)
|
|
52
54
|
parser.add_argument(
|
|
53
55
|
"host", metavar="<host-name>", help=_("Name of volume host")
|
|
@@ -65,7 +67,7 @@ class SetVolumeHost(command.Command):
|
|
|
65
67
|
)
|
|
66
68
|
return parser
|
|
67
69
|
|
|
68
|
-
def take_action(self, parsed_args):
|
|
70
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
69
71
|
service_client = self.app.client_manager.volume
|
|
70
72
|
if parsed_args.enable:
|
|
71
73
|
service_client.services.thaw_host(parsed_args.host)
|