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
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
#
|
|
13
13
|
|
|
14
|
-
import
|
|
14
|
+
import argparse
|
|
15
|
+
from collections.abc import Generator
|
|
15
16
|
import contextlib
|
|
16
17
|
import logging
|
|
17
|
-
|
|
18
|
+
from typing import Any
|
|
18
19
|
|
|
19
|
-
from cliff import _argparse
|
|
20
20
|
import openstack.exceptions
|
|
21
21
|
from osc_lib.cli import parseractions
|
|
22
22
|
from osc_lib import exceptions
|
|
@@ -37,13 +37,11 @@ _required_opt_extensions_map = {
|
|
|
37
37
|
'security_groups': 'security-groups',
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
_NET_TYPE_NEUTRON = 'neutron'
|
|
41
|
-
_NET_TYPE_COMPUTE = 'nova-network'
|
|
42
|
-
_QUALIFIER_FMT = "%s\n\n*%s*"
|
|
43
|
-
|
|
44
40
|
|
|
45
41
|
@contextlib.contextmanager
|
|
46
|
-
def check_missing_extension_if_error(
|
|
42
|
+
def check_missing_extension_if_error(
|
|
43
|
+
client_manager: Any, attrs: dict[str, Any]
|
|
44
|
+
) -> Generator[None, None, None]:
|
|
47
45
|
# If specified option requires extension, then try to
|
|
48
46
|
# find out if it exists. If it does not exist,
|
|
49
47
|
# then an exception with the appropriate message
|
|
@@ -57,233 +55,6 @@ def check_missing_extension_if_error(client_manager, attrs):
|
|
|
57
55
|
raise
|
|
58
56
|
|
|
59
57
|
|
|
60
|
-
class NetDetectionMixin(metaclass=abc.ABCMeta):
|
|
61
|
-
"""Convenience methods for nova-network vs. neutron decisions.
|
|
62
|
-
|
|
63
|
-
A live environment detects which network type it is running and creates its
|
|
64
|
-
parser with only the options relevant to that network type.
|
|
65
|
-
|
|
66
|
-
But the command classes are used for docs builds as well, and docs must
|
|
67
|
-
present the options for both network types, often qualified accordingly.
|
|
68
|
-
"""
|
|
69
|
-
|
|
70
|
-
@property
|
|
71
|
-
def _network_type(self):
|
|
72
|
-
"""Discover whether the running cloud is using neutron or nova-network.
|
|
73
|
-
|
|
74
|
-
:return:
|
|
75
|
-
* ``NET_TYPE_NEUTRON`` if neutron is detected
|
|
76
|
-
* ``NET_TYPE_COMPUTE`` if running in a cloud but neutron is not
|
|
77
|
-
detected.
|
|
78
|
-
* ``None`` if not running in a cloud, which hopefully means we're
|
|
79
|
-
building docs.
|
|
80
|
-
"""
|
|
81
|
-
# Have we set it up yet for this command?
|
|
82
|
-
if not hasattr(self, '_net_type'):
|
|
83
|
-
try:
|
|
84
|
-
if self.app.client_manager.is_network_endpoint_enabled(): # type: ignore
|
|
85
|
-
net_type = _NET_TYPE_NEUTRON
|
|
86
|
-
else:
|
|
87
|
-
net_type = _NET_TYPE_COMPUTE
|
|
88
|
-
except AttributeError:
|
|
89
|
-
LOG.warning(
|
|
90
|
-
"%s: Could not detect a network type. Assuming we are "
|
|
91
|
-
"building docs.",
|
|
92
|
-
self.__class__.__name__,
|
|
93
|
-
)
|
|
94
|
-
net_type = None
|
|
95
|
-
self._net_type = net_type
|
|
96
|
-
return self._net_type
|
|
97
|
-
|
|
98
|
-
@property
|
|
99
|
-
def is_neutron(self):
|
|
100
|
-
return self._network_type is _NET_TYPE_NEUTRON
|
|
101
|
-
|
|
102
|
-
@property
|
|
103
|
-
def is_nova_network(self):
|
|
104
|
-
return self._network_type is _NET_TYPE_COMPUTE
|
|
105
|
-
|
|
106
|
-
@property
|
|
107
|
-
def is_docs_build(self):
|
|
108
|
-
return self._network_type is None
|
|
109
|
-
|
|
110
|
-
def enhance_help_neutron(self, _help):
|
|
111
|
-
if self.is_docs_build:
|
|
112
|
-
# Why can't we say 'neutron'?
|
|
113
|
-
return _QUALIFIER_FMT % (_help, _("Network version 2 only"))
|
|
114
|
-
return _help
|
|
115
|
-
|
|
116
|
-
def enhance_help_nova_network(self, _help):
|
|
117
|
-
if self.is_docs_build:
|
|
118
|
-
# Why can't we say 'nova-network'?
|
|
119
|
-
return _QUALIFIER_FMT % (_help, _("Compute version 2 only"))
|
|
120
|
-
return _help
|
|
121
|
-
|
|
122
|
-
@staticmethod
|
|
123
|
-
def split_help(network_help, compute_help):
|
|
124
|
-
return (
|
|
125
|
-
"*{network_qualifier}:*\n {network_help}\n\n"
|
|
126
|
-
"*{compute_qualifier}:*\n {compute_help}".format(
|
|
127
|
-
**dict(
|
|
128
|
-
network_qualifier=_("Network version 2"),
|
|
129
|
-
network_help=network_help,
|
|
130
|
-
compute_qualifier=_("Compute version 2"),
|
|
131
|
-
compute_help=compute_help,
|
|
132
|
-
)
|
|
133
|
-
)
|
|
134
|
-
)
|
|
135
|
-
|
|
136
|
-
def get_parser(self, prog_name: str) -> _argparse.ArgumentParser:
|
|
137
|
-
LOG.debug('get_parser(%s)', prog_name)
|
|
138
|
-
parser = super().get_parser(prog_name) # type: ignore
|
|
139
|
-
parser = self.update_parser_common(parser)
|
|
140
|
-
LOG.debug('common parser: %s', parser)
|
|
141
|
-
if self.is_neutron or self.is_docs_build:
|
|
142
|
-
parser = self.update_parser_network(parser)
|
|
143
|
-
if self.is_nova_network or self.is_docs_build:
|
|
144
|
-
# Add nova-net options if running nova-network or building docs
|
|
145
|
-
parser = self.update_parser_compute(parser)
|
|
146
|
-
return parser
|
|
147
|
-
|
|
148
|
-
def update_parser_common(self, parser):
|
|
149
|
-
"""Default is no updates to parser."""
|
|
150
|
-
return parser
|
|
151
|
-
|
|
152
|
-
def update_parser_network(self, parser):
|
|
153
|
-
"""Default is no updates to parser."""
|
|
154
|
-
return parser
|
|
155
|
-
|
|
156
|
-
def update_parser_compute(self, parser):
|
|
157
|
-
"""Default is no updates to parser."""
|
|
158
|
-
return parser
|
|
159
|
-
|
|
160
|
-
def take_action(self, parsed_args):
|
|
161
|
-
if self.is_neutron:
|
|
162
|
-
return self.take_action_network(
|
|
163
|
-
self.app.client_manager.network, # type: ignore
|
|
164
|
-
parsed_args,
|
|
165
|
-
)
|
|
166
|
-
elif self.is_nova_network:
|
|
167
|
-
return self.take_action_compute(
|
|
168
|
-
self.app.client_manager.compute, # type: ignore
|
|
169
|
-
parsed_args,
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
def take_action_network(self, client, parsed_args):
|
|
173
|
-
"""Override to do something useful."""
|
|
174
|
-
pass
|
|
175
|
-
|
|
176
|
-
def take_action_compute(self, client, parsed_args):
|
|
177
|
-
"""Override to do something useful."""
|
|
178
|
-
pass
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
class NetworkAndComputeCommand(
|
|
182
|
-
NetDetectionMixin, command.Command, metaclass=abc.ABCMeta
|
|
183
|
-
):
|
|
184
|
-
"""Network and Compute Command
|
|
185
|
-
|
|
186
|
-
Command class for commands that support implementation via
|
|
187
|
-
the network or compute endpoint. Such commands have different
|
|
188
|
-
implementations for take_action() and may even have different
|
|
189
|
-
arguments.
|
|
190
|
-
"""
|
|
191
|
-
|
|
192
|
-
pass
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
class NetworkAndComputeDelete(NetworkAndComputeCommand, metaclass=abc.ABCMeta):
|
|
196
|
-
"""Network and Compute Delete
|
|
197
|
-
|
|
198
|
-
Delete class for commands that support implementation via
|
|
199
|
-
the network or compute endpoint. Such commands have different
|
|
200
|
-
implementations for take_action() and may even have different
|
|
201
|
-
arguments. This class supports bulk deletion, and error handling
|
|
202
|
-
following the rules in doc/source/command-errors.rst.
|
|
203
|
-
"""
|
|
204
|
-
|
|
205
|
-
resource: str
|
|
206
|
-
|
|
207
|
-
def take_action(self, parsed_args):
|
|
208
|
-
ret = 0
|
|
209
|
-
resources = getattr(parsed_args, self.resource, [])
|
|
210
|
-
|
|
211
|
-
for r in resources:
|
|
212
|
-
self.r = r
|
|
213
|
-
try:
|
|
214
|
-
if self.app.client_manager.is_network_endpoint_enabled():
|
|
215
|
-
self.take_action_network(
|
|
216
|
-
self.app.client_manager.network, parsed_args
|
|
217
|
-
)
|
|
218
|
-
else:
|
|
219
|
-
self.take_action_compute(
|
|
220
|
-
self.app.client_manager.compute,
|
|
221
|
-
parsed_args,
|
|
222
|
-
)
|
|
223
|
-
except Exception as e:
|
|
224
|
-
msg = _(
|
|
225
|
-
"Failed to delete %(resource)s with name or ID "
|
|
226
|
-
"'%(name_or_id)s': %(e)s"
|
|
227
|
-
) % {
|
|
228
|
-
"resource": self.resource,
|
|
229
|
-
"name_or_id": r,
|
|
230
|
-
"e": e,
|
|
231
|
-
}
|
|
232
|
-
LOG.error(msg)
|
|
233
|
-
ret += 1
|
|
234
|
-
|
|
235
|
-
if ret:
|
|
236
|
-
total = len(resources)
|
|
237
|
-
msg = _("%(num)s of %(total)s %(resource)ss failed to delete.") % {
|
|
238
|
-
"num": ret,
|
|
239
|
-
"total": total,
|
|
240
|
-
"resource": self.resource,
|
|
241
|
-
}
|
|
242
|
-
raise exceptions.CommandError(msg)
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
class NetworkAndComputeLister(
|
|
246
|
-
NetDetectionMixin, command.Lister, metaclass=abc.ABCMeta
|
|
247
|
-
):
|
|
248
|
-
"""Network and Compute Lister
|
|
249
|
-
|
|
250
|
-
Lister class for commands that support implementation via
|
|
251
|
-
the network or compute endpoint. Such commands have different
|
|
252
|
-
implementations for take_action() and may even have different
|
|
253
|
-
arguments.
|
|
254
|
-
"""
|
|
255
|
-
|
|
256
|
-
pass
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
class NetworkAndComputeShowOne(
|
|
260
|
-
NetDetectionMixin, command.ShowOne, metaclass=abc.ABCMeta
|
|
261
|
-
):
|
|
262
|
-
"""Network and Compute ShowOne
|
|
263
|
-
|
|
264
|
-
ShowOne class for commands that support implementation via
|
|
265
|
-
the network or compute endpoint. Such commands have different
|
|
266
|
-
implementations for take_action() and may even have different
|
|
267
|
-
arguments.
|
|
268
|
-
"""
|
|
269
|
-
|
|
270
|
-
def take_action(self, parsed_args):
|
|
271
|
-
try:
|
|
272
|
-
if self.app.client_manager.is_network_endpoint_enabled():
|
|
273
|
-
return self.take_action_network(
|
|
274
|
-
self.app.client_manager.network, parsed_args
|
|
275
|
-
)
|
|
276
|
-
else:
|
|
277
|
-
return self.take_action_compute(
|
|
278
|
-
self.app.client_manager.compute, parsed_args
|
|
279
|
-
)
|
|
280
|
-
except openstack.exceptions.HttpException as exc:
|
|
281
|
-
msg = _("Error while executing command: %s") % exc.message
|
|
282
|
-
if exc.details:
|
|
283
|
-
msg += ", " + str(exc.details)
|
|
284
|
-
raise exceptions.CommandError(msg)
|
|
285
|
-
|
|
286
|
-
|
|
287
58
|
class NeutronCommandWithExtraArgs(command.Command):
|
|
288
59
|
"""Create and Update commands with additional extra properties.
|
|
289
60
|
|
|
@@ -300,7 +71,7 @@ class NeutronCommandWithExtraArgs(command.Command):
|
|
|
300
71
|
'str': str,
|
|
301
72
|
}
|
|
302
73
|
|
|
303
|
-
def _get_property_converter(self, _property):
|
|
74
|
+
def _get_property_converter(self, _property: dict[str, Any]) -> Any:
|
|
304
75
|
if 'type' in _property:
|
|
305
76
|
converter = self._allowed_types_dict.get(_property['type'])
|
|
306
77
|
else:
|
|
@@ -316,15 +87,17 @@ class NeutronCommandWithExtraArgs(command.Command):
|
|
|
316
87
|
)
|
|
317
88
|
return converter
|
|
318
89
|
|
|
319
|
-
def _parse_extra_properties(
|
|
320
|
-
|
|
90
|
+
def _parse_extra_properties(
|
|
91
|
+
self, extra_properties: list[dict[str, Any]] | None
|
|
92
|
+
) -> dict[str, Any]:
|
|
93
|
+
result: dict[str, Any] = {}
|
|
321
94
|
if extra_properties:
|
|
322
95
|
for _property in extra_properties:
|
|
323
96
|
converter = self._get_property_converter(_property)
|
|
324
97
|
result[_property['name']] = converter(_property['value'])
|
|
325
98
|
return result
|
|
326
99
|
|
|
327
|
-
def get_parser(self, prog_name):
|
|
100
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
328
101
|
parser = super().get_parser(prog_name)
|
|
329
102
|
parser.add_argument(
|
|
330
103
|
'--extra-property',
|
|
@@ -349,8 +122,10 @@ class NeutronCommandWithExtraArgs(command.Command):
|
|
|
349
122
|
|
|
350
123
|
|
|
351
124
|
class NeutronUnsetCommandWithExtraArgs(NeutronCommandWithExtraArgs):
|
|
352
|
-
def _parse_extra_properties(
|
|
353
|
-
|
|
125
|
+
def _parse_extra_properties(
|
|
126
|
+
self, extra_properties: list[dict[str, Any]] | None
|
|
127
|
+
) -> dict[str, Any]:
|
|
128
|
+
result: dict[str, Any] = {}
|
|
354
129
|
if extra_properties:
|
|
355
130
|
for _property in extra_properties:
|
|
356
131
|
result[_property['name']] = None
|
openstackclient/network/utils.py
CHANGED
|
@@ -9,50 +9,22 @@
|
|
|
9
9
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
from typing import Any, cast
|
|
13
14
|
|
|
14
15
|
from osc_lib import exceptions
|
|
15
16
|
|
|
16
17
|
from openstackclient.i18n import _
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
def transform_compute_security_group_rule(sg_rule):
|
|
21
|
-
info = {}
|
|
22
|
-
info.update(sg_rule)
|
|
23
|
-
from_port = info.pop('from_port')
|
|
24
|
-
to_port = info.pop('to_port')
|
|
25
|
-
if isinstance(from_port, int) and isinstance(to_port, int):
|
|
26
|
-
port_range = {'port_range': f"{from_port}:{to_port}"}
|
|
27
|
-
elif from_port is None and to_port is None:
|
|
28
|
-
port_range = {'port_range': ""}
|
|
29
|
-
else:
|
|
30
|
-
port_range = {'port_range': f"{from_port}:{to_port}"}
|
|
31
|
-
info.update(port_range)
|
|
32
|
-
if 'cidr' in info['ip_range']:
|
|
33
|
-
info['ip_range'] = info['ip_range']['cidr']
|
|
34
|
-
else:
|
|
35
|
-
info['ip_range'] = ''
|
|
36
|
-
if info['ip_protocol'] is None:
|
|
37
|
-
info['ip_protocol'] = ''
|
|
38
|
-
elif info['ip_protocol'].lower() == 'icmp':
|
|
39
|
-
info['port_range'] = ''
|
|
40
|
-
group = info.pop('group')
|
|
41
|
-
if 'name' in group:
|
|
42
|
-
info['remote_security_group'] = group['name']
|
|
43
|
-
else:
|
|
44
|
-
info['remote_security_group'] = ''
|
|
45
|
-
return info
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def str2bool(strbool):
|
|
20
|
+
def str2bool(strbool: str | None) -> bool | None:
|
|
49
21
|
if strbool is None:
|
|
50
22
|
return None
|
|
51
23
|
return strbool.lower() == 'true'
|
|
52
24
|
|
|
53
25
|
|
|
54
|
-
def str2list(strlist):
|
|
55
|
-
result = []
|
|
26
|
+
def str2list(strlist: str | None) -> list[str]:
|
|
27
|
+
result: list[str] = []
|
|
56
28
|
if strlist:
|
|
57
29
|
result = strlist.split(';')
|
|
58
30
|
return result
|
|
@@ -78,17 +50,12 @@ def str2dict(strdict: str) -> dict[str, str]:
|
|
|
78
50
|
else:
|
|
79
51
|
kvlist[i - 1] = f"{kvlist[i - 1]};{kv}"
|
|
80
52
|
for kv in kvlist:
|
|
81
|
-
key,
|
|
53
|
+
key, value = kv.split(':', 1)
|
|
82
54
|
result[key] = value
|
|
83
55
|
return result
|
|
84
56
|
|
|
85
57
|
|
|
86
|
-
def
|
|
87
|
-
data = transform_compute_security_group_rule(obj)
|
|
88
|
-
return zip(*sorted(data.items()))
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def format_network_port_range(rule):
|
|
58
|
+
def format_network_port_range(rule: dict[str, Any]) -> str:
|
|
92
59
|
# Display port range or ICMP type and code. For example:
|
|
93
60
|
# - ICMP type: 'type=3'
|
|
94
61
|
# - ICMP type and code: 'type=3:code=0'
|
|
@@ -114,8 +81,8 @@ def format_network_port_range(rule):
|
|
|
114
81
|
return port_range
|
|
115
82
|
|
|
116
83
|
|
|
117
|
-
def format_remote_ip_prefix(rule):
|
|
118
|
-
remote_ip_prefix = rule['remote_ip_prefix']
|
|
84
|
+
def format_remote_ip_prefix(rule: dict[str, Any]) -> str | None:
|
|
85
|
+
remote_ip_prefix = cast(str | None, rule['remote_ip_prefix'])
|
|
119
86
|
if remote_ip_prefix is None:
|
|
120
87
|
ethertype = rule['ether_type']
|
|
121
88
|
if ethertype == 'IPv4':
|
|
@@ -125,7 +92,7 @@ def format_remote_ip_prefix(rule):
|
|
|
125
92
|
return remote_ip_prefix
|
|
126
93
|
|
|
127
94
|
|
|
128
|
-
def convert_ipvx_case(string):
|
|
95
|
+
def convert_ipvx_case(string: str) -> str:
|
|
129
96
|
if string.lower() == 'ipv4':
|
|
130
97
|
return 'IPv4'
|
|
131
98
|
if string.lower() == 'ipv6':
|
|
@@ -133,7 +100,7 @@ def convert_ipvx_case(string):
|
|
|
133
100
|
return string
|
|
134
101
|
|
|
135
102
|
|
|
136
|
-
def is_icmp_protocol(protocol):
|
|
103
|
+
def is_icmp_protocol(protocol: str | None) -> bool:
|
|
137
104
|
# NOTE(rtheis): Neutron has deprecated protocol icmpv6.
|
|
138
105
|
# However, while the OSC CLI doesn't document the protocol,
|
|
139
106
|
# the code must still handle it. In addition, handle both
|
|
@@ -144,12 +111,14 @@ def is_icmp_protocol(protocol):
|
|
|
144
111
|
return False
|
|
145
112
|
|
|
146
113
|
|
|
147
|
-
def convert_to_lowercase(string):
|
|
114
|
+
def convert_to_lowercase(string: str) -> str:
|
|
148
115
|
return string.lower()
|
|
149
116
|
|
|
150
117
|
|
|
151
|
-
def get_protocol(
|
|
152
|
-
|
|
118
|
+
def get_protocol(
|
|
119
|
+
parsed_args: Any, default_protocol: str = 'any'
|
|
120
|
+
) -> str | None:
|
|
121
|
+
protocol: str | None = default_protocol
|
|
153
122
|
if parsed_args.protocol is not None:
|
|
154
123
|
protocol = parsed_args.protocol
|
|
155
124
|
if hasattr(parsed_args, "proto") and parsed_args.proto is not None:
|
|
@@ -159,7 +128,7 @@ def get_protocol(parsed_args, default_protocol='any'):
|
|
|
159
128
|
return protocol
|
|
160
129
|
|
|
161
130
|
|
|
162
|
-
def get_ethertype(parsed_args, protocol):
|
|
131
|
+
def get_ethertype(parsed_args: Any, protocol: str | None) -> str:
|
|
163
132
|
ethertype = 'IPv4'
|
|
164
133
|
if parsed_args.ethertype is not None:
|
|
165
134
|
ethertype = parsed_args.ethertype
|
|
@@ -168,16 +137,20 @@ def get_ethertype(parsed_args, protocol):
|
|
|
168
137
|
return ethertype
|
|
169
138
|
|
|
170
139
|
|
|
171
|
-
def is_ipv6_protocol(protocol):
|
|
140
|
+
def is_ipv6_protocol(protocol: str | None) -> bool:
|
|
172
141
|
# NOTE(rtheis): Neutron has deprecated protocol icmpv6.
|
|
173
142
|
# However, while the OSC CLI doesn't document the protocol,
|
|
174
143
|
# the code must still handle it. In addition, handle both
|
|
175
144
|
# protocol names and numbers.
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
145
|
+
if (protocol is not None and protocol.startswith('ipv6-')) or protocol in [
|
|
146
|
+
'icmpv6',
|
|
147
|
+
'41',
|
|
148
|
+
'43',
|
|
149
|
+
'44',
|
|
150
|
+
'58',
|
|
151
|
+
'59',
|
|
152
|
+
'60',
|
|
153
|
+
]:
|
|
181
154
|
return True
|
|
182
155
|
else:
|
|
183
156
|
return False
|
|
@@ -13,13 +13,18 @@
|
|
|
13
13
|
|
|
14
14
|
"""Address group action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
16
17
|
import logging
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
17
20
|
|
|
18
21
|
import netaddr
|
|
22
|
+
from openstack.network.v2 import address_group as _address_group
|
|
19
23
|
from osc_lib import exceptions
|
|
20
24
|
from osc_lib import utils
|
|
21
25
|
|
|
22
26
|
from openstackclient import command
|
|
27
|
+
from openstackclient.common import pagination
|
|
23
28
|
from openstackclient.i18n import _
|
|
24
29
|
from openstackclient.identity import common as identity_common
|
|
25
30
|
from openstackclient.network import common
|
|
@@ -27,19 +32,23 @@ from openstackclient.network import common
|
|
|
27
32
|
LOG = logging.getLogger(__name__)
|
|
28
33
|
|
|
29
34
|
|
|
30
|
-
def _get_columns(
|
|
35
|
+
def _get_columns(
|
|
36
|
+
item: _address_group.AddressGroup,
|
|
37
|
+
) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
31
38
|
hidden_columns = ['location', 'tenant_id']
|
|
32
39
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
33
40
|
item, {}, hidden_columns
|
|
34
41
|
)
|
|
35
42
|
|
|
36
43
|
|
|
37
|
-
def _format_addresses(addresses):
|
|
44
|
+
def _format_addresses(addresses: list[str]) -> list[str]:
|
|
38
45
|
return [str(netaddr.IPNetwork(addr)) for addr in addresses]
|
|
39
46
|
|
|
40
47
|
|
|
41
|
-
def _get_attrs(
|
|
42
|
-
|
|
48
|
+
def _get_attrs(
|
|
49
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
50
|
+
) -> dict[str, Any]:
|
|
51
|
+
attrs: dict[str, Any] = {}
|
|
43
52
|
attrs['name'] = parsed_args.name
|
|
44
53
|
if parsed_args.description:
|
|
45
54
|
attrs['description'] = parsed_args.description
|
|
@@ -59,7 +68,7 @@ def _get_attrs(client_manager, parsed_args):
|
|
|
59
68
|
class CreateAddressGroup(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
60
69
|
_description = _("Create a new Address Group")
|
|
61
70
|
|
|
62
|
-
def get_parser(self, prog_name):
|
|
71
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
63
72
|
parser = super().get_parser(prog_name)
|
|
64
73
|
parser.add_argument(
|
|
65
74
|
'name', metavar="<name>", help=_("New address group name")
|
|
@@ -87,7 +96,9 @@ class CreateAddressGroup(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
87
96
|
|
|
88
97
|
return parser
|
|
89
98
|
|
|
90
|
-
def take_action(
|
|
99
|
+
def take_action(
|
|
100
|
+
self, parsed_args: argparse.Namespace
|
|
101
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
91
102
|
client = self.app.client_manager.network
|
|
92
103
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
|
93
104
|
|
|
@@ -105,7 +116,7 @@ class CreateAddressGroup(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
|
105
116
|
class DeleteAddressGroup(command.Command):
|
|
106
117
|
_description = _("Delete address group(s)")
|
|
107
118
|
|
|
108
|
-
def get_parser(self, prog_name):
|
|
119
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
109
120
|
parser = super().get_parser(prog_name)
|
|
110
121
|
parser.add_argument(
|
|
111
122
|
'address_group',
|
|
@@ -116,7 +127,7 @@ class DeleteAddressGroup(command.Command):
|
|
|
116
127
|
|
|
117
128
|
return parser
|
|
118
129
|
|
|
119
|
-
def take_action(self, parsed_args):
|
|
130
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
120
131
|
client = self.app.client_manager.network
|
|
121
132
|
result = 0
|
|
122
133
|
|
|
@@ -145,7 +156,7 @@ class DeleteAddressGroup(command.Command):
|
|
|
145
156
|
class ListAddressGroup(command.Lister):
|
|
146
157
|
_description = _("List address groups")
|
|
147
158
|
|
|
148
|
-
def get_parser(self, prog_name):
|
|
159
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
149
160
|
parser = super().get_parser(prog_name)
|
|
150
161
|
|
|
151
162
|
parser.add_argument(
|
|
@@ -162,10 +173,13 @@ class ListAddressGroup(command.Lister):
|
|
|
162
173
|
),
|
|
163
174
|
)
|
|
164
175
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
176
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
165
177
|
|
|
166
178
|
return parser
|
|
167
179
|
|
|
168
|
-
def take_action(
|
|
180
|
+
def take_action(
|
|
181
|
+
self, parsed_args: argparse.Namespace
|
|
182
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
169
183
|
client = self.app.client_manager.network
|
|
170
184
|
columns = (
|
|
171
185
|
'id',
|
|
@@ -192,6 +206,13 @@ class ListAddressGroup(command.Lister):
|
|
|
192
206
|
parsed_args.project_domain,
|
|
193
207
|
).id
|
|
194
208
|
attrs['project_id'] = project_id
|
|
209
|
+
if parsed_args.marker is not None:
|
|
210
|
+
attrs['marker'] = parsed_args.marker
|
|
211
|
+
if parsed_args.limit is not None:
|
|
212
|
+
attrs['limit'] = parsed_args.limit
|
|
213
|
+
if parsed_args.max_items is not None:
|
|
214
|
+
attrs['max_items'] = parsed_args.max_items
|
|
215
|
+
|
|
195
216
|
data = client.address_groups(**attrs)
|
|
196
217
|
|
|
197
218
|
return (
|
|
@@ -210,7 +231,7 @@ class ListAddressGroup(command.Lister):
|
|
|
210
231
|
class SetAddressGroup(common.NeutronCommandWithExtraArgs):
|
|
211
232
|
_description = _("Set address group properties")
|
|
212
233
|
|
|
213
|
-
def get_parser(self, prog_name):
|
|
234
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
214
235
|
parser = super().get_parser(prog_name)
|
|
215
236
|
parser.add_argument(
|
|
216
237
|
'address_group',
|
|
@@ -236,7 +257,7 @@ class SetAddressGroup(common.NeutronCommandWithExtraArgs):
|
|
|
236
257
|
)
|
|
237
258
|
return parser
|
|
238
259
|
|
|
239
|
-
def take_action(self, parsed_args):
|
|
260
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
240
261
|
client = self.app.client_manager.network
|
|
241
262
|
obj = client.find_address_group(
|
|
242
263
|
parsed_args.address_group, ignore_missing=False
|
|
@@ -261,7 +282,7 @@ class SetAddressGroup(common.NeutronCommandWithExtraArgs):
|
|
|
261
282
|
class ShowAddressGroup(command.ShowOne):
|
|
262
283
|
_description = _("Display address group details")
|
|
263
284
|
|
|
264
|
-
def get_parser(self, prog_name):
|
|
285
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
265
286
|
parser = super().get_parser(prog_name)
|
|
266
287
|
parser.add_argument(
|
|
267
288
|
'address_group',
|
|
@@ -271,7 +292,9 @@ class ShowAddressGroup(command.ShowOne):
|
|
|
271
292
|
|
|
272
293
|
return parser
|
|
273
294
|
|
|
274
|
-
def take_action(
|
|
295
|
+
def take_action(
|
|
296
|
+
self, parsed_args: argparse.Namespace
|
|
297
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
275
298
|
client = self.app.client_manager.network
|
|
276
299
|
obj = client.find_address_group(
|
|
277
300
|
parsed_args.address_group, ignore_missing=False
|
|
@@ -285,7 +308,7 @@ class ShowAddressGroup(command.ShowOne):
|
|
|
285
308
|
class UnsetAddressGroup(command.Command):
|
|
286
309
|
_description = _("Unset address group properties")
|
|
287
310
|
|
|
288
|
-
def get_parser(self, prog_name):
|
|
311
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
289
312
|
parser = super().get_parser(prog_name)
|
|
290
313
|
parser.add_argument(
|
|
291
314
|
'address_group',
|
|
@@ -304,7 +327,7 @@ class UnsetAddressGroup(command.Command):
|
|
|
304
327
|
)
|
|
305
328
|
return parser
|
|
306
329
|
|
|
307
|
-
def take_action(self, parsed_args):
|
|
330
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
308
331
|
client = self.app.client_manager.network
|
|
309
332
|
obj = client.find_address_group(
|
|
310
333
|
parsed_args.address_group, ignore_missing=False
|