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
|
@@ -12,25 +12,34 @@
|
|
|
12
12
|
|
|
13
13
|
"""Network action implementations"""
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
16
|
+
from collections.abc import Iterable, Sequence
|
|
17
|
+
import logging
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
15
20
|
from cliff import columns as cliff_columns
|
|
21
|
+
from openstack.network.v2 import network as _network
|
|
16
22
|
from osc_lib.cli import format_columns
|
|
17
23
|
from osc_lib import exceptions
|
|
18
24
|
from osc_lib import utils
|
|
19
25
|
from osc_lib.utils import tags as _tag
|
|
20
26
|
|
|
21
|
-
from openstackclient
|
|
27
|
+
from openstackclient import command
|
|
28
|
+
from openstackclient.common import pagination
|
|
22
29
|
from openstackclient.i18n import _
|
|
23
30
|
from openstackclient.identity import common as identity_common
|
|
24
31
|
from openstackclient.network import common
|
|
25
32
|
|
|
33
|
+
LOG = logging.getLogger(__name__)
|
|
34
|
+
|
|
26
35
|
|
|
27
36
|
class AdminStateColumn(cliff_columns.FormattableColumn[bool]):
|
|
28
|
-
def human_readable(self):
|
|
37
|
+
def human_readable(self) -> str:
|
|
29
38
|
return 'UP' if self._value else 'DOWN'
|
|
30
39
|
|
|
31
40
|
|
|
32
41
|
class RouterExternalColumn(cliff_columns.FormattableColumn[bool]):
|
|
33
|
-
def human_readable(self):
|
|
42
|
+
def human_readable(self) -> str:
|
|
34
43
|
return 'External' if self._value else 'Internal'
|
|
35
44
|
|
|
36
45
|
|
|
@@ -47,7 +56,9 @@ _formatters = {
|
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
|
|
50
|
-
def _get_columns_network(
|
|
59
|
+
def _get_columns_network(
|
|
60
|
+
item: _network.Network,
|
|
61
|
+
) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
51
62
|
column_map = {
|
|
52
63
|
'subnet_ids': 'subnets',
|
|
53
64
|
'is_admin_state_up': 'admin_state_up',
|
|
@@ -67,11 +78,13 @@ def _get_columns_network(item):
|
|
|
67
78
|
)
|
|
68
79
|
|
|
69
80
|
|
|
70
|
-
def _get_columns_compute(item):
|
|
81
|
+
def _get_columns_compute(item: Any) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
71
82
|
return utils.get_osc_show_columns_for_sdk_resource(item, {})
|
|
72
83
|
|
|
73
84
|
|
|
74
|
-
def _get_attrs_network(
|
|
85
|
+
def _get_attrs_network(
|
|
86
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
87
|
+
) -> dict[str, Any]:
|
|
75
88
|
attrs = {}
|
|
76
89
|
if parsed_args.name is not None:
|
|
77
90
|
attrs['name'] = parsed_args.name
|
|
@@ -137,13 +150,22 @@ def _get_attrs_network(client_manager, parsed_args):
|
|
|
137
150
|
attrs['qos_policy_id'] = _qos_policy.id
|
|
138
151
|
if 'no_qos_policy' in parsed_args and parsed_args.no_qos_policy:
|
|
139
152
|
attrs['qos_policy_id'] = None
|
|
153
|
+
|
|
154
|
+
# Set pvlan
|
|
155
|
+
if parsed_args.pvlan:
|
|
156
|
+
attrs['pvlan'] = True
|
|
157
|
+
if parsed_args.no_pvlan:
|
|
158
|
+
attrs['pvlan'] = False
|
|
159
|
+
|
|
140
160
|
# Update DNS network options
|
|
141
161
|
if parsed_args.dns_domain is not None:
|
|
142
162
|
attrs['dns_domain'] = parsed_args.dns_domain
|
|
143
163
|
return attrs
|
|
144
164
|
|
|
145
165
|
|
|
146
|
-
def _get_attrs_compute(
|
|
166
|
+
def _get_attrs_compute(
|
|
167
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
168
|
+
) -> dict[str, Any]:
|
|
147
169
|
attrs = {}
|
|
148
170
|
if parsed_args.name is not None:
|
|
149
171
|
attrs['name'] = parsed_args.name
|
|
@@ -156,7 +178,7 @@ def _get_attrs_compute(client_manager, parsed_args):
|
|
|
156
178
|
return attrs
|
|
157
179
|
|
|
158
180
|
|
|
159
|
-
def _add_additional_network_options(parser):
|
|
181
|
+
def _add_additional_network_options(parser: argparse.ArgumentParser) -> None:
|
|
160
182
|
# Add additional network options
|
|
161
183
|
|
|
162
184
|
parser.add_argument(
|
|
@@ -197,14 +219,11 @@ def _add_additional_network_options(parser):
|
|
|
197
219
|
)
|
|
198
220
|
|
|
199
221
|
|
|
200
|
-
|
|
201
|
-
# OSC minimum requirements include SDK 1.0.
|
|
202
|
-
class CreateNetwork(
|
|
203
|
-
common.NetworkAndComputeShowOne, common.NeutronCommandWithExtraArgs
|
|
204
|
-
):
|
|
222
|
+
class CreateNetwork(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
205
223
|
_description = _("Create new network")
|
|
206
224
|
|
|
207
|
-
def
|
|
225
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
226
|
+
parser = super().get_parser(prog_name)
|
|
208
227
|
parser.add_argument(
|
|
209
228
|
'name', metavar='<name>', help=_("New network name")
|
|
210
229
|
)
|
|
@@ -220,35 +239,32 @@ class CreateNetwork(
|
|
|
220
239
|
action='store_true',
|
|
221
240
|
help=_("Do not share the network between projects"),
|
|
222
241
|
)
|
|
223
|
-
return parser
|
|
224
|
-
|
|
225
|
-
def update_parser_network(self, parser):
|
|
226
242
|
admin_group = parser.add_mutually_exclusive_group()
|
|
227
243
|
admin_group.add_argument(
|
|
228
244
|
'--enable',
|
|
229
245
|
action='store_true',
|
|
230
246
|
default=True,
|
|
231
|
-
help=
|
|
247
|
+
help=_("Enable network (default)"),
|
|
232
248
|
)
|
|
233
249
|
admin_group.add_argument(
|
|
234
250
|
'--disable',
|
|
235
251
|
action='store_true',
|
|
236
|
-
help=
|
|
252
|
+
help=_("Disable network"),
|
|
237
253
|
)
|
|
238
254
|
parser.add_argument(
|
|
239
255
|
'--project',
|
|
240
256
|
metavar='<project>',
|
|
241
|
-
help=
|
|
257
|
+
help=_("Owner's project (name or ID)"),
|
|
242
258
|
)
|
|
243
259
|
parser.add_argument(
|
|
244
260
|
'--description',
|
|
245
261
|
metavar='<description>',
|
|
246
|
-
help=
|
|
262
|
+
help=_("Set network description"),
|
|
247
263
|
)
|
|
248
264
|
parser.add_argument(
|
|
249
265
|
'--mtu',
|
|
250
266
|
metavar='<mtu>',
|
|
251
|
-
help=
|
|
267
|
+
help=_("Set network mtu"),
|
|
252
268
|
)
|
|
253
269
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
254
270
|
parser.add_argument(
|
|
@@ -256,133 +272,117 @@ class CreateNetwork(
|
|
|
256
272
|
action='append',
|
|
257
273
|
dest='availability_zone_hints',
|
|
258
274
|
metavar='<availability-zone>',
|
|
259
|
-
help=
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
"repeat option to set multiple availability zones)"
|
|
264
|
-
)
|
|
275
|
+
help=_(
|
|
276
|
+
"Availability Zone in which to create this network "
|
|
277
|
+
"(Network Availability Zone extension required, "
|
|
278
|
+
"repeat option to set multiple availability zones)"
|
|
265
279
|
),
|
|
266
280
|
)
|
|
267
281
|
port_security_group = parser.add_mutually_exclusive_group()
|
|
268
282
|
port_security_group.add_argument(
|
|
269
283
|
'--enable-port-security',
|
|
270
284
|
action='store_true',
|
|
271
|
-
help=
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
"this network (default)"
|
|
275
|
-
)
|
|
285
|
+
help=_(
|
|
286
|
+
"Enable port security by default for ports created on "
|
|
287
|
+
"this network (default)"
|
|
276
288
|
),
|
|
277
289
|
)
|
|
278
290
|
port_security_group.add_argument(
|
|
279
291
|
'--disable-port-security',
|
|
280
292
|
action='store_true',
|
|
281
|
-
help=
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
"this network"
|
|
285
|
-
)
|
|
293
|
+
help=_(
|
|
294
|
+
"Disable port security by default for ports created on "
|
|
295
|
+
"this network"
|
|
286
296
|
),
|
|
287
297
|
)
|
|
288
298
|
external_router_grp = parser.add_mutually_exclusive_group()
|
|
289
299
|
external_router_grp.add_argument(
|
|
290
300
|
'--external',
|
|
291
301
|
action='store_true',
|
|
292
|
-
help=
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
"(external-net extension required)"
|
|
298
|
-
)
|
|
302
|
+
help=_(
|
|
303
|
+
"The network has an external routing facility that is not "
|
|
304
|
+
"managed by Neutron and can be used. For example: "
|
|
305
|
+
"openstack router set --external-gateway NETWORK "
|
|
306
|
+
"(external-net extension required)"
|
|
299
307
|
),
|
|
300
308
|
)
|
|
301
309
|
external_router_grp.add_argument(
|
|
302
310
|
'--internal',
|
|
303
311
|
action='store_true',
|
|
304
|
-
help=
|
|
305
|
-
_("Opposite of '--external' (default)")
|
|
306
|
-
),
|
|
312
|
+
help=_("Opposite of '--external' (default)"),
|
|
307
313
|
)
|
|
308
314
|
default_router_grp = parser.add_mutually_exclusive_group()
|
|
309
315
|
default_router_grp.add_argument(
|
|
310
316
|
'--default',
|
|
311
317
|
action='store_true',
|
|
312
|
-
help=
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
"external network"
|
|
316
|
-
)
|
|
318
|
+
help=_(
|
|
319
|
+
"Specify if this network should be used as the default "
|
|
320
|
+
"external network"
|
|
317
321
|
),
|
|
318
322
|
)
|
|
319
323
|
default_router_grp.add_argument(
|
|
320
324
|
'--no-default',
|
|
321
325
|
action='store_true',
|
|
322
|
-
help=
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
"(default)"
|
|
326
|
-
)
|
|
326
|
+
help=_(
|
|
327
|
+
"Do not use the network as the default external network "
|
|
328
|
+
"(default)"
|
|
327
329
|
),
|
|
328
330
|
)
|
|
329
331
|
parser.add_argument(
|
|
330
332
|
'--qos-policy',
|
|
331
333
|
metavar='<qos-policy>',
|
|
332
|
-
help=
|
|
333
|
-
_("QoS policy to attach to this network (name or ID)")
|
|
334
|
-
),
|
|
334
|
+
help=_("QoS policy to attach to this network (name or ID)"),
|
|
335
335
|
)
|
|
336
336
|
vlan_transparent_grp = parser.add_mutually_exclusive_group()
|
|
337
337
|
vlan_transparent_grp.add_argument(
|
|
338
338
|
'--transparent-vlan',
|
|
339
339
|
action='store_true',
|
|
340
|
-
help=
|
|
341
|
-
_("Make the network VLAN transparent")
|
|
342
|
-
),
|
|
340
|
+
help=_("Make the network VLAN transparent"),
|
|
343
341
|
)
|
|
344
342
|
vlan_transparent_grp.add_argument(
|
|
345
343
|
'--no-transparent-vlan',
|
|
346
344
|
action='store_true',
|
|
347
|
-
help=
|
|
348
|
-
_("Do not make the network VLAN transparent")
|
|
349
|
-
),
|
|
345
|
+
help=_("Do not make the network VLAN transparent"),
|
|
350
346
|
)
|
|
351
347
|
|
|
352
348
|
vlan_qinq_grp = parser.add_mutually_exclusive_group()
|
|
353
349
|
vlan_qinq_grp.add_argument(
|
|
354
350
|
'--qinq-vlan',
|
|
355
351
|
action='store_true',
|
|
356
|
-
help=
|
|
357
|
-
_("Enable VLAN QinQ (S-Tag ethtype 0x8a88) for the network")
|
|
358
|
-
),
|
|
352
|
+
help=_("Enable VLAN QinQ (S-Tag ethtype 0x8a88) for the network"),
|
|
359
353
|
)
|
|
360
354
|
vlan_qinq_grp.add_argument(
|
|
361
355
|
'--no-qinq-vlan',
|
|
362
356
|
action='store_true',
|
|
363
|
-
help=
|
|
364
|
-
_("Disable VLAN QinQ (S-Tag ethtype 0x8a88) for the network")
|
|
365
|
-
),
|
|
357
|
+
help=_("Disable VLAN QinQ (S-Tag ethtype 0x8a88) for the network"),
|
|
366
358
|
)
|
|
367
359
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
360
|
+
pvlan_grp = parser.add_mutually_exclusive_group()
|
|
361
|
+
pvlan_grp.add_argument(
|
|
362
|
+
'--pvlan',
|
|
363
|
+
action='store_true',
|
|
364
|
+
help=_(
|
|
365
|
+
"Enable Private VLAN for the network "
|
|
366
|
+
"(PVLAN extension required)"
|
|
367
|
+
),
|
|
371
368
|
)
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
required=True,
|
|
379
|
-
help=self.enhance_help_nova_network(
|
|
380
|
-
_("IPv4 subnet for fixed IPs (in CIDR notation)")
|
|
369
|
+
pvlan_grp.add_argument(
|
|
370
|
+
'--no-pvlan',
|
|
371
|
+
action='store_true',
|
|
372
|
+
help=_(
|
|
373
|
+
"Disable Private VLAN for the network "
|
|
374
|
+
"(PVLAN extension required)"
|
|
381
375
|
),
|
|
382
376
|
)
|
|
377
|
+
|
|
378
|
+
_add_additional_network_options(parser)
|
|
379
|
+
_tag.add_tag_option_to_parser_for_create(parser, _('network'))
|
|
383
380
|
return parser
|
|
384
381
|
|
|
385
|
-
def
|
|
382
|
+
def take_action(
|
|
383
|
+
self, parsed_args: argparse.Namespace
|
|
384
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
385
|
+
client = self.app.client_manager.network
|
|
386
386
|
attrs = _get_attrs_network(self.app.client_manager, parsed_args)
|
|
387
387
|
if parsed_args.transparent_vlan:
|
|
388
388
|
attrs['vlan_transparent'] = True
|
|
@@ -394,6 +394,11 @@ class CreateNetwork(
|
|
|
394
394
|
if parsed_args.no_qinq_vlan:
|
|
395
395
|
attrs['vlan_qinq'] = False
|
|
396
396
|
|
|
397
|
+
if parsed_args.pvlan:
|
|
398
|
+
attrs['pvlan'] = True
|
|
399
|
+
if parsed_args.no_pvlan:
|
|
400
|
+
attrs['pvlan'] = False
|
|
401
|
+
|
|
397
402
|
if attrs.get('vlan_transparent') and attrs.get('vlan_qinq'):
|
|
398
403
|
msg = _(
|
|
399
404
|
"--transparent-vlan and --qinq-vlan can not be both enabled "
|
|
@@ -401,6 +406,14 @@ class CreateNetwork(
|
|
|
401
406
|
)
|
|
402
407
|
raise exceptions.CommandError(msg)
|
|
403
408
|
|
|
409
|
+
if (
|
|
410
|
+
attrs.get('port_security_enabled') is False
|
|
411
|
+
and attrs.get('pvlan') is True
|
|
412
|
+
):
|
|
413
|
+
msg = _(
|
|
414
|
+
"--disable-port-security and --pvlan can not be used together."
|
|
415
|
+
)
|
|
416
|
+
raise exceptions.CommandError(msg)
|
|
404
417
|
if (
|
|
405
418
|
parsed_args.segmentation_id
|
|
406
419
|
and not parsed_args.provider_network_type
|
|
@@ -425,81 +438,83 @@ class CreateNetwork(
|
|
|
425
438
|
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
|
426
439
|
return (display_columns, data)
|
|
427
440
|
|
|
428
|
-
def take_action_compute(self, client, parsed_args):
|
|
429
|
-
attrs = _get_attrs_compute(self.app.client_manager, parsed_args)
|
|
430
|
-
obj = compute_v2.create_network(client, **attrs)
|
|
431
|
-
display_columns, columns = _get_columns_compute(obj)
|
|
432
|
-
data = utils.get_dict_properties(obj, columns)
|
|
433
|
-
return (display_columns, data)
|
|
434
|
-
|
|
435
441
|
|
|
436
|
-
class DeleteNetwork(
|
|
442
|
+
class DeleteNetwork(command.Command):
|
|
437
443
|
_description = _("Delete network(s)")
|
|
438
444
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
r = None
|
|
442
|
-
|
|
443
|
-
def update_parser_common(self, parser):
|
|
445
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
446
|
+
parser = super().get_parser(prog_name)
|
|
444
447
|
parser.add_argument(
|
|
445
448
|
'network',
|
|
446
449
|
metavar="<network>",
|
|
447
450
|
nargs="+",
|
|
448
451
|
help=_("Network(s) to delete (name or ID)"),
|
|
449
452
|
)
|
|
450
|
-
|
|
451
453
|
return parser
|
|
452
454
|
|
|
453
|
-
def
|
|
454
|
-
|
|
455
|
-
|
|
455
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
456
|
+
client = self.app.client_manager.network
|
|
457
|
+
result = 0
|
|
458
|
+
|
|
459
|
+
for net in parsed_args.network:
|
|
460
|
+
try:
|
|
461
|
+
obj = client.find_network(net, ignore_missing=False)
|
|
462
|
+
client.delete_network(obj)
|
|
463
|
+
except Exception as e:
|
|
464
|
+
result += 1
|
|
465
|
+
LOG.error(
|
|
466
|
+
_(
|
|
467
|
+
"Failed to delete network with "
|
|
468
|
+
"name or ID '%(network)s': %(e)s"
|
|
469
|
+
),
|
|
470
|
+
{'network': net, 'e': e},
|
|
471
|
+
)
|
|
456
472
|
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
473
|
+
if result > 0:
|
|
474
|
+
total = len(parsed_args.network)
|
|
475
|
+
msg = _("%(result)s of %(total)s networks failed to delete.") % {
|
|
476
|
+
'result': result,
|
|
477
|
+
'total': total,
|
|
478
|
+
}
|
|
479
|
+
raise exceptions.CommandError(msg)
|
|
460
480
|
|
|
461
481
|
|
|
462
|
-
|
|
463
|
-
# OSC minimum requirements include SDK 1.0.
|
|
464
|
-
class ListNetwork(common.NetworkAndComputeLister):
|
|
482
|
+
class ListNetwork(command.Lister):
|
|
465
483
|
_description = _("List networks")
|
|
466
484
|
|
|
467
|
-
def
|
|
485
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
486
|
+
parser = super().get_parser(prog_name)
|
|
468
487
|
router_ext_group = parser.add_mutually_exclusive_group()
|
|
469
488
|
router_ext_group.add_argument(
|
|
470
489
|
'--external',
|
|
471
490
|
action='store_true',
|
|
472
|
-
help=
|
|
491
|
+
help=_("List only external networks"),
|
|
473
492
|
)
|
|
474
493
|
router_ext_group.add_argument(
|
|
475
494
|
'--internal',
|
|
476
495
|
action='store_true',
|
|
477
|
-
help=
|
|
496
|
+
help=_("List only internal networks"),
|
|
478
497
|
)
|
|
479
498
|
parser.add_argument(
|
|
480
499
|
'--long',
|
|
481
500
|
action='store_true',
|
|
482
|
-
help=
|
|
483
|
-
_("List additional fields in output")
|
|
484
|
-
),
|
|
501
|
+
help=_("List additional fields in output"),
|
|
485
502
|
)
|
|
486
503
|
parser.add_argument(
|
|
487
504
|
'--name',
|
|
488
505
|
metavar='<name>',
|
|
489
|
-
help=
|
|
490
|
-
_("List only networks with the specified name")
|
|
491
|
-
),
|
|
506
|
+
help=_("List only networks with the specified name"),
|
|
492
507
|
)
|
|
493
508
|
admin_state_group = parser.add_mutually_exclusive_group()
|
|
494
509
|
admin_state_group.add_argument(
|
|
495
510
|
'--enable',
|
|
496
511
|
action='store_true',
|
|
497
|
-
help=
|
|
512
|
+
help=_("List only enabled networks"),
|
|
498
513
|
)
|
|
499
514
|
admin_state_group.add_argument(
|
|
500
515
|
'--disable',
|
|
501
516
|
action='store_true',
|
|
502
|
-
help=
|
|
517
|
+
help=_("List only disabled networks"),
|
|
503
518
|
)
|
|
504
519
|
parser.add_argument(
|
|
505
520
|
'--project',
|
|
@@ -508,85 +523,70 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
508
523
|
"List only networks with the specified project (name or ID)"
|
|
509
524
|
),
|
|
510
525
|
)
|
|
511
|
-
identity_common.add_project_domain_option_to_parser(
|
|
512
|
-
parser, enhance_help=self.enhance_help_neutron
|
|
513
|
-
)
|
|
526
|
+
identity_common.add_project_domain_option_to_parser(parser)
|
|
514
527
|
shared_group = parser.add_mutually_exclusive_group()
|
|
515
528
|
shared_group.add_argument(
|
|
516
529
|
'--share',
|
|
517
530
|
action='store_true',
|
|
518
|
-
help=
|
|
519
|
-
_("List only networks shared between projects")
|
|
520
|
-
),
|
|
531
|
+
help=_("List only networks shared between projects"),
|
|
521
532
|
)
|
|
522
533
|
shared_group.add_argument(
|
|
523
534
|
'--no-share',
|
|
524
535
|
action='store_true',
|
|
525
|
-
help=
|
|
526
|
-
_("List only networks not shared between projects")
|
|
527
|
-
),
|
|
536
|
+
help=_("List only networks not shared between projects"),
|
|
528
537
|
)
|
|
529
538
|
parser.add_argument(
|
|
530
539
|
'--status',
|
|
531
540
|
metavar='<status>',
|
|
532
541
|
choices=['ACTIVE', 'BUILD', 'DOWN', 'ERROR'],
|
|
533
|
-
help=
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
"('ACTIVE', 'BUILD', 'DOWN', 'ERROR')"
|
|
537
|
-
)
|
|
542
|
+
help=_(
|
|
543
|
+
"List only networks with the specified status "
|
|
544
|
+
"('ACTIVE', 'BUILD', 'DOWN', 'ERROR')"
|
|
538
545
|
),
|
|
539
546
|
)
|
|
540
547
|
parser.add_argument(
|
|
541
548
|
'--provider-network-type',
|
|
542
549
|
metavar='<provider-network-type>',
|
|
543
550
|
choices=['flat', 'geneve', 'gre', 'local', 'vlan', 'vxlan'],
|
|
544
|
-
help=
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
"vlan and vxlan."
|
|
550
|
-
)
|
|
551
|
+
help=_(
|
|
552
|
+
"List only networks with the specified physical "
|
|
553
|
+
"mechanisms. "
|
|
554
|
+
"The supported options are: flat, geneve, gre, local, "
|
|
555
|
+
"vlan and vxlan."
|
|
551
556
|
),
|
|
552
557
|
)
|
|
553
558
|
parser.add_argument(
|
|
554
559
|
'--provider-physical-network',
|
|
555
560
|
metavar='<provider-physical-network>',
|
|
556
561
|
dest='physical_network',
|
|
557
|
-
help=
|
|
558
|
-
|
|
559
|
-
"List only networks with the specified physical network "
|
|
560
|
-
"name"
|
|
561
|
-
)
|
|
562
|
+
help=_(
|
|
563
|
+
"List only networks with the specified physical network name"
|
|
562
564
|
),
|
|
563
565
|
)
|
|
564
566
|
parser.add_argument(
|
|
565
567
|
'--provider-segment',
|
|
566
568
|
metavar='<provider-segment>',
|
|
567
569
|
dest='segmentation_id',
|
|
568
|
-
help=
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
"Tunnel ID for GENEVE/GRE/VXLAN networks)"
|
|
573
|
-
)
|
|
570
|
+
help=_(
|
|
571
|
+
"List only networks with the specified provider segment "
|
|
572
|
+
"ID (VLAN ID for VLAN networks or "
|
|
573
|
+
"Tunnel ID for GENEVE/GRE/VXLAN networks)"
|
|
574
574
|
),
|
|
575
575
|
)
|
|
576
576
|
parser.add_argument(
|
|
577
577
|
'--agent',
|
|
578
578
|
metavar='<agent-id>',
|
|
579
579
|
dest='agent_id',
|
|
580
|
-
help=
|
|
581
|
-
_('List only networks hosted the specified agent (ID only)')
|
|
582
|
-
),
|
|
583
|
-
)
|
|
584
|
-
_tag.add_tag_filtering_option_to_parser(
|
|
585
|
-
parser, _('networks'), enhance_help=self.enhance_help_neutron
|
|
580
|
+
help=_('List only networks hosted the specified agent (ID only)'),
|
|
586
581
|
)
|
|
582
|
+
_tag.add_tag_filtering_option_to_parser(parser, _('networks'))
|
|
583
|
+
pagination.add_marker_pagination_option_to_parser(parser)
|
|
587
584
|
return parser
|
|
588
585
|
|
|
589
|
-
def
|
|
586
|
+
def take_action(
|
|
587
|
+
self, parsed_args: argparse.Namespace
|
|
588
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
589
|
+
client = self.app.client_manager.network
|
|
590
590
|
identity_client = self.app.client_manager.identity
|
|
591
591
|
if parsed_args.long:
|
|
592
592
|
columns: tuple[str, ...] = (
|
|
@@ -615,7 +615,15 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
615
615
|
'Availability Zones',
|
|
616
616
|
'Tags',
|
|
617
617
|
)
|
|
618
|
-
|
|
618
|
+
else:
|
|
619
|
+
columns = ('id', 'name', 'subnet_ids')
|
|
620
|
+
column_headers = (
|
|
621
|
+
'ID',
|
|
622
|
+
'Name',
|
|
623
|
+
'Subnets',
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
if parsed_args.agent_id:
|
|
619
627
|
columns = ('id', 'name', 'subnet_ids')
|
|
620
628
|
column_headers = (
|
|
621
629
|
'ID',
|
|
@@ -624,7 +632,6 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
624
632
|
)
|
|
625
633
|
client = self.app.client_manager.network
|
|
626
634
|
dhcp_agent = client.get_agent(parsed_args.agent_id)
|
|
627
|
-
data = client.dhcp_agent_hosting_networks(dhcp_agent)
|
|
628
635
|
|
|
629
636
|
return (
|
|
630
637
|
column_headers,
|
|
@@ -634,16 +641,9 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
634
641
|
columns,
|
|
635
642
|
formatters=_formatters,
|
|
636
643
|
)
|
|
637
|
-
for s in
|
|
644
|
+
for s in client.dhcp_agent_hosting_networks(dhcp_agent)
|
|
638
645
|
),
|
|
639
646
|
)
|
|
640
|
-
else:
|
|
641
|
-
columns = ('id', 'name', 'subnet_ids')
|
|
642
|
-
column_headers = (
|
|
643
|
-
'ID',
|
|
644
|
-
'Name',
|
|
645
|
-
'Subnets',
|
|
646
|
-
)
|
|
647
647
|
|
|
648
648
|
args = {}
|
|
649
649
|
|
|
@@ -692,9 +692,14 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
692
692
|
args['provider:segmentation_id'] = parsed_args.segmentation_id
|
|
693
693
|
args['provider_segmentation_id'] = parsed_args.segmentation_id
|
|
694
694
|
|
|
695
|
-
|
|
695
|
+
if parsed_args.marker is not None:
|
|
696
|
+
args['marker'] = parsed_args.marker
|
|
697
|
+
if parsed_args.limit is not None:
|
|
698
|
+
args['limit'] = parsed_args.limit
|
|
699
|
+
if parsed_args.max_items is not None:
|
|
700
|
+
args['max_items'] = parsed_args.max_items
|
|
696
701
|
|
|
697
|
-
|
|
702
|
+
_tag.get_tag_filtering_args(parsed_args, args)
|
|
698
703
|
|
|
699
704
|
return (
|
|
700
705
|
column_headers,
|
|
@@ -704,43 +709,15 @@ class ListNetwork(common.NetworkAndComputeLister):
|
|
|
704
709
|
columns,
|
|
705
710
|
formatters=_formatters,
|
|
706
711
|
)
|
|
707
|
-
for s in
|
|
708
|
-
),
|
|
709
|
-
)
|
|
710
|
-
|
|
711
|
-
def take_action_compute(self, client, parsed_args):
|
|
712
|
-
columns = (
|
|
713
|
-
'id',
|
|
714
|
-
'label',
|
|
715
|
-
'cidr',
|
|
716
|
-
)
|
|
717
|
-
column_headers = (
|
|
718
|
-
'ID',
|
|
719
|
-
'Name',
|
|
720
|
-
'Subnet',
|
|
721
|
-
)
|
|
722
|
-
|
|
723
|
-
data = compute_v2.list_networks(client)
|
|
724
|
-
|
|
725
|
-
return (
|
|
726
|
-
column_headers,
|
|
727
|
-
(
|
|
728
|
-
utils.get_dict_properties(
|
|
729
|
-
s,
|
|
730
|
-
columns,
|
|
731
|
-
formatters=_formatters,
|
|
732
|
-
)
|
|
733
|
-
for s in data
|
|
712
|
+
for s in client.networks(**args)
|
|
734
713
|
),
|
|
735
714
|
)
|
|
736
715
|
|
|
737
716
|
|
|
738
|
-
# TODO(sindhu): Use the SDK resource mapped attribute names once the
|
|
739
|
-
# OSC minimum requirements include SDK 1.0.
|
|
740
717
|
class SetNetwork(common.NeutronCommandWithExtraArgs):
|
|
741
718
|
_description = _("Set network properties")
|
|
742
719
|
|
|
743
|
-
def get_parser(self, prog_name):
|
|
720
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
744
721
|
parser = super().get_parser(prog_name)
|
|
745
722
|
parser.add_argument(
|
|
746
723
|
'network',
|
|
@@ -835,11 +812,28 @@ class SetNetwork(common.NeutronCommandWithExtraArgs):
|
|
|
835
812
|
action='store_true',
|
|
836
813
|
help=_("Remove the QoS policy attached to this network"),
|
|
837
814
|
)
|
|
815
|
+
pvlan_grp = parser.add_mutually_exclusive_group()
|
|
816
|
+
pvlan_grp.add_argument(
|
|
817
|
+
'--pvlan',
|
|
818
|
+
action='store_true',
|
|
819
|
+
help=_(
|
|
820
|
+
"Enable Private VLAN for the network. PVLAN extension "
|
|
821
|
+
"required."
|
|
822
|
+
),
|
|
823
|
+
)
|
|
824
|
+
pvlan_grp.add_argument(
|
|
825
|
+
'--no-pvlan',
|
|
826
|
+
action='store_true',
|
|
827
|
+
help=_(
|
|
828
|
+
"Disable Private VLAN for the network (Default). "
|
|
829
|
+
"PVLAN extension required."
|
|
830
|
+
),
|
|
831
|
+
)
|
|
838
832
|
_tag.add_tag_option_to_parser_for_set(parser, _('network'))
|
|
839
833
|
_add_additional_network_options(parser)
|
|
840
834
|
return parser
|
|
841
835
|
|
|
842
|
-
def take_action(self, parsed_args):
|
|
836
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
843
837
|
client = self.app.client_manager.network
|
|
844
838
|
obj = client.find_network(parsed_args.network, ignore_missing=False)
|
|
845
839
|
|
|
@@ -847,6 +841,14 @@ class SetNetwork(common.NeutronCommandWithExtraArgs):
|
|
|
847
841
|
attrs.update(
|
|
848
842
|
self._parse_extra_properties(parsed_args.extra_properties)
|
|
849
843
|
)
|
|
844
|
+
if (
|
|
845
|
+
attrs.get('port_security_enabled') is False
|
|
846
|
+
and attrs.get('pvlan') is True
|
|
847
|
+
):
|
|
848
|
+
msg = _(
|
|
849
|
+
"--disable-port-security and --pvlan can not be used together."
|
|
850
|
+
)
|
|
851
|
+
raise exceptions.CommandError(msg)
|
|
850
852
|
if attrs:
|
|
851
853
|
with common.check_missing_extension_if_error(
|
|
852
854
|
self.app.client_manager.network, attrs
|
|
@@ -857,10 +859,11 @@ class SetNetwork(common.NeutronCommandWithExtraArgs):
|
|
|
857
859
|
_tag.update_tags_for_set(client, obj, parsed_args)
|
|
858
860
|
|
|
859
861
|
|
|
860
|
-
class ShowNetwork(
|
|
862
|
+
class ShowNetwork(command.ShowOne):
|
|
861
863
|
_description = _("Show network details")
|
|
862
864
|
|
|
863
|
-
def
|
|
865
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
866
|
+
parser = super().get_parser(prog_name)
|
|
864
867
|
parser.add_argument(
|
|
865
868
|
'network',
|
|
866
869
|
metavar="<network>",
|
|
@@ -868,23 +871,20 @@ class ShowNetwork(common.NetworkAndComputeShowOne):
|
|
|
868
871
|
)
|
|
869
872
|
return parser
|
|
870
873
|
|
|
871
|
-
def
|
|
874
|
+
def take_action(
|
|
875
|
+
self, parsed_args: argparse.Namespace
|
|
876
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
877
|
+
client = self.app.client_manager.network
|
|
872
878
|
obj = client.find_network(parsed_args.network, ignore_missing=False)
|
|
873
879
|
display_columns, columns = _get_columns_network(obj)
|
|
874
880
|
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
|
875
881
|
return (display_columns, data)
|
|
876
882
|
|
|
877
|
-
def take_action_compute(self, client, parsed_args):
|
|
878
|
-
obj = compute_v2.find_network(client, parsed_args.network)
|
|
879
|
-
display_columns, columns = _get_columns_compute(obj)
|
|
880
|
-
data = utils.get_dict_properties(obj, columns)
|
|
881
|
-
return (display_columns, data)
|
|
882
|
-
|
|
883
883
|
|
|
884
884
|
class UnsetNetwork(common.NeutronUnsetCommandWithExtraArgs):
|
|
885
885
|
_description = _("Unset network properties")
|
|
886
886
|
|
|
887
|
-
def get_parser(self, prog_name):
|
|
887
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
888
888
|
parser = super().get_parser(prog_name)
|
|
889
889
|
parser.add_argument(
|
|
890
890
|
'network',
|
|
@@ -894,7 +894,7 @@ class UnsetNetwork(common.NeutronUnsetCommandWithExtraArgs):
|
|
|
894
894
|
_tag.add_tag_option_to_parser_for_unset(parser, _('network'))
|
|
895
895
|
return parser
|
|
896
896
|
|
|
897
|
-
def take_action(self, parsed_args):
|
|
897
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
898
898
|
client = self.app.client_manager.network
|
|
899
899
|
obj = client.find_network(parsed_args.network, ignore_missing=False)
|
|
900
900
|
|