python-openstackclient 9.0.0__py3-none-any.whl → 10.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +59 -43
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +36 -34
- openstackclient/common/pagination.py +50 -6
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +11 -6
- openstackclient/common/quota.py +105 -103
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +42 -22
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +16 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +35 -16
- openstackclient/compute/v2/server.py +268 -179
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +28 -12
- openstackclient/compute/v2/server_group.py +23 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +27 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +13 -5
- openstackclient/compute/v2/service.py +17 -8
- openstackclient/compute/v2/usage.py +28 -23
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +82 -47
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +23 -11
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +32 -12
- openstackclient/identity/v3/application_credential.py +66 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +39 -17
- openstackclient/identity/v3/domain.py +40 -19
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +98 -64
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +44 -20
- openstackclient/identity/v3/group.py +64 -40
- openstackclient/identity/v3/identity_provider.py +95 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +42 -17
- openstackclient/identity/v3/mapping.py +58 -28
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +59 -26
- openstackclient/identity/v3/region.py +39 -17
- openstackclient/identity/v3/registered_limit.py +41 -16
- openstackclient/identity/v3/role.py +62 -31
- openstackclient/identity/v3/role_assignment.py +25 -7
- openstackclient/identity/v3/service.py +39 -17
- openstackclient/identity/v3/service_provider.py +40 -16
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +39 -18
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +86 -36
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +16 -11
- openstackclient/image/v2/image.py +88 -56
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +117 -20
- openstackclient/image/v2/metadef_objects.py +32 -19
- openstackclient/image/v2/metadef_properties.py +30 -16
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +25 -27
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +27 -54
- openstackclient/network/v2/address_group.py +39 -16
- openstackclient/network/v2/address_scope.py +36 -20
- openstackclient/network/v2/bgpvpn/bgpvpn.py +477 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +226 -0
- openstackclient/network/v2/bgpvpn/port_association.py +504 -0
- openstackclient/network/v2/bgpvpn/router_association.py +301 -0
- openstackclient/network/v2/default_security_group_rule.py +31 -14
- openstackclient/network/v2/floating_ip.py +121 -162
- openstackclient/network/v2/floating_ip_port_forwarding.py +41 -19
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +499 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +610 -0
- openstackclient/network/v2/ip_availability.py +25 -8
- openstackclient/network/v2/l3_conntrack_helper.py +35 -13
- openstackclient/network/v2/local_ip.py +27 -13
- openstackclient/network/v2/local_ip_association.py +17 -7
- openstackclient/network/v2/ndp_proxy.py +23 -11
- openstackclient/network/v2/network.py +213 -213
- openstackclient/network/v2/network_agent.py +77 -34
- openstackclient/network/v2/network_auto_allocated_topology.py +27 -15
- openstackclient/network/v2/network_flavor.py +45 -21
- openstackclient/network/v2/network_flavor_profile.py +42 -17
- openstackclient/network/v2/network_meter.py +39 -15
- openstackclient/network/v2/network_meter_rule.py +40 -12
- openstackclient/network/v2/network_qos_policy.py +39 -21
- openstackclient/network/v2/network_qos_rule.py +48 -18
- openstackclient/network/v2/network_qos_rule_type.py +28 -9
- openstackclient/network/v2/network_rbac.py +34 -16
- openstackclient/network/v2/network_segment.py +32 -11
- openstackclient/network/v2/network_segment_range.py +70 -31
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +41 -22
- openstackclient/network/v2/port.py +141 -40
- openstackclient/network/v2/router.py +101 -67
- openstackclient/network/v2/security_group.py +97 -198
- openstackclient/network/v2/security_group_rule.py +115 -282
- openstackclient/network/v2/subnet.py +63 -34
- openstackclient/network/v2/subnet_pool.py +42 -24
- openstackclient/network/v2/taas/tap_flow.py +35 -14
- openstackclient/network/v2/taas/tap_mirror.py +28 -14
- openstackclient/network/v2/taas/tap_service.py +26 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +28 -16
- openstackclient/object/v1/object.py +28 -16
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +59 -19
- openstackclient/tests/functional/identity/v3/test_application_credential.py +1 -1
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_mapping.py +81 -0
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_group.py +163 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +11 -7
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_limits.py +1 -1
- openstackclient/tests/unit/common/test_module.py +82 -44
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +15 -26
- openstackclient/tests/unit/compute/v2/fakes.py +26 -57
- openstackclient/tests/unit/compute/v2/test_agent.py +4 -4
- openstackclient/tests/unit/compute/v2/test_aggregate.py +1 -1
- openstackclient/tests/unit/compute/v2/test_console.py +2 -2
- openstackclient/tests/unit/compute/v2/test_console_connection.py +1 -1
- openstackclient/tests/unit/compute/v2/test_flavor.py +29 -3
- openstackclient/tests/unit/compute/v2/test_host.py +3 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +2 -2
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +7 -7
- openstackclient/tests/unit/compute/v2/test_server.py +26 -111
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_group.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_image.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/compute/v2/test_server_volume.py +2 -2
- openstackclient/tests/unit/compute/v2/test_service.py +3 -3
- openstackclient/tests/unit/compute/v2/test_usage.py +1 -1
- openstackclient/tests/unit/identity/v2_0/fakes.py +3 -7
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_project.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_service.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_token.py +2 -2
- openstackclient/tests/unit/identity/v2_0/test_user.py +1 -1
- openstackclient/tests/unit/identity/v3/fakes.py +8 -38
- openstackclient/tests/unit/identity/v3/test_access_rule.py +3 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +4 -4
- openstackclient/tests/unit/identity/v3/test_credential.py +5 -5
- openstackclient/tests/unit/identity/v3/test_domain.py +5 -5
- openstackclient/tests/unit/identity/v3/test_endpoint.py +6 -6
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +12 -22
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_implied_role.py +1 -1
- openstackclient/tests/unit/identity/v3/test_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_mappings.py +163 -79
- openstackclient/tests/unit/identity/v3/test_project.py +28 -5
- openstackclient/tests/unit/identity/v3/test_protocol.py +3 -3
- openstackclient/tests/unit/identity/v3/test_region.py +5 -5
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_role.py +8 -8
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v3/test_service.py +5 -5
- openstackclient/tests/unit/identity/v3/test_token.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +77 -10
- openstackclient/tests/unit/image/v2/test_image.py +11 -11
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fakes.py +5 -77
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +923 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +1005 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +26 -2
- openstackclient/tests/unit/network/v2/test_address_scope.py +24 -0
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +27 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +37 -13
- openstackclient/tests/unit/network/v2/test_ip_availability.py +25 -0
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +29 -3
- openstackclient/tests/unit/network/v2/test_network.py +74 -12
- openstackclient/tests/unit/network/v2/test_network_agent.py +58 -5
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +26 -2
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_meter.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_rbac.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +31 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_port.py +166 -0
- openstackclient/tests/unit/network/v2/test_router.py +36 -16
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +11 -8
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +28 -37
- openstackclient/tests/unit/network/v2/test_subnet.py +30 -5
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +26 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +21 -140
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +8 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +205 -100
- openstackclient/tests/unit/volume/v3/test_backup_record.py +114 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group.py +720 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group_snapshot.py +354 -0
- openstackclient/tests/unit/volume/v3/test_qos_specs.py +455 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -1
- openstackclient/tests/unit/volume/v3/test_volume_backend.py +158 -0
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +65 -0
- openstackclient/tests/unit/volume/v3/test_volume_host.py +115 -0
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +61 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +29 -17
- openstackclient/volume/v2/consistency_group_snapshot.py +25 -10
- openstackclient/volume/v2/qos_specs.py +28 -17
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +60 -30
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -23
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +49 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/backup_record.py +94 -0
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/consistency_group.py +400 -0
- openstackclient/volume/v3/consistency_group_snapshot.py +225 -0
- openstackclient/volume/v3/qos_specs.py +389 -0
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +92 -40
- openstackclient/volume/v3/volume_attachment.py +47 -21
- openstackclient/volume/v3/volume_backend.py +130 -0
- openstackclient/volume/v3/volume_backup.py +55 -27
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +34 -17
- openstackclient/volume/v3/volume_group_type.py +27 -14
- openstackclient/volume/v3/volume_host.py +74 -0
- openstackclient/volume/v3/volume_message.py +18 -8
- openstackclient/volume/v3/volume_snapshot.py +70 -32
- openstackclient/volume/v3/volume_transfer_request.py +31 -13
- openstackclient/volume/v3/volume_type.py +42 -24
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/METADATA +7 -8
- python_openstackclient-10.1.0.dist-info/RECORD +524 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/entry_points.txt +77 -25
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.1.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-9.0.0.dist-info/RECORD +0 -499
- python_openstackclient-9.0.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/top_level.txt +0 -0
|
@@ -14,12 +14,15 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v2 snapshot action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
17
18
|
import functools
|
|
18
19
|
import logging
|
|
19
|
-
import
|
|
20
|
+
from collections.abc import Iterable, Sequence
|
|
21
|
+
from typing import Any
|
|
20
22
|
|
|
21
23
|
from cliff import columns as cliff_columns
|
|
22
24
|
from openstack.block_storage.v2 import snapshot as _snapshot
|
|
25
|
+
from openstack import utils as sdk_utils
|
|
23
26
|
from osc_lib.cli import format_columns
|
|
24
27
|
from osc_lib.cli import parseractions
|
|
25
28
|
from osc_lib import exceptions
|
|
@@ -45,11 +48,13 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
45
48
|
``functools.partial(VolumeIdColumn, volume_cache)``.
|
|
46
49
|
"""
|
|
47
50
|
|
|
48
|
-
def __init__(
|
|
51
|
+
def __init__(
|
|
52
|
+
self, value: str, volume_cache: dict[str, Any] | None = None
|
|
53
|
+
) -> None:
|
|
49
54
|
super().__init__(value)
|
|
50
55
|
self._volume_cache = volume_cache or {}
|
|
51
56
|
|
|
52
|
-
def human_readable(self):
|
|
57
|
+
def human_readable(self) -> str:
|
|
53
58
|
"""Return a volume name if available
|
|
54
59
|
|
|
55
60
|
:rtype: either the volume ID or name
|
|
@@ -61,7 +66,7 @@ class VolumeIdColumn(cliff_columns.FormattableColumn[str]):
|
|
|
61
66
|
return volume
|
|
62
67
|
|
|
63
68
|
|
|
64
|
-
def _format_snapshot(snapshot: _snapshot.Snapshot) -> dict[str,
|
|
69
|
+
def _format_snapshot(snapshot: _snapshot.Snapshot) -> dict[str, object]:
|
|
65
70
|
# Some columns returned by openstacksdk should not be shown because they're
|
|
66
71
|
# either irrelevant or duplicates
|
|
67
72
|
ignored_columns = {
|
|
@@ -100,7 +105,7 @@ def _format_snapshot(snapshot: _snapshot.Snapshot) -> dict[str, ty.Any]:
|
|
|
100
105
|
class CreateVolumeSnapshot(command.ShowOne):
|
|
101
106
|
_description = _("Create new volume snapshot")
|
|
102
107
|
|
|
103
|
-
def get_parser(self, prog_name):
|
|
108
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
104
109
|
parser = super().get_parser(prog_name)
|
|
105
110
|
parser.add_argument(
|
|
106
111
|
"snapshot_name",
|
|
@@ -150,8 +155,12 @@ class CreateVolumeSnapshot(command.ShowOne):
|
|
|
150
155
|
)
|
|
151
156
|
return parser
|
|
152
157
|
|
|
153
|
-
def take_action(
|
|
154
|
-
|
|
158
|
+
def take_action(
|
|
159
|
+
self, parsed_args: argparse.Namespace
|
|
160
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
161
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
162
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
163
|
+
)
|
|
155
164
|
|
|
156
165
|
volume = parsed_args.volume
|
|
157
166
|
if not parsed_args.volume:
|
|
@@ -186,13 +195,14 @@ class CreateVolumeSnapshot(command.ShowOne):
|
|
|
186
195
|
)
|
|
187
196
|
|
|
188
197
|
data = _format_snapshot(snapshot)
|
|
189
|
-
|
|
198
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
199
|
+
return col_headers, col_data
|
|
190
200
|
|
|
191
201
|
|
|
192
202
|
class DeleteVolumeSnapshot(command.Command):
|
|
193
203
|
_description = _("Delete volume snapshot(s)")
|
|
194
204
|
|
|
195
|
-
def get_parser(self, prog_name):
|
|
205
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
196
206
|
parser = super().get_parser(prog_name)
|
|
197
207
|
parser.add_argument(
|
|
198
208
|
"snapshots",
|
|
@@ -210,8 +220,10 @@ class DeleteVolumeSnapshot(command.Command):
|
|
|
210
220
|
)
|
|
211
221
|
return parser
|
|
212
222
|
|
|
213
|
-
def take_action(self, parsed_args):
|
|
214
|
-
volume_client =
|
|
223
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
224
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
225
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
226
|
+
)
|
|
215
227
|
result = 0
|
|
216
228
|
|
|
217
229
|
for snapshot in parsed_args.snapshots:
|
|
@@ -220,7 +232,8 @@ class DeleteVolumeSnapshot(command.Command):
|
|
|
220
232
|
snapshot, ignore_missing=False
|
|
221
233
|
).id
|
|
222
234
|
volume_client.delete_snapshot(
|
|
223
|
-
snapshot_id,
|
|
235
|
+
snapshot_id,
|
|
236
|
+
force=parsed_args.force,
|
|
224
237
|
)
|
|
225
238
|
except Exception as e:
|
|
226
239
|
result += 1
|
|
@@ -244,7 +257,7 @@ class DeleteVolumeSnapshot(command.Command):
|
|
|
244
257
|
class ListVolumeSnapshot(command.Lister):
|
|
245
258
|
_description = _("List volume snapshots")
|
|
246
259
|
|
|
247
|
-
def get_parser(self, prog_name):
|
|
260
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
248
261
|
parser = super().get_parser(prog_name)
|
|
249
262
|
parser.add_argument(
|
|
250
263
|
'--all-projects',
|
|
@@ -295,8 +308,12 @@ class ListVolumeSnapshot(command.Lister):
|
|
|
295
308
|
pagination.add_marker_pagination_option_to_parser(parser)
|
|
296
309
|
return parser
|
|
297
310
|
|
|
298
|
-
def take_action(
|
|
299
|
-
|
|
311
|
+
def take_action(
|
|
312
|
+
self, parsed_args: argparse.Namespace
|
|
313
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
314
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
315
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
316
|
+
)
|
|
300
317
|
identity_client = self.app.client_manager.identity
|
|
301
318
|
|
|
302
319
|
columns: tuple[str, ...] = (
|
|
@@ -359,6 +376,7 @@ class ListVolumeSnapshot(command.Lister):
|
|
|
359
376
|
data = volume_client.snapshots(
|
|
360
377
|
marker=parsed_args.marker,
|
|
361
378
|
limit=parsed_args.limit,
|
|
379
|
+
max_items=parsed_args.max_items,
|
|
362
380
|
all_projects=all_projects,
|
|
363
381
|
project_id=project_id,
|
|
364
382
|
name=parsed_args.name,
|
|
@@ -384,7 +402,7 @@ class ListVolumeSnapshot(command.Lister):
|
|
|
384
402
|
class SetVolumeSnapshot(command.Command):
|
|
385
403
|
_description = _("Set volume snapshot properties")
|
|
386
404
|
|
|
387
|
-
def get_parser(self, prog_name):
|
|
405
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
388
406
|
parser = super().get_parser(prog_name)
|
|
389
407
|
parser.add_argument(
|
|
390
408
|
'snapshot',
|
|
@@ -440,8 +458,10 @@ class SetVolumeSnapshot(command.Command):
|
|
|
440
458
|
)
|
|
441
459
|
return parser
|
|
442
460
|
|
|
443
|
-
def take_action(self, parsed_args):
|
|
444
|
-
volume_client =
|
|
461
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
462
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
463
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
464
|
+
)
|
|
445
465
|
|
|
446
466
|
snapshot = volume_client.find_snapshot(
|
|
447
467
|
parsed_args.snapshot, ignore_missing=False
|
|
@@ -499,7 +519,7 @@ class SetVolumeSnapshot(command.Command):
|
|
|
499
519
|
class ShowVolumeSnapshot(command.ShowOne):
|
|
500
520
|
_description = _("Display volume snapshot details")
|
|
501
521
|
|
|
502
|
-
def get_parser(self, prog_name):
|
|
522
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
503
523
|
parser = super().get_parser(prog_name)
|
|
504
524
|
parser.add_argument(
|
|
505
525
|
"snapshot",
|
|
@@ -508,21 +528,26 @@ class ShowVolumeSnapshot(command.ShowOne):
|
|
|
508
528
|
)
|
|
509
529
|
return parser
|
|
510
530
|
|
|
511
|
-
def take_action(
|
|
512
|
-
|
|
531
|
+
def take_action(
|
|
532
|
+
self, parsed_args: argparse.Namespace
|
|
533
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
534
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
535
|
+
self.app.client_manager.sdk_connection.volume, '2'
|
|
536
|
+
)
|
|
513
537
|
|
|
514
538
|
snapshot = volume_client.find_snapshot(
|
|
515
539
|
parsed_args.snapshot, ignore_missing=False
|
|
516
540
|
)
|
|
517
541
|
|
|
518
542
|
data = _format_snapshot(snapshot)
|
|
519
|
-
|
|
543
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
544
|
+
return col_headers, col_data
|
|
520
545
|
|
|
521
546
|
|
|
522
547
|
class UnsetVolumeSnapshot(command.Command):
|
|
523
548
|
_description = _("Unset volume snapshot properties")
|
|
524
549
|
|
|
525
|
-
def get_parser(self, prog_name):
|
|
550
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
526
551
|
parser = super().get_parser(prog_name)
|
|
527
552
|
parser.add_argument(
|
|
528
553
|
'snapshot',
|
|
@@ -542,7 +567,7 @@ class UnsetVolumeSnapshot(command.Command):
|
|
|
542
567
|
)
|
|
543
568
|
return parser
|
|
544
569
|
|
|
545
|
-
def take_action(self, parsed_args):
|
|
570
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
546
571
|
volume_client = self.app.client_manager.sdk_connection.volume
|
|
547
572
|
|
|
548
573
|
snapshot = volume_client.find_snapshot(
|
|
@@ -14,7 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v2 transfer 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 exceptions
|
|
20
23
|
from osc_lib import utils
|
|
@@ -29,7 +32,7 @@ LOG = logging.getLogger(__name__)
|
|
|
29
32
|
class AcceptTransferRequest(command.ShowOne):
|
|
30
33
|
_description = _("Accept volume transfer request.")
|
|
31
34
|
|
|
32
|
-
def get_parser(self, prog_name):
|
|
35
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
33
36
|
parser = super().get_parser(prog_name)
|
|
34
37
|
parser.add_argument(
|
|
35
38
|
'transfer_request',
|
|
@@ -44,7 +47,9 @@ class AcceptTransferRequest(command.ShowOne):
|
|
|
44
47
|
)
|
|
45
48
|
return parser
|
|
46
49
|
|
|
47
|
-
def take_action(
|
|
50
|
+
def take_action(
|
|
51
|
+
self, parsed_args: argparse.Namespace
|
|
52
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
48
53
|
volume_client = self.app.client_manager.volume
|
|
49
54
|
|
|
50
55
|
try:
|
|
@@ -62,13 +67,14 @@ class AcceptTransferRequest(command.ShowOne):
|
|
|
62
67
|
)
|
|
63
68
|
transfer_accept._info.pop("links", None)
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
col_headers, col_data = zip(*sorted(transfer_accept._info.items()))
|
|
71
|
+
return col_headers, col_data
|
|
66
72
|
|
|
67
73
|
|
|
68
74
|
class CreateTransferRequest(command.ShowOne):
|
|
69
75
|
_description = _("Create volume transfer request.")
|
|
70
76
|
|
|
71
|
-
def get_parser(self, prog_name):
|
|
77
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
72
78
|
parser = super().get_parser(prog_name)
|
|
73
79
|
parser.add_argument(
|
|
74
80
|
'--name',
|
|
@@ -82,7 +88,9 @@ class CreateTransferRequest(command.ShowOne):
|
|
|
82
88
|
)
|
|
83
89
|
return parser
|
|
84
90
|
|
|
85
|
-
def take_action(
|
|
91
|
+
def take_action(
|
|
92
|
+
self, parsed_args: argparse.Namespace
|
|
93
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
86
94
|
volume_client = self.app.client_manager.volume
|
|
87
95
|
|
|
88
96
|
volume_id = utils.find_resource(
|
|
@@ -95,13 +103,16 @@ class CreateTransferRequest(command.ShowOne):
|
|
|
95
103
|
)
|
|
96
104
|
volume_transfer_request._info.pop("links", None)
|
|
97
105
|
|
|
98
|
-
|
|
106
|
+
col_headers, col_data = zip(
|
|
107
|
+
*sorted(volume_transfer_request._info.items())
|
|
108
|
+
)
|
|
109
|
+
return col_headers, col_data
|
|
99
110
|
|
|
100
111
|
|
|
101
112
|
class DeleteTransferRequest(command.Command):
|
|
102
113
|
_description = _("Delete volume transfer request(s).")
|
|
103
114
|
|
|
104
|
-
def get_parser(self, prog_name):
|
|
115
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
105
116
|
parser = super().get_parser(prog_name)
|
|
106
117
|
parser.add_argument(
|
|
107
118
|
'transfer_request',
|
|
@@ -111,7 +122,7 @@ class DeleteTransferRequest(command.Command):
|
|
|
111
122
|
)
|
|
112
123
|
return parser
|
|
113
124
|
|
|
114
|
-
def take_action(self, parsed_args):
|
|
125
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
115
126
|
volume_client = self.app.client_manager.volume
|
|
116
127
|
result = 0
|
|
117
128
|
|
|
@@ -144,7 +155,7 @@ class DeleteTransferRequest(command.Command):
|
|
|
144
155
|
class ListTransferRequest(command.Lister):
|
|
145
156
|
_description = _("Lists all volume transfer requests.")
|
|
146
157
|
|
|
147
|
-
def get_parser(self, prog_name):
|
|
158
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
148
159
|
parser = super().get_parser(prog_name)
|
|
149
160
|
parser.add_argument(
|
|
150
161
|
'--all-projects',
|
|
@@ -155,7 +166,9 @@ class ListTransferRequest(command.Lister):
|
|
|
155
166
|
)
|
|
156
167
|
return parser
|
|
157
168
|
|
|
158
|
-
def take_action(
|
|
169
|
+
def take_action(
|
|
170
|
+
self, parsed_args: argparse.Namespace
|
|
171
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
159
172
|
columns = ['ID', 'Name', 'Volume ID']
|
|
160
173
|
column_headers = ['ID', 'Name', 'Volume']
|
|
161
174
|
|
|
@@ -178,7 +191,7 @@ class ListTransferRequest(command.Lister):
|
|
|
178
191
|
class ShowTransferRequest(command.ShowOne):
|
|
179
192
|
_description = _("Show volume transfer request details.")
|
|
180
193
|
|
|
181
|
-
def get_parser(self, prog_name):
|
|
194
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
182
195
|
parser = super().get_parser(prog_name)
|
|
183
196
|
parser.add_argument(
|
|
184
197
|
'transfer_request',
|
|
@@ -187,7 +200,9 @@ class ShowTransferRequest(command.ShowOne):
|
|
|
187
200
|
)
|
|
188
201
|
return parser
|
|
189
202
|
|
|
190
|
-
def take_action(
|
|
203
|
+
def take_action(
|
|
204
|
+
self, parsed_args: argparse.Namespace
|
|
205
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
191
206
|
volume_client = self.app.client_manager.volume
|
|
192
207
|
volume_transfer_request = utils.find_resource(
|
|
193
208
|
volume_client.transfers,
|
|
@@ -195,4 +210,7 @@ class ShowTransferRequest(command.ShowOne):
|
|
|
195
210
|
)
|
|
196
211
|
volume_transfer_request._info.pop("links", None)
|
|
197
212
|
|
|
198
|
-
|
|
213
|
+
col_headers, col_data = zip(
|
|
214
|
+
*sorted(volume_transfer_request._info.items())
|
|
215
|
+
)
|
|
216
|
+
return col_headers, col_data
|
|
@@ -14,9 +14,12 @@
|
|
|
14
14
|
|
|
15
15
|
"""Volume v2 Type action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import MutableMapping
|
|
17
19
|
import functools
|
|
18
20
|
import logging
|
|
19
|
-
import
|
|
21
|
+
from collections.abc import Iterable, Sequence
|
|
22
|
+
from typing import Any
|
|
20
23
|
|
|
21
24
|
from cliff import columns as cliff_columns
|
|
22
25
|
from osc_lib.cli import format_columns
|
|
@@ -32,7 +35,7 @@ from openstackclient.identity import common as identity_common
|
|
|
32
35
|
LOG = logging.getLogger(__name__)
|
|
33
36
|
|
|
34
37
|
|
|
35
|
-
class EncryptionInfoColumn(cliff_columns.FormattableColumn[
|
|
38
|
+
class EncryptionInfoColumn(cliff_columns.FormattableColumn[Any]):
|
|
36
39
|
"""Formattable column for encryption info column.
|
|
37
40
|
|
|
38
41
|
Unlike the parent FormattableColumn class, the initializer of the
|
|
@@ -43,26 +46,30 @@ class EncryptionInfoColumn(cliff_columns.FormattableColumn[ty.Any]):
|
|
|
43
46
|
``functools.partial(EncryptionInfoColumn encryption_data)``.
|
|
44
47
|
"""
|
|
45
48
|
|
|
46
|
-
def __init__(
|
|
49
|
+
def __init__(
|
|
50
|
+
self, value: Any, encryption_data: dict[str, Any] | None = None
|
|
51
|
+
) -> None:
|
|
47
52
|
super().__init__(value)
|
|
48
53
|
self._encryption_data = encryption_data or {}
|
|
49
54
|
|
|
50
|
-
def _get_encryption_info(self):
|
|
55
|
+
def _get_encryption_info(self) -> Any:
|
|
51
56
|
type_id = self._value
|
|
52
57
|
return self._encryption_data.get(type_id)
|
|
53
58
|
|
|
54
|
-
def human_readable(self):
|
|
59
|
+
def human_readable(self) -> str:
|
|
55
60
|
encryption_info = self._get_encryption_info()
|
|
56
61
|
if encryption_info:
|
|
57
62
|
return utils.format_dict(encryption_info)
|
|
58
63
|
else:
|
|
59
64
|
return '-'
|
|
60
65
|
|
|
61
|
-
def machine_readable(self):
|
|
66
|
+
def machine_readable(self) -> Any:
|
|
62
67
|
return self._get_encryption_info()
|
|
63
68
|
|
|
64
69
|
|
|
65
|
-
def _create_encryption_type(
|
|
70
|
+
def _create_encryption_type(
|
|
71
|
+
volume_client: Any, volume_type: Any, parsed_args: argparse.Namespace
|
|
72
|
+
) -> Any:
|
|
66
73
|
if not parsed_args.encryption_provider:
|
|
67
74
|
msg = _(
|
|
68
75
|
"'--encryption-provider' should be specified while "
|
|
@@ -85,7 +92,9 @@ def _create_encryption_type(volume_client, volume_type, parsed_args):
|
|
|
85
92
|
return encryption
|
|
86
93
|
|
|
87
94
|
|
|
88
|
-
def _set_encryption_type(
|
|
95
|
+
def _set_encryption_type(
|
|
96
|
+
volume_client: Any, volume_type: Any, parsed_args: argparse.Namespace
|
|
97
|
+
) -> None:
|
|
89
98
|
# update the existing encryption type
|
|
90
99
|
body = {}
|
|
91
100
|
for attr in ['provider', 'cipher', 'key_size', 'control_location']:
|
|
@@ -109,7 +118,7 @@ def _set_encryption_type(volume_client, volume_type, parsed_args):
|
|
|
109
118
|
class CreateVolumeType(command.ShowOne):
|
|
110
119
|
_description = _("Create new volume type")
|
|
111
120
|
|
|
112
|
-
def get_parser(self, prog_name):
|
|
121
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
113
122
|
parser = super().get_parser(prog_name)
|
|
114
123
|
parser.add_argument(
|
|
115
124
|
"name",
|
|
@@ -243,7 +252,9 @@ class CreateVolumeType(command.ShowOne):
|
|
|
243
252
|
)
|
|
244
253
|
return parser
|
|
245
254
|
|
|
246
|
-
def take_action(
|
|
255
|
+
def take_action(
|
|
256
|
+
self, parsed_args: argparse.Namespace
|
|
257
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
247
258
|
identity_client = self.app.client_manager.identity
|
|
248
259
|
volume_client = self.app.client_manager.volume
|
|
249
260
|
|
|
@@ -325,13 +336,14 @@ class CreateVolumeType(command.ShowOne):
|
|
|
325
336
|
|
|
326
337
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
|
327
338
|
|
|
328
|
-
|
|
339
|
+
col_headers, col_data = zip(*sorted(volume_type._info.items()))
|
|
340
|
+
return col_headers, col_data
|
|
329
341
|
|
|
330
342
|
|
|
331
343
|
class DeleteVolumeType(command.Command):
|
|
332
344
|
_description = _("Delete volume type(s)")
|
|
333
345
|
|
|
334
|
-
def get_parser(self, prog_name):
|
|
346
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
335
347
|
parser = super().get_parser(prog_name)
|
|
336
348
|
parser.add_argument(
|
|
337
349
|
"volume_types",
|
|
@@ -341,7 +353,7 @@ class DeleteVolumeType(command.Command):
|
|
|
341
353
|
)
|
|
342
354
|
return parser
|
|
343
355
|
|
|
344
|
-
def take_action(self, parsed_args):
|
|
356
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
345
357
|
volume_client = self.app.client_manager.volume
|
|
346
358
|
result = 0
|
|
347
359
|
|
|
@@ -373,7 +385,7 @@ class DeleteVolumeType(command.Command):
|
|
|
373
385
|
class ListVolumeType(command.Lister):
|
|
374
386
|
_description = _("List volume types")
|
|
375
387
|
|
|
376
|
-
def get_parser(self, prog_name):
|
|
388
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
377
389
|
parser = super().get_parser(prog_name)
|
|
378
390
|
parser.add_argument(
|
|
379
391
|
'--long',
|
|
@@ -412,7 +424,9 @@ class ListVolumeType(command.Lister):
|
|
|
412
424
|
)
|
|
413
425
|
return parser
|
|
414
426
|
|
|
415
|
-
def take_action(
|
|
427
|
+
def take_action(
|
|
428
|
+
self, parsed_args: argparse.Namespace
|
|
429
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
416
430
|
volume_client = self.app.client_manager.volume
|
|
417
431
|
|
|
418
432
|
if parsed_args.long:
|
|
@@ -439,7 +453,9 @@ class ListVolumeType(command.Lister):
|
|
|
439
453
|
is_public=parsed_args.is_public,
|
|
440
454
|
)
|
|
441
455
|
|
|
442
|
-
formatters = {
|
|
456
|
+
formatters: MutableMapping[str, Any] = {
|
|
457
|
+
'Extra Specs': format_columns.DictColumn
|
|
458
|
+
}
|
|
443
459
|
|
|
444
460
|
if parsed_args.encryption_type:
|
|
445
461
|
encryption = {}
|
|
@@ -466,7 +482,7 @@ class ListVolumeType(command.Lister):
|
|
|
466
482
|
_EncryptionInfoColumn = functools.partial(
|
|
467
483
|
EncryptionInfoColumn, encryption_data=encryption
|
|
468
484
|
)
|
|
469
|
-
formatters['id'] = _EncryptionInfoColumn
|
|
485
|
+
formatters['id'] = _EncryptionInfoColumn
|
|
470
486
|
|
|
471
487
|
return (
|
|
472
488
|
column_headers,
|
|
@@ -484,7 +500,7 @@ class ListVolumeType(command.Lister):
|
|
|
484
500
|
class SetVolumeType(command.Command):
|
|
485
501
|
_description = _("Set volume type properties")
|
|
486
502
|
|
|
487
|
-
def get_parser(self, prog_name):
|
|
503
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
488
504
|
parser = super().get_parser(prog_name)
|
|
489
505
|
parser.add_argument(
|
|
490
506
|
'volume_type',
|
|
@@ -623,7 +639,7 @@ class SetVolumeType(command.Command):
|
|
|
623
639
|
)
|
|
624
640
|
return parser
|
|
625
641
|
|
|
626
|
-
def take_action(self, parsed_args):
|
|
642
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
627
643
|
volume_client = self.app.client_manager.volume
|
|
628
644
|
identity_client = self.app.client_manager.identity
|
|
629
645
|
|
|
@@ -719,7 +735,7 @@ class SetVolumeType(command.Command):
|
|
|
719
735
|
class ShowVolumeType(command.ShowOne):
|
|
720
736
|
_description = _("Display volume type details")
|
|
721
737
|
|
|
722
|
-
def get_parser(self, prog_name):
|
|
738
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
723
739
|
parser = super().get_parser(prog_name)
|
|
724
740
|
parser.add_argument(
|
|
725
741
|
"volume_type",
|
|
@@ -736,7 +752,9 @@ class ShowVolumeType(command.ShowOne):
|
|
|
736
752
|
)
|
|
737
753
|
return parser
|
|
738
754
|
|
|
739
|
-
def take_action(
|
|
755
|
+
def take_action(
|
|
756
|
+
self, parsed_args: argparse.Namespace
|
|
757
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
740
758
|
volume_client = self.app.client_manager.volume
|
|
741
759
|
volume_type = utils.find_resource(
|
|
742
760
|
volume_client.volume_types, parsed_args.volume_type
|
|
@@ -784,13 +802,14 @@ class ShowVolumeType(command.ShowOne):
|
|
|
784
802
|
e,
|
|
785
803
|
)
|
|
786
804
|
volume_type._info.pop("os-volume-type-access:is_public", None)
|
|
787
|
-
|
|
805
|
+
col_headers, col_data = zip(*sorted(volume_type._info.items()))
|
|
806
|
+
return col_headers, col_data
|
|
788
807
|
|
|
789
808
|
|
|
790
809
|
class UnsetVolumeType(command.Command):
|
|
791
810
|
_description = _("Unset volume type properties")
|
|
792
811
|
|
|
793
|
-
def get_parser(self, prog_name):
|
|
812
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
794
813
|
parser = super().get_parser(prog_name)
|
|
795
814
|
parser.add_argument(
|
|
796
815
|
'volume_type',
|
|
@@ -825,7 +844,7 @@ class UnsetVolumeType(command.Command):
|
|
|
825
844
|
)
|
|
826
845
|
return parser
|
|
827
846
|
|
|
828
|
-
def take_action(self, parsed_args):
|
|
847
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
829
848
|
volume_client = self.app.client_manager.volume
|
|
830
849
|
identity_client = self.app.client_manager.identity
|
|
831
850
|
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
3
|
+
# not use this file except in compliance with the License. You may obtain
|
|
4
|
+
# a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
+
# License for the specific language governing permissions and limitations
|
|
12
|
+
# under the License.
|
|
13
|
+
|
|
14
|
+
"""Volume v3 Backup action implementations"""
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
import logging
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
21
|
+
from osc_lib import utils
|
|
22
|
+
|
|
23
|
+
from openstackclient import command
|
|
24
|
+
from openstackclient.i18n import _
|
|
25
|
+
|
|
26
|
+
LOG = logging.getLogger(__name__)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ExportBackupRecord(command.ShowOne):
|
|
30
|
+
_description = _(
|
|
31
|
+
"""Export volume backup details.
|
|
32
|
+
|
|
33
|
+
Backup information can be imported into a new service instance to be able to
|
|
34
|
+
restore."""
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
38
|
+
parser = super().get_parser(prog_name)
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
"backup",
|
|
41
|
+
metavar="<backup>",
|
|
42
|
+
help=_("Backup to export (name or ID)"),
|
|
43
|
+
)
|
|
44
|
+
return parser
|
|
45
|
+
|
|
46
|
+
def take_action(
|
|
47
|
+
self, parsed_args: argparse.Namespace
|
|
48
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
49
|
+
volume_client = self.app.client_manager.volume
|
|
50
|
+
backup = utils.find_resource(volume_client.backups, parsed_args.backup)
|
|
51
|
+
backup_data = volume_client.backups.export_record(backup.id)
|
|
52
|
+
|
|
53
|
+
# We only want to show "friendly" display names, but also want to keep
|
|
54
|
+
# json structure compatibility with cinderclient
|
|
55
|
+
if parsed_args.formatter == 'table':
|
|
56
|
+
backup_data['Backup Service'] = backup_data.pop('backup_service')
|
|
57
|
+
backup_data['Metadata'] = backup_data.pop('backup_url')
|
|
58
|
+
|
|
59
|
+
col_headers, col_data = zip(*sorted(backup_data.items()))
|
|
60
|
+
return col_headers, col_data
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class ImportBackupRecord(command.ShowOne):
|
|
64
|
+
_description = _(
|
|
65
|
+
"""Import volume backup details.
|
|
66
|
+
|
|
67
|
+
Exported backup details contain the metadata necessary to restore to a new or
|
|
68
|
+
rebuilt service instance"""
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
72
|
+
parser = super().get_parser(prog_name)
|
|
73
|
+
parser.add_argument(
|
|
74
|
+
"backup_service",
|
|
75
|
+
metavar="<backup_service>",
|
|
76
|
+
help=_("Backup service containing the backup."),
|
|
77
|
+
)
|
|
78
|
+
parser.add_argument(
|
|
79
|
+
"backup_metadata",
|
|
80
|
+
metavar="<backup_metadata>",
|
|
81
|
+
help=_("Encoded backup metadata from export."),
|
|
82
|
+
)
|
|
83
|
+
return parser
|
|
84
|
+
|
|
85
|
+
def take_action(
|
|
86
|
+
self, parsed_args: argparse.Namespace
|
|
87
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
88
|
+
volume_client = self.app.client_manager.volume
|
|
89
|
+
backup_data = volume_client.backups.import_record(
|
|
90
|
+
parsed_args.backup_service, parsed_args.backup_metadata
|
|
91
|
+
)
|
|
92
|
+
backup_data.pop('links', None)
|
|
93
|
+
col_headers, col_data = zip(*sorted(backup_data.items()))
|
|
94
|
+
return col_headers, col_data
|
|
@@ -10,6 +10,10 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
import argparse
|
|
14
|
+
from collections.abc import Iterable
|
|
15
|
+
from typing import Any
|
|
16
|
+
|
|
13
17
|
from cinderclient import api_versions
|
|
14
18
|
from osc_lib import exceptions
|
|
15
19
|
|
|
@@ -17,7 +21,9 @@ from openstackclient import command
|
|
|
17
21
|
from openstackclient.i18n import _
|
|
18
22
|
|
|
19
23
|
|
|
20
|
-
def _format_cleanup_response(
|
|
24
|
+
def _format_cleanup_response(
|
|
25
|
+
cleaning: Any, unavailable: Any
|
|
26
|
+
) -> tuple[tuple[str, ...], list[tuple[Any, ...]]]:
|
|
21
27
|
column_headers = (
|
|
22
28
|
'ID',
|
|
23
29
|
'Cluster Name',
|
|
@@ -49,7 +55,7 @@ class BlockStorageCleanup(command.Lister):
|
|
|
49
55
|
This command requires ``--os-volume-api-version`` 3.24 or greater.
|
|
50
56
|
"""
|
|
51
57
|
|
|
52
|
-
def get_parser(self, prog_name):
|
|
58
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
53
59
|
parser = super().get_parser(prog_name)
|
|
54
60
|
parser.add_argument(
|
|
55
61
|
'--cluster',
|
|
@@ -127,7 +133,9 @@ class BlockStorageCleanup(command.Lister):
|
|
|
127
133
|
)
|
|
128
134
|
return parser
|
|
129
135
|
|
|
130
|
-
def take_action(
|
|
136
|
+
def take_action(
|
|
137
|
+
self, parsed_args: argparse.Namespace
|
|
138
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
131
139
|
volume_client = self.app.client_manager.volume
|
|
132
140
|
|
|
133
141
|
if volume_client.api_version < api_versions.APIVersion('3.24'):
|