python-openstackclient 6.6.1__py3-none-any.whl → 7.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/api/api.py +4 -4
- openstackclient/api/compute_v2.py +352 -638
- openstackclient/api/image_v1.py +1 -1
- openstackclient/api/object_store_v1.py +3 -4
- openstackclient/common/availability_zone.py +1 -1
- openstackclient/common/clientmanager.py +16 -4
- openstackclient/common/configuration.py +1 -1
- openstackclient/common/extension.py +1 -1
- openstackclient/common/limits.py +66 -32
- openstackclient/common/module.py +3 -3
- openstackclient/common/progressbar.py +2 -2
- openstackclient/common/project_cleanup.py +5 -2
- openstackclient/common/quota.py +281 -410
- openstackclient/common/versions.py +1 -1
- openstackclient/compute/client.py +7 -116
- openstackclient/compute/v2/agent.py +75 -49
- openstackclient/compute/v2/aggregate.py +9 -9
- openstackclient/compute/v2/console.py +2 -2
- openstackclient/compute/v2/flavor.py +6 -6
- openstackclient/compute/v2/host.py +38 -33
- openstackclient/compute/v2/hypervisor.py +4 -3
- openstackclient/compute/v2/keypair.py +7 -8
- openstackclient/compute/v2/server.py +478 -396
- openstackclient/compute/v2/server_backup.py +1 -1
- openstackclient/compute/v2/server_group.py +4 -4
- openstackclient/compute/v2/server_image.py +1 -1
- openstackclient/compute/v2/server_migration.py +3 -4
- openstackclient/compute/v2/service.py +4 -4
- openstackclient/compute/v2/usage.py +3 -3
- openstackclient/identity/common.py +34 -0
- openstackclient/identity/v2_0/catalog.py +2 -2
- openstackclient/identity/v2_0/ec2creds.py +4 -4
- openstackclient/identity/v2_0/endpoint.py +4 -4
- openstackclient/identity/v2_0/project.py +6 -6
- openstackclient/identity/v2_0/role.py +5 -5
- openstackclient/identity/v2_0/role_assignment.py +1 -1
- openstackclient/identity/v2_0/service.py +4 -4
- openstackclient/identity/v2_0/token.py +2 -2
- openstackclient/identity/v2_0/user.py +7 -7
- openstackclient/identity/v3/access_rule.py +3 -3
- openstackclient/identity/v3/application_credential.py +127 -45
- openstackclient/identity/v3/catalog.py +2 -2
- openstackclient/identity/v3/consumer.py +4 -4
- openstackclient/identity/v3/credential.py +5 -5
- openstackclient/identity/v3/domain.py +5 -5
- openstackclient/identity/v3/ec2creds.py +4 -4
- openstackclient/identity/v3/endpoint.py +7 -7
- openstackclient/identity/v3/endpoint_group.py +8 -10
- openstackclient/identity/v3/federation_protocol.py +5 -5
- openstackclient/identity/v3/group.py +8 -8
- openstackclient/identity/v3/identity_provider.py +5 -5
- openstackclient/identity/v3/implied_role.py +3 -3
- openstackclient/identity/v3/limit.py +5 -5
- openstackclient/identity/v3/mapping.py +5 -5
- openstackclient/identity/v3/policy.py +5 -5
- openstackclient/identity/v3/project.py +5 -5
- openstackclient/identity/v3/region.py +5 -5
- openstackclient/identity/v3/registered_limit.py +5 -5
- openstackclient/identity/v3/role.py +7 -7
- openstackclient/identity/v3/role_assignment.py +92 -140
- openstackclient/identity/v3/service.py +64 -34
- openstackclient/identity/v3/service_provider.py +4 -4
- openstackclient/identity/v3/tag.py +2 -2
- openstackclient/identity/v3/token.py +5 -5
- openstackclient/identity/v3/trust.py +3 -3
- openstackclient/identity/v3/user.py +144 -80
- openstackclient/image/client.py +4 -4
- openstackclient/image/v1/image.py +8 -9
- openstackclient/image/v2/cache.py +12 -10
- openstackclient/image/v2/metadef_objects.py +44 -0
- openstackclient/image/v2/metadef_resource_type_association.py +189 -0
- openstackclient/image/v2/task.py +1 -1
- openstackclient/network/common.py +6 -5
- openstackclient/network/utils.py +2 -2
- openstackclient/network/v2/address_group.py +6 -6
- openstackclient/network/v2/address_scope.py +5 -5
- openstackclient/network/v2/default_security_group_rule.py +1 -1
- openstackclient/network/v2/floating_ip.py +8 -10
- openstackclient/network/v2/floating_ip_pool.py +6 -15
- openstackclient/network/v2/floating_ip_port_forwarding.py +5 -13
- openstackclient/network/v2/ip_availability.py +2 -2
- openstackclient/network/v2/l3_conntrack_helper.py +5 -5
- openstackclient/network/v2/network.py +8 -8
- openstackclient/network/v2/network_agent.py +8 -8
- openstackclient/network/v2/network_auto_allocated_topology.py +2 -2
- openstackclient/network/v2/network_flavor.py +6 -8
- openstackclient/network/v2/network_flavor_profile.py +4 -4
- openstackclient/network/v2/network_meter.py +3 -3
- openstackclient/network/v2/network_meter_rule.py +3 -3
- openstackclient/network/v2/network_qos_policy.py +5 -5
- openstackclient/network/v2/network_qos_rule.py +9 -9
- openstackclient/network/v2/network_qos_rule_type.py +1 -1
- openstackclient/network/v2/network_rbac.py +5 -5
- openstackclient/network/v2/network_segment.py +5 -5
- openstackclient/network/v2/network_segment_range.py +7 -7
- openstackclient/network/v2/network_trunk.py +7 -7
- openstackclient/network/v2/port.py +26 -12
- openstackclient/network/v2/router.py +403 -54
- openstackclient/network/v2/security_group.py +18 -14
- openstackclient/network/v2/security_group_rule.py +18 -15
- openstackclient/network/v2/subnet.py +15 -8
- openstackclient/network/v2/subnet_pool.py +6 -6
- openstackclient/object/v1/account.py +2 -2
- openstackclient/object/v1/container.py +7 -7
- openstackclient/object/v1/object.py +7 -7
- openstackclient/shell.py +4 -6
- openstackclient/tests/functional/base.py +1 -1
- openstackclient/tests/functional/common/test_extension.py +1 -1
- openstackclient/tests/functional/common/test_help.py +2 -2
- openstackclient/tests/functional/common/test_module.py +1 -1
- openstackclient/tests/functional/common/test_quota.py +43 -61
- openstackclient/tests/functional/compute/v2/common.py +2 -2
- openstackclient/tests/functional/compute/v2/test_flavor.py +2 -2
- openstackclient/tests/functional/compute/v2/test_keypair.py +1 -1
- openstackclient/tests/functional/compute/v2/test_server.py +5 -5
- openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
- openstackclient/tests/functional/identity/v2/common.py +3 -3
- openstackclient/tests/functional/identity/v3/common.py +14 -6
- openstackclient/tests/functional/identity/v3/test_application_credential.py +13 -19
- openstackclient/tests/functional/identity/v3/test_domain.py +1 -3
- openstackclient/tests/functional/identity/v3/test_endpoint.py +1 -1
- openstackclient/tests/functional/identity/v3/test_idp.py +1 -1
- openstackclient/tests/functional/identity/v3/test_limit.py +2 -2
- openstackclient/tests/functional/identity/v3/test_region.py +1 -3
- openstackclient/tests/functional/identity/v3/test_registered_limit.py +1 -1
- openstackclient/tests/functional/identity/v3/test_role.py +2 -2
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +210 -0
- openstackclient/tests/functional/identity/v3/test_service.py +4 -6
- openstackclient/tests/functional/identity/v3/test_service_provider.py +1 -3
- openstackclient/tests/functional/image/base.py +1 -1
- openstackclient/tests/functional/image/v2/test_image.py +1 -1
- openstackclient/tests/functional/image/v2/test_info.py +1 -1
- openstackclient/tests/functional/network/v2/common.py +4 -6
- openstackclient/tests/functional/network/v2/test_network.py +5 -3
- openstackclient/tests/functional/network/v2/test_network_agent.py +7 -5
- openstackclient/tests/functional/network/v2/test_network_qos_rule.py +4 -4
- openstackclient/tests/functional/network/v2/test_port.py +11 -7
- openstackclient/tests/functional/network/v2/test_router.py +2 -2
- openstackclient/tests/functional/object/v1/common.py +1 -1
- openstackclient/tests/functional/object/v1/test_container.py +3 -3
- openstackclient/tests/functional/object/v1/test_object.py +9 -13
- openstackclient/tests/functional/volume/base.py +1 -1
- openstackclient/tests/functional/volume/v1/test_service.py +1 -1
- openstackclient/tests/functional/volume/v1/test_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v1/test_transfer_request.py +2 -2
- openstackclient/tests/functional/volume/v1/test_volume_type.py +1 -1
- openstackclient/tests/functional/volume/v2/test_service.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_backup.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v2/test_volume_type.py +1 -1
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +2 -2
- openstackclient/tests/functional/volume/v3/test_volume_type.py +1 -1
- openstackclient/tests/unit/api/fakes.py +1 -1
- openstackclient/tests/unit/api/test_api.py +2 -2
- openstackclient/tests/unit/api/test_compute_v2.py +522 -707
- openstackclient/tests/unit/api/test_image_v1.py +1 -1
- openstackclient/tests/unit/api/test_image_v2.py +1 -1
- openstackclient/tests/unit/api/test_object_store_v1.py +4 -4
- openstackclient/tests/unit/common/test_limits.py +73 -35
- openstackclient/tests/unit/common/test_logs.py +2 -2
- openstackclient/tests/unit/common/test_module.py +4 -2
- openstackclient/tests/unit/common/test_project_cleanup.py +31 -6
- openstackclient/tests/unit/common/test_quota.py +490 -630
- openstackclient/tests/unit/compute/v2/fakes.py +37 -286
- openstackclient/tests/unit/compute/v2/test_agent.py +189 -147
- openstackclient/tests/unit/compute/v2/test_aggregate.py +18 -16
- openstackclient/tests/unit/compute/v2/test_console.py +4 -5
- openstackclient/tests/unit/compute/v2/test_flavor.py +59 -68
- openstackclient/tests/unit/compute/v2/test_host.py +83 -54
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +28 -31
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +65 -50
- openstackclient/tests/unit/compute/v2/test_server.py +2895 -2459
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +14 -39
- openstackclient/tests/unit/compute/v2/test_server_group.py +28 -29
- openstackclient/tests/unit/compute/v2/test_server_migration.py +43 -68
- openstackclient/tests/unit/compute/v2/test_server_volume.py +17 -34
- openstackclient/tests/unit/compute/v2/test_service.py +34 -52
- openstackclient/tests/unit/compute/v2/test_usage.py +4 -4
- openstackclient/tests/unit/fakes.py +11 -11
- openstackclient/tests/unit/identity/v2_0/fakes.py +27 -10
- openstackclient/tests/unit/identity/v2_0/test_catalog.py +3 -3
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +7 -7
- openstackclient/tests/unit/identity/v2_0/test_project.py +8 -8
- openstackclient/tests/unit/identity/v2_0/test_role.py +10 -10
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +4 -4
- openstackclient/tests/unit/identity/v2_0/test_service.py +6 -6
- openstackclient/tests/unit/identity/v2_0/test_token.py +4 -4
- openstackclient/tests/unit/identity/v2_0/test_user.py +8 -8
- openstackclient/tests/unit/identity/v3/fakes.py +59 -20
- openstackclient/tests/unit/identity/v3/test_access_rule.py +5 -5
- openstackclient/tests/unit/identity/v3/test_application_credential.py +212 -235
- openstackclient/tests/unit/identity/v3/test_catalog.py +3 -3
- openstackclient/tests/unit/identity/v3/test_consumer.py +7 -8
- openstackclient/tests/unit/identity/v3/test_credential.py +9 -9
- openstackclient/tests/unit/identity/v3/test_domain.py +8 -8
- openstackclient/tests/unit/identity/v3/test_endpoint.py +13 -13
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +12 -14
- openstackclient/tests/unit/identity/v3/test_group.py +12 -12
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +8 -8
- openstackclient/tests/unit/identity/v3/test_implied_role.py +5 -5
- openstackclient/tests/unit/identity/v3/test_limit.py +7 -7
- openstackclient/tests/unit/identity/v3/test_mappings.py +7 -7
- openstackclient/tests/unit/identity/v3/test_oauth.py +5 -5
- openstackclient/tests/unit/identity/v3/test_project.py +16 -16
- openstackclient/tests/unit/identity/v3/test_protocol.py +7 -7
- openstackclient/tests/unit/identity/v3/test_region.py +7 -7
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +12 -13
- openstackclient/tests/unit/identity/v3/test_role.py +13 -13
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +410 -331
- openstackclient/tests/unit/identity/v3/test_service.py +93 -97
- openstackclient/tests/unit/identity/v3/test_service_provider.py +7 -7
- openstackclient/tests/unit/identity/v3/test_token.py +4 -4
- openstackclient/tests/unit/identity/v3/test_trust.py +9 -9
- openstackclient/tests/unit/identity/v3/test_unscoped_saml.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +299 -327
- openstackclient/tests/unit/image/v1/test_image.py +6 -6
- openstackclient/tests/unit/image/v2/fakes.py +46 -9
- openstackclient/tests/unit/image/v2/test_cache.py +2 -2
- openstackclient/tests/unit/image/v2/test_image.py +3 -3
- openstackclient/tests/unit/image/v2/test_metadef_objects.py +62 -0
- openstackclient/tests/unit/image/v2/test_metadef_resource_type_association.py +131 -0
- openstackclient/tests/unit/integ/base.py +1 -1
- openstackclient/tests/unit/integ/cli/test_project.py +4 -4
- openstackclient/tests/unit/integ/cli/test_shell.py +7 -7
- openstackclient/tests/unit/network/test_common.py +12 -21
- openstackclient/tests/unit/network/v2/fakes.py +64 -130
- openstackclient/tests/unit/network/v2/test_address_group.py +15 -15
- openstackclient/tests/unit/network/v2/test_address_scope.py +13 -13
- openstackclient/tests/unit/network/v2/test_default_security_group_rule.py +49 -27
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +40 -38
- openstackclient/tests/unit/network/v2/test_floating_ip_network.py +15 -15
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +4 -7
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +3 -5
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +11 -11
- openstackclient/tests/unit/network/v2/test_ip_availability.py +6 -6
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +11 -21
- openstackclient/tests/unit/network/v2/test_local_ip.py +7 -7
- openstackclient/tests/unit/network/v2/test_local_ip_association.py +3 -5
- openstackclient/tests/unit/network/v2/test_ndp_proxy.py +13 -13
- openstackclient/tests/unit/network/v2/test_network.py +23 -28
- openstackclient/tests/unit/network/v2/test_network_agent.py +17 -21
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +8 -8
- openstackclient/tests/unit/network/v2/test_network_compute.py +66 -65
- openstackclient/tests/unit/network/v2/test_network_flavor.py +17 -19
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_meter.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_meter_rule.py +11 -11
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +11 -21
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +51 -77
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +5 -9
- openstackclient/tests/unit/network/v2/test_network_rbac.py +12 -12
- openstackclient/tests/unit/network/v2/test_network_segment.py +11 -15
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +11 -13
- openstackclient/tests/unit/network/v2/test_network_service_provider.py +3 -5
- openstackclient/tests/unit/network/v2/test_network_trunk.py +11 -11
- openstackclient/tests/unit/network/v2/test_port.py +22 -25
- openstackclient/tests/unit/network/v2/test_router.py +721 -51
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +65 -49
- openstackclient/tests/unit/network/v2/test_security_group_network.py +15 -15
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +57 -45
- openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +11 -19
- openstackclient/tests/unit/network/v2/test_subnet.py +29 -25
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +15 -15
- openstackclient/tests/unit/object/v1/fakes.py +1 -1
- openstackclient/tests/unit/object/v1/test_container.py +5 -5
- openstackclient/tests/unit/object/v1/test_container_all.py +6 -6
- openstackclient/tests/unit/object/v1/test_object.py +3 -3
- openstackclient/tests/unit/object/v1/test_object_all.py +5 -5
- openstackclient/tests/unit/test_shell.py +5 -5
- openstackclient/tests/unit/utils.py +4 -1
- openstackclient/tests/unit/volume/test_find_resource.py +2 -2
- openstackclient/tests/unit/volume/v1/fakes.py +5 -6
- openstackclient/tests/unit/volume/v1/test_volume.py +5 -4
- openstackclient/tests/unit/volume/v2/fakes.py +39 -259
- openstackclient/tests/unit/volume/v2/test_consistency_group_snapshot.py +5 -5
- openstackclient/tests/unit/volume/v2/test_qos_specs.py +9 -9
- openstackclient/tests/unit/volume/v2/test_volume.py +21 -87
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +7 -368
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +1 -1
- openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +0 -44
- openstackclient/tests/unit/volume/v2/test_volume_type.py +6 -87
- openstackclient/tests/unit/volume/v3/fakes.py +505 -22
- openstackclient/tests/unit/volume/v3/test_block_storage_cleanup.py +2 -3
- openstackclient/tests/unit/volume/v3/test_block_storage_cluster.py +10 -11
- openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +10 -6
- openstackclient/tests/unit/volume/v3/test_block_storage_manage.py +25 -17
- openstackclient/tests/unit/volume/v3/test_block_storage_resource_filter.py +6 -32
- openstackclient/tests/unit/volume/v3/test_service.py +271 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +2177 -33
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +48 -52
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +892 -0
- openstackclient/tests/unit/volume/v3/test_volume_group.py +19 -20
- openstackclient/tests/unit/volume/v3/test_volume_group_snapshot.py +14 -34
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +13 -16
- openstackclient/tests/unit/volume/v3/test_volume_message.py +10 -11
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +161 -0
- openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +425 -0
- openstackclient/tests/unit/volume/v3/test_volume_type.py +1109 -0
- openstackclient/volume/v1/qos_specs.py +7 -7
- openstackclient/volume/v1/service.py +2 -2
- openstackclient/volume/v1/volume.py +12 -12
- openstackclient/volume/v1/volume_backup.py +7 -7
- openstackclient/volume/v1/volume_snapshot.py +8 -8
- openstackclient/volume/v1/volume_transfer_request.py +5 -5
- openstackclient/volume/v1/volume_type.py +7 -7
- openstackclient/volume/v2/backup_record.py +2 -2
- openstackclient/volume/v2/consistency_group.py +7 -9
- openstackclient/volume/v2/consistency_group_snapshot.py +4 -12
- openstackclient/volume/v2/qos_specs.py +7 -7
- openstackclient/volume/v2/service.py +2 -2
- openstackclient/volume/v2/volume.py +80 -80
- openstackclient/volume/v2/volume_backend.py +2 -2
- openstackclient/volume/v2/volume_backup.py +7 -217
- openstackclient/volume/v2/volume_host.py +2 -2
- openstackclient/volume/v2/volume_snapshot.py +8 -8
- openstackclient/volume/v2/volume_transfer_request.py +5 -37
- openstackclient/volume/v2/volume_type.py +7 -89
- openstackclient/volume/v3/service.py +56 -0
- openstackclient/volume/v3/volume.py +971 -0
- openstackclient/volume/v3/volume_attachment.py +31 -29
- openstackclient/volume/v3/volume_backup.py +670 -0
- openstackclient/volume/v3/volume_message.py +1 -1
- openstackclient/volume/v3/volume_snapshot.py +97 -0
- openstackclient/volume/v3/volume_transfer_request.py +233 -0
- openstackclient/volume/v3/volume_type.py +967 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/AUTHORS +4 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/METADATA +2 -3
- python_openstackclient-7.0.0.dist-info/RECORD +502 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/entry_points.txt +33 -27
- python_openstackclient-7.0.0.dist-info/pbr.json +1 -0
- python_openstackclient-6.6.1.dist-info/RECORD +0 -489
- python_openstackclient-6.6.1.dist-info/pbr.json +0 -1
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/LICENSE +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/WHEEL +0 -0
- {python_openstackclient-6.6.1.dist-info → python_openstackclient-7.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
"""Volume v3 snapshot action implementations"""
|
|
16
|
+
|
|
17
|
+
import logging
|
|
18
|
+
|
|
19
|
+
from osc_lib.command import command
|
|
20
|
+
from osc_lib import exceptions
|
|
21
|
+
from osc_lib import utils
|
|
22
|
+
|
|
23
|
+
from openstackclient.i18n import _
|
|
24
|
+
|
|
25
|
+
LOG = logging.getLogger(__name__)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class DeleteVolumeSnapshot(command.Command):
|
|
29
|
+
_description = _("Delete volume snapshot(s)")
|
|
30
|
+
|
|
31
|
+
def get_parser(self, prog_name):
|
|
32
|
+
parser = super().get_parser(prog_name)
|
|
33
|
+
parser.add_argument(
|
|
34
|
+
"snapshots",
|
|
35
|
+
metavar="<snapshot>",
|
|
36
|
+
nargs="+",
|
|
37
|
+
help=_("Snapshot(s) to delete (name or ID)"),
|
|
38
|
+
)
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
'--force',
|
|
41
|
+
action='store_true',
|
|
42
|
+
help=_(
|
|
43
|
+
"Attempt forced removal of snapshot(s), "
|
|
44
|
+
"regardless of state (defaults to False)"
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
parser.add_argument(
|
|
48
|
+
'--remote',
|
|
49
|
+
action='store_true',
|
|
50
|
+
help=_(
|
|
51
|
+
'Unmanage the snapshot, removing it from the Block Storage '
|
|
52
|
+
'service management but not from the backend.'
|
|
53
|
+
),
|
|
54
|
+
)
|
|
55
|
+
return parser
|
|
56
|
+
|
|
57
|
+
def take_action(self, parsed_args):
|
|
58
|
+
volume_client = self.app.client_manager.volume
|
|
59
|
+
volume_client_sdk = self.app.client_manager.sdk_connection.volume
|
|
60
|
+
|
|
61
|
+
result = 0
|
|
62
|
+
|
|
63
|
+
if parsed_args.remote:
|
|
64
|
+
if parsed_args.force:
|
|
65
|
+
msg = _(
|
|
66
|
+
"The --force option is not supported with the "
|
|
67
|
+
"--remote parameter."
|
|
68
|
+
)
|
|
69
|
+
raise exceptions.CommandError(msg)
|
|
70
|
+
|
|
71
|
+
for i in parsed_args.snapshots:
|
|
72
|
+
try:
|
|
73
|
+
snapshot_id = utils.find_resource(
|
|
74
|
+
volume_client.volume_snapshots, i
|
|
75
|
+
).id
|
|
76
|
+
if parsed_args.remote:
|
|
77
|
+
volume_client_sdk.unmanage_snapshot(snapshot_id)
|
|
78
|
+
else:
|
|
79
|
+
volume_client.volume_snapshots.delete(
|
|
80
|
+
snapshot_id, parsed_args.force
|
|
81
|
+
)
|
|
82
|
+
except Exception as e:
|
|
83
|
+
result += 1
|
|
84
|
+
LOG.error(
|
|
85
|
+
_(
|
|
86
|
+
"Failed to delete snapshot with "
|
|
87
|
+
"name or ID '%(snapshot)s': %(e)s"
|
|
88
|
+
)
|
|
89
|
+
% {'snapshot': i, 'e': e}
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
if result > 0:
|
|
93
|
+
total = len(parsed_args.snapshots)
|
|
94
|
+
msg = _(
|
|
95
|
+
"%(result)s of %(total)s snapshots failed " "to delete."
|
|
96
|
+
) % {'result': result, 'total': total}
|
|
97
|
+
raise exceptions.CommandError(msg)
|
|
@@ -0,0 +1,233 @@
|
|
|
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
|
+
"""Volume v3 transfer action implementations"""
|
|
16
|
+
|
|
17
|
+
import logging
|
|
18
|
+
|
|
19
|
+
from cinderclient import api_versions
|
|
20
|
+
from osc_lib.command import command
|
|
21
|
+
from osc_lib import exceptions
|
|
22
|
+
from osc_lib import utils
|
|
23
|
+
|
|
24
|
+
from openstackclient.i18n import _
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
LOG = logging.getLogger(__name__)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class AcceptTransferRequest(command.ShowOne):
|
|
31
|
+
_description = _("Accept volume transfer request.")
|
|
32
|
+
|
|
33
|
+
def get_parser(self, prog_name):
|
|
34
|
+
parser = super().get_parser(prog_name)
|
|
35
|
+
parser.add_argument(
|
|
36
|
+
'transfer_request',
|
|
37
|
+
metavar="<transfer-request-id>",
|
|
38
|
+
help=_('Volume transfer request to accept (ID only)'),
|
|
39
|
+
)
|
|
40
|
+
parser.add_argument(
|
|
41
|
+
'--auth-key',
|
|
42
|
+
metavar="<key>",
|
|
43
|
+
required=True,
|
|
44
|
+
help=_('Volume transfer request authentication key'),
|
|
45
|
+
)
|
|
46
|
+
return parser
|
|
47
|
+
|
|
48
|
+
def take_action(self, parsed_args):
|
|
49
|
+
volume_client = self.app.client_manager.volume
|
|
50
|
+
|
|
51
|
+
try:
|
|
52
|
+
transfer_request_id = utils.find_resource(
|
|
53
|
+
volume_client.transfers, parsed_args.transfer_request
|
|
54
|
+
).id
|
|
55
|
+
except exceptions.CommandError:
|
|
56
|
+
# Non-admin users will fail to lookup name -> ID so we just
|
|
57
|
+
# move on and attempt with the user-supplied information
|
|
58
|
+
transfer_request_id = parsed_args.transfer_request
|
|
59
|
+
|
|
60
|
+
transfer_accept = volume_client.transfers.accept(
|
|
61
|
+
transfer_request_id,
|
|
62
|
+
parsed_args.auth_key,
|
|
63
|
+
)
|
|
64
|
+
transfer_accept._info.pop("links", None)
|
|
65
|
+
|
|
66
|
+
return zip(*sorted(transfer_accept._info.items()))
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class CreateTransferRequest(command.ShowOne):
|
|
70
|
+
_description = _("Create volume transfer request.")
|
|
71
|
+
|
|
72
|
+
def get_parser(self, prog_name):
|
|
73
|
+
parser = super().get_parser(prog_name)
|
|
74
|
+
parser.add_argument(
|
|
75
|
+
'--name',
|
|
76
|
+
metavar="<name>",
|
|
77
|
+
help=_('New transfer request name (default to None)'),
|
|
78
|
+
)
|
|
79
|
+
parser.add_argument(
|
|
80
|
+
'--snapshots',
|
|
81
|
+
action='store_true',
|
|
82
|
+
dest='snapshots',
|
|
83
|
+
help=_(
|
|
84
|
+
'Allow transfer volumes without snapshots (default) '
|
|
85
|
+
'(supported by --os-volume-api-version 3.55 or later)'
|
|
86
|
+
),
|
|
87
|
+
default=None,
|
|
88
|
+
)
|
|
89
|
+
parser.add_argument(
|
|
90
|
+
'--no-snapshots',
|
|
91
|
+
action='store_false',
|
|
92
|
+
dest='snapshots',
|
|
93
|
+
help=_(
|
|
94
|
+
'Disallow transfer volumes without snapshots '
|
|
95
|
+
'(supported by --os-volume-api-version 3.55 or later)'
|
|
96
|
+
),
|
|
97
|
+
)
|
|
98
|
+
parser.add_argument(
|
|
99
|
+
'volume',
|
|
100
|
+
metavar="<volume>",
|
|
101
|
+
help=_('Volume to transfer (name or ID)'),
|
|
102
|
+
)
|
|
103
|
+
return parser
|
|
104
|
+
|
|
105
|
+
def take_action(self, parsed_args):
|
|
106
|
+
volume_client = self.app.client_manager.volume
|
|
107
|
+
|
|
108
|
+
kwargs = {}
|
|
109
|
+
|
|
110
|
+
if parsed_args.snapshots is not None:
|
|
111
|
+
if volume_client.api_version < api_versions.APIVersion('3.55'):
|
|
112
|
+
msg = _(
|
|
113
|
+
"--os-volume-api-version 3.55 or greater is required to "
|
|
114
|
+
"support the '--(no-)snapshots' option"
|
|
115
|
+
)
|
|
116
|
+
raise exceptions.CommandError(msg)
|
|
117
|
+
|
|
118
|
+
# unfortunately this option is negative so we have to reverse
|
|
119
|
+
# things
|
|
120
|
+
kwargs['no_snapshots'] = not parsed_args.snapshots
|
|
121
|
+
|
|
122
|
+
volume_id = utils.find_resource(
|
|
123
|
+
volume_client.volumes,
|
|
124
|
+
parsed_args.volume,
|
|
125
|
+
).id
|
|
126
|
+
volume_transfer_request = volume_client.transfers.create(
|
|
127
|
+
volume_id,
|
|
128
|
+
parsed_args.name,
|
|
129
|
+
**kwargs,
|
|
130
|
+
)
|
|
131
|
+
volume_transfer_request._info.pop("links", None)
|
|
132
|
+
|
|
133
|
+
return zip(*sorted(volume_transfer_request._info.items()))
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
class DeleteTransferRequest(command.Command):
|
|
137
|
+
_description = _("Delete volume transfer request(s).")
|
|
138
|
+
|
|
139
|
+
def get_parser(self, prog_name):
|
|
140
|
+
parser = super().get_parser(prog_name)
|
|
141
|
+
parser.add_argument(
|
|
142
|
+
'transfer_request',
|
|
143
|
+
metavar="<transfer-request>",
|
|
144
|
+
nargs="+",
|
|
145
|
+
help=_('Volume transfer request(s) to delete (name or ID)'),
|
|
146
|
+
)
|
|
147
|
+
return parser
|
|
148
|
+
|
|
149
|
+
def take_action(self, parsed_args):
|
|
150
|
+
volume_client = self.app.client_manager.volume
|
|
151
|
+
result = 0
|
|
152
|
+
|
|
153
|
+
for t in parsed_args.transfer_request:
|
|
154
|
+
try:
|
|
155
|
+
transfer_request_id = utils.find_resource(
|
|
156
|
+
volume_client.transfers,
|
|
157
|
+
t,
|
|
158
|
+
).id
|
|
159
|
+
volume_client.transfers.delete(transfer_request_id)
|
|
160
|
+
except Exception as e:
|
|
161
|
+
result += 1
|
|
162
|
+
LOG.error(
|
|
163
|
+
_(
|
|
164
|
+
"Failed to delete volume transfer request "
|
|
165
|
+
"with name or ID '%(transfer)s': %(e)s"
|
|
166
|
+
)
|
|
167
|
+
% {'transfer': t, 'e': e}
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
if result > 0:
|
|
171
|
+
total = len(parsed_args.transfer_request)
|
|
172
|
+
msg = _(
|
|
173
|
+
"%(result)s of %(total)s volume transfer requests failed"
|
|
174
|
+
" to delete"
|
|
175
|
+
) % {'result': result, 'total': total}
|
|
176
|
+
raise exceptions.CommandError(msg)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class ListTransferRequest(command.Lister):
|
|
180
|
+
_description = _("Lists all volume transfer requests.")
|
|
181
|
+
|
|
182
|
+
def get_parser(self, prog_name):
|
|
183
|
+
parser = super().get_parser(prog_name)
|
|
184
|
+
parser.add_argument(
|
|
185
|
+
'--all-projects',
|
|
186
|
+
dest='all_projects',
|
|
187
|
+
action="store_true",
|
|
188
|
+
default=False,
|
|
189
|
+
help=_('Include all projects (admin only)'),
|
|
190
|
+
)
|
|
191
|
+
return parser
|
|
192
|
+
|
|
193
|
+
def take_action(self, parsed_args):
|
|
194
|
+
columns = ['ID', 'Name', 'Volume ID']
|
|
195
|
+
column_headers = ['ID', 'Name', 'Volume']
|
|
196
|
+
|
|
197
|
+
volume_client = self.app.client_manager.volume
|
|
198
|
+
|
|
199
|
+
volume_transfer_result = volume_client.transfers.list(
|
|
200
|
+
detailed=True,
|
|
201
|
+
search_opts={'all_tenants': parsed_args.all_projects},
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
column_headers,
|
|
206
|
+
(
|
|
207
|
+
utils.get_item_properties(s, columns)
|
|
208
|
+
for s in volume_transfer_result
|
|
209
|
+
),
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
class ShowTransferRequest(command.ShowOne):
|
|
214
|
+
_description = _("Show volume transfer request details.")
|
|
215
|
+
|
|
216
|
+
def get_parser(self, prog_name):
|
|
217
|
+
parser = super().get_parser(prog_name)
|
|
218
|
+
parser.add_argument(
|
|
219
|
+
'transfer_request',
|
|
220
|
+
metavar="<transfer-request>",
|
|
221
|
+
help=_('Volume transfer request to display (name or ID)'),
|
|
222
|
+
)
|
|
223
|
+
return parser
|
|
224
|
+
|
|
225
|
+
def take_action(self, parsed_args):
|
|
226
|
+
volume_client = self.app.client_manager.volume
|
|
227
|
+
volume_transfer_request = utils.find_resource(
|
|
228
|
+
volume_client.transfers,
|
|
229
|
+
parsed_args.transfer_request,
|
|
230
|
+
)
|
|
231
|
+
volume_transfer_request._info.pop("links", None)
|
|
232
|
+
|
|
233
|
+
return zip(*sorted(volume_transfer_request._info.items()))
|