python-openstackclient 9.0.0__py3-none-any.whl → 10.0.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 +58 -42
- 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 +14 -6
- openstackclient/common/pagination.py +8 -2
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +13 -7
- openstackclient/common/quota.py +97 -99
- 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 +39 -21
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +14 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +29 -14
- openstackclient/compute/v2/server.py +249 -169
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +21 -12
- openstackclient/compute/v2/server_group.py +21 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +24 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +10 -4
- openstackclient/compute/v2/service.py +14 -7
- openstackclient/compute/v2/usage.py +26 -21
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +78 -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 +26 -12
- openstackclient/identity/v3/application_credential.py +59 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +36 -16
- openstackclient/identity/v3/domain.py +37 -18
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +42 -20
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +38 -16
- openstackclient/identity/v3/group.py +55 -32
- openstackclient/identity/v3/identity_provider.py +92 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +38 -16
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +43 -23
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +40 -16
- openstackclient/identity/v3/role.py +61 -31
- openstackclient/identity/v3/role_assignment.py +23 -6
- openstackclient/identity/v3/service.py +36 -16
- openstackclient/identity/v3/service_provider.py +37 -15
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +32 -14
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +49 -26
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +14 -9
- openstackclient/image/v2/image.py +74 -48
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +109 -13
- openstackclient/image/v2/metadef_objects.py +28 -15
- openstackclient/image/v2/metadef_properties.py +24 -13
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +15 -6
- 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 +36 -22
- openstackclient/network/v2/address_group.py +27 -16
- openstackclient/network/v2/address_scope.py +24 -13
- openstackclient/network/v2/bgpvpn/bgpvpn.py +463 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +214 -0
- openstackclient/network/v2/bgpvpn/port_association.py +490 -0
- openstackclient/network/v2/bgpvpn/router_association.py +288 -0
- openstackclient/network/v2/default_security_group_rule.py +19 -10
- openstackclient/network/v2/floating_ip.py +110 -159
- openstackclient/network/v2/floating_ip_port_forwarding.py +30 -18
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +466 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +574 -0
- openstackclient/network/v2/ip_availability.py +13 -5
- openstackclient/network/v2/l3_conntrack_helper.py +22 -13
- openstackclient/network/v2/local_ip.py +24 -13
- openstackclient/network/v2/local_ip_association.py +14 -7
- openstackclient/network/v2/ndp_proxy.py +20 -11
- openstackclient/network/v2/network.py +129 -196
- openstackclient/network/v2/network_agent.py +46 -25
- openstackclient/network/v2/network_auto_allocated_topology.py +22 -11
- openstackclient/network/v2/network_flavor.py +27 -16
- openstackclient/network/v2/network_flavor_profile.py +23 -12
- openstackclient/network/v2/network_meter.py +21 -10
- openstackclient/network/v2/network_meter_rule.py +21 -11
- openstackclient/network/v2/network_qos_policy.py +25 -15
- openstackclient/network/v2/network_qos_rule.py +32 -17
- openstackclient/network/v2/network_qos_rule_type.py +13 -5
- openstackclient/network/v2/network_rbac.py +23 -12
- openstackclient/network/v2/network_segment.py +20 -11
- openstackclient/network/v2/network_segment_range.py +56 -29
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +38 -22
- openstackclient/network/v2/port.py +54 -29
- openstackclient/network/v2/router.py +75 -52
- openstackclient/network/v2/security_group.py +87 -157
- openstackclient/network/v2/security_group_rule.py +100 -280
- openstackclient/network/v2/subnet.py +49 -28
- openstackclient/network/v2/subnet_pool.py +30 -17
- openstackclient/network/v2/taas/tap_flow.py +22 -11
- openstackclient/network/v2/taas/tap_mirror.py +22 -11
- openstackclient/network/v2/taas/tap_service.py +23 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +25 -15
- openstackclient/object/v1/object.py +25 -15
- 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 +25 -19
- 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_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_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_module.py +12 -7
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +6 -26
- openstackclient/tests/unit/compute/v2/fakes.py +25 -0
- openstackclient/tests/unit/compute/v2/test_flavor.py +28 -2
- openstackclient/tests/unit/compute/v2/test_keypair.py +6 -6
- openstackclient/tests/unit/compute/v2/test_server.py +11 -96
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/identity/v3/fakes.py +3 -0
- openstackclient/tests/unit/identity/v3/test_group.py +4 -14
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_user.py +4 -4
- 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/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +897 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +980 -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 +2 -2
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +3 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +13 -13
- openstackclient/tests/unit/network/v2/test_network_agent.py +8 -4
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_rbac.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +1 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +7 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_router.py +8 -9
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +1 -20
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +7 -41
- openstackclient/tests/unit/network/v2/test_subnet.py +2 -1
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +2 -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 +1 -0
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +2 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +1 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +1 -5
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +55 -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 +57 -29
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +46 -20
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +50 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- 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/service.py +16 -6
- openstackclient/volume/v3/volume.py +89 -39
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +53 -24
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +32 -13
- openstackclient/volume/v3/volume_group_type.py +26 -13
- openstackclient/volume/v3/volume_message.py +15 -7
- openstackclient/volume/v3/volume_snapshot.py +69 -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.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +271 -260
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +4 -0
- python_openstackclient-10.0.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/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.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -12,34 +12,44 @@
|
|
|
12
12
|
|
|
13
13
|
"""IP Floating 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 openstack import exceptions as sdk_exceptions
|
|
16
21
|
from osc_lib.cli import format_columns
|
|
22
|
+
from osc_lib import exceptions
|
|
17
23
|
from osc_lib import utils
|
|
18
24
|
from osc_lib.utils import tags as _tag
|
|
19
25
|
|
|
20
|
-
from openstackclient
|
|
26
|
+
from openstackclient import command
|
|
21
27
|
from openstackclient.i18n import _
|
|
22
28
|
from openstackclient.identity import common as identity_common
|
|
23
29
|
from openstackclient.network import common
|
|
24
30
|
|
|
31
|
+
LOG = logging.getLogger(__name__)
|
|
32
|
+
|
|
25
33
|
_formatters = {
|
|
26
34
|
'port_details': format_columns.DictColumn,
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
|
|
30
|
-
def _get_network_columns(item):
|
|
38
|
+
def _get_network_columns(item: Any) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
31
39
|
hidden_columns = ['location', 'tenant_id']
|
|
32
40
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
33
41
|
item, {}, hidden_columns
|
|
34
42
|
)
|
|
35
43
|
|
|
36
44
|
|
|
37
|
-
def _get_columns(item):
|
|
45
|
+
def _get_columns(item: Any) -> tuple[str, ...]:
|
|
38
46
|
columns = list(item.keys())
|
|
39
47
|
return tuple(sorted(columns))
|
|
40
48
|
|
|
41
49
|
|
|
42
|
-
def _get_attrs(
|
|
50
|
+
def _get_attrs(
|
|
51
|
+
client_manager: Any, parsed_args: argparse.Namespace
|
|
52
|
+
) -> dict[str, Any]:
|
|
43
53
|
attrs = {}
|
|
44
54
|
network_client = client_manager.network
|
|
45
55
|
|
|
@@ -92,104 +102,82 @@ def _get_attrs(client_manager, parsed_args):
|
|
|
92
102
|
return attrs
|
|
93
103
|
|
|
94
104
|
|
|
95
|
-
class CreateFloatingIP(
|
|
96
|
-
common.NetworkAndComputeShowOne, common.NeutronCommandWithExtraArgs
|
|
97
|
-
):
|
|
105
|
+
class CreateFloatingIP(command.ShowOne, common.NeutronCommandWithExtraArgs):
|
|
98
106
|
_description = _("Create floating IP")
|
|
99
107
|
|
|
100
|
-
def
|
|
101
|
-
|
|
102
|
-
# IP pools, which are actually external networks. So deprecate the
|
|
103
|
-
# parameter "pool", and use "network" instead.
|
|
108
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
109
|
+
parser = super().get_parser(prog_name)
|
|
104
110
|
parser.add_argument(
|
|
105
111
|
'network',
|
|
106
112
|
metavar='<network>',
|
|
107
113
|
help=_("Network to allocate floating IP from (name or ID)"),
|
|
108
114
|
)
|
|
109
|
-
return parser
|
|
110
|
-
|
|
111
|
-
def update_parser_network(self, parser):
|
|
112
115
|
parser.add_argument(
|
|
113
116
|
'--subnet',
|
|
114
117
|
metavar='<subnet>',
|
|
115
|
-
help=
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
"(name or ID)"
|
|
119
|
-
)
|
|
118
|
+
help=_(
|
|
119
|
+
"Subnet on which you want to create the floating IP "
|
|
120
|
+
"(name or ID)"
|
|
120
121
|
),
|
|
121
122
|
)
|
|
122
123
|
parser.add_argument(
|
|
123
124
|
'--port',
|
|
124
125
|
metavar='<port>',
|
|
125
|
-
help=
|
|
126
|
-
_("Port to be associated with the floating IP (name or ID)")
|
|
127
|
-
),
|
|
126
|
+
help=_("Port to be associated with the floating IP (name or ID)"),
|
|
128
127
|
)
|
|
129
128
|
parser.add_argument(
|
|
130
129
|
'--floating-ip-address',
|
|
131
130
|
metavar='<ip-address>',
|
|
132
131
|
dest='floating_ip_address',
|
|
133
|
-
help=
|
|
132
|
+
help=_("Floating IP address"),
|
|
134
133
|
)
|
|
135
134
|
parser.add_argument(
|
|
136
135
|
'--fixed-ip-address',
|
|
137
136
|
metavar='<ip-address>',
|
|
138
137
|
dest='fixed_ip_address',
|
|
139
|
-
help=
|
|
140
|
-
_("Fixed IP address mapped to the floating IP")
|
|
141
|
-
),
|
|
138
|
+
help=_("Fixed IP address mapped to the floating IP"),
|
|
142
139
|
)
|
|
143
140
|
parser.add_argument(
|
|
144
141
|
'--qos-policy',
|
|
145
142
|
metavar='<qos-policy>',
|
|
146
|
-
help=
|
|
147
|
-
_("Attach QoS policy to the floating IP (name or ID)")
|
|
148
|
-
),
|
|
143
|
+
help=_("Attach QoS policy to the floating IP (name or ID)"),
|
|
149
144
|
)
|
|
150
145
|
parser.add_argument(
|
|
151
146
|
'--description',
|
|
152
147
|
metavar='<description>',
|
|
153
|
-
help=
|
|
148
|
+
help=_('Set floating IP description'),
|
|
154
149
|
)
|
|
155
150
|
parser.add_argument(
|
|
156
151
|
'--project',
|
|
157
152
|
metavar='<project>',
|
|
158
|
-
help=
|
|
153
|
+
help=_("Owner's project (name or ID)"),
|
|
159
154
|
)
|
|
160
155
|
parser.add_argument(
|
|
161
156
|
'--dns-domain',
|
|
162
157
|
metavar='<dns-domain>',
|
|
163
158
|
dest='dns_domain',
|
|
164
|
-
help=
|
|
165
|
-
_("Set DNS domain for this floating IP")
|
|
166
|
-
),
|
|
159
|
+
help=_("Set DNS domain for this floating IP"),
|
|
167
160
|
)
|
|
168
161
|
parser.add_argument(
|
|
169
162
|
'--dns-name',
|
|
170
163
|
metavar='<dns-name>',
|
|
171
164
|
dest='dns_name',
|
|
172
|
-
help=
|
|
173
|
-
_("Set DNS name for this floating IP")
|
|
174
|
-
),
|
|
165
|
+
help=_("Set DNS name for this floating IP"),
|
|
175
166
|
)
|
|
176
167
|
|
|
177
|
-
identity_common.add_project_domain_option_to_parser(
|
|
178
|
-
|
|
179
|
-
)
|
|
180
|
-
_tag.add_tag_option_to_parser_for_create(
|
|
181
|
-
parser, _('floating IP'), enhance_help=self.enhance_help_neutron
|
|
182
|
-
)
|
|
168
|
+
identity_common.add_project_domain_option_to_parser(parser)
|
|
169
|
+
_tag.add_tag_option_to_parser_for_create(parser, _('floating IP'))
|
|
183
170
|
return parser
|
|
184
171
|
|
|
185
|
-
def
|
|
172
|
+
def take_action(
|
|
173
|
+
self, parsed_args: argparse.Namespace
|
|
174
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
175
|
+
client = self.app.client_manager.network
|
|
186
176
|
attrs = _get_attrs(self.app.client_manager, parsed_args)
|
|
187
177
|
attrs.update(
|
|
188
178
|
self._parse_extra_properties(parsed_args.extra_properties)
|
|
189
179
|
)
|
|
190
|
-
with common.check_missing_extension_if_error(
|
|
191
|
-
self.app.client_manager.network, attrs
|
|
192
|
-
):
|
|
180
|
+
with common.check_missing_extension_if_error(client, attrs):
|
|
193
181
|
obj = client.create_ip(**attrs)
|
|
194
182
|
|
|
195
183
|
# tags cannot be set when created, so tags need to be set later.
|
|
@@ -199,21 +187,12 @@ class CreateFloatingIP(
|
|
|
199
187
|
data = utils.get_item_properties(obj, columns)
|
|
200
188
|
return (display_columns, data)
|
|
201
189
|
|
|
202
|
-
def take_action_compute(self, client, parsed_args):
|
|
203
|
-
obj = compute_v2.create_floating_ip(client, parsed_args.network)
|
|
204
|
-
columns = _get_columns(obj)
|
|
205
|
-
data = utils.get_dict_properties(obj, columns)
|
|
206
|
-
return (columns, data)
|
|
207
|
-
|
|
208
190
|
|
|
209
|
-
class DeleteFloatingIP(
|
|
191
|
+
class DeleteFloatingIP(command.Command):
|
|
210
192
|
_description = _("Delete floating IP(s)")
|
|
211
193
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
r = None
|
|
215
|
-
|
|
216
|
-
def update_parser_common(self, parser):
|
|
194
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
195
|
+
parser = super().get_parser(prog_name)
|
|
217
196
|
parser.add_argument(
|
|
218
197
|
'floating_ip',
|
|
219
198
|
metavar="<floating-ip>",
|
|
@@ -222,35 +201,52 @@ class DeleteFloatingIP(common.NetworkAndComputeDelete):
|
|
|
222
201
|
)
|
|
223
202
|
return parser
|
|
224
203
|
|
|
225
|
-
def
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
204
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
205
|
+
client = self.app.client_manager.network
|
|
206
|
+
result = 0
|
|
207
|
+
|
|
208
|
+
for fip in parsed_args.floating_ip:
|
|
209
|
+
try:
|
|
210
|
+
obj = client.find_ip(fip, ignore_missing=False)
|
|
211
|
+
client.delete_ip(obj)
|
|
212
|
+
except Exception as e:
|
|
213
|
+
result += 1
|
|
214
|
+
LOG.error(
|
|
215
|
+
_(
|
|
216
|
+
"Failed to delete floating IP with "
|
|
217
|
+
"name or ID '%(fip)s': %(e)s"
|
|
218
|
+
),
|
|
219
|
+
{'fip': fip, 'e': e},
|
|
220
|
+
)
|
|
231
221
|
|
|
232
|
-
|
|
233
|
-
|
|
222
|
+
if result > 0:
|
|
223
|
+
total = len(parsed_args.floating_ip)
|
|
224
|
+
msg = _(
|
|
225
|
+
"%(result)s of %(total)s floating IPs failed to delete."
|
|
226
|
+
) % {
|
|
227
|
+
'result': result,
|
|
228
|
+
'total': total,
|
|
229
|
+
}
|
|
230
|
+
raise exceptions.CommandError(msg)
|
|
234
231
|
|
|
235
232
|
|
|
236
|
-
class ListFloatingIP(
|
|
233
|
+
class ListFloatingIP(command.Lister):
|
|
237
234
|
# TODO(songminglong): Use SDK resource mapped attribute names once
|
|
238
235
|
# the OSC minimum requirements include SDK 1.0
|
|
239
236
|
|
|
240
237
|
_description = _("List floating IP(s)")
|
|
241
238
|
|
|
242
|
-
def
|
|
239
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
240
|
+
parser = super().get_parser(prog_name)
|
|
243
241
|
parser.add_argument(
|
|
244
242
|
'--network',
|
|
245
243
|
metavar='<network>',
|
|
246
244
|
dest='networks',
|
|
247
245
|
action='append',
|
|
248
|
-
help=
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
"(repeat option to fiter on multiple networks)"
|
|
253
|
-
)
|
|
246
|
+
help=_(
|
|
247
|
+
"List only floating IP(s) with the specified network "
|
|
248
|
+
"(name or ID) "
|
|
249
|
+
"(repeat option to fiter on multiple networks)"
|
|
254
250
|
),
|
|
255
251
|
)
|
|
256
252
|
parser.add_argument(
|
|
@@ -258,53 +254,42 @@ class ListFloatingIP(common.NetworkAndComputeLister):
|
|
|
258
254
|
metavar='<port>',
|
|
259
255
|
dest='ports',
|
|
260
256
|
action='append',
|
|
261
|
-
help=
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
"(repeat option to fiter on multiple ports)"
|
|
266
|
-
)
|
|
257
|
+
help=_(
|
|
258
|
+
"List only floating IP(s) with the specified port "
|
|
259
|
+
"(name or ID) "
|
|
260
|
+
"(repeat option to fiter on multiple ports)"
|
|
267
261
|
),
|
|
268
262
|
)
|
|
269
263
|
parser.add_argument(
|
|
270
264
|
'--fixed-ip-address',
|
|
271
265
|
metavar='<ip-address>',
|
|
272
|
-
help=
|
|
273
|
-
|
|
274
|
-
"List only floating IP(s) with the specified fixed IP "
|
|
275
|
-
"address"
|
|
276
|
-
)
|
|
266
|
+
help=_(
|
|
267
|
+
"List only floating IP(s) with the specified fixed IP address"
|
|
277
268
|
),
|
|
278
269
|
)
|
|
279
270
|
parser.add_argument(
|
|
280
271
|
'--floating-ip-address',
|
|
281
272
|
metavar='<ip-address>',
|
|
282
|
-
help=
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
"address"
|
|
286
|
-
)
|
|
273
|
+
help=_(
|
|
274
|
+
"List only floating IP(s) with the specified floating IP "
|
|
275
|
+
"address"
|
|
287
276
|
),
|
|
288
277
|
)
|
|
289
278
|
parser.add_argument(
|
|
290
279
|
'--status',
|
|
291
280
|
metavar='<status>',
|
|
292
281
|
choices=['ACTIVE', 'DOWN'],
|
|
293
|
-
help=
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"('ACTIVE', 'DOWN')"
|
|
297
|
-
)
|
|
282
|
+
help=_(
|
|
283
|
+
"List only floating IP(s) with the specified status "
|
|
284
|
+
"('ACTIVE', 'DOWN')"
|
|
298
285
|
),
|
|
299
286
|
)
|
|
300
287
|
parser.add_argument(
|
|
301
288
|
'--project',
|
|
302
289
|
metavar='<project>',
|
|
303
|
-
help=
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
"(name or ID)"
|
|
307
|
-
)
|
|
290
|
+
help=_(
|
|
291
|
+
"List only floating IP(s) with the specified project "
|
|
292
|
+
"(name or ID)"
|
|
308
293
|
),
|
|
309
294
|
)
|
|
310
295
|
identity_common.add_project_domain_option_to_parser(parser)
|
|
@@ -313,29 +298,24 @@ class ListFloatingIP(common.NetworkAndComputeLister):
|
|
|
313
298
|
metavar='<router>',
|
|
314
299
|
dest='routers',
|
|
315
300
|
action='append',
|
|
316
|
-
help=
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
"(repeat option to fiter on multiple routers)"
|
|
321
|
-
)
|
|
301
|
+
help=_(
|
|
302
|
+
"List only floating IP(s) with the specified router "
|
|
303
|
+
"(name or ID) "
|
|
304
|
+
"(repeat option to fiter on multiple routers)"
|
|
322
305
|
),
|
|
323
306
|
)
|
|
324
|
-
_tag.add_tag_filtering_option_to_parser(
|
|
325
|
-
parser, _('floating IP'), enhance_help=self.enhance_help_neutron
|
|
326
|
-
)
|
|
307
|
+
_tag.add_tag_filtering_option_to_parser(parser, _('floating IP'))
|
|
327
308
|
parser.add_argument(
|
|
328
309
|
'--long',
|
|
329
310
|
action='store_true',
|
|
330
311
|
default=False,
|
|
331
|
-
help=
|
|
332
|
-
_("List additional fields in output")
|
|
333
|
-
),
|
|
312
|
+
help=_("List additional fields in output"),
|
|
334
313
|
)
|
|
335
|
-
|
|
336
314
|
return parser
|
|
337
315
|
|
|
338
|
-
def
|
|
316
|
+
def take_action(
|
|
317
|
+
self, parsed_args: argparse.Namespace
|
|
318
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
339
319
|
network_client = self.app.client_manager.network
|
|
340
320
|
identity_client = self.app.client_manager.identity
|
|
341
321
|
|
|
@@ -422,7 +402,7 @@ class ListFloatingIP(common.NetworkAndComputeLister):
|
|
|
422
402
|
_tag.get_tag_filtering_args(parsed_args, query)
|
|
423
403
|
|
|
424
404
|
try:
|
|
425
|
-
data = list(
|
|
405
|
+
data = list(network_client.ips(**query))
|
|
426
406
|
except sdk_exceptions.NotFoundException:
|
|
427
407
|
data = []
|
|
428
408
|
|
|
@@ -438,40 +418,11 @@ class ListFloatingIP(common.NetworkAndComputeLister):
|
|
|
438
418
|
),
|
|
439
419
|
)
|
|
440
420
|
|
|
441
|
-
def take_action_compute(self, client, parsed_args):
|
|
442
|
-
columns: tuple[str, ...] = (
|
|
443
|
-
'ID',
|
|
444
|
-
'IP',
|
|
445
|
-
'Fixed IP',
|
|
446
|
-
'Instance ID',
|
|
447
|
-
'Pool',
|
|
448
|
-
)
|
|
449
|
-
headers: tuple[str, ...] = (
|
|
450
|
-
'ID',
|
|
451
|
-
'Floating IP Address',
|
|
452
|
-
'Fixed IP Address',
|
|
453
|
-
'Server',
|
|
454
|
-
'Pool',
|
|
455
|
-
)
|
|
456
|
-
|
|
457
|
-
objs = compute_v2.list_floating_ips(client)
|
|
458
|
-
return (
|
|
459
|
-
headers,
|
|
460
|
-
(
|
|
461
|
-
utils.get_dict_properties(
|
|
462
|
-
s,
|
|
463
|
-
columns,
|
|
464
|
-
formatters={},
|
|
465
|
-
)
|
|
466
|
-
for s in objs
|
|
467
|
-
),
|
|
468
|
-
)
|
|
469
|
-
|
|
470
421
|
|
|
471
422
|
class SetFloatingIP(common.NeutronCommandWithExtraArgs):
|
|
472
423
|
_description = _("Set floating IP Properties")
|
|
473
424
|
|
|
474
|
-
def get_parser(self, prog_name):
|
|
425
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
475
426
|
parser = super().get_parser(prog_name)
|
|
476
427
|
parser.add_argument(
|
|
477
428
|
'floating_ip',
|
|
@@ -512,13 +463,15 @@ class SetFloatingIP(common.NeutronCommandWithExtraArgs):
|
|
|
512
463
|
|
|
513
464
|
return parser
|
|
514
465
|
|
|
515
|
-
def take_action(self, parsed_args):
|
|
466
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
516
467
|
client = self.app.client_manager.network
|
|
517
|
-
attrs = {}
|
|
518
468
|
obj = client.find_ip(
|
|
519
469
|
parsed_args.floating_ip,
|
|
520
470
|
ignore_missing=False,
|
|
521
471
|
)
|
|
472
|
+
|
|
473
|
+
attrs: dict[str, Any] = {}
|
|
474
|
+
|
|
522
475
|
if parsed_args.port:
|
|
523
476
|
port = client.find_port(parsed_args.port, ignore_missing=False)
|
|
524
477
|
attrs['port_id'] = port.id
|
|
@@ -548,10 +501,11 @@ class SetFloatingIP(common.NeutronCommandWithExtraArgs):
|
|
|
548
501
|
_tag.update_tags_for_set(client, obj, parsed_args)
|
|
549
502
|
|
|
550
503
|
|
|
551
|
-
class ShowFloatingIP(
|
|
504
|
+
class ShowFloatingIP(command.ShowOne):
|
|
552
505
|
_description = _("Display floating IP details")
|
|
553
506
|
|
|
554
|
-
def
|
|
507
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
508
|
+
parser = super().get_parser(prog_name)
|
|
555
509
|
parser.add_argument(
|
|
556
510
|
'floating_ip',
|
|
557
511
|
metavar="<floating-ip>",
|
|
@@ -559,7 +513,10 @@ class ShowFloatingIP(common.NetworkAndComputeShowOne):
|
|
|
559
513
|
)
|
|
560
514
|
return parser
|
|
561
515
|
|
|
562
|
-
def
|
|
516
|
+
def take_action(
|
|
517
|
+
self, parsed_args: argparse.Namespace
|
|
518
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
519
|
+
client = self.app.client_manager.network
|
|
563
520
|
obj = client.find_ip(
|
|
564
521
|
parsed_args.floating_ip,
|
|
565
522
|
ignore_missing=False,
|
|
@@ -568,17 +525,11 @@ class ShowFloatingIP(common.NetworkAndComputeShowOne):
|
|
|
568
525
|
data = utils.get_item_properties(obj, columns, formatters=_formatters)
|
|
569
526
|
return (display_columns, data)
|
|
570
527
|
|
|
571
|
-
def take_action_compute(self, client, parsed_args):
|
|
572
|
-
obj = compute_v2.get_floating_ip(client, parsed_args.floating_ip)
|
|
573
|
-
columns = _get_columns(obj)
|
|
574
|
-
data = utils.get_dict_properties(obj, columns)
|
|
575
|
-
return (columns, data)
|
|
576
|
-
|
|
577
528
|
|
|
578
529
|
class UnsetFloatingIP(common.NeutronCommandWithExtraArgs):
|
|
579
530
|
_description = _("Unset floating IP Properties")
|
|
580
531
|
|
|
581
|
-
def get_parser(self, prog_name):
|
|
532
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
582
533
|
parser = super().get_parser(prog_name)
|
|
583
534
|
parser.add_argument(
|
|
584
535
|
'floating_ip',
|
|
@@ -601,7 +552,7 @@ class UnsetFloatingIP(common.NeutronCommandWithExtraArgs):
|
|
|
601
552
|
|
|
602
553
|
return parser
|
|
603
554
|
|
|
604
|
-
def take_action(self, parsed_args):
|
|
555
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
605
556
|
client = self.app.client_manager.network
|
|
606
557
|
obj = client.find_ip(
|
|
607
558
|
parsed_args.floating_ip,
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
|
|
14
14
|
"""Floating IP Port Forwarding action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
16
17
|
import logging
|
|
17
|
-
import
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
18
20
|
|
|
19
21
|
from osc_lib import exceptions
|
|
20
22
|
from osc_lib import utils
|
|
@@ -26,7 +28,7 @@ from openstackclient.network import common
|
|
|
26
28
|
LOG = logging.getLogger(__name__)
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
def validate_ports_diff(ports):
|
|
31
|
+
def validate_ports_diff(ports: list[int]) -> int:
|
|
30
32
|
if len(ports) == 0:
|
|
31
33
|
return 0
|
|
32
34
|
|
|
@@ -40,7 +42,9 @@ def validate_ports_diff(ports):
|
|
|
40
42
|
return ports_diff
|
|
41
43
|
|
|
42
44
|
|
|
43
|
-
def validate_ports_match(
|
|
45
|
+
def validate_ports_match(
|
|
46
|
+
internal_ports: list[int], external_ports: list[int]
|
|
47
|
+
) -> None:
|
|
44
48
|
internal_ports_diff = validate_ports_diff(internal_ports)
|
|
45
49
|
external_ports_diff = validate_ports_diff(external_ports)
|
|
46
50
|
|
|
@@ -52,7 +56,9 @@ def validate_ports_match(internal_ports, external_ports):
|
|
|
52
56
|
raise exceptions.CommandError(msg)
|
|
53
57
|
|
|
54
58
|
|
|
55
|
-
def validate_and_assign_port_ranges(
|
|
59
|
+
def validate_and_assign_port_ranges(
|
|
60
|
+
parsed_args: argparse.Namespace, attrs: dict[str, Any]
|
|
61
|
+
) -> None:
|
|
56
62
|
internal_port_range = parsed_args.internal_protocol_port
|
|
57
63
|
external_port_range = parsed_args.external_protocol_port
|
|
58
64
|
external_ports = internal_ports = []
|
|
@@ -79,13 +85,13 @@ def validate_and_assign_port_ranges(parsed_args, attrs):
|
|
|
79
85
|
attrs['external_port'] = int(external_port_range)
|
|
80
86
|
|
|
81
87
|
|
|
82
|
-
def validate_port(port):
|
|
88
|
+
def validate_port(port: int) -> None:
|
|
83
89
|
if port <= 0 or port > 65535:
|
|
84
90
|
msg = _("The port number range is <1-65535>")
|
|
85
91
|
raise exceptions.CommandError(msg)
|
|
86
92
|
|
|
87
93
|
|
|
88
|
-
def _get_columns(item):
|
|
94
|
+
def _get_columns(item: Any) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
89
95
|
hidden_columns = ['location', 'tenant_id']
|
|
90
96
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
91
97
|
item, {}, hidden_columns
|
|
@@ -97,7 +103,7 @@ class CreateFloatingIPPortForwarding(
|
|
|
97
103
|
):
|
|
98
104
|
_description = _("Create floating IP port forwarding")
|
|
99
105
|
|
|
100
|
-
def get_parser(self, prog_name):
|
|
106
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
101
107
|
parser = super().get_parser(prog_name)
|
|
102
108
|
parser.add_argument(
|
|
103
109
|
'--internal-ip-address',
|
|
@@ -164,8 +170,10 @@ class CreateFloatingIPPortForwarding(
|
|
|
164
170
|
|
|
165
171
|
return parser
|
|
166
172
|
|
|
167
|
-
def take_action(
|
|
168
|
-
|
|
173
|
+
def take_action(
|
|
174
|
+
self, parsed_args: argparse.Namespace
|
|
175
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
176
|
+
attrs: dict[str, Any] = {}
|
|
169
177
|
client = self.app.client_manager.network
|
|
170
178
|
floating_ip = client.find_ip(
|
|
171
179
|
parsed_args.floating_ip,
|
|
@@ -198,7 +206,7 @@ class CreateFloatingIPPortForwarding(
|
|
|
198
206
|
class DeleteFloatingIPPortForwarding(command.Command):
|
|
199
207
|
_description = _("Delete floating IP port forwarding")
|
|
200
208
|
|
|
201
|
-
def get_parser(self, prog_name):
|
|
209
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
202
210
|
parser = super().get_parser(prog_name)
|
|
203
211
|
parser.add_argument(
|
|
204
212
|
'floating_ip',
|
|
@@ -216,7 +224,7 @@ class DeleteFloatingIPPortForwarding(command.Command):
|
|
|
216
224
|
)
|
|
217
225
|
return parser
|
|
218
226
|
|
|
219
|
-
def take_action(self, parsed_args):
|
|
227
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
220
228
|
client = self.app.client_manager.network
|
|
221
229
|
floating_ip = client.find_ip(
|
|
222
230
|
parsed_args.floating_ip,
|
|
@@ -251,7 +259,7 @@ class DeleteFloatingIPPortForwarding(command.Command):
|
|
|
251
259
|
class ListFloatingIPPortForwarding(command.Lister):
|
|
252
260
|
_description = _("List floating IP port forwarding")
|
|
253
261
|
|
|
254
|
-
def get_parser(self, prog_name):
|
|
262
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
255
263
|
parser = super().get_parser(prog_name)
|
|
256
264
|
parser.add_argument(
|
|
257
265
|
'floating_ip',
|
|
@@ -289,7 +297,9 @@ class ListFloatingIPPortForwarding(command.Lister):
|
|
|
289
297
|
|
|
290
298
|
return parser
|
|
291
299
|
|
|
292
|
-
def take_action(
|
|
300
|
+
def take_action(
|
|
301
|
+
self, parsed_args: argparse.Namespace
|
|
302
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
293
303
|
client = self.app.client_manager.network
|
|
294
304
|
|
|
295
305
|
columns = (
|
|
@@ -315,7 +325,7 @@ class ListFloatingIPPortForwarding(command.Lister):
|
|
|
315
325
|
'Description',
|
|
316
326
|
)
|
|
317
327
|
|
|
318
|
-
query = {}
|
|
328
|
+
query: dict[str, Any] = {}
|
|
319
329
|
|
|
320
330
|
if parsed_args.port:
|
|
321
331
|
port = client.find_port(parsed_args.port, ignore_missing=False)
|
|
@@ -354,7 +364,7 @@ class ListFloatingIPPortForwarding(command.Lister):
|
|
|
354
364
|
class SetFloatingIPPortForwarding(common.NeutronCommandWithExtraArgs):
|
|
355
365
|
_description = _("Set floating IP Port Forwarding Properties")
|
|
356
366
|
|
|
357
|
-
def get_parser(self, prog_name):
|
|
367
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
358
368
|
parser = super().get_parser(prog_name)
|
|
359
369
|
parser.add_argument(
|
|
360
370
|
'floating_ip',
|
|
@@ -419,7 +429,7 @@ class SetFloatingIPPortForwarding(common.NeutronCommandWithExtraArgs):
|
|
|
419
429
|
|
|
420
430
|
return parser
|
|
421
431
|
|
|
422
|
-
def take_action(self, parsed_args):
|
|
432
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
423
433
|
client = self.app.client_manager.network
|
|
424
434
|
floating_ip = client.find_ip(
|
|
425
435
|
parsed_args.floating_ip,
|
|
@@ -454,7 +464,7 @@ class SetFloatingIPPortForwarding(common.NeutronCommandWithExtraArgs):
|
|
|
454
464
|
class ShowFloatingIPPortForwarding(command.ShowOne):
|
|
455
465
|
_description = _("Display floating IP Port Forwarding details")
|
|
456
466
|
|
|
457
|
-
def get_parser(self, prog_name):
|
|
467
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
458
468
|
parser = super().get_parser(prog_name)
|
|
459
469
|
parser.add_argument(
|
|
460
470
|
'floating_ip',
|
|
@@ -471,7 +481,9 @@ class ShowFloatingIPPortForwarding(command.ShowOne):
|
|
|
471
481
|
)
|
|
472
482
|
return parser
|
|
473
483
|
|
|
474
|
-
def take_action(
|
|
484
|
+
def take_action(
|
|
485
|
+
self, parsed_args: argparse.Namespace
|
|
486
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
475
487
|
client = self.app.client_manager.network
|
|
476
488
|
floating_ip = client.find_ip(
|
|
477
489
|
parsed_args.floating_ip,
|
|
File without changes
|