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
|
@@ -0,0 +1,158 @@
|
|
|
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
|
+
|
|
15
|
+
from osc_lib.cli import format_columns
|
|
16
|
+
|
|
17
|
+
from openstackclient.tests.unit.volume.v3 import fakes as volume_fakes
|
|
18
|
+
from openstackclient.volume.v3 import volume_backend
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class TestShowVolumeCapability(volume_fakes.TestVolume):
|
|
22
|
+
"""Test backend capability functionality."""
|
|
23
|
+
|
|
24
|
+
# The capability to be listed
|
|
25
|
+
capability = volume_fakes.create_one_capability()
|
|
26
|
+
|
|
27
|
+
def setUp(self):
|
|
28
|
+
super().setUp()
|
|
29
|
+
|
|
30
|
+
# Assign return value to capabilities mock
|
|
31
|
+
self.volume_sdk_client.get_capabilities.return_value = self.capability
|
|
32
|
+
|
|
33
|
+
# Get the command object to test
|
|
34
|
+
self.cmd = volume_backend.ShowCapability(self.app, None)
|
|
35
|
+
|
|
36
|
+
def test_capability_show(self):
|
|
37
|
+
self.set_volume_api_version('3.0')
|
|
38
|
+
|
|
39
|
+
arglist = [
|
|
40
|
+
'fake',
|
|
41
|
+
]
|
|
42
|
+
verifylist = [
|
|
43
|
+
('host', 'fake'),
|
|
44
|
+
]
|
|
45
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
46
|
+
|
|
47
|
+
# In base command class Lister in cliff, abstract method take_action()
|
|
48
|
+
# returns a tuple containing the column names and an iterable
|
|
49
|
+
# containing the data to be listed.
|
|
50
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
51
|
+
|
|
52
|
+
expected_columns = [
|
|
53
|
+
'Title',
|
|
54
|
+
'Key',
|
|
55
|
+
'Type',
|
|
56
|
+
'Description',
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
# confirming if all expected columns are present in the result.
|
|
60
|
+
self.assertEqual(expected_columns, columns)
|
|
61
|
+
|
|
62
|
+
capabilities = [
|
|
63
|
+
'Compression',
|
|
64
|
+
'Replication',
|
|
65
|
+
'QoS',
|
|
66
|
+
'Thin Provisioning',
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
# confirming if all expected values are present in the result.
|
|
70
|
+
for cap in data:
|
|
71
|
+
self.assertIn(cap[0], capabilities)
|
|
72
|
+
|
|
73
|
+
# checking if proper call was made to get capabilities
|
|
74
|
+
self.volume_sdk_client.get_capabilities.assert_called_with(
|
|
75
|
+
'fake',
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class TestListVolumePool(volume_fakes.TestVolume):
|
|
80
|
+
"""Tests for volume backend pool listing."""
|
|
81
|
+
|
|
82
|
+
# The pool to be listed
|
|
83
|
+
pools = volume_fakes.create_one_pool()
|
|
84
|
+
|
|
85
|
+
def setUp(self):
|
|
86
|
+
super().setUp()
|
|
87
|
+
|
|
88
|
+
self.volume_sdk_client.backend_pools.return_value = [self.pools]
|
|
89
|
+
|
|
90
|
+
# Get the command object to test
|
|
91
|
+
self.cmd = volume_backend.ListPool(self.app, None)
|
|
92
|
+
|
|
93
|
+
def test_pool_list(self):
|
|
94
|
+
self.set_volume_api_version('3.0')
|
|
95
|
+
|
|
96
|
+
arglist = []
|
|
97
|
+
verifylist = []
|
|
98
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
99
|
+
|
|
100
|
+
# In base command class Lister in cliff, abstract method take_action()
|
|
101
|
+
# returns a tuple containing the column names and an iterable
|
|
102
|
+
# containing the data to be listed.
|
|
103
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
104
|
+
|
|
105
|
+
expected_columns = [
|
|
106
|
+
'Name',
|
|
107
|
+
]
|
|
108
|
+
|
|
109
|
+
# confirming if all expected columns are present in the result.
|
|
110
|
+
self.assertEqual(expected_columns, columns)
|
|
111
|
+
|
|
112
|
+
datalist = ((self.pools.name,),)
|
|
113
|
+
|
|
114
|
+
# confirming if all expected values are present in the result.
|
|
115
|
+
self.assertEqual(datalist, tuple(data))
|
|
116
|
+
|
|
117
|
+
# checking if proper call was made to list pools
|
|
118
|
+
self.volume_sdk_client.backend_pools.assert_called_with(
|
|
119
|
+
detailed=False,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
# checking if long columns are present in output
|
|
123
|
+
self.assertNotIn("total_volumes", columns)
|
|
124
|
+
self.assertNotIn("storage_protocol", columns)
|
|
125
|
+
|
|
126
|
+
def test_service_list_with_long_option(self):
|
|
127
|
+
self.set_volume_api_version('3.0')
|
|
128
|
+
|
|
129
|
+
arglist = ['--long']
|
|
130
|
+
verifylist = [('long', True)]
|
|
131
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
132
|
+
|
|
133
|
+
# In base command class Lister in cliff, abstract method take_action()
|
|
134
|
+
# returns a tuple containing the column names and an iterable
|
|
135
|
+
# containing the data to be listed.
|
|
136
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
137
|
+
|
|
138
|
+
expected_columns = [
|
|
139
|
+
'Name',
|
|
140
|
+
'Capabilities',
|
|
141
|
+
]
|
|
142
|
+
|
|
143
|
+
# confirming if all expected columns are present in the result.
|
|
144
|
+
self.assertEqual(expected_columns, columns)
|
|
145
|
+
|
|
146
|
+
datalist = (
|
|
147
|
+
(
|
|
148
|
+
self.pools.name,
|
|
149
|
+
format_columns.DictColumn(self.pools.capabilities),
|
|
150
|
+
),
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
# confirming if all expected values are present in the result.
|
|
154
|
+
self.assertEqual(datalist, tuple(data))
|
|
155
|
+
|
|
156
|
+
self.volume_sdk_client.backend_pools.assert_called_with(
|
|
157
|
+
detailed=True,
|
|
158
|
+
)
|
|
@@ -319,11 +319,7 @@ class TestBackupList(volume_fakes.TestVolume):
|
|
|
319
319
|
'Incremental',
|
|
320
320
|
'Created At',
|
|
321
321
|
)
|
|
322
|
-
columns_long = columns
|
|
323
|
-
'Availability Zone',
|
|
324
|
-
'Volume',
|
|
325
|
-
'Container',
|
|
326
|
-
)
|
|
322
|
+
columns_long = (*columns, 'Availability Zone', 'Volume', 'Container')
|
|
327
323
|
|
|
328
324
|
def setUp(self):
|
|
329
325
|
super().setUp()
|
|
@@ -397,6 +393,7 @@ class TestBackupList(volume_fakes.TestVolume):
|
|
|
397
393
|
all_tenants=False,
|
|
398
394
|
marker=None,
|
|
399
395
|
limit=None,
|
|
396
|
+
max_items=None,
|
|
400
397
|
project_id=None,
|
|
401
398
|
)
|
|
402
399
|
self.assertEqual(self.columns, columns)
|
|
@@ -448,6 +445,7 @@ class TestBackupList(volume_fakes.TestVolume):
|
|
|
448
445
|
all_tenants=True,
|
|
449
446
|
marker=self.backups[0].id,
|
|
450
447
|
limit=3,
|
|
448
|
+
max_items=None,
|
|
451
449
|
project_id=project.id,
|
|
452
450
|
)
|
|
453
451
|
self.assertEqual(self.columns_long, columns)
|
|
@@ -498,9 +496,7 @@ class TestBackupRestore(volume_fakes.TestVolume):
|
|
|
498
496
|
|
|
499
497
|
columns, data = self.cmd.take_action(parsed_args)
|
|
500
498
|
self.volume_sdk_client.restore_backup.assert_called_with(
|
|
501
|
-
self.backup.id,
|
|
502
|
-
volume_id=None,
|
|
503
|
-
name=None,
|
|
499
|
+
self.backup.id, volume=None, name=None
|
|
504
500
|
)
|
|
505
501
|
|
|
506
502
|
self.assertEqual(self.columns, columns)
|
|
@@ -522,9 +518,7 @@ class TestBackupRestore(volume_fakes.TestVolume):
|
|
|
522
518
|
|
|
523
519
|
columns, data = self.cmd.take_action(parsed_args)
|
|
524
520
|
self.volume_sdk_client.restore_backup.assert_called_with(
|
|
525
|
-
self.backup.id,
|
|
526
|
-
volume_id=None,
|
|
527
|
-
name=self.backup.volume_id,
|
|
521
|
+
self.backup.id, volume=None, name=self.backup.volume_id
|
|
528
522
|
)
|
|
529
523
|
|
|
530
524
|
self.assertEqual(self.columns, columns)
|
|
@@ -545,9 +539,7 @@ class TestBackupRestore(volume_fakes.TestVolume):
|
|
|
545
539
|
|
|
546
540
|
columns, data = self.cmd.take_action(parsed_args)
|
|
547
541
|
self.volume_sdk_client.restore_backup.assert_called_with(
|
|
548
|
-
self.backup.id,
|
|
549
|
-
volume_id=self.volume.id,
|
|
550
|
-
name=None,
|
|
542
|
+
self.backup.id, volume=self.volume.id, name=None
|
|
551
543
|
)
|
|
552
544
|
|
|
553
545
|
self.assertEqual(self.columns, columns)
|
|
@@ -459,3 +459,68 @@ class TestVolumeGroupTypeList(TestVolumeGroupType):
|
|
|
459
459
|
self.assertIn(
|
|
460
460
|
'--os-volume-api-version 3.11 or greater is required', str(exc)
|
|
461
461
|
)
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
class TestVolumeGroupTypeShow(TestVolumeGroupType):
|
|
465
|
+
fake_volume_group_type = volume_fakes.create_one_volume_group_type()
|
|
466
|
+
|
|
467
|
+
columns = (
|
|
468
|
+
'ID',
|
|
469
|
+
'Name',
|
|
470
|
+
'Description',
|
|
471
|
+
'Is Public',
|
|
472
|
+
'Properties',
|
|
473
|
+
)
|
|
474
|
+
data = (
|
|
475
|
+
fake_volume_group_type.id,
|
|
476
|
+
fake_volume_group_type.name,
|
|
477
|
+
fake_volume_group_type.description,
|
|
478
|
+
fake_volume_group_type.is_public,
|
|
479
|
+
format_columns.DictColumn(fake_volume_group_type.group_specs),
|
|
480
|
+
)
|
|
481
|
+
|
|
482
|
+
def setUp(self):
|
|
483
|
+
super().setUp()
|
|
484
|
+
|
|
485
|
+
self.volume_group_types_mock.get.return_value = (
|
|
486
|
+
self.fake_volume_group_type
|
|
487
|
+
)
|
|
488
|
+
|
|
489
|
+
self.cmd = volume_group_type.ShowVolumeGroupType(self.app, None)
|
|
490
|
+
|
|
491
|
+
def test_volume_group_type_show(self):
|
|
492
|
+
self.set_volume_api_version('3.11')
|
|
493
|
+
|
|
494
|
+
arglist = [
|
|
495
|
+
self.fake_volume_group_type.id,
|
|
496
|
+
]
|
|
497
|
+
verifylist = [
|
|
498
|
+
('group_type', self.fake_volume_group_type.id),
|
|
499
|
+
]
|
|
500
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
501
|
+
|
|
502
|
+
columns, data = self.cmd.take_action(parsed_args)
|
|
503
|
+
|
|
504
|
+
self.volume_group_types_mock.get.assert_called_once_with(
|
|
505
|
+
self.fake_volume_group_type.id,
|
|
506
|
+
)
|
|
507
|
+
self.assertEqual(self.columns, columns)
|
|
508
|
+
self.assertCountEqual(self.data, data)
|
|
509
|
+
|
|
510
|
+
def test_volume_group_type_show_pre_v311(self):
|
|
511
|
+
self.set_volume_api_version('3.10')
|
|
512
|
+
|
|
513
|
+
arglist = [
|
|
514
|
+
self.fake_volume_group_type.id,
|
|
515
|
+
]
|
|
516
|
+
verifylist = [
|
|
517
|
+
('group_type', self.fake_volume_group_type.id),
|
|
518
|
+
]
|
|
519
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
520
|
+
|
|
521
|
+
exc = self.assertRaises(
|
|
522
|
+
exceptions.CommandError, self.cmd.take_action, parsed_args
|
|
523
|
+
)
|
|
524
|
+
self.assertIn(
|
|
525
|
+
'--os-volume-api-version 3.11 or greater is required', str(exc)
|
|
526
|
+
)
|
|
@@ -0,0 +1,115 @@
|
|
|
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
|
+
from openstackclient.tests.unit.volume.v3 import fakes as volume_fakes
|
|
15
|
+
from openstackclient.volume.v3 import volume_host
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class TestVolumeHost(volume_fakes.TestVolume):
|
|
19
|
+
def setUp(self):
|
|
20
|
+
super().setUp()
|
|
21
|
+
|
|
22
|
+
self.host_mock = self.volume_client.services
|
|
23
|
+
self.host_mock.reset_mock()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class TestVolumeHostSet(TestVolumeHost):
|
|
27
|
+
service = volume_fakes.create_one_service()
|
|
28
|
+
|
|
29
|
+
def setUp(self):
|
|
30
|
+
super().setUp()
|
|
31
|
+
|
|
32
|
+
self.host_mock.freeze_host.return_value = None
|
|
33
|
+
self.host_mock.thaw_host.return_value = None
|
|
34
|
+
|
|
35
|
+
# Get the command object to mock
|
|
36
|
+
self.cmd = volume_host.SetVolumeHost(self.app, None)
|
|
37
|
+
|
|
38
|
+
def test_volume_host_set_nothing(self):
|
|
39
|
+
arglist = [
|
|
40
|
+
self.service.host,
|
|
41
|
+
]
|
|
42
|
+
verifylist = [
|
|
43
|
+
('host', self.service.host),
|
|
44
|
+
]
|
|
45
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
46
|
+
result = self.cmd.take_action(parsed_args)
|
|
47
|
+
|
|
48
|
+
self.host_mock.freeze_host.assert_not_called()
|
|
49
|
+
self.host_mock.thaw_host.assert_not_called()
|
|
50
|
+
self.assertIsNone(result)
|
|
51
|
+
|
|
52
|
+
def test_volume_host_set_enable(self):
|
|
53
|
+
arglist = [
|
|
54
|
+
'--enable',
|
|
55
|
+
self.service.host,
|
|
56
|
+
]
|
|
57
|
+
verifylist = [
|
|
58
|
+
('enable', True),
|
|
59
|
+
('host', self.service.host),
|
|
60
|
+
]
|
|
61
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
62
|
+
|
|
63
|
+
result = self.cmd.take_action(parsed_args)
|
|
64
|
+
|
|
65
|
+
self.host_mock.thaw_host.assert_called_with(self.service.host)
|
|
66
|
+
self.host_mock.freeze_host.assert_not_called()
|
|
67
|
+
self.assertIsNone(result)
|
|
68
|
+
|
|
69
|
+
def test_volume_host_set_disable(self):
|
|
70
|
+
arglist = [
|
|
71
|
+
'--disable',
|
|
72
|
+
self.service.host,
|
|
73
|
+
]
|
|
74
|
+
verifylist = [
|
|
75
|
+
('disable', True),
|
|
76
|
+
('host', self.service.host),
|
|
77
|
+
]
|
|
78
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
79
|
+
|
|
80
|
+
result = self.cmd.take_action(parsed_args)
|
|
81
|
+
|
|
82
|
+
self.host_mock.freeze_host.assert_called_with(self.service.host)
|
|
83
|
+
self.host_mock.thaw_host.assert_not_called()
|
|
84
|
+
self.assertIsNone(result)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class TestVolumeHostFailover(TestVolumeHost):
|
|
88
|
+
service = volume_fakes.create_one_service()
|
|
89
|
+
|
|
90
|
+
def setUp(self):
|
|
91
|
+
super().setUp()
|
|
92
|
+
|
|
93
|
+
self.host_mock.failover_host.return_value = None
|
|
94
|
+
|
|
95
|
+
# Get the command object to mock
|
|
96
|
+
self.cmd = volume_host.FailoverVolumeHost(self.app, None)
|
|
97
|
+
|
|
98
|
+
def test_volume_host_failover(self):
|
|
99
|
+
arglist = [
|
|
100
|
+
'--volume-backend',
|
|
101
|
+
'backend_test',
|
|
102
|
+
self.service.host,
|
|
103
|
+
]
|
|
104
|
+
verifylist = [
|
|
105
|
+
('volume_backend', 'backend_test'),
|
|
106
|
+
('host', self.service.host),
|
|
107
|
+
]
|
|
108
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
109
|
+
|
|
110
|
+
result = self.cmd.take_action(parsed_args)
|
|
111
|
+
|
|
112
|
+
self.host_mock.failover_host.assert_called_with(
|
|
113
|
+
self.service.host, 'backend_test'
|
|
114
|
+
)
|
|
115
|
+
self.assertIsNone(result)
|
|
@@ -180,6 +180,59 @@ class TestVolumeSnapshotCreate(volume_fakes.TestVolume):
|
|
|
180
180
|
)
|
|
181
181
|
self.volume_sdk_client.create_snapshot.assert_not_called()
|
|
182
182
|
|
|
183
|
+
def test_snapshot_create_pre_v366(self):
|
|
184
|
+
self.set_volume_api_version('3.65')
|
|
185
|
+
|
|
186
|
+
arglist = ["--force", self.snapshot.name]
|
|
187
|
+
verifylist = [("force", True), ("snapshot_name", self.snapshot.name)]
|
|
188
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
189
|
+
|
|
190
|
+
self.cmd.take_action(parsed_args)
|
|
191
|
+
|
|
192
|
+
# force parameter should be passed
|
|
193
|
+
self.volume_sdk_client.create_snapshot.assert_called_with(
|
|
194
|
+
volume_id=self.snapshot.volume_id,
|
|
195
|
+
force=True,
|
|
196
|
+
name=self.snapshot.name,
|
|
197
|
+
description=None,
|
|
198
|
+
metadata=None,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
def test_snapshot_create_v366_or_later(self):
|
|
202
|
+
self.set_volume_api_version('3.66')
|
|
203
|
+
|
|
204
|
+
arglist = [self.snapshot.name]
|
|
205
|
+
verifylist = [("force", False), ("snapshot_name", self.snapshot.name)]
|
|
206
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
207
|
+
|
|
208
|
+
self.cmd.take_action(parsed_args)
|
|
209
|
+
|
|
210
|
+
# force parameter should not be passed, for >=3.66
|
|
211
|
+
self.volume_sdk_client.create_snapshot.assert_called_with(
|
|
212
|
+
volume_id=self.snapshot.volume_id,
|
|
213
|
+
name=self.snapshot.name,
|
|
214
|
+
description=None,
|
|
215
|
+
metadata=None,
|
|
216
|
+
)
|
|
217
|
+
|
|
218
|
+
def test_snapshot_create_v366_or_later_with_force(self):
|
|
219
|
+
"""--force should be ignored for microversion >= 3.66."""
|
|
220
|
+
self.set_volume_api_version('3.66')
|
|
221
|
+
|
|
222
|
+
arglist = ["--force", self.snapshot.name]
|
|
223
|
+
verifylist = [("force", True), ("snapshot_name", self.snapshot.name)]
|
|
224
|
+
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
|
|
225
|
+
|
|
226
|
+
self.cmd.take_action(parsed_args)
|
|
227
|
+
|
|
228
|
+
# passed but ignored
|
|
229
|
+
self.volume_sdk_client.create_snapshot.assert_called_with(
|
|
230
|
+
volume_id=self.snapshot.volume_id,
|
|
231
|
+
name=self.snapshot.name,
|
|
232
|
+
description=None,
|
|
233
|
+
metadata=None,
|
|
234
|
+
)
|
|
235
|
+
|
|
183
236
|
|
|
184
237
|
class TestVolumeSnapshotDelete(volume_fakes.TestVolume):
|
|
185
238
|
def setUp(self):
|
|
@@ -340,7 +393,8 @@ class TestVolumeSnapshotList(volume_fakes.TestVolume):
|
|
|
340
393
|
self.project_mock.get.return_value = self.project
|
|
341
394
|
|
|
342
395
|
self.columns = ("ID", "Name", "Description", "Status", "Size")
|
|
343
|
-
self.columns_long =
|
|
396
|
+
self.columns_long = (
|
|
397
|
+
*self.columns,
|
|
344
398
|
"Created At",
|
|
345
399
|
"Volume",
|
|
346
400
|
"Properties",
|
|
@@ -385,6 +439,7 @@ class TestVolumeSnapshotList(volume_fakes.TestVolume):
|
|
|
385
439
|
self.volume_sdk_client.snapshots.assert_called_once_with(
|
|
386
440
|
limit=None,
|
|
387
441
|
marker=None,
|
|
442
|
+
max_items=None,
|
|
388
443
|
all_projects=False,
|
|
389
444
|
name=None,
|
|
390
445
|
status=None,
|
|
@@ -418,6 +473,7 @@ class TestVolumeSnapshotList(volume_fakes.TestVolume):
|
|
|
418
473
|
self.volume_sdk_client.snapshots.assert_called_once_with(
|
|
419
474
|
limit=2,
|
|
420
475
|
marker=self.snapshots[0].id,
|
|
476
|
+
max_items=None,
|
|
421
477
|
all_projects=True,
|
|
422
478
|
project_id=self.project.id,
|
|
423
479
|
name=None,
|
|
@@ -439,6 +495,7 @@ class TestVolumeSnapshotList(volume_fakes.TestVolume):
|
|
|
439
495
|
self.volume_sdk_client.snapshots.assert_called_once_with(
|
|
440
496
|
limit=None,
|
|
441
497
|
marker=None,
|
|
498
|
+
max_items=None,
|
|
442
499
|
all_projects=True,
|
|
443
500
|
name=None,
|
|
444
501
|
status=None,
|
|
@@ -465,6 +522,7 @@ class TestVolumeSnapshotList(volume_fakes.TestVolume):
|
|
|
465
522
|
self.volume_sdk_client.snapshots.assert_called_once_with(
|
|
466
523
|
limit=None,
|
|
467
524
|
marker=None,
|
|
525
|
+
max_items=None,
|
|
468
526
|
all_projects=False,
|
|
469
527
|
name=self.snapshots[0].name,
|
|
470
528
|
status=None,
|
|
@@ -491,6 +549,7 @@ class TestVolumeSnapshotList(volume_fakes.TestVolume):
|
|
|
491
549
|
self.volume_sdk_client.snapshots.assert_called_once_with(
|
|
492
550
|
limit=None,
|
|
493
551
|
marker=None,
|
|
552
|
+
max_items=None,
|
|
494
553
|
all_projects=False,
|
|
495
554
|
name=None,
|
|
496
555
|
status='available',
|
|
@@ -517,6 +576,7 @@ class TestVolumeSnapshotList(volume_fakes.TestVolume):
|
|
|
517
576
|
self.volume_sdk_client.snapshots.assert_called_once_with(
|
|
518
577
|
limit=None,
|
|
519
578
|
marker=None,
|
|
579
|
+
max_items=None,
|
|
520
580
|
all_projects=False,
|
|
521
581
|
name=None,
|
|
522
582
|
status=None,
|
|
@@ -331,7 +331,7 @@ class TestTypeList(TestType):
|
|
|
331
331
|
"Name",
|
|
332
332
|
"Is Public",
|
|
333
333
|
]
|
|
334
|
-
columns_long = columns
|
|
334
|
+
columns_long = [*columns, "Description", "Properties"]
|
|
335
335
|
data_with_default_type = [(volume_types[0].id, volume_types[0].name, True)]
|
|
336
336
|
data = []
|
|
337
337
|
for t in volume_types:
|
|
@@ -509,9 +509,7 @@ class TestTypeList(TestType):
|
|
|
509
509
|
'key_size': None,
|
|
510
510
|
'control_location': 'front-end',
|
|
511
511
|
}
|
|
512
|
-
encryption_columns = self.columns
|
|
513
|
-
"Encryption",
|
|
514
|
-
]
|
|
512
|
+
encryption_columns = [*self.columns, "Encryption"]
|
|
515
513
|
encryption_data = []
|
|
516
514
|
encryption_data.append(
|
|
517
515
|
(
|
openstackclient/volume/client.py
CHANGED
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
# under the License.
|
|
14
14
|
#
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
16
17
|
import logging
|
|
18
|
+
from typing import Any
|
|
17
19
|
|
|
18
20
|
from osc_lib import exceptions
|
|
19
21
|
from osc_lib import utils
|
|
@@ -34,7 +36,7 @@ API_VERSIONS = {
|
|
|
34
36
|
_volume_api_version = None
|
|
35
37
|
|
|
36
38
|
|
|
37
|
-
def make_client(instance):
|
|
39
|
+
def make_client(instance: Any) -> Any:
|
|
38
40
|
"""Returns a volume service client."""
|
|
39
41
|
|
|
40
42
|
# Defer client imports until we actually need them
|
|
@@ -92,7 +94,9 @@ def make_client(instance):
|
|
|
92
94
|
return client
|
|
93
95
|
|
|
94
96
|
|
|
95
|
-
def build_option_parser(
|
|
97
|
+
def build_option_parser(
|
|
98
|
+
parser: argparse.ArgumentParser,
|
|
99
|
+
) -> argparse.ArgumentParser:
|
|
96
100
|
"""Hook to add global options"""
|
|
97
101
|
parser.add_argument(
|
|
98
102
|
'--os-volume-api-version',
|
|
@@ -104,7 +108,7 @@ def build_option_parser(parser):
|
|
|
104
108
|
return parser
|
|
105
109
|
|
|
106
110
|
|
|
107
|
-
def check_api_version(check_version):
|
|
111
|
+
def check_api_version(check_version: str) -> bool:
|
|
108
112
|
"""Validate version supplied by user
|
|
109
113
|
|
|
110
114
|
Returns:
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v2 Backup action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
17
18
|
import logging
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
20
|
+
from typing import Any
|
|
18
21
|
|
|
19
22
|
from osc_lib import utils
|
|
20
23
|
|
|
@@ -33,7 +36,7 @@ Backup information can be imported into a new service instance to be able to
|
|
|
33
36
|
restore."""
|
|
34
37
|
)
|
|
35
38
|
|
|
36
|
-
def get_parser(self, prog_name):
|
|
39
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
37
40
|
parser = super().get_parser(prog_name)
|
|
38
41
|
parser.add_argument(
|
|
39
42
|
"backup",
|
|
@@ -42,7 +45,9 @@ restore."""
|
|
|
42
45
|
)
|
|
43
46
|
return parser
|
|
44
47
|
|
|
45
|
-
def take_action(
|
|
48
|
+
def take_action(
|
|
49
|
+
self, parsed_args: argparse.Namespace
|
|
50
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
46
51
|
volume_client = self.app.client_manager.volume
|
|
47
52
|
backup = utils.find_resource(volume_client.backups, parsed_args.backup)
|
|
48
53
|
backup_data = volume_client.backups.export_record(backup.id)
|
|
@@ -53,7 +58,8 @@ restore."""
|
|
|
53
58
|
backup_data['Backup Service'] = backup_data.pop('backup_service')
|
|
54
59
|
backup_data['Metadata'] = backup_data.pop('backup_url')
|
|
55
60
|
|
|
56
|
-
|
|
61
|
+
col_headers, col_data = zip(*sorted(backup_data.items()))
|
|
62
|
+
return col_headers, col_data
|
|
57
63
|
|
|
58
64
|
|
|
59
65
|
class ImportBackupRecord(command.ShowOne):
|
|
@@ -64,7 +70,7 @@ Exported backup details contain the metadata necessary to restore to a new or
|
|
|
64
70
|
rebuilt service instance"""
|
|
65
71
|
)
|
|
66
72
|
|
|
67
|
-
def get_parser(self, prog_name):
|
|
73
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
68
74
|
parser = super().get_parser(prog_name)
|
|
69
75
|
parser.add_argument(
|
|
70
76
|
"backup_service",
|
|
@@ -78,10 +84,13 @@ rebuilt service instance"""
|
|
|
78
84
|
)
|
|
79
85
|
return parser
|
|
80
86
|
|
|
81
|
-
def take_action(
|
|
87
|
+
def take_action(
|
|
88
|
+
self, parsed_args: argparse.Namespace
|
|
89
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
82
90
|
volume_client = self.app.client_manager.volume
|
|
83
91
|
backup_data = volume_client.backups.import_record(
|
|
84
92
|
parsed_args.backup_service, parsed_args.backup_metadata
|
|
85
93
|
)
|
|
86
94
|
backup_data.pop('links', None)
|
|
87
|
-
|
|
95
|
+
col_headers, col_data = zip(*sorted(backup_data.items()))
|
|
96
|
+
return col_headers, col_data
|