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
openstackclient/common/quota.py
CHANGED
|
@@ -18,15 +18,16 @@ import argparse
|
|
|
18
18
|
import itertools
|
|
19
19
|
import logging
|
|
20
20
|
import sys
|
|
21
|
-
import
|
|
21
|
+
from collections.abc import Iterable, Sequence
|
|
22
|
+
from typing import Any
|
|
22
23
|
|
|
23
24
|
from openstack import exceptions as sdk_exceptions
|
|
25
|
+
from openstack import utils as sdk_utils
|
|
24
26
|
from osc_lib import exceptions
|
|
25
27
|
from osc_lib import utils
|
|
26
28
|
|
|
27
29
|
from openstackclient import command
|
|
28
30
|
from openstackclient.i18n import _
|
|
29
|
-
from openstackclient.network import common
|
|
30
31
|
|
|
31
32
|
LOG = logging.getLogger(__name__)
|
|
32
33
|
|
|
@@ -50,6 +51,7 @@ VOLUME_QUOTAS = {
|
|
|
50
51
|
'backups': 'backups',
|
|
51
52
|
'backup_gigabytes': 'backup-gigabytes',
|
|
52
53
|
'gigabytes': 'gigabytes',
|
|
54
|
+
'groups': 'groups',
|
|
53
55
|
'per_volume_gigabytes': 'per-volume-gigabytes',
|
|
54
56
|
'snapshots': 'snapshots',
|
|
55
57
|
'volumes': 'volumes',
|
|
@@ -61,13 +63,6 @@ IMPACT_VOLUME_TYPE_QUOTAS = [
|
|
|
61
63
|
'volumes',
|
|
62
64
|
]
|
|
63
65
|
|
|
64
|
-
NOVA_NETWORK_QUOTAS = {
|
|
65
|
-
'fixed_ips': 'fixed-ips',
|
|
66
|
-
'floating_ips': 'floating-ips',
|
|
67
|
-
'security_group_rules': 'secgroup-rules',
|
|
68
|
-
'security_groups': 'secgroups',
|
|
69
|
-
}
|
|
70
|
-
|
|
71
66
|
NETWORK_QUOTAS = {
|
|
72
67
|
'floatingip': 'floating-ips',
|
|
73
68
|
'security_group_rule': 'secgroup-rules',
|
|
@@ -76,6 +71,7 @@ NETWORK_QUOTAS = {
|
|
|
76
71
|
'subnet': 'subnets',
|
|
77
72
|
'port': 'ports',
|
|
78
73
|
'router': 'routers',
|
|
74
|
+
'router_route': 'router-routes',
|
|
79
75
|
'rbac_policy': 'rbac-policies',
|
|
80
76
|
'subnetpool': 'subnetpools',
|
|
81
77
|
}
|
|
@@ -84,6 +80,7 @@ NETWORK_KEYS = [
|
|
|
84
80
|
'floating_ips',
|
|
85
81
|
'networks',
|
|
86
82
|
'rbac_policies',
|
|
83
|
+
'router_routes',
|
|
87
84
|
'routers',
|
|
88
85
|
'ports',
|
|
89
86
|
'security_group_rules',
|
|
@@ -93,9 +90,13 @@ NETWORK_KEYS = [
|
|
|
93
90
|
]
|
|
94
91
|
|
|
95
92
|
|
|
96
|
-
def _xform_get_quota(
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
def _xform_get_quota(
|
|
94
|
+
data: Any,
|
|
95
|
+
value: str,
|
|
96
|
+
keys: Any,
|
|
97
|
+
) -> list[dict[str, Any]]:
|
|
98
|
+
res: list[dict[str, Any]] = []
|
|
99
|
+
res_info: dict[str, Any] = {}
|
|
99
100
|
for key in keys:
|
|
100
101
|
res_info[key] = getattr(data, key, '')
|
|
101
102
|
|
|
@@ -104,20 +105,21 @@ def _xform_get_quota(data, value, keys):
|
|
|
104
105
|
return res
|
|
105
106
|
|
|
106
107
|
|
|
107
|
-
def get_project(app, project):
|
|
108
|
+
def get_project(app: Any, project: str | None) -> dict[str, str]:
|
|
108
109
|
if project is not None:
|
|
109
|
-
identity_client =
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
project_name = project.project_name
|
|
110
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
111
|
+
app.client_manager.sdk_connection.identity, '3'
|
|
112
|
+
)
|
|
113
|
+
found_project = identity_client.find_project(
|
|
114
|
+
project, ignore_missing=False
|
|
115
|
+
)
|
|
116
|
+
project_id = found_project.id
|
|
117
|
+
project_name = found_project.name
|
|
118
118
|
else:
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
# Get the project from the current auth
|
|
120
|
+
auth_ref = app.client_manager.auth_ref
|
|
121
|
+
project_id = auth_ref.project_id
|
|
122
|
+
project_name = auth_ref.project_name
|
|
121
123
|
|
|
122
124
|
return {
|
|
123
125
|
'id': project_id,
|
|
@@ -126,12 +128,12 @@ def get_project(app, project):
|
|
|
126
128
|
|
|
127
129
|
|
|
128
130
|
def get_compute_quotas(
|
|
129
|
-
app,
|
|
130
|
-
project_id,
|
|
131
|
+
app: Any,
|
|
132
|
+
project_id: str | None,
|
|
131
133
|
*,
|
|
132
|
-
detail=False,
|
|
133
|
-
default=False,
|
|
134
|
-
):
|
|
134
|
+
detail: bool = False,
|
|
135
|
+
default: bool = False,
|
|
136
|
+
) -> dict[str, Any]:
|
|
135
137
|
try:
|
|
136
138
|
client = app.client_manager.compute
|
|
137
139
|
if default:
|
|
@@ -140,7 +142,7 @@ def get_compute_quotas(
|
|
|
140
142
|
quota = client.get_quota_set(project_id, usage=detail)
|
|
141
143
|
except sdk_exceptions.EndpointNotFound:
|
|
142
144
|
return {}
|
|
143
|
-
data = quota.to_dict()
|
|
145
|
+
data: dict[str, Any] = quota.to_dict()
|
|
144
146
|
if not detail:
|
|
145
147
|
del data['usage']
|
|
146
148
|
del data['reservation']
|
|
@@ -148,12 +150,12 @@ def get_compute_quotas(
|
|
|
148
150
|
|
|
149
151
|
|
|
150
152
|
def get_volume_quotas(
|
|
151
|
-
app,
|
|
152
|
-
project_id,
|
|
153
|
+
app: Any,
|
|
154
|
+
project_id: str | None,
|
|
153
155
|
*,
|
|
154
|
-
detail=False,
|
|
155
|
-
default=False,
|
|
156
|
-
):
|
|
156
|
+
detail: bool = False,
|
|
157
|
+
default: bool = False,
|
|
158
|
+
) -> dict[str, Any]:
|
|
157
159
|
try:
|
|
158
160
|
client = app.client_manager.sdk_connection.volume
|
|
159
161
|
if default:
|
|
@@ -162,7 +164,7 @@ def get_volume_quotas(
|
|
|
162
164
|
quota = client.get_quota_set(project_id, usage=detail)
|
|
163
165
|
except sdk_exceptions.EndpointNotFound:
|
|
164
166
|
return {}
|
|
165
|
-
data = quota.to_dict()
|
|
167
|
+
data: dict[str, Any] = quota.to_dict()
|
|
166
168
|
if not detail:
|
|
167
169
|
del data['usage']
|
|
168
170
|
del data['reservation']
|
|
@@ -170,17 +172,19 @@ def get_volume_quotas(
|
|
|
170
172
|
|
|
171
173
|
|
|
172
174
|
def get_network_quotas(
|
|
173
|
-
app,
|
|
174
|
-
project_id,
|
|
175
|
+
app: Any,
|
|
176
|
+
project_id: str | None,
|
|
175
177
|
*,
|
|
176
|
-
detail=False,
|
|
177
|
-
default=False,
|
|
178
|
-
):
|
|
179
|
-
def _network_quota_to_dict(
|
|
180
|
-
|
|
178
|
+
detail: bool = False,
|
|
179
|
+
default: bool = False,
|
|
180
|
+
) -> dict[str, Any]:
|
|
181
|
+
def _network_quota_to_dict(
|
|
182
|
+
network_quota: Any, detail: bool = False
|
|
183
|
+
) -> dict[str, Any]:
|
|
184
|
+
data: dict[str, Any] = network_quota.to_dict(computed=False)
|
|
181
185
|
|
|
182
186
|
if not detail:
|
|
183
|
-
return
|
|
187
|
+
return data
|
|
184
188
|
|
|
185
189
|
# Neutron returns quota details in dict which is in format like:
|
|
186
190
|
# {'resource_name': {'in_use': X, 'limit': Y, 'reserved': Z},
|
|
@@ -200,8 +204,8 @@ def get_network_quotas(
|
|
|
200
204
|
#
|
|
201
205
|
# so we need to make conversion to have data in same format from
|
|
202
206
|
# all of the services
|
|
203
|
-
result: dict[str,
|
|
204
|
-
for key, values in
|
|
207
|
+
result: dict[str, Any] = {"usage": {}, "reservation": {}}
|
|
208
|
+
for key, values in data.items():
|
|
205
209
|
if values is None:
|
|
206
210
|
continue
|
|
207
211
|
if isinstance(values, dict):
|
|
@@ -232,7 +236,7 @@ class ListQuota(command.Lister):
|
|
|
232
236
|
inspected with 'openstack quota show --default'.
|
|
233
237
|
"""
|
|
234
238
|
|
|
235
|
-
def get_parser(self, prog_name):
|
|
239
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
236
240
|
parser = super().get_parser(prog_name)
|
|
237
241
|
option = parser.add_mutually_exclusive_group(required=True)
|
|
238
242
|
option.add_argument(
|
|
@@ -255,7 +259,11 @@ class ListQuota(command.Lister):
|
|
|
255
259
|
)
|
|
256
260
|
return parser
|
|
257
261
|
|
|
258
|
-
def _list_quota_compute(
|
|
262
|
+
def _list_quota_compute(
|
|
263
|
+
self,
|
|
264
|
+
parsed_args: argparse.Namespace,
|
|
265
|
+
project_ids: list[str],
|
|
266
|
+
) -> tuple[tuple[str, ...], Any]:
|
|
259
267
|
compute_client = self.app.client_manager.compute
|
|
260
268
|
result = []
|
|
261
269
|
|
|
@@ -325,7 +333,11 @@ class ListQuota(command.Lister):
|
|
|
325
333
|
(utils.get_dict_properties(s, columns) for s in result),
|
|
326
334
|
)
|
|
327
335
|
|
|
328
|
-
def _list_quota_volume(
|
|
336
|
+
def _list_quota_volume(
|
|
337
|
+
self,
|
|
338
|
+
parsed_args: argparse.Namespace,
|
|
339
|
+
project_ids: list[str],
|
|
340
|
+
) -> tuple[tuple[str, ...], Any]:
|
|
329
341
|
volume_client = self.app.client_manager.sdk_connection.volume
|
|
330
342
|
result = []
|
|
331
343
|
|
|
@@ -364,6 +376,7 @@ class ListQuota(command.Lister):
|
|
|
364
376
|
'backups',
|
|
365
377
|
'backup_gigabytes',
|
|
366
378
|
'gigabytes',
|
|
379
|
+
'groups',
|
|
367
380
|
'per_volume_gigabytes',
|
|
368
381
|
'snapshots',
|
|
369
382
|
'volumes',
|
|
@@ -373,6 +386,7 @@ class ListQuota(command.Lister):
|
|
|
373
386
|
'Backups',
|
|
374
387
|
'Backup Gigabytes',
|
|
375
388
|
'Gigabytes',
|
|
389
|
+
'Groups',
|
|
376
390
|
'Per Volume Gigabytes',
|
|
377
391
|
'Snapshots',
|
|
378
392
|
'Volumes',
|
|
@@ -383,7 +397,11 @@ class ListQuota(command.Lister):
|
|
|
383
397
|
(utils.get_dict_properties(s, columns) for s in result),
|
|
384
398
|
)
|
|
385
399
|
|
|
386
|
-
def _list_quota_network(
|
|
400
|
+
def _list_quota_network(
|
|
401
|
+
self,
|
|
402
|
+
parsed_args: argparse.Namespace,
|
|
403
|
+
project_ids: list[str],
|
|
404
|
+
) -> tuple[tuple[str, ...], Any]:
|
|
387
405
|
network_client = self.app.client_manager.network
|
|
388
406
|
result = []
|
|
389
407
|
|
|
@@ -423,6 +441,7 @@ class ListQuota(command.Lister):
|
|
|
423
441
|
'networks',
|
|
424
442
|
'ports',
|
|
425
443
|
'rbac_policies',
|
|
444
|
+
'router_routes',
|
|
426
445
|
'routers',
|
|
427
446
|
'security_groups',
|
|
428
447
|
'security_group_rules',
|
|
@@ -435,6 +454,7 @@ class ListQuota(command.Lister):
|
|
|
435
454
|
'Networks',
|
|
436
455
|
'Ports',
|
|
437
456
|
'RBAC Policies',
|
|
457
|
+
'Router Routes',
|
|
438
458
|
'Routers',
|
|
439
459
|
'Security Groups',
|
|
440
460
|
'Security Group Rules',
|
|
@@ -447,11 +467,14 @@ class ListQuota(command.Lister):
|
|
|
447
467
|
(utils.get_dict_properties(s, columns) for s in result),
|
|
448
468
|
)
|
|
449
469
|
|
|
450
|
-
def take_action(
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
470
|
+
def take_action(
|
|
471
|
+
self, parsed_args: argparse.Namespace
|
|
472
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
473
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
474
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
475
|
+
)
|
|
476
|
+
|
|
477
|
+
project_ids = [p.id for p in identity_client.projects()]
|
|
455
478
|
if parsed_args.compute:
|
|
456
479
|
return self._list_quota_compute(parsed_args, project_ids)
|
|
457
480
|
elif parsed_args.volume:
|
|
@@ -463,44 +486,23 @@ class ListQuota(command.Lister):
|
|
|
463
486
|
return ((), ())
|
|
464
487
|
|
|
465
488
|
|
|
466
|
-
class SetQuota(
|
|
489
|
+
class SetQuota(command.Command):
|
|
467
490
|
_description = _("Set quotas for project or class")
|
|
468
491
|
|
|
469
|
-
def _build_options_list(self):
|
|
492
|
+
def _build_options_list(self) -> list[tuple[str, str, str]]:
|
|
470
493
|
help_fmt = _('New value for the %s quota')
|
|
471
|
-
# Compute and
|
|
494
|
+
# Compute volume and network quota options are always the same
|
|
472
495
|
rets = [
|
|
473
496
|
(k, v, help_fmt % v)
|
|
474
497
|
for k, v in itertools.chain(
|
|
475
498
|
COMPUTE_QUOTAS.items(),
|
|
476
499
|
VOLUME_QUOTAS.items(),
|
|
500
|
+
NETWORK_QUOTAS.items(),
|
|
477
501
|
)
|
|
478
502
|
]
|
|
479
|
-
# For docs build, we want to produce helps for both neutron and
|
|
480
|
-
# nova-network options. They overlap, so we have to figure out which
|
|
481
|
-
# need to be tagged as specific to one network type or the other.
|
|
482
|
-
if self.is_docs_build:
|
|
483
|
-
# NOTE(efried): This takes advantage of the fact that we know the
|
|
484
|
-
# nova-net options are a subset of the neutron options. If that
|
|
485
|
-
# ever changes, this algorithm will need to be adjusted accordingly
|
|
486
|
-
inv_compute = set(NOVA_NETWORK_QUOTAS.values())
|
|
487
|
-
for k, v in NETWORK_QUOTAS.items():
|
|
488
|
-
_help = help_fmt % v
|
|
489
|
-
if v not in inv_compute:
|
|
490
|
-
# This one is unique to neutron
|
|
491
|
-
_help = self.enhance_help_neutron(_help)
|
|
492
|
-
rets.append((k, v, _help))
|
|
493
|
-
elif self.is_neutron:
|
|
494
|
-
rets.extend(
|
|
495
|
-
[(k, v, help_fmt % v) for k, v in NETWORK_QUOTAS.items()]
|
|
496
|
-
)
|
|
497
|
-
elif self.is_nova_network:
|
|
498
|
-
rets.extend(
|
|
499
|
-
[(k, v, help_fmt % v) for k, v in NOVA_NETWORK_QUOTAS.items()]
|
|
500
|
-
)
|
|
501
503
|
return rets
|
|
502
504
|
|
|
503
|
-
def get_parser(self, prog_name):
|
|
505
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
504
506
|
parser = super().get_parser(prog_name)
|
|
505
507
|
parser.add_argument(
|
|
506
508
|
'project',
|
|
@@ -575,7 +577,7 @@ class SetQuota(common.NetDetectionMixin, command.Command):
|
|
|
575
577
|
)
|
|
576
578
|
return parser
|
|
577
579
|
|
|
578
|
-
def take_action(self, parsed_args):
|
|
580
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
579
581
|
if parsed_args.quota_class:
|
|
580
582
|
msg = _(
|
|
581
583
|
"The '--class' option has been deprecated. Quota classes were "
|
|
@@ -595,6 +597,9 @@ class SetQuota(common.NetDetectionMixin, command.Command):
|
|
|
595
597
|
compute_kwargs = {}
|
|
596
598
|
volume_kwargs = {}
|
|
597
599
|
network_kwargs = {}
|
|
600
|
+
compute_client = None
|
|
601
|
+
volume_client = None
|
|
602
|
+
network_client = None
|
|
598
603
|
|
|
599
604
|
if self.app.client_manager.is_compute_endpoint_enabled():
|
|
600
605
|
compute_client = self.app.client_manager.compute
|
|
@@ -627,11 +632,6 @@ class SetQuota(common.NetDetectionMixin, command.Command):
|
|
|
627
632
|
value = getattr(parsed_args, k, None)
|
|
628
633
|
if value is not None:
|
|
629
634
|
network_kwargs[k] = value
|
|
630
|
-
elif self.app.client_manager.is_compute_endpoint_enabled():
|
|
631
|
-
for k, v in NOVA_NETWORK_QUOTAS.items():
|
|
632
|
-
value = getattr(parsed_args, k, None)
|
|
633
|
-
if value is not None:
|
|
634
|
-
compute_kwargs[k] = value
|
|
635
635
|
|
|
636
636
|
if network_kwargs:
|
|
637
637
|
if parsed_args.force is True:
|
|
@@ -643,12 +643,12 @@ class SetQuota(common.NetDetectionMixin, command.Command):
|
|
|
643
643
|
network_kwargs['check_limit'] = True
|
|
644
644
|
|
|
645
645
|
if parsed_args.quota_class or parsed_args.default:
|
|
646
|
-
if compute_kwargs:
|
|
646
|
+
if compute_kwargs and compute_client:
|
|
647
647
|
compute_client.update_quota_class_set(
|
|
648
648
|
parsed_args.project or 'default',
|
|
649
649
|
**compute_kwargs,
|
|
650
650
|
)
|
|
651
|
-
if volume_kwargs:
|
|
651
|
+
if volume_kwargs and volume_client:
|
|
652
652
|
volume_client.update_quota_class_set(
|
|
653
653
|
parsed_args.project or 'default',
|
|
654
654
|
**volume_kwargs,
|
|
@@ -664,11 +664,11 @@ class SetQuota(common.NetDetectionMixin, command.Command):
|
|
|
664
664
|
project_info = get_project(self.app, parsed_args.project)
|
|
665
665
|
project = project_info['id']
|
|
666
666
|
|
|
667
|
-
if compute_kwargs:
|
|
667
|
+
if compute_kwargs and compute_client:
|
|
668
668
|
compute_client.update_quota_set(project, **compute_kwargs)
|
|
669
|
-
if volume_kwargs:
|
|
669
|
+
if volume_kwargs and volume_client:
|
|
670
670
|
volume_client.update_quota_set(project, **volume_kwargs)
|
|
671
|
-
if network_kwargs:
|
|
671
|
+
if network_kwargs and network_client:
|
|
672
672
|
network_client.update_quota(project, **network_kwargs)
|
|
673
673
|
|
|
674
674
|
|
|
@@ -680,7 +680,7 @@ Specify ``--os-compute-api-version 2.50`` or higher to see ``server-groups``
|
|
|
680
680
|
and ``server-group-members`` output for a given quota class."""
|
|
681
681
|
)
|
|
682
682
|
|
|
683
|
-
def get_parser(self, prog_name):
|
|
683
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
684
684
|
parser = super().get_parser(prog_name)
|
|
685
685
|
parser.add_argument(
|
|
686
686
|
'project',
|
|
@@ -742,7 +742,9 @@ and ``server-group-members`` output for a given quota class."""
|
|
|
742
742
|
|
|
743
743
|
return parser
|
|
744
744
|
|
|
745
|
-
def take_action(
|
|
745
|
+
def take_action(
|
|
746
|
+
self, parsed_args: argparse.Namespace
|
|
747
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
746
748
|
project_info = get_project(self.app, parsed_args.project)
|
|
747
749
|
project = project_info['id']
|
|
748
750
|
|
|
@@ -806,7 +808,7 @@ and ``server-group-members`` output for a given quota class."""
|
|
|
806
808
|
info.update(volume_quota_info)
|
|
807
809
|
info.update(network_quota_info)
|
|
808
810
|
|
|
809
|
-
def _normalize_names(section: dict) -> None:
|
|
811
|
+
def _normalize_names(section: dict[str, Any]) -> None:
|
|
810
812
|
# Map the internal quota names to the external ones
|
|
811
813
|
# COMPUTE_QUOTAS and NETWORK_QUOTAS share floating-ips,
|
|
812
814
|
# secgroup-rules and secgroups as dict value, so when
|
|
@@ -814,7 +816,6 @@ and ``server-group-members`` output for a given quota class."""
|
|
|
814
816
|
# in nova will be replaced by neutron's.
|
|
815
817
|
for k, v in itertools.chain(
|
|
816
818
|
COMPUTE_QUOTAS.items(),
|
|
817
|
-
NOVA_NETWORK_QUOTAS.items(),
|
|
818
819
|
VOLUME_QUOTAS.items(),
|
|
819
820
|
NETWORK_QUOTAS.items(),
|
|
820
821
|
):
|
|
@@ -827,13 +828,11 @@ and ``server-group-members`` output for a given quota class."""
|
|
|
827
828
|
_normalize_names(info["usage"])
|
|
828
829
|
|
|
829
830
|
# Remove the 'id' field since it's not very useful
|
|
830
|
-
|
|
831
|
-
del info['id']
|
|
831
|
+
info.pop('id', None)
|
|
832
832
|
|
|
833
833
|
# Remove the sdk-derived fields
|
|
834
834
|
for field in ('location', 'name', 'force'):
|
|
835
|
-
|
|
836
|
-
del info[field]
|
|
835
|
+
info.pop(field, None)
|
|
837
836
|
|
|
838
837
|
if not parsed_args.usage:
|
|
839
838
|
result = [{'resource': k, 'limit': v} for k, v in info.items()]
|
|
@@ -879,7 +878,7 @@ class DeleteQuota(command.Command):
|
|
|
879
878
|
"Delete configured quota for a project and revert to defaults."
|
|
880
879
|
)
|
|
881
880
|
|
|
882
|
-
def get_parser(self, prog_name):
|
|
881
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
883
882
|
parser = super().get_parser(prog_name)
|
|
884
883
|
parser.add_argument(
|
|
885
884
|
'project',
|
|
@@ -924,8 +923,11 @@ class DeleteQuota(command.Command):
|
|
|
924
923
|
)
|
|
925
924
|
return parser
|
|
926
925
|
|
|
927
|
-
def take_action(self, parsed_args):
|
|
928
|
-
identity_client =
|
|
926
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
927
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
928
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
929
|
+
)
|
|
930
|
+
|
|
929
931
|
project = identity_client.find_project(
|
|
930
932
|
parsed_args.project, ignore_missing=False
|
|
931
933
|
)
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""Versions Action Implementation"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
17
21
|
from openstackclient import command
|
|
18
22
|
from openstackclient.i18n import _
|
|
19
23
|
|
|
@@ -21,7 +25,7 @@ from openstackclient.i18n import _
|
|
|
21
25
|
class ShowVersions(command.Lister):
|
|
22
26
|
_description = _("Show available versions of services")
|
|
23
27
|
|
|
24
|
-
def get_parser(self, prog_name):
|
|
28
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
25
29
|
parser = super().get_parser(prog_name)
|
|
26
30
|
interface_group = parser.add_mutually_exclusive_group()
|
|
27
31
|
interface_group.add_argument(
|
|
@@ -67,7 +71,9 @@ class ShowVersions(command.Lister):
|
|
|
67
71
|
)
|
|
68
72
|
return parser
|
|
69
73
|
|
|
70
|
-
def take_action(
|
|
74
|
+
def take_action(
|
|
75
|
+
self, parsed_args: argparse.Namespace
|
|
76
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
71
77
|
interface = parsed_args.interface
|
|
72
78
|
if parsed_args.is_all_interfaces:
|
|
73
79
|
interface = None
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
15
16
|
import logging
|
|
17
|
+
from typing import Any
|
|
16
18
|
|
|
17
19
|
from osc_lib import utils
|
|
18
20
|
|
|
@@ -27,7 +29,7 @@ API_NAME = 'compute'
|
|
|
27
29
|
API_VERSIONS = ('2', '2.1')
|
|
28
30
|
|
|
29
31
|
|
|
30
|
-
def make_client(instance):
|
|
32
|
+
def make_client(instance: Any) -> Any:
|
|
31
33
|
"""Returns a compute service client."""
|
|
32
34
|
LOG.debug(
|
|
33
35
|
'Compute client initialized using OpenStack SDK: %s',
|
|
@@ -36,7 +38,9 @@ def make_client(instance):
|
|
|
36
38
|
return instance.sdk_connection.compute
|
|
37
39
|
|
|
38
40
|
|
|
39
|
-
def build_option_parser(
|
|
41
|
+
def build_option_parser(
|
|
42
|
+
parser: argparse.ArgumentParser,
|
|
43
|
+
) -> argparse.ArgumentParser:
|
|
40
44
|
"""Hook to add global options"""
|
|
41
45
|
parser.add_argument(
|
|
42
46
|
'--os-compute-api-version',
|
|
@@ -48,6 +52,6 @@ def build_option_parser(parser):
|
|
|
48
52
|
return parser
|
|
49
53
|
|
|
50
54
|
|
|
51
|
-
def check_api_version(check_version):
|
|
55
|
+
def check_api_version(check_version: str) -> bool:
|
|
52
56
|
# SDK supports auto-negotiation for us: always return True
|
|
53
57
|
return True
|
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
|
-
#
|
|
15
14
|
|
|
16
15
|
"""Agent action implementations"""
|
|
17
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
18
19
|
import logging
|
|
20
|
+
from typing import Any
|
|
19
21
|
|
|
20
22
|
from openstack import exceptions as sdk_exceptions
|
|
21
23
|
from osc_lib import exceptions
|
|
@@ -36,7 +38,7 @@ class CreateAgent(command.ShowOne):
|
|
|
36
38
|
23.0.0 (Wallaby) release.
|
|
37
39
|
"""
|
|
38
40
|
|
|
39
|
-
def get_parser(self, prog_name):
|
|
41
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
40
42
|
parser = super().get_parser(prog_name)
|
|
41
43
|
parser.add_argument("os", metavar="<os>", help=_("Type of OS"))
|
|
42
44
|
parser.add_argument(
|
|
@@ -55,7 +57,9 @@ class CreateAgent(command.ShowOne):
|
|
|
55
57
|
)
|
|
56
58
|
return parser
|
|
57
59
|
|
|
58
|
-
def take_action(
|
|
60
|
+
def take_action(
|
|
61
|
+
self, parsed_args: argparse.Namespace
|
|
62
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
59
63
|
compute_client = self.app.client_manager.compute
|
|
60
64
|
|
|
61
65
|
# doing this since openstacksdk has decided not to support this
|
|
@@ -76,7 +80,8 @@ class CreateAgent(command.ShowOne):
|
|
|
76
80
|
sdk_exceptions.raise_from_response(response)
|
|
77
81
|
agent = response.json().get('agent')
|
|
78
82
|
|
|
79
|
-
|
|
83
|
+
col_headers, col_data = zip(*sorted(agent.items()))
|
|
84
|
+
return col_headers, col_data
|
|
80
85
|
|
|
81
86
|
|
|
82
87
|
class DeleteAgent(command.Command):
|
|
@@ -87,14 +92,14 @@ class DeleteAgent(command.Command):
|
|
|
87
92
|
23.0.0 (Wallaby) release.
|
|
88
93
|
"""
|
|
89
94
|
|
|
90
|
-
def get_parser(self, prog_name):
|
|
95
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
91
96
|
parser = super().get_parser(prog_name)
|
|
92
97
|
parser.add_argument(
|
|
93
98
|
"id", metavar="<id>", nargs='+', help=_("ID of agent(s) to delete")
|
|
94
99
|
)
|
|
95
100
|
return parser
|
|
96
101
|
|
|
97
|
-
def take_action(self, parsed_args):
|
|
102
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
98
103
|
compute_client = self.app.client_manager.compute
|
|
99
104
|
result = 0
|
|
100
105
|
for id in parsed_args.id:
|
|
@@ -129,7 +134,7 @@ class ListAgent(command.Lister):
|
|
|
129
134
|
23.0.0 (Wallaby) release.
|
|
130
135
|
"""
|
|
131
136
|
|
|
132
|
-
def get_parser(self, prog_name):
|
|
137
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
133
138
|
parser = super().get_parser(prog_name)
|
|
134
139
|
parser.add_argument(
|
|
135
140
|
"--hypervisor",
|
|
@@ -138,7 +143,9 @@ class ListAgent(command.Lister):
|
|
|
138
143
|
)
|
|
139
144
|
return parser
|
|
140
145
|
|
|
141
|
-
def take_action(
|
|
146
|
+
def take_action(
|
|
147
|
+
self, parsed_args: argparse.Namespace
|
|
148
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
142
149
|
compute_client = self.app.client_manager.compute
|
|
143
150
|
columns = (
|
|
144
151
|
"Agent ID",
|
|
@@ -171,7 +178,7 @@ class SetAgent(command.Command):
|
|
|
171
178
|
23.0.0 (Wallaby) release.
|
|
172
179
|
"""
|
|
173
180
|
|
|
174
|
-
def get_parser(self, prog_name):
|
|
181
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
175
182
|
parser = super().get_parser(prog_name)
|
|
176
183
|
parser.add_argument(
|
|
177
184
|
"id",
|
|
@@ -193,7 +200,7 @@ class SetAgent(command.Command):
|
|
|
193
200
|
)
|
|
194
201
|
return parser
|
|
195
202
|
|
|
196
|
-
def take_action(self, parsed_args):
|
|
203
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
197
204
|
compute_client = self.app.client_manager.compute
|
|
198
205
|
|
|
199
206
|
response = compute_client.get('/os-agents', microversion='2.1')
|