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
|
@@ -20,14 +20,14 @@ from collections.abc import Callable
|
|
|
20
20
|
import importlib
|
|
21
21
|
import logging
|
|
22
22
|
import sys
|
|
23
|
-
|
|
23
|
+
from typing import TYPE_CHECKING, Any, Protocol, TypeVar, runtime_checkable
|
|
24
24
|
|
|
25
25
|
from osc_lib.cli import client_config
|
|
26
26
|
from osc_lib import clientmanager
|
|
27
27
|
from osc_lib import shell
|
|
28
28
|
import stevedore
|
|
29
29
|
|
|
30
|
-
if
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
31
|
from keystoneauth1 import access as ksa_access
|
|
32
32
|
from openstack.compute.v2 import _proxy as compute_proxy
|
|
33
33
|
from openstack.image.v2 import _proxy as image_proxy
|
|
@@ -37,7 +37,7 @@ if ty.TYPE_CHECKING:
|
|
|
37
37
|
|
|
38
38
|
LOG = logging.getLogger(__name__)
|
|
39
39
|
|
|
40
|
-
PLUGIN_MODULES: list[
|
|
40
|
+
PLUGIN_MODULES: list[Any] = []
|
|
41
41
|
|
|
42
42
|
USER_AGENT = 'python-openstackclient'
|
|
43
43
|
|
|
@@ -50,7 +50,7 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
50
50
|
in osc-lib so we need to maintain a transition period.
|
|
51
51
|
"""
|
|
52
52
|
|
|
53
|
-
if
|
|
53
|
+
if TYPE_CHECKING:
|
|
54
54
|
# we know this will be set by us and will not be nullable
|
|
55
55
|
auth_ref: ksa_access.AccessInfo
|
|
56
56
|
|
|
@@ -62,18 +62,18 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
62
62
|
# services...
|
|
63
63
|
# TODO(stephenfin): We also need to migrate object storage...
|
|
64
64
|
compute: compute_proxy.Proxy
|
|
65
|
-
identity:
|
|
65
|
+
identity: Any
|
|
66
66
|
image: image_proxy.Proxy
|
|
67
67
|
network: network_proxy.Proxy
|
|
68
68
|
object_store: object_store_v1.APIv1
|
|
69
|
-
volume:
|
|
69
|
+
volume: Any
|
|
70
70
|
|
|
71
71
|
def __init__(
|
|
72
72
|
self,
|
|
73
|
-
cli_options=None,
|
|
74
|
-
api_version=None,
|
|
75
|
-
pw_func=None,
|
|
76
|
-
):
|
|
73
|
+
cli_options: Any = None,
|
|
74
|
+
api_version: Any = None,
|
|
75
|
+
pw_func: Any = None,
|
|
76
|
+
) -> None:
|
|
77
77
|
super().__init__(
|
|
78
78
|
cli_options=cli_options,
|
|
79
79
|
api_version=api_version,
|
|
@@ -89,7 +89,7 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
89
89
|
# store original auth_type
|
|
90
90
|
self._original_auth_type = cli_options.auth_type
|
|
91
91
|
|
|
92
|
-
def setup_auth(self):
|
|
92
|
+
def setup_auth(self) -> None:
|
|
93
93
|
"""Set up authentication"""
|
|
94
94
|
|
|
95
95
|
if self._auth_setup_completed:
|
|
@@ -125,7 +125,7 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
125
125
|
|
|
126
126
|
return super().setup_auth()
|
|
127
127
|
|
|
128
|
-
def _fallback_load_auth_plugin(self, e):
|
|
128
|
+
def _fallback_load_auth_plugin(self, e: Exception) -> None:
|
|
129
129
|
# NOTES(RuiChen): Hack to avoid auth plugins choking on data they don't
|
|
130
130
|
# expect, delete fake token and endpoint, then try to
|
|
131
131
|
# load auth plugin again with user specified options.
|
|
@@ -150,52 +150,77 @@ class ClientManager(clientmanager.ClientManager):
|
|
|
150
150
|
else:
|
|
151
151
|
raise e
|
|
152
152
|
|
|
153
|
-
def is_network_endpoint_enabled(self):
|
|
153
|
+
def is_network_endpoint_enabled(self) -> bool:
|
|
154
154
|
"""Check if the network endpoint is enabled"""
|
|
155
155
|
# NOTE(dtroyer): is_service_available() can also return None if
|
|
156
156
|
# there is no Service Catalog, callers here are
|
|
157
157
|
# not expecting that so fold None into True to
|
|
158
158
|
# use Network API by default
|
|
159
|
-
return
|
|
159
|
+
return (
|
|
160
|
+
self.is_service_available(
|
|
161
|
+
'network', self.region_name, self.interface
|
|
162
|
+
)
|
|
163
|
+
is not False
|
|
164
|
+
)
|
|
160
165
|
|
|
161
|
-
def is_compute_endpoint_enabled(self):
|
|
166
|
+
def is_compute_endpoint_enabled(self) -> bool:
|
|
162
167
|
"""Check if Compute endpoint is enabled"""
|
|
163
|
-
return
|
|
168
|
+
return (
|
|
169
|
+
self.is_service_available(
|
|
170
|
+
'compute', self.region_name, self.interface
|
|
171
|
+
)
|
|
172
|
+
is not False
|
|
173
|
+
)
|
|
164
174
|
|
|
165
175
|
# TODO(stephenfin): Drop volume_client argument in OSC 8.0 or later.
|
|
166
|
-
def is_volume_endpoint_enabled(self, volume_client=None):
|
|
176
|
+
def is_volume_endpoint_enabled(self, volume_client: Any = None) -> bool:
|
|
167
177
|
"""Check if volume endpoint is enabled"""
|
|
168
178
|
# We check against the service type and all aliases defined by the
|
|
169
179
|
# Service Types Authority
|
|
170
180
|
# https://service-types.openstack.org/service-types.json
|
|
171
181
|
return (
|
|
172
|
-
self.is_service_available(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
or self.is_service_available(
|
|
182
|
+
self.is_service_available(
|
|
183
|
+
'block-storage', self.region_name, self.interface
|
|
184
|
+
)
|
|
185
|
+
is not False
|
|
186
|
+
or self.is_service_available(
|
|
187
|
+
'volume', self.region_name, self.interface
|
|
188
|
+
)
|
|
189
|
+
is not False
|
|
190
|
+
or self.is_service_available(
|
|
191
|
+
'volumev3', self.region_name, self.interface
|
|
192
|
+
)
|
|
193
|
+
is not False
|
|
194
|
+
or self.is_service_available(
|
|
195
|
+
'volumev2', self.region_name, self.interface
|
|
196
|
+
)
|
|
197
|
+
is not False
|
|
198
|
+
or self.is_service_available(
|
|
199
|
+
'block-store', self.region_name, self.interface
|
|
200
|
+
)
|
|
201
|
+
is not False
|
|
177
202
|
)
|
|
178
203
|
|
|
179
204
|
|
|
180
205
|
# Plugin Support
|
|
181
206
|
|
|
182
|
-
ArgumentParserT =
|
|
207
|
+
ArgumentParserT = TypeVar('ArgumentParserT', bound=argparse.ArgumentParser)
|
|
183
208
|
|
|
184
209
|
|
|
185
|
-
@
|
|
186
|
-
class PluginModule(
|
|
210
|
+
@runtime_checkable # Optional: allows usage with isinstance()
|
|
211
|
+
class PluginModule(Protocol):
|
|
187
212
|
DEFAULT_API_VERSION: str
|
|
188
213
|
API_VERSION_OPTION: str
|
|
189
214
|
API_NAME: str
|
|
190
215
|
API_VERSIONS: tuple[str]
|
|
191
216
|
|
|
192
|
-
make_client: Callable[...,
|
|
217
|
+
make_client: Callable[..., Any]
|
|
193
218
|
build_option_parser: Callable[[ArgumentParserT], ArgumentParserT]
|
|
194
219
|
check_api_version: Callable[[str], bool]
|
|
195
220
|
|
|
196
221
|
|
|
197
222
|
def _on_load_failure_callback(
|
|
198
|
-
manager: stevedore.ExtensionManager,
|
|
223
|
+
manager: stevedore.ExtensionManager[PluginModule],
|
|
199
224
|
ep: importlib.metadata.EntryPoint,
|
|
200
225
|
err: BaseException,
|
|
201
226
|
) -> None:
|
|
@@ -204,7 +229,7 @@ def _on_load_failure_callback(
|
|
|
204
229
|
)
|
|
205
230
|
|
|
206
231
|
|
|
207
|
-
def get_plugin_modules(group):
|
|
232
|
+
def get_plugin_modules(group: str) -> list[Any]:
|
|
208
233
|
"""Find plugin entry points"""
|
|
209
234
|
mod_list = []
|
|
210
235
|
mgr: stevedore.ExtensionManager[PluginModule]
|
|
@@ -238,7 +263,9 @@ def get_plugin_modules(group):
|
|
|
238
263
|
return mod_list
|
|
239
264
|
|
|
240
265
|
|
|
241
|
-
def build_plugin_option_parser(
|
|
266
|
+
def build_plugin_option_parser(
|
|
267
|
+
parser: ArgumentParserT,
|
|
268
|
+
) -> ArgumentParserT:
|
|
242
269
|
"""Add plugin options to the parser"""
|
|
243
270
|
|
|
244
271
|
# Loop through extensions to get parser additions
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
"""Configuration action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
17
|
+
from collections.abc import Iterable, Sequence
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
16
20
|
from keystoneauth1.loading import base
|
|
17
21
|
|
|
18
22
|
from openstackclient import command
|
|
@@ -26,7 +30,7 @@ class ShowConfiguration(command.ShowOne):
|
|
|
26
30
|
|
|
27
31
|
auth_required = False
|
|
28
32
|
|
|
29
|
-
def get_parser(self, prog_name):
|
|
33
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
30
34
|
parser = super().get_parser(prog_name)
|
|
31
35
|
mask_group = parser.add_mutually_exclusive_group()
|
|
32
36
|
mask_group.add_argument(
|
|
@@ -44,7 +48,9 @@ class ShowConfiguration(command.ShowOne):
|
|
|
44
48
|
)
|
|
45
49
|
return parser
|
|
46
50
|
|
|
47
|
-
def take_action(
|
|
51
|
+
def take_action(
|
|
52
|
+
self, parsed_args: argparse.Namespace
|
|
53
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
48
54
|
info = self.app.client_manager.get_configuration()
|
|
49
55
|
|
|
50
56
|
# Assume a default secret list in case we do not have an auth_plugin
|
|
@@ -68,4 +74,5 @@ class ShowConfiguration(command.ShowOne):
|
|
|
68
74
|
if secret_opt in info:
|
|
69
75
|
info[secret_opt] = REDACTED
|
|
70
76
|
|
|
71
|
-
|
|
77
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
78
|
+
return col_headers, col_data
|
|
@@ -15,7 +15,7 @@ import os
|
|
|
15
15
|
from openstackclient.i18n import _
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
def bool_from_str(value, strict=False):
|
|
18
|
+
def bool_from_str(value: bool | str, strict: bool = False) -> bool:
|
|
19
19
|
true_strings = ('1', 't', 'true', 'on', 'y', 'yes')
|
|
20
20
|
false_strings = ('0', 'f', 'false', 'off', 'n', 'no')
|
|
21
21
|
|
|
@@ -39,7 +39,7 @@ def bool_from_str(value, strict=False):
|
|
|
39
39
|
raise ValueError(msg)
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
def boolenv(*vars, default=False):
|
|
42
|
+
def boolenv(*vars: str, default: bool = False) -> bool:
|
|
43
43
|
"""Search for the first defined of possibly many bool-like env vars.
|
|
44
44
|
|
|
45
45
|
Returns the first environment variable defined in vars, or returns the
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Extension action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
18
19
|
import logging
|
|
20
|
+
from collections.abc import Iterable, Sequence
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from osc_lib import utils
|
|
21
24
|
|
|
@@ -25,7 +28,9 @@ from openstackclient.i18n import _
|
|
|
25
28
|
LOG = logging.getLogger(__name__)
|
|
26
29
|
|
|
27
30
|
|
|
28
|
-
def _get_extension_columns(
|
|
31
|
+
def _get_extension_columns(
|
|
32
|
+
item: Any,
|
|
33
|
+
) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
29
34
|
column_map = {
|
|
30
35
|
'updated': 'updated_at',
|
|
31
36
|
}
|
|
@@ -38,7 +43,7 @@ def _get_extension_columns(item):
|
|
|
38
43
|
class ListExtension(command.Lister):
|
|
39
44
|
_description = _("List API extensions")
|
|
40
45
|
|
|
41
|
-
def get_parser(self, prog_name):
|
|
46
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
42
47
|
parser = super().get_parser(prog_name)
|
|
43
48
|
parser.add_argument(
|
|
44
49
|
'--compute',
|
|
@@ -72,7 +77,9 @@ class ListExtension(command.Lister):
|
|
|
72
77
|
)
|
|
73
78
|
return parser
|
|
74
79
|
|
|
75
|
-
def take_action(
|
|
80
|
+
def take_action(
|
|
81
|
+
self, parsed_args: argparse.Namespace
|
|
82
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
76
83
|
columns: tuple[str, ...] = ('Name', 'Alias', 'Description')
|
|
77
84
|
if parsed_args.long:
|
|
78
85
|
columns += ('Namespace', 'Updated At', 'Links')
|
|
@@ -139,7 +146,7 @@ class ListExtension(command.Lister):
|
|
|
139
146
|
class ShowExtension(command.ShowOne):
|
|
140
147
|
_description = _("Show API extension")
|
|
141
148
|
|
|
142
|
-
def get_parser(self, prog_name):
|
|
149
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
143
150
|
parser = super().get_parser(prog_name)
|
|
144
151
|
parser.add_argument(
|
|
145
152
|
'extension',
|
|
@@ -152,7 +159,9 @@ class ShowExtension(command.ShowOne):
|
|
|
152
159
|
)
|
|
153
160
|
return parser
|
|
154
161
|
|
|
155
|
-
def take_action(
|
|
162
|
+
def take_action(
|
|
163
|
+
self, parsed_args: argparse.Namespace
|
|
164
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
156
165
|
client = self.app.client_manager.network
|
|
157
166
|
|
|
158
167
|
extension = client.find_extension(
|
openstackclient/common/limits.py
CHANGED
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Limits Action Implementation"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
18
19
|
import itertools
|
|
20
|
+
from collections.abc import Iterable, Sequence
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from osc_lib import utils
|
|
21
24
|
|
|
@@ -24,8 +27,8 @@ from openstackclient.i18n import _
|
|
|
24
27
|
from openstackclient.identity import common as identity_common
|
|
25
28
|
|
|
26
29
|
|
|
27
|
-
def _format_absolute_limit(absolute_limits):
|
|
28
|
-
info = {}
|
|
30
|
+
def _format_absolute_limit(absolute_limits: Any) -> dict[str, Any]:
|
|
31
|
+
info: dict[str, Any] = {}
|
|
29
32
|
|
|
30
33
|
for key in set(absolute_limits):
|
|
31
34
|
if key in ('id', 'name', 'location'):
|
|
@@ -36,7 +39,7 @@ def _format_absolute_limit(absolute_limits):
|
|
|
36
39
|
return info
|
|
37
40
|
|
|
38
41
|
|
|
39
|
-
def _format_rate_limit(rate_limits):
|
|
42
|
+
def _format_rate_limit(rate_limits: Any) -> Any:
|
|
40
43
|
# flatten this:
|
|
41
44
|
#
|
|
42
45
|
# {'uri': '<uri>', 'limit': [{'value': '<value>', ...], ...}
|
|
@@ -52,7 +55,7 @@ def _format_rate_limit(rate_limits):
|
|
|
52
55
|
class ShowLimits(command.Lister):
|
|
53
56
|
_description = _("Show compute and block storage limits")
|
|
54
57
|
|
|
55
|
-
def get_parser(self, prog_name):
|
|
58
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
56
59
|
parser = super().get_parser(prog_name)
|
|
57
60
|
type_group = parser.add_mutually_exclusive_group(required=True)
|
|
58
61
|
type_group.add_argument(
|
|
@@ -100,7 +103,9 @@ class ShowLimits(command.Lister):
|
|
|
100
103
|
)
|
|
101
104
|
return parser
|
|
102
105
|
|
|
103
|
-
def take_action(
|
|
106
|
+
def take_action(
|
|
107
|
+
self, parsed_args: argparse.Namespace
|
|
108
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
104
109
|
project_id = None
|
|
105
110
|
if parsed_args.project is not None:
|
|
106
111
|
identity_client = self.app.client_manager.identity
|
openstackclient/common/module.py
CHANGED
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
|
|
16
16
|
"""Module action implementation"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
import importlib.metadata
|
|
18
20
|
import sys
|
|
21
|
+
from collections.abc import Iterable, Sequence
|
|
22
|
+
from typing import Any
|
|
19
23
|
|
|
20
24
|
from osc_lib import utils
|
|
21
25
|
|
|
@@ -28,7 +32,7 @@ class ListCommand(command.Lister):
|
|
|
28
32
|
|
|
29
33
|
auth_required = False
|
|
30
34
|
|
|
31
|
-
def get_parser(self, prog_name):
|
|
35
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
32
36
|
parser = super().get_parser(prog_name)
|
|
33
37
|
parser.add_argument(
|
|
34
38
|
'--group',
|
|
@@ -41,7 +45,9 @@ class ListCommand(command.Lister):
|
|
|
41
45
|
)
|
|
42
46
|
return parser
|
|
43
47
|
|
|
44
|
-
def take_action(
|
|
48
|
+
def take_action(
|
|
49
|
+
self, parsed_args: argparse.Namespace
|
|
50
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
45
51
|
cm = self.app.command_manager
|
|
46
52
|
groups = cm.get_command_groups()
|
|
47
53
|
groups = sorted(groups)
|
|
@@ -61,7 +67,7 @@ class ListCommand(command.Lister):
|
|
|
61
67
|
# TODO(bapalm): Fix this when cliff properly supports
|
|
62
68
|
# handling the detection rather than using the hard-code below.
|
|
63
69
|
if parsed_args.formatter == 'table':
|
|
64
|
-
command_names = utils.format_list(command_names, "\n") # type: ignore
|
|
70
|
+
command_names = utils.format_list(command_names, "\n") # type: ignore[assignment]
|
|
65
71
|
|
|
66
72
|
commands.append((group, command_names))
|
|
67
73
|
|
|
@@ -73,7 +79,7 @@ class ListModule(command.ShowOne):
|
|
|
73
79
|
|
|
74
80
|
auth_required = False
|
|
75
81
|
|
|
76
|
-
def get_parser(self, prog_name):
|
|
82
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
77
83
|
parser = super().get_parser(prog_name)
|
|
78
84
|
parser.add_argument(
|
|
79
85
|
'--all',
|
|
@@ -83,38 +89,34 @@ class ListModule(command.ShowOne):
|
|
|
83
89
|
)
|
|
84
90
|
return parser
|
|
85
91
|
|
|
86
|
-
def take_action(
|
|
92
|
+
def take_action(
|
|
93
|
+
self, parsed_args: argparse.Namespace
|
|
94
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
87
95
|
data = {}
|
|
88
96
|
# Get module versions
|
|
89
|
-
|
|
90
|
-
for k in
|
|
91
|
-
|
|
97
|
+
package_distributions = importlib.metadata.packages_distributions()
|
|
98
|
+
for k in sys.modules.keys():
|
|
99
|
+
module = k.split('.')[0]
|
|
92
100
|
# Skip private modules and the modules that had been added,
|
|
93
101
|
# like: keystoneclient, keystoneclient.exceptions and
|
|
94
102
|
# keystoneclient.auth
|
|
95
|
-
if
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
data[k] = mods[k].__version__
|
|
116
|
-
except Exception: # noqa: S110
|
|
117
|
-
# Catch all exceptions, just skip it
|
|
118
|
-
pass
|
|
119
|
-
|
|
120
|
-
return zip(*sorted(data.items()))
|
|
103
|
+
if module.startswith('_') or module in data:
|
|
104
|
+
continue
|
|
105
|
+
|
|
106
|
+
# TODO(dtroyer): Need a better way to decide which modules to
|
|
107
|
+
# show for the default (not --all) invocation.
|
|
108
|
+
# It should be just the things we actually care
|
|
109
|
+
# about like client and plugin modules...
|
|
110
|
+
# Handle xxxclient and openstacksdk
|
|
111
|
+
if parsed_args.all or (
|
|
112
|
+
module.endswith('client') or module == 'openstack'
|
|
113
|
+
):
|
|
114
|
+
try:
|
|
115
|
+
package = package_distributions[module][0]
|
|
116
|
+
data[module] = importlib.metadata.version(package)
|
|
117
|
+
except Exception: # noqa: S110
|
|
118
|
+
# Catch all exceptions, just skip it
|
|
119
|
+
pass
|
|
120
|
+
|
|
121
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
122
|
+
return col_headers, col_data
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
import argparse
|
|
14
|
+
|
|
13
15
|
from osc_lib.cli import parseractions
|
|
14
16
|
|
|
15
17
|
from openstackclient.i18n import _
|
|
@@ -19,7 +21,12 @@ from openstackclient.i18n import _
|
|
|
19
21
|
# useful
|
|
20
22
|
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
# TODO(stephenfin): include_max_items should not be necessary once we need to
|
|
25
|
+
# migrate remaining users to openstacksdk
|
|
26
|
+
def add_marker_pagination_option_to_parser(
|
|
27
|
+
parser: argparse.ArgumentParser,
|
|
28
|
+
include_max_items: bool = True,
|
|
29
|
+
) -> None:
|
|
23
30
|
"""Add marker-based pagination options to the parser.
|
|
24
31
|
|
|
25
32
|
APIs that use marker-based paging use the marker and limit query parameters
|
|
@@ -35,8 +42,11 @@ def add_marker_pagination_option_to_parser(parser):
|
|
|
35
42
|
type=int,
|
|
36
43
|
action=parseractions.NonNegativeAction,
|
|
37
44
|
help=_(
|
|
38
|
-
'The maximum number of entries to return. If the value
|
|
39
|
-
'the server-defined maximum, then the
|
|
45
|
+
'The maximum number of entries to return per page. If the value '
|
|
46
|
+
'exceeds the server-defined maximum, then the server-defined '
|
|
47
|
+
'value will be used. Note that this controls the page size, not '
|
|
48
|
+
'the total number of entries returned. Use --max-items to limit '
|
|
49
|
+
'the total number of entries returned.'
|
|
40
50
|
),
|
|
41
51
|
)
|
|
42
52
|
parser.add_argument(
|
|
@@ -48,9 +58,27 @@ def add_marker_pagination_option_to_parser(parser):
|
|
|
48
58
|
'This should be a value that was returned in a previous request.'
|
|
49
59
|
),
|
|
50
60
|
)
|
|
61
|
+
if include_max_items:
|
|
62
|
+
parser.add_argument(
|
|
63
|
+
'--max-items',
|
|
64
|
+
metavar='<max-items>',
|
|
65
|
+
type=int,
|
|
66
|
+
action=parseractions.NonNegativeAction,
|
|
67
|
+
default=None,
|
|
68
|
+
help=_(
|
|
69
|
+
'The maximum number of entries to return in total, paging '
|
|
70
|
+
'through multiple requests if needed. Use --limit to control '
|
|
71
|
+
'the page size.'
|
|
72
|
+
),
|
|
73
|
+
)
|
|
51
74
|
|
|
52
75
|
|
|
53
|
-
|
|
76
|
+
# TODO(stephenfin): include_max_items should not be necessary once we need to
|
|
77
|
+
# migrate remaining users to openstacksdk
|
|
78
|
+
def add_offset_pagination_option_to_parser(
|
|
79
|
+
parser: argparse.ArgumentParser,
|
|
80
|
+
include_max_items: bool = True,
|
|
81
|
+
) -> None:
|
|
54
82
|
"""Add offset-based pagination options to the parser.
|
|
55
83
|
|
|
56
84
|
APIs that use offset-based paging use the offset and limit query parameters
|
|
@@ -65,8 +93,11 @@ def add_offset_pagination_option_to_parser(parser):
|
|
|
65
93
|
type=int,
|
|
66
94
|
action=parseractions.NonNegativeAction,
|
|
67
95
|
help=_(
|
|
68
|
-
'The maximum number of entries to return. If the value
|
|
69
|
-
'the server-defined maximum, then the maximum value will
|
|
96
|
+
'The maximum number of entries to return per page. If the value '
|
|
97
|
+
'exceeds the server-defined maximum, then the maximum value will '
|
|
98
|
+
'be used. Note that this controls the page size, not the total '
|
|
99
|
+
'number of entries returned. Use --max-items to limit the total '
|
|
100
|
+
'number of entries returned.'
|
|
70
101
|
),
|
|
71
102
|
)
|
|
72
103
|
parser.add_argument(
|
|
@@ -80,3 +111,16 @@ def add_offset_pagination_option_to_parser(parser):
|
|
|
80
111
|
'return.'
|
|
81
112
|
),
|
|
82
113
|
)
|
|
114
|
+
if include_max_items:
|
|
115
|
+
parser.add_argument(
|
|
116
|
+
'--max-items',
|
|
117
|
+
metavar='<max-items>',
|
|
118
|
+
type=int,
|
|
119
|
+
action=parseractions.NonNegativeAction,
|
|
120
|
+
default=None,
|
|
121
|
+
help=_(
|
|
122
|
+
'The maximum number of entries to return in total, paging '
|
|
123
|
+
'through multiple requests if needed. Use --limit to control '
|
|
124
|
+
'the page size.'
|
|
125
|
+
),
|
|
126
|
+
)
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
# under the License.
|
|
15
15
|
|
|
16
16
|
import sys
|
|
17
|
+
from typing import Any
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
class _ProgressBarBase:
|
|
@@ -28,24 +29,24 @@ class _ProgressBarBase:
|
|
|
28
29
|
:note: The progress will be displayed only if sys.stdout is a tty.
|
|
29
30
|
"""
|
|
30
31
|
|
|
31
|
-
def __init__(self, wrapped, totalsize):
|
|
32
|
+
def __init__(self, wrapped: Any, totalsize: int) -> None:
|
|
32
33
|
self._wrapped = wrapped
|
|
33
34
|
self._totalsize = float(totalsize)
|
|
34
35
|
self._show_progress = sys.stdout.isatty() and self._totalsize != 0
|
|
35
|
-
self._percent = 0
|
|
36
|
+
self._percent = 0.0
|
|
36
37
|
|
|
37
|
-
def _display_progress_bar(self, size_read):
|
|
38
|
+
def _display_progress_bar(self, size_read: int) -> None:
|
|
38
39
|
if self._show_progress:
|
|
39
40
|
self._percent += size_read / self._totalsize
|
|
40
41
|
# Output something like this: [==========> ] 49%
|
|
41
42
|
sys.stdout.write(
|
|
42
43
|
'\r[{:<30}] {:.0%}'.format(
|
|
43
|
-
'=' *
|
|
44
|
+
'=' * round(self._percent * 29) + '>', self._percent
|
|
44
45
|
)
|
|
45
46
|
)
|
|
46
47
|
sys.stdout.flush()
|
|
47
48
|
|
|
48
|
-
def __getattr__(self, attr):
|
|
49
|
+
def __getattr__(self, attr: str) -> Any:
|
|
49
50
|
# Forward other attribute access to the wrapped object.
|
|
50
51
|
return getattr(self._wrapped, attr)
|
|
51
52
|
|
|
@@ -57,7 +58,7 @@ class VerboseFileWrapper(_ProgressBarBase):
|
|
|
57
58
|
wrapped file's read method is called.
|
|
58
59
|
"""
|
|
59
60
|
|
|
60
|
-
def read(self, *args, **kwargs):
|
|
61
|
+
def read(self, *args: Any, **kwargs: Any) -> Any:
|
|
61
62
|
data = self._wrapped.read(*args, **kwargs)
|
|
62
63
|
if data:
|
|
63
64
|
self._display_progress_bar(len(data))
|
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
# under the License.
|
|
14
14
|
#
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
16
17
|
import getpass
|
|
17
18
|
import logging
|
|
18
19
|
import os
|
|
19
20
|
import queue
|
|
20
|
-
|
|
21
|
+
from typing import Any
|
|
21
22
|
|
|
22
23
|
from cliff.formatters import table
|
|
24
|
+
from openstack import utils as sdk_utils
|
|
23
25
|
|
|
24
26
|
from openstackclient import command
|
|
25
27
|
from openstackclient.i18n import _
|
|
@@ -29,7 +31,7 @@ from openstackclient.identity import common as identity_common
|
|
|
29
31
|
LOG = logging.getLogger(__name__)
|
|
30
32
|
|
|
31
33
|
|
|
32
|
-
def ask_user_yesno(msg):
|
|
34
|
+
def ask_user_yesno(msg: str) -> bool:
|
|
33
35
|
"""Ask user Y/N question
|
|
34
36
|
|
|
35
37
|
:param str msg: question text
|
|
@@ -46,7 +48,7 @@ def ask_user_yesno(msg):
|
|
|
46
48
|
class ProjectCleanup(command.Command):
|
|
47
49
|
_description = _("Clean resources associated with a project")
|
|
48
50
|
|
|
49
|
-
def get_parser(self, prog_name):
|
|
51
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
50
52
|
parser = super().get_parser(prog_name)
|
|
51
53
|
action_group = parser.add_mutually_exclusive_group()
|
|
52
54
|
action_group.add_argument(
|
|
@@ -89,7 +91,7 @@ class ProjectCleanup(command.Command):
|
|
|
89
91
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
90
92
|
return parser
|
|
91
93
|
|
|
92
|
-
def take_action(self, parsed_args):
|
|
94
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
93
95
|
connection = self.app.client_manager.sdk_connection
|
|
94
96
|
|
|
95
97
|
if parsed_args.auth_project:
|
|
@@ -97,13 +99,16 @@ class ProjectCleanup(command.Command):
|
|
|
97
99
|
# as-is
|
|
98
100
|
pass
|
|
99
101
|
elif parsed_args.project:
|
|
100
|
-
|
|
102
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
103
|
+
connection.identity, '3'
|
|
104
|
+
)
|
|
105
|
+
project = identity_client.find_project(
|
|
101
106
|
name_or_id=parsed_args.project, ignore_missing=False
|
|
102
107
|
)
|
|
103
108
|
connection = connection.connect_as_project(project)
|
|
104
109
|
|
|
105
110
|
if connection:
|
|
106
|
-
status_queue: queue.Queue[
|
|
111
|
+
status_queue: queue.Queue[Any] = queue.Queue()
|
|
107
112
|
parsed_args.max_width = int(
|
|
108
113
|
os.environ.get('CLIFF_MAX_TERM_WIDTH', 0)
|
|
109
114
|
)
|