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
|
@@ -9,29 +9,34 @@
|
|
|
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
|
-
#
|
|
13
12
|
|
|
14
13
|
"""Security Group action implementations"""
|
|
15
14
|
|
|
16
15
|
import argparse
|
|
17
|
-
import
|
|
16
|
+
from collections.abc import Iterable, Sequence
|
|
17
|
+
import logging
|
|
18
|
+
from typing import Any, cast
|
|
18
19
|
|
|
19
20
|
from cliff import columns as cliff_columns
|
|
21
|
+
from openstack.network.v2 import security_group as _security_group
|
|
22
|
+
from osc_lib import exceptions
|
|
20
23
|
from osc_lib import utils
|
|
21
24
|
from osc_lib.utils import tags as _tag
|
|
22
25
|
|
|
23
|
-
from openstackclient.api import compute_v2
|
|
24
26
|
from openstackclient import command
|
|
27
|
+
from openstackclient.common import pagination
|
|
25
28
|
from openstackclient.i18n import _
|
|
26
29
|
from openstackclient.identity import common as identity_common
|
|
27
30
|
from openstackclient.network import common
|
|
28
|
-
|
|
31
|
+
|
|
32
|
+
LOG = logging.getLogger(__name__)
|
|
29
33
|
|
|
30
34
|
|
|
31
|
-
def _format_network_security_group_rules(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
#
|
|
35
|
+
def _format_network_security_group_rules(
|
|
36
|
+
sg_rules: list[dict[str, Any]],
|
|
37
|
+
) -> str:
|
|
38
|
+
# For readability, trim keys with caller known (e.g. security group and
|
|
39
|
+
# tenant ID) or empty values.
|
|
35
40
|
for sg_rule in sg_rules:
|
|
36
41
|
empty_keys = [k for k, v in sg_rule.items() if not v]
|
|
37
42
|
for key in empty_keys:
|
|
@@ -39,54 +44,22 @@ def _format_network_security_group_rules(sg_rules):
|
|
|
39
44
|
sg_rule.pop('security_group_id', None)
|
|
40
45
|
sg_rule.pop('tenant_id', None)
|
|
41
46
|
sg_rule.pop('project_id', None)
|
|
42
|
-
return utils.format_list_of_dicts(sg_rules)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def _format_compute_security_group_rule(sg_rule):
|
|
46
|
-
info = network_utils.transform_compute_security_group_rule(sg_rule)
|
|
47
|
-
# Trim parent security group ID since caller has this information.
|
|
48
|
-
info.pop('parent_group_id', None)
|
|
49
|
-
# Trim keys with empty string values.
|
|
50
|
-
keys_to_trim = [
|
|
51
|
-
'ip_protocol',
|
|
52
|
-
'ip_range',
|
|
53
|
-
'port_range',
|
|
54
|
-
'remote_security_group',
|
|
55
|
-
]
|
|
56
|
-
for key in keys_to_trim:
|
|
57
|
-
if key in info and not info[key]:
|
|
58
|
-
info.pop(key)
|
|
59
|
-
return utils.format_dict(info)
|
|
47
|
+
return utils.format_list_of_dicts(sg_rules) or ""
|
|
60
48
|
|
|
61
49
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
for sg_rule in sg_rules:
|
|
65
|
-
rules.append(_format_compute_security_group_rule(sg_rule))
|
|
66
|
-
return utils.format_list(rules, separator='\n')
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
class NetworkSecurityGroupRulesColumn(cliff_columns.FormattableColumn[ty.Any]):
|
|
70
|
-
def human_readable(self):
|
|
50
|
+
class NetworkSecurityGroupRulesColumn(cliff_columns.FormattableColumn[Any]):
|
|
51
|
+
def human_readable(self) -> str:
|
|
71
52
|
return _format_network_security_group_rules(self._value)
|
|
72
53
|
|
|
73
54
|
|
|
74
|
-
|
|
75
|
-
def human_readable(self):
|
|
76
|
-
return _format_compute_security_group_rules(self._value)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
_formatters_network = {
|
|
55
|
+
_formatters = {
|
|
80
56
|
'security_group_rules': NetworkSecurityGroupRulesColumn,
|
|
81
57
|
}
|
|
82
58
|
|
|
83
59
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
def _get_columns(item):
|
|
60
|
+
def _get_columns(
|
|
61
|
+
item: _security_group.SecurityGroup,
|
|
62
|
+
) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
90
63
|
# We still support Nova managed security groups, where we have tenant_id.
|
|
91
64
|
column_map = {
|
|
92
65
|
'security_group_rules': 'rules',
|
|
@@ -97,14 +70,11 @@ def _get_columns(item):
|
|
|
97
70
|
)
|
|
98
71
|
|
|
99
72
|
|
|
100
|
-
|
|
101
|
-
# OSC minimum requirements include SDK 1.0.
|
|
102
|
-
class CreateSecurityGroup(
|
|
103
|
-
common.NetworkAndComputeShowOne, common.NeutronCommandWithExtraArgs
|
|
104
|
-
):
|
|
73
|
+
class CreateSecurityGroup(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
105
74
|
_description = _("Create a new security group")
|
|
106
75
|
|
|
107
|
-
def
|
|
76
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
77
|
+
parser = super().get_parser(prog_name)
|
|
108
78
|
parser.add_argument(
|
|
109
79
|
"name", metavar="<name>", help=_("New security group name")
|
|
110
80
|
)
|
|
@@ -113,13 +83,10 @@ class CreateSecurityGroup(
|
|
|
113
83
|
metavar="<description>",
|
|
114
84
|
help=_("Security group description"),
|
|
115
85
|
)
|
|
116
|
-
return parser
|
|
117
|
-
|
|
118
|
-
def update_parser_network(self, parser):
|
|
119
86
|
parser.add_argument(
|
|
120
87
|
'--project',
|
|
121
88
|
metavar='<project>',
|
|
122
|
-
help=
|
|
89
|
+
help=_("Owner's project (name or ID)"),
|
|
123
90
|
)
|
|
124
91
|
stateful_group = parser.add_mutually_exclusive_group()
|
|
125
92
|
stateful_group.add_argument(
|
|
@@ -134,21 +101,20 @@ class CreateSecurityGroup(
|
|
|
134
101
|
default=None,
|
|
135
102
|
help=_("Security group is stateless"),
|
|
136
103
|
)
|
|
137
|
-
identity_common.add_project_domain_option_to_parser(
|
|
138
|
-
|
|
139
|
-
)
|
|
140
|
-
_tag.add_tag_option_to_parser_for_create(
|
|
141
|
-
parser, _('security group'), enhance_help=self.enhance_help_neutron
|
|
142
|
-
)
|
|
104
|
+
identity_common.add_project_domain_option_to_parser(parser)
|
|
105
|
+
_tag.add_tag_option_to_parser_for_create(parser, _('security group'))
|
|
143
106
|
return parser
|
|
144
107
|
|
|
145
|
-
def _get_description(self, parsed_args):
|
|
108
|
+
def _get_description(self, parsed_args: argparse.Namespace) -> str:
|
|
146
109
|
if parsed_args.description is not None:
|
|
147
|
-
return parsed_args.description
|
|
110
|
+
return cast(str, parsed_args.description)
|
|
148
111
|
else:
|
|
149
|
-
return parsed_args.name
|
|
112
|
+
return cast(str, parsed_args.name)
|
|
150
113
|
|
|
151
|
-
def
|
|
114
|
+
def take_action(
|
|
115
|
+
self, parsed_args: argparse.Namespace
|
|
116
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
117
|
+
client = self.app.client_manager.network
|
|
152
118
|
# Build the create attributes.
|
|
153
119
|
attrs = {}
|
|
154
120
|
attrs['name'] = parsed_args.name
|
|
@@ -175,33 +141,16 @@ class CreateSecurityGroup(
|
|
|
175
141
|
_tag.update_tags_for_set(client, obj, parsed_args)
|
|
176
142
|
display_columns, property_columns = _get_columns(obj)
|
|
177
143
|
data = utils.get_item_properties(
|
|
178
|
-
obj, property_columns, formatters=
|
|
179
|
-
)
|
|
180
|
-
return (display_columns, data)
|
|
181
|
-
|
|
182
|
-
def take_action_compute(self, client, parsed_args):
|
|
183
|
-
description = self._get_description(parsed_args)
|
|
184
|
-
obj = compute_v2.create_security_group(
|
|
185
|
-
client,
|
|
186
|
-
parsed_args.name,
|
|
187
|
-
description,
|
|
188
|
-
)
|
|
189
|
-
display_columns = ('description', 'id', 'name', 'project_id', 'rules')
|
|
190
|
-
property_columns = ('description', 'id', 'name', 'tenant_id', 'rules')
|
|
191
|
-
data = utils.get_dict_properties(
|
|
192
|
-
obj, property_columns, formatters=_formatters_compute
|
|
144
|
+
obj, property_columns, formatters=_formatters
|
|
193
145
|
)
|
|
194
146
|
return (display_columns, data)
|
|
195
147
|
|
|
196
148
|
|
|
197
|
-
class DeleteSecurityGroup(
|
|
149
|
+
class DeleteSecurityGroup(command.Command):
|
|
198
150
|
_description = _("Delete security group(s)")
|
|
199
151
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
r = None
|
|
203
|
-
|
|
204
|
-
def update_parser_common(self, parser):
|
|
152
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
153
|
+
parser = super().get_parser(prog_name)
|
|
205
154
|
parser.add_argument(
|
|
206
155
|
'group',
|
|
207
156
|
metavar='<group>',
|
|
@@ -210,18 +159,34 @@ class DeleteSecurityGroup(common.NetworkAndComputeDelete):
|
|
|
210
159
|
)
|
|
211
160
|
return parser
|
|
212
161
|
|
|
213
|
-
def
|
|
214
|
-
|
|
215
|
-
|
|
162
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
163
|
+
client = self.app.client_manager.network
|
|
164
|
+
result = 0
|
|
165
|
+
|
|
166
|
+
for group in parsed_args.group:
|
|
167
|
+
try:
|
|
168
|
+
obj = client.find_security_group(group, ignore_missing=False)
|
|
169
|
+
client.delete_security_group(obj)
|
|
170
|
+
except Exception as e:
|
|
171
|
+
result += 1
|
|
172
|
+
LOG.error(
|
|
173
|
+
_(
|
|
174
|
+
"Failed to delete security group with "
|
|
175
|
+
"name or ID '%(group)s': %(e)s"
|
|
176
|
+
),
|
|
177
|
+
{'group': group, 'e': e},
|
|
178
|
+
)
|
|
216
179
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
180
|
+
if result > 0:
|
|
181
|
+
total = len(parsed_args.group)
|
|
182
|
+
msg = _("%(result)s of %(total)s groups failed to delete.") % {
|
|
183
|
+
'result': result,
|
|
184
|
+
'total': total,
|
|
185
|
+
}
|
|
186
|
+
raise exceptions.CommandError(msg)
|
|
220
187
|
|
|
221
188
|
|
|
222
|
-
|
|
223
|
-
# the OSC minimum requirements include SDK 1.0.
|
|
224
|
-
class ListSecurityGroup(common.NetworkAndComputeLister):
|
|
189
|
+
class ListSecurityGroup(command.Lister):
|
|
225
190
|
_description = _("List security groups")
|
|
226
191
|
FIELDS_TO_RETRIEVE = [
|
|
227
192
|
'id',
|
|
@@ -232,30 +197,17 @@ class ListSecurityGroup(common.NetworkAndComputeLister):
|
|
|
232
197
|
'shared',
|
|
233
198
|
]
|
|
234
199
|
|
|
235
|
-
def
|
|
236
|
-
|
|
237
|
-
# Maintain and hide the argument for backwards compatibility.
|
|
238
|
-
# Network will always return all projects for an admin.
|
|
239
|
-
parser.add_argument(
|
|
240
|
-
'--all-projects',
|
|
241
|
-
action='store_true',
|
|
242
|
-
default=False,
|
|
243
|
-
help=argparse.SUPPRESS,
|
|
244
|
-
)
|
|
245
|
-
|
|
200
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
201
|
+
parser = super().get_parser(prog_name)
|
|
246
202
|
parser.add_argument(
|
|
247
203
|
'--project',
|
|
248
204
|
metavar='<project>',
|
|
249
|
-
help=
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
"(name or ID)"
|
|
253
|
-
)
|
|
205
|
+
help=_(
|
|
206
|
+
"List only security groups with the specified project "
|
|
207
|
+
"(name or ID)"
|
|
254
208
|
),
|
|
255
209
|
)
|
|
256
|
-
identity_common.add_project_domain_option_to_parser(
|
|
257
|
-
parser, enhance_help=self.enhance_help_neutron
|
|
258
|
-
)
|
|
210
|
+
identity_common.add_project_domain_option_to_parser(parser)
|
|
259
211
|
|
|
260
212
|
shared_group = parser.add_mutually_exclusive_group()
|
|
261
213
|
shared_group.add_argument(
|
|
@@ -273,24 +225,16 @@ class ListSecurityGroup(common.NetworkAndComputeLister):
|
|
|
273
225
|
help=_("List only security groups not shared between projects"),
|
|
274
226
|
)
|
|
275
227
|
|
|
276
|
-
_tag.add_tag_filtering_option_to_parser(
|
|
277
|
-
|
|
278
|
-
)
|
|
279
|
-
return parser
|
|
280
|
-
|
|
281
|
-
def update_parser_compute(self, parser):
|
|
282
|
-
parser.add_argument(
|
|
283
|
-
'--all-projects',
|
|
284
|
-
action='store_true',
|
|
285
|
-
default=False,
|
|
286
|
-
help=self.enhance_help_nova_network(
|
|
287
|
-
_("Display information from all projects (admin only)")
|
|
288
|
-
),
|
|
289
|
-
)
|
|
228
|
+
_tag.add_tag_filtering_option_to_parser(parser, _('security group'))
|
|
229
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
290
230
|
return parser
|
|
291
231
|
|
|
292
|
-
def
|
|
232
|
+
def take_action(
|
|
233
|
+
self, parsed_args: argparse.Namespace
|
|
234
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
235
|
+
client = self.app.client_manager.network
|
|
293
236
|
filters = {}
|
|
237
|
+
|
|
294
238
|
if parsed_args.project:
|
|
295
239
|
identity_client = self.app.client_manager.identity
|
|
296
240
|
project_id = identity_common.find_project(
|
|
@@ -302,6 +246,12 @@ class ListSecurityGroup(common.NetworkAndComputeLister):
|
|
|
302
246
|
|
|
303
247
|
if parsed_args.shared is not None:
|
|
304
248
|
filters['shared'] = parsed_args.shared
|
|
249
|
+
if parsed_args.marker is not None:
|
|
250
|
+
filters['marker'] = parsed_args.marker
|
|
251
|
+
if parsed_args.limit is not None:
|
|
252
|
+
filters['limit'] = parsed_args.limit
|
|
253
|
+
if parsed_args.max_items is not None:
|
|
254
|
+
filters['max_items'] = parsed_args.max_items
|
|
305
255
|
|
|
306
256
|
_tag.get_tag_filtering_args(parsed_args, filters)
|
|
307
257
|
data = client.security_groups(
|
|
@@ -335,36 +285,12 @@ class ListSecurityGroup(common.NetworkAndComputeLister):
|
|
|
335
285
|
),
|
|
336
286
|
)
|
|
337
287
|
|
|
338
|
-
def take_action_compute(self, client, parsed_args):
|
|
339
|
-
data = compute_v2.list_security_groups(
|
|
340
|
-
# TODO(dtroyer): add limit, marker
|
|
341
|
-
client,
|
|
342
|
-
all_projects=parsed_args.all_projects,
|
|
343
|
-
)
|
|
344
|
-
|
|
345
|
-
columns: tuple[str, ...] = ("id", "name", "description")
|
|
346
|
-
column_headers: tuple[str, ...] = ("ID", "Name", "Description")
|
|
347
|
-
if parsed_args.all_projects:
|
|
348
|
-
columns += ('tenant_id',)
|
|
349
|
-
column_headers += ('Project',)
|
|
350
|
-
return (
|
|
351
|
-
column_headers,
|
|
352
|
-
(
|
|
353
|
-
utils.get_dict_properties(
|
|
354
|
-
s,
|
|
355
|
-
columns,
|
|
356
|
-
)
|
|
357
|
-
for s in data
|
|
358
|
-
),
|
|
359
|
-
)
|
|
360
|
-
|
|
361
288
|
|
|
362
|
-
class SetSecurityGroup(
|
|
363
|
-
common.NetworkAndComputeCommand, common.NeutronCommandWithExtraArgs
|
|
364
|
-
):
|
|
289
|
+
class SetSecurityGroup(common.NeutronCommandWithExtraArgs):
|
|
365
290
|
_description = _("Set security group properties")
|
|
366
291
|
|
|
367
|
-
def
|
|
292
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
293
|
+
parser = super().get_parser(prog_name)
|
|
368
294
|
parser.add_argument(
|
|
369
295
|
'group',
|
|
370
296
|
metavar='<group>',
|
|
@@ -391,15 +317,11 @@ class SetSecurityGroup(
|
|
|
391
317
|
default=None,
|
|
392
318
|
help=_("Security group is stateless"),
|
|
393
319
|
)
|
|
320
|
+
_tag.add_tag_option_to_parser_for_set(parser, _('security group'))
|
|
394
321
|
return parser
|
|
395
322
|
|
|
396
|
-
def
|
|
397
|
-
|
|
398
|
-
parser, _('security group'), enhance_help=self.enhance_help_neutron
|
|
399
|
-
)
|
|
400
|
-
return parser
|
|
401
|
-
|
|
402
|
-
def take_action_network(self, client, parsed_args):
|
|
323
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
324
|
+
client = self.app.client_manager.network
|
|
403
325
|
obj = client.find_security_group(
|
|
404
326
|
parsed_args.group, ignore_missing=False
|
|
405
327
|
)
|
|
@@ -423,29 +345,12 @@ class SetSecurityGroup(
|
|
|
423
345
|
# tags is a subresource and it needs to be updated separately.
|
|
424
346
|
_tag.update_tags_for_set(client, obj, parsed_args)
|
|
425
347
|
|
|
426
|
-
def take_action_compute(self, client, parsed_args):
|
|
427
|
-
security_group = compute_v2.find_security_group(
|
|
428
|
-
client, parsed_args.group
|
|
429
|
-
)
|
|
430
348
|
|
|
431
|
-
|
|
432
|
-
if parsed_args.name is not None:
|
|
433
|
-
params['name'] = parsed_args.name
|
|
434
|
-
if parsed_args.description is not None:
|
|
435
|
-
params['description'] = parsed_args.description
|
|
436
|
-
|
|
437
|
-
# NOTE(rtheis): Previous behavior did not raise a CommandError
|
|
438
|
-
# if there were no updates. Maintain this behavior and issue
|
|
439
|
-
# the update.
|
|
440
|
-
compute_v2.update_security_group(
|
|
441
|
-
client, security_group['id'], **params
|
|
442
|
-
)
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
class ShowSecurityGroup(common.NetworkAndComputeShowOne):
|
|
349
|
+
class ShowSecurityGroup(command.ShowOne):
|
|
446
350
|
_description = _("Display security group details")
|
|
447
351
|
|
|
448
|
-
def
|
|
352
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
353
|
+
parser = super().get_parser(prog_name)
|
|
449
354
|
parser.add_argument(
|
|
450
355
|
'group',
|
|
451
356
|
metavar='<group>',
|
|
@@ -453,22 +358,16 @@ class ShowSecurityGroup(common.NetworkAndComputeShowOne):
|
|
|
453
358
|
)
|
|
454
359
|
return parser
|
|
455
360
|
|
|
456
|
-
def
|
|
361
|
+
def take_action(
|
|
362
|
+
self, parsed_args: argparse.Namespace
|
|
363
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
364
|
+
client = self.app.client_manager.network
|
|
457
365
|
obj = client.find_security_group(
|
|
458
366
|
parsed_args.group, ignore_missing=False
|
|
459
367
|
)
|
|
460
368
|
display_columns, property_columns = _get_columns(obj)
|
|
461
369
|
data = utils.get_item_properties(
|
|
462
|
-
obj, property_columns, formatters=
|
|
463
|
-
)
|
|
464
|
-
return (display_columns, data)
|
|
465
|
-
|
|
466
|
-
def take_action_compute(self, client, parsed_args):
|
|
467
|
-
obj = compute_v2.find_security_group(client, parsed_args.group)
|
|
468
|
-
display_columns = ('description', 'id', 'name', 'project_id', 'rules')
|
|
469
|
-
property_columns = ('description', 'id', 'name', 'tenant_id', 'rules')
|
|
470
|
-
data = utils.get_dict_properties(
|
|
471
|
-
obj, property_columns, formatters=_formatters_compute
|
|
370
|
+
obj, property_columns, formatters=_formatters
|
|
472
371
|
)
|
|
473
372
|
return (display_columns, data)
|
|
474
373
|
|
|
@@ -476,7 +375,7 @@ class ShowSecurityGroup(common.NetworkAndComputeShowOne):
|
|
|
476
375
|
class UnsetSecurityGroup(command.Command):
|
|
477
376
|
_description = _("Unset security group properties")
|
|
478
377
|
|
|
479
|
-
def get_parser(self, prog_name):
|
|
378
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
480
379
|
parser = super().get_parser(prog_name)
|
|
481
380
|
parser.add_argument(
|
|
482
381
|
'group',
|
|
@@ -486,7 +385,7 @@ class UnsetSecurityGroup(command.Command):
|
|
|
486
385
|
_tag.add_tag_option_to_parser_for_unset(parser, _('security group'))
|
|
487
386
|
return parser
|
|
488
387
|
|
|
489
|
-
def take_action(self, parsed_args):
|
|
388
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
490
389
|
client = self.app.client_manager.network
|
|
491
390
|
obj = client.find_security_group(
|
|
492
391
|
parsed_args.group, ignore_missing=False
|