python-openstackclient 8.3.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 +126 -114
- 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 +251 -171
- 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 +103 -41
- 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 +26 -12
- 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 +71 -50
- 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 +115 -92
- openstackclient/identity/v3/mapping.py +26 -13
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +211 -122
- openstackclient/identity/v3/region.py +36 -16
- openstackclient/identity/v3/registered_limit.py +116 -109
- 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 -17
- 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 +76 -49
- 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_limit.py +47 -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/image/v2/test_metadef_objects.py +69 -0
- 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 +56 -138
- 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 +62 -23
- 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 +17 -104
- 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_limit.py +197 -145
- openstackclient/tests/unit/identity/v3/test_project.py +831 -512
- openstackclient/tests/unit/identity/v3/test_protocol.py +97 -88
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +355 -220
- openstackclient/tests/unit/identity/v3/test_user.py +4 -4
- openstackclient/tests/unit/image/v2/test_image.py +16 -16
- 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_consistency_group.py +8 -2
- openstackclient/tests/unit/volume/v2/test_volume.py +7 -6
- 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 +94 -15
- 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 +37 -25
- openstackclient/volume/v2/consistency_group_snapshot.py +27 -12
- openstackclient/volume/v2/qos_specs.py +30 -19
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +69 -34
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -22
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +52 -26
- openstackclient/volume/v2/volume_transfer_request.py +33 -15
- openstackclient/volume/v2/volume_type.py +46 -27
- 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 +103 -46
- openstackclient/volume/v3/volume_attachment.py +43 -21
- openstackclient/volume/v3/volume_backup.py +55 -26
- 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 +71 -34
- openstackclient/volume/v3/volume_transfer_request.py +33 -15
- openstackclient/volume/v3/volume_type.py +45 -27
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +279 -267
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +9 -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-8.3.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
|
@@ -16,7 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
"""Identity v2 EC2 Credentials action implementations"""
|
|
18
18
|
|
|
19
|
+
import argparse
|
|
20
|
+
from collections.abc import Iterable, Sequence
|
|
19
21
|
import logging
|
|
22
|
+
from typing import Any
|
|
20
23
|
|
|
21
24
|
from osc_lib import exceptions
|
|
22
25
|
from osc_lib import utils
|
|
@@ -31,7 +34,7 @@ LOG = logging.getLogger(__name__)
|
|
|
31
34
|
class CreateEC2Creds(command.ShowOne):
|
|
32
35
|
_description = _("Create EC2 credentials")
|
|
33
36
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
38
|
parser = super().get_parser(prog_name)
|
|
36
39
|
parser.add_argument(
|
|
37
40
|
'--project',
|
|
@@ -51,7 +54,9 @@ class CreateEC2Creds(command.ShowOne):
|
|
|
51
54
|
)
|
|
52
55
|
return parser
|
|
53
56
|
|
|
54
|
-
def take_action(
|
|
57
|
+
def take_action(
|
|
58
|
+
self, parsed_args: argparse.Namespace
|
|
59
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
55
60
|
identity_client = self.app.client_manager.identity
|
|
56
61
|
|
|
57
62
|
if parsed_args.project:
|
|
@@ -79,13 +84,14 @@ class CreateEC2Creds(command.ShowOne):
|
|
|
79
84
|
if 'tenant_id' in info:
|
|
80
85
|
info.update({'project_id': info.pop('tenant_id')})
|
|
81
86
|
|
|
82
|
-
|
|
87
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
88
|
+
return col_headers, col_data
|
|
83
89
|
|
|
84
90
|
|
|
85
91
|
class DeleteEC2Creds(command.Command):
|
|
86
92
|
_description = _("Delete EC2 credentials")
|
|
87
93
|
|
|
88
|
-
def get_parser(self, prog_name):
|
|
94
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
89
95
|
parser = super().get_parser(prog_name)
|
|
90
96
|
parser.add_argument(
|
|
91
97
|
'access_keys',
|
|
@@ -100,7 +106,7 @@ class DeleteEC2Creds(command.Command):
|
|
|
100
106
|
)
|
|
101
107
|
return parser
|
|
102
108
|
|
|
103
|
-
def take_action(self, parsed_args):
|
|
109
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
104
110
|
identity_client = self.app.client_manager.identity
|
|
105
111
|
|
|
106
112
|
if parsed_args.user:
|
|
@@ -138,7 +144,7 @@ class DeleteEC2Creds(command.Command):
|
|
|
138
144
|
class ListEC2Creds(command.Lister):
|
|
139
145
|
_description = _("List EC2 credentials")
|
|
140
146
|
|
|
141
|
-
def get_parser(self, prog_name):
|
|
147
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
142
148
|
parser = super().get_parser(prog_name)
|
|
143
149
|
parser.add_argument(
|
|
144
150
|
'--user',
|
|
@@ -147,7 +153,9 @@ class ListEC2Creds(command.Lister):
|
|
|
147
153
|
)
|
|
148
154
|
return parser
|
|
149
155
|
|
|
150
|
-
def take_action(
|
|
156
|
+
def take_action(
|
|
157
|
+
self, parsed_args: argparse.Namespace
|
|
158
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
151
159
|
identity_client = self.app.client_manager.identity
|
|
152
160
|
|
|
153
161
|
if parsed_args.user:
|
|
@@ -179,7 +187,7 @@ class ListEC2Creds(command.Lister):
|
|
|
179
187
|
class ShowEC2Creds(command.ShowOne):
|
|
180
188
|
_description = _("Display EC2 credentials details")
|
|
181
189
|
|
|
182
|
-
def get_parser(self, prog_name):
|
|
190
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
183
191
|
parser = super().get_parser(prog_name)
|
|
184
192
|
parser.add_argument(
|
|
185
193
|
'access_key',
|
|
@@ -193,7 +201,9 @@ class ShowEC2Creds(command.ShowOne):
|
|
|
193
201
|
)
|
|
194
202
|
return parser
|
|
195
203
|
|
|
196
|
-
def take_action(
|
|
204
|
+
def take_action(
|
|
205
|
+
self, parsed_args: argparse.Namespace
|
|
206
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
197
207
|
identity_client = self.app.client_manager.identity
|
|
198
208
|
|
|
199
209
|
if parsed_args.user:
|
|
@@ -213,4 +223,5 @@ class ShowEC2Creds(command.ShowOne):
|
|
|
213
223
|
if 'tenant_id' in info:
|
|
214
224
|
info.update({'project_id': info.pop('tenant_id')})
|
|
215
225
|
|
|
216
|
-
|
|
226
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
227
|
+
return col_headers, col_data
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Endpoint action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from osc_lib import exceptions
|
|
21
24
|
from osc_lib import utils
|
|
@@ -31,7 +34,7 @@ LOG = logging.getLogger(__name__)
|
|
|
31
34
|
class CreateEndpoint(command.ShowOne):
|
|
32
35
|
_description = _("Create new endpoint")
|
|
33
36
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
38
|
parser = super().get_parser(prog_name)
|
|
36
39
|
parser.add_argument(
|
|
37
40
|
'service',
|
|
@@ -61,7 +64,9 @@ class CreateEndpoint(command.ShowOne):
|
|
|
61
64
|
)
|
|
62
65
|
return parser
|
|
63
66
|
|
|
64
|
-
def take_action(
|
|
67
|
+
def take_action(
|
|
68
|
+
self, parsed_args: argparse.Namespace
|
|
69
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
65
70
|
identity_client = self.app.client_manager.identity
|
|
66
71
|
service = common.find_service(identity_client, parsed_args.service)
|
|
67
72
|
endpoint = identity_client.endpoints.create(
|
|
@@ -76,13 +81,14 @@ class CreateEndpoint(command.ShowOne):
|
|
|
76
81
|
info.update(endpoint._info)
|
|
77
82
|
info['service_name'] = service.name
|
|
78
83
|
info['service_type'] = service.type
|
|
79
|
-
|
|
84
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
85
|
+
return col_headers, col_data
|
|
80
86
|
|
|
81
87
|
|
|
82
88
|
class DeleteEndpoint(command.Command):
|
|
83
89
|
_description = _("Delete endpoint(s)")
|
|
84
90
|
|
|
85
|
-
def get_parser(self, prog_name):
|
|
91
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
86
92
|
parser = super().get_parser(prog_name)
|
|
87
93
|
parser.add_argument(
|
|
88
94
|
'endpoints',
|
|
@@ -92,7 +98,7 @@ class DeleteEndpoint(command.Command):
|
|
|
92
98
|
)
|
|
93
99
|
return parser
|
|
94
100
|
|
|
95
|
-
def take_action(self, parsed_args):
|
|
101
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
96
102
|
identity_client = self.app.client_manager.identity
|
|
97
103
|
|
|
98
104
|
result = 0
|
|
@@ -121,7 +127,7 @@ class DeleteEndpoint(command.Command):
|
|
|
121
127
|
class ListEndpoint(command.Lister):
|
|
122
128
|
_description = _("List endpoints")
|
|
123
129
|
|
|
124
|
-
def get_parser(self, prog_name):
|
|
130
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
125
131
|
parser = super().get_parser(prog_name)
|
|
126
132
|
parser.add_argument(
|
|
127
133
|
'--long',
|
|
@@ -131,7 +137,9 @@ class ListEndpoint(command.Lister):
|
|
|
131
137
|
)
|
|
132
138
|
return parser
|
|
133
139
|
|
|
134
|
-
def take_action(
|
|
140
|
+
def take_action(
|
|
141
|
+
self, parsed_args: argparse.Namespace
|
|
142
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
135
143
|
identity_client = self.app.client_manager.identity
|
|
136
144
|
|
|
137
145
|
columns: tuple[str, ...] = (
|
|
@@ -168,7 +176,7 @@ class ListEndpoint(command.Lister):
|
|
|
168
176
|
class ShowEndpoint(command.ShowOne):
|
|
169
177
|
_description = _("Display endpoint details")
|
|
170
178
|
|
|
171
|
-
def get_parser(self, prog_name):
|
|
179
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
172
180
|
parser = super().get_parser(prog_name)
|
|
173
181
|
parser.add_argument(
|
|
174
182
|
'endpoint_or_service',
|
|
@@ -180,7 +188,9 @@ class ShowEndpoint(command.ShowOne):
|
|
|
180
188
|
)
|
|
181
189
|
return parser
|
|
182
190
|
|
|
183
|
-
def take_action(
|
|
191
|
+
def take_action(
|
|
192
|
+
self, parsed_args: argparse.Namespace
|
|
193
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
184
194
|
identity_client = self.app.client_manager.identity
|
|
185
195
|
data = identity_client.endpoints.list()
|
|
186
196
|
match = None
|
|
@@ -196,9 +206,11 @@ class ShowEndpoint(command.ShowOne):
|
|
|
196
206
|
if ep.service_id == service.id:
|
|
197
207
|
match = ep
|
|
198
208
|
if match is None:
|
|
199
|
-
return
|
|
209
|
+
return ((), ())
|
|
210
|
+
|
|
200
211
|
info = {}
|
|
201
212
|
info.update(match._info)
|
|
202
213
|
info['service_name'] = service.name
|
|
203
214
|
info['service_type'] = service.type
|
|
204
|
-
|
|
215
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
216
|
+
return col_headers, col_data
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v2 Project action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from keystoneauth1 import exceptions as ks_exc
|
|
21
24
|
from osc_lib.cli import format_columns
|
|
@@ -33,7 +36,7 @@ LOG = logging.getLogger(__name__)
|
|
|
33
36
|
class CreateProject(command.ShowOne):
|
|
34
37
|
_description = _("Create new project")
|
|
35
38
|
|
|
36
|
-
def get_parser(self, prog_name):
|
|
39
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
37
40
|
parser = super().get_parser(prog_name)
|
|
38
41
|
parser.add_argument(
|
|
39
42
|
'name',
|
|
@@ -73,7 +76,9 @@ class CreateProject(command.ShowOne):
|
|
|
73
76
|
)
|
|
74
77
|
return parser
|
|
75
78
|
|
|
76
|
-
def take_action(
|
|
79
|
+
def take_action(
|
|
80
|
+
self, parsed_args: argparse.Namespace
|
|
81
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
77
82
|
identity_client = self.app.client_manager.identity
|
|
78
83
|
|
|
79
84
|
enabled = True
|
|
@@ -102,7 +107,8 @@ class CreateProject(command.ShowOne):
|
|
|
102
107
|
|
|
103
108
|
# TODO(stevemar): Remove the line below when we support multitenancy
|
|
104
109
|
project._info.pop('parent_id', None)
|
|
105
|
-
|
|
110
|
+
col_headers, col_data = zip(*sorted(project._info.items()))
|
|
111
|
+
return col_headers, col_data
|
|
106
112
|
|
|
107
113
|
|
|
108
114
|
class DeleteProject(command.Command):
|
|
@@ -115,7 +121,7 @@ class DeleteProject(command.Command):
|
|
|
115
121
|
"regardless."
|
|
116
122
|
)
|
|
117
123
|
|
|
118
|
-
def get_parser(self, prog_name):
|
|
124
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
119
125
|
parser = super().get_parser(prog_name)
|
|
120
126
|
parser.add_argument(
|
|
121
127
|
'projects',
|
|
@@ -125,7 +131,7 @@ class DeleteProject(command.Command):
|
|
|
125
131
|
)
|
|
126
132
|
return parser
|
|
127
133
|
|
|
128
|
-
def take_action(self, parsed_args):
|
|
134
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
129
135
|
identity_client = self.app.client_manager.identity
|
|
130
136
|
|
|
131
137
|
errors = 0
|
|
@@ -158,7 +164,7 @@ class DeleteProject(command.Command):
|
|
|
158
164
|
class ListProject(command.Lister):
|
|
159
165
|
_description = _("List projects")
|
|
160
166
|
|
|
161
|
-
def get_parser(self, prog_name):
|
|
167
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
162
168
|
parser = super().get_parser(prog_name)
|
|
163
169
|
parser.add_argument(
|
|
164
170
|
'--long',
|
|
@@ -177,7 +183,9 @@ class ListProject(command.Lister):
|
|
|
177
183
|
)
|
|
178
184
|
return parser
|
|
179
185
|
|
|
180
|
-
def take_action(
|
|
186
|
+
def take_action(
|
|
187
|
+
self, parsed_args: argparse.Namespace
|
|
188
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
181
189
|
columns: tuple[str, ...] = ('ID', 'Name')
|
|
182
190
|
if parsed_args.long:
|
|
183
191
|
columns += ('Description', 'Enabled')
|
|
@@ -200,7 +208,7 @@ class ListProject(command.Lister):
|
|
|
200
208
|
class SetProject(command.Command):
|
|
201
209
|
_description = _("Set project properties")
|
|
202
210
|
|
|
203
|
-
def get_parser(self, prog_name):
|
|
211
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
204
212
|
parser = super().get_parser(prog_name)
|
|
205
213
|
parser.add_argument(
|
|
206
214
|
'project',
|
|
@@ -240,7 +248,7 @@ class SetProject(command.Command):
|
|
|
240
248
|
)
|
|
241
249
|
return parser
|
|
242
250
|
|
|
243
|
-
def take_action(self, parsed_args):
|
|
251
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
244
252
|
identity_client = self.app.client_manager.identity
|
|
245
253
|
|
|
246
254
|
project = utils.find_resource(
|
|
@@ -272,7 +280,7 @@ class SetProject(command.Command):
|
|
|
272
280
|
class ShowProject(command.ShowOne):
|
|
273
281
|
_description = _("Display project details")
|
|
274
282
|
|
|
275
|
-
def get_parser(self, prog_name):
|
|
283
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
276
284
|
parser = super().get_parser(prog_name)
|
|
277
285
|
parser.add_argument(
|
|
278
286
|
'project',
|
|
@@ -281,7 +289,9 @@ class ShowProject(command.ShowOne):
|
|
|
281
289
|
)
|
|
282
290
|
return parser
|
|
283
291
|
|
|
284
|
-
def take_action(
|
|
292
|
+
def take_action(
|
|
293
|
+
self, parsed_args: argparse.Namespace
|
|
294
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
285
295
|
identity_client = self.app.client_manager.identity
|
|
286
296
|
|
|
287
297
|
info = {}
|
|
@@ -324,13 +334,14 @@ class ShowProject(command.ShowOne):
|
|
|
324
334
|
properties[k] = v
|
|
325
335
|
|
|
326
336
|
info['properties'] = format_columns.DictColumn(properties)
|
|
327
|
-
|
|
337
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
338
|
+
return col_headers, col_data
|
|
328
339
|
|
|
329
340
|
|
|
330
341
|
class UnsetProject(command.Command):
|
|
331
342
|
_description = _("Unset project properties")
|
|
332
343
|
|
|
333
|
-
def get_parser(self, prog_name):
|
|
344
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
334
345
|
parser = super().get_parser(prog_name)
|
|
335
346
|
parser.add_argument(
|
|
336
347
|
'project',
|
|
@@ -350,7 +361,7 @@ class UnsetProject(command.Command):
|
|
|
350
361
|
)
|
|
351
362
|
return parser
|
|
352
363
|
|
|
353
|
-
def take_action(self, parsed_args):
|
|
364
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
354
365
|
identity_client = self.app.client_manager.identity
|
|
355
366
|
project = utils.find_resource(
|
|
356
367
|
identity_client.tenants,
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v2 Role action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from keystoneauth1 import exceptions as ks_exc
|
|
21
24
|
from osc_lib import exceptions
|
|
@@ -31,7 +34,7 @@ LOG = logging.getLogger(__name__)
|
|
|
31
34
|
class AddRole(command.ShowOne):
|
|
32
35
|
_description = _("Add role to project:user")
|
|
33
36
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
38
|
parser = super().get_parser(prog_name)
|
|
36
39
|
parser.add_argument(
|
|
37
40
|
'role',
|
|
@@ -52,7 +55,9 @@ class AddRole(command.ShowOne):
|
|
|
52
55
|
)
|
|
53
56
|
return parser
|
|
54
57
|
|
|
55
|
-
def take_action(
|
|
58
|
+
def take_action(
|
|
59
|
+
self, parsed_args: argparse.Namespace
|
|
60
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
56
61
|
identity_client = self.app.client_manager.identity
|
|
57
62
|
role = utils.find_resource(identity_client.roles, parsed_args.role)
|
|
58
63
|
project = utils.find_resource(
|
|
@@ -68,13 +73,14 @@ class AddRole(command.ShowOne):
|
|
|
68
73
|
|
|
69
74
|
info = {}
|
|
70
75
|
info.update(role._info)
|
|
71
|
-
|
|
76
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
77
|
+
return col_headers, col_data
|
|
72
78
|
|
|
73
79
|
|
|
74
80
|
class CreateRole(command.ShowOne):
|
|
75
81
|
_description = _("Create new role")
|
|
76
82
|
|
|
77
|
-
def get_parser(self, prog_name):
|
|
83
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
78
84
|
parser = super().get_parser(prog_name)
|
|
79
85
|
parser.add_argument(
|
|
80
86
|
'role_name',
|
|
@@ -88,7 +94,9 @@ class CreateRole(command.ShowOne):
|
|
|
88
94
|
)
|
|
89
95
|
return parser
|
|
90
96
|
|
|
91
|
-
def take_action(
|
|
97
|
+
def take_action(
|
|
98
|
+
self, parsed_args: argparse.Namespace
|
|
99
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
92
100
|
identity_client = self.app.client_manager.identity
|
|
93
101
|
try:
|
|
94
102
|
role = identity_client.roles.create(parsed_args.role_name)
|
|
@@ -104,13 +112,14 @@ class CreateRole(command.ShowOne):
|
|
|
104
112
|
|
|
105
113
|
info = {}
|
|
106
114
|
info.update(role._info)
|
|
107
|
-
|
|
115
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
116
|
+
return col_headers, col_data
|
|
108
117
|
|
|
109
118
|
|
|
110
119
|
class DeleteRole(command.Command):
|
|
111
120
|
_description = _("Delete role(s)")
|
|
112
121
|
|
|
113
|
-
def get_parser(self, prog_name):
|
|
122
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
114
123
|
parser = super().get_parser(prog_name)
|
|
115
124
|
parser.add_argument(
|
|
116
125
|
'roles',
|
|
@@ -120,7 +129,7 @@ class DeleteRole(command.Command):
|
|
|
120
129
|
)
|
|
121
130
|
return parser
|
|
122
131
|
|
|
123
|
-
def take_action(self, parsed_args):
|
|
132
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
124
133
|
identity_client = self.app.client_manager.identity
|
|
125
134
|
|
|
126
135
|
errors = 0
|
|
@@ -153,7 +162,9 @@ class DeleteRole(command.Command):
|
|
|
153
162
|
class ListRole(command.Lister):
|
|
154
163
|
_description = _("List roles")
|
|
155
164
|
|
|
156
|
-
def take_action(
|
|
165
|
+
def take_action(
|
|
166
|
+
self, parsed_args: argparse.Namespace
|
|
167
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
157
168
|
identity_client = self.app.client_manager.identity
|
|
158
169
|
|
|
159
170
|
columns = ('ID', 'Name')
|
|
@@ -175,7 +186,7 @@ class ListRole(command.Lister):
|
|
|
175
186
|
class RemoveRole(command.Command):
|
|
176
187
|
_description = _("Remove role from project : user")
|
|
177
188
|
|
|
178
|
-
def get_parser(self, prog_name):
|
|
189
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
179
190
|
parser = super().get_parser(prog_name)
|
|
180
191
|
parser.add_argument(
|
|
181
192
|
'role',
|
|
@@ -196,7 +207,7 @@ class RemoveRole(command.Command):
|
|
|
196
207
|
)
|
|
197
208
|
return parser
|
|
198
209
|
|
|
199
|
-
def take_action(self, parsed_args):
|
|
210
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
200
211
|
identity_client = self.app.client_manager.identity
|
|
201
212
|
role = utils.find_resource(identity_client.roles, parsed_args.role)
|
|
202
213
|
project = utils.find_resource(
|
|
@@ -210,7 +221,7 @@ class RemoveRole(command.Command):
|
|
|
210
221
|
class ShowRole(command.ShowOne):
|
|
211
222
|
_description = _("Display role details")
|
|
212
223
|
|
|
213
|
-
def get_parser(self, prog_name):
|
|
224
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
214
225
|
parser = super().get_parser(prog_name)
|
|
215
226
|
parser.add_argument(
|
|
216
227
|
'role',
|
|
@@ -219,10 +230,13 @@ class ShowRole(command.ShowOne):
|
|
|
219
230
|
)
|
|
220
231
|
return parser
|
|
221
232
|
|
|
222
|
-
def take_action(
|
|
233
|
+
def take_action(
|
|
234
|
+
self, parsed_args: argparse.Namespace
|
|
235
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
223
236
|
identity_client = self.app.client_manager.identity
|
|
224
237
|
role = utils.find_resource(identity_client.roles, parsed_args.role)
|
|
225
238
|
|
|
226
239
|
info = {}
|
|
227
240
|
info.update(role._info)
|
|
228
|
-
|
|
241
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
242
|
+
return col_headers, col_data
|
|
@@ -13,17 +13,21 @@
|
|
|
13
13
|
|
|
14
14
|
"""Identity v2 Assignment action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
17
|
+
from collections.abc import Iterable
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
16
20
|
from osc_lib import exceptions
|
|
17
21
|
from osc_lib import utils
|
|
18
22
|
|
|
19
23
|
from openstackclient import command
|
|
20
|
-
from openstackclient.i18n import _
|
|
24
|
+
from openstackclient.i18n import _
|
|
21
25
|
|
|
22
26
|
|
|
23
27
|
class ListRoleAssignment(command.Lister):
|
|
24
28
|
_description = _("List role assignments")
|
|
25
29
|
|
|
26
|
-
def get_parser(self, prog_name):
|
|
30
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
27
31
|
parser = super().get_parser(prog_name)
|
|
28
32
|
parser.add_argument(
|
|
29
33
|
'--user',
|
|
@@ -55,7 +59,9 @@ class ListRoleAssignment(command.Lister):
|
|
|
55
59
|
)
|
|
56
60
|
return parser
|
|
57
61
|
|
|
58
|
-
def take_action(
|
|
62
|
+
def take_action(
|
|
63
|
+
self, parsed_args: argparse.Namespace
|
|
64
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
59
65
|
identity_client = self.app.client_manager.identity
|
|
60
66
|
auth_ref = self.app.client_manager.auth_ref
|
|
61
67
|
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Service action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from osc_lib import exceptions
|
|
21
24
|
from osc_lib import utils
|
|
@@ -31,7 +34,7 @@ LOG = logging.getLogger(__name__)
|
|
|
31
34
|
class CreateService(command.ShowOne):
|
|
32
35
|
_description = _("Create new service")
|
|
33
36
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
38
|
parser = super().get_parser(prog_name)
|
|
36
39
|
parser.add_argument(
|
|
37
40
|
'type',
|
|
@@ -50,7 +53,9 @@ class CreateService(command.ShowOne):
|
|
|
50
53
|
)
|
|
51
54
|
return parser
|
|
52
55
|
|
|
53
|
-
def take_action(
|
|
56
|
+
def take_action(
|
|
57
|
+
self, parsed_args: argparse.Namespace
|
|
58
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
54
59
|
identity_client = self.app.client_manager.identity
|
|
55
60
|
|
|
56
61
|
name = parsed_args.name
|
|
@@ -64,13 +69,14 @@ class CreateService(command.ShowOne):
|
|
|
64
69
|
|
|
65
70
|
info = {}
|
|
66
71
|
info.update(service._info)
|
|
67
|
-
|
|
72
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
73
|
+
return col_headers, col_data
|
|
68
74
|
|
|
69
75
|
|
|
70
76
|
class DeleteService(command.Command):
|
|
71
77
|
_description = _("Delete service(s)")
|
|
72
78
|
|
|
73
|
-
def get_parser(self, prog_name):
|
|
79
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
74
80
|
parser = super().get_parser(prog_name)
|
|
75
81
|
parser.add_argument(
|
|
76
82
|
'services',
|
|
@@ -80,7 +86,7 @@ class DeleteService(command.Command):
|
|
|
80
86
|
)
|
|
81
87
|
return parser
|
|
82
88
|
|
|
83
|
-
def take_action(self, parsed_args):
|
|
89
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
84
90
|
identity_client = self.app.client_manager.identity
|
|
85
91
|
|
|
86
92
|
result = 0
|
|
@@ -110,7 +116,7 @@ class DeleteService(command.Command):
|
|
|
110
116
|
class ListService(command.Lister):
|
|
111
117
|
_description = _("List services")
|
|
112
118
|
|
|
113
|
-
def get_parser(self, prog_name):
|
|
119
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
114
120
|
parser = super().get_parser(prog_name)
|
|
115
121
|
parser.add_argument(
|
|
116
122
|
'--long',
|
|
@@ -120,7 +126,9 @@ class ListService(command.Lister):
|
|
|
120
126
|
)
|
|
121
127
|
return parser
|
|
122
128
|
|
|
123
|
-
def take_action(
|
|
129
|
+
def take_action(
|
|
130
|
+
self, parsed_args: argparse.Namespace
|
|
131
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
124
132
|
columns: tuple[str, ...] = ('ID', 'Name', 'Type')
|
|
125
133
|
if parsed_args.long:
|
|
126
134
|
columns += ('Description',)
|
|
@@ -134,7 +142,7 @@ class ListService(command.Lister):
|
|
|
134
142
|
class ShowService(command.ShowOne):
|
|
135
143
|
_description = _("Display service details")
|
|
136
144
|
|
|
137
|
-
def get_parser(self, prog_name):
|
|
145
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
138
146
|
parser = super().get_parser(prog_name)
|
|
139
147
|
parser.add_argument(
|
|
140
148
|
'service',
|
|
@@ -149,7 +157,9 @@ class ShowService(command.ShowOne):
|
|
|
149
157
|
)
|
|
150
158
|
return parser
|
|
151
159
|
|
|
152
|
-
def take_action(
|
|
160
|
+
def take_action(
|
|
161
|
+
self, parsed_args: argparse.Namespace
|
|
162
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
153
163
|
identity_client = self.app.client_manager.identity
|
|
154
164
|
auth_ref = self.app.client_manager.auth_ref
|
|
155
165
|
|
|
@@ -160,8 +170,11 @@ class ShowService(command.ShowOne):
|
|
|
160
170
|
for service, service_endpoints in endpoints.items():
|
|
161
171
|
if service_endpoints:
|
|
162
172
|
info = {"type": service}
|
|
163
|
-
|
|
164
|
-
|
|
173
|
+
# FIXME(stephenfin): The return type for this in ksa is
|
|
174
|
+
# wrong
|
|
175
|
+
info.update(service_endpoints[0]) # type: ignore
|
|
176
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
177
|
+
return col_headers, col_data
|
|
165
178
|
|
|
166
179
|
msg = _(
|
|
167
180
|
"No service catalog with a type, name or ID of '%s' exists."
|
|
@@ -171,4 +184,5 @@ class ShowService(command.ShowOne):
|
|
|
171
184
|
service = common.find_service(identity_client, parsed_args.service)
|
|
172
185
|
info = {}
|
|
173
186
|
info.update(service._info)
|
|
174
|
-
|
|
187
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
188
|
+
return col_headers, col_data
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v2 Token action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
18
22
|
from osc_lib import exceptions
|
|
19
23
|
|
|
20
24
|
from openstackclient import command
|
|
@@ -27,11 +31,13 @@ class IssueToken(command.ShowOne):
|
|
|
27
31
|
# scoped token is optional
|
|
28
32
|
required_scope = False
|
|
29
33
|
|
|
30
|
-
def get_parser(self, prog_name):
|
|
34
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
31
35
|
parser = super().get_parser(prog_name)
|
|
32
36
|
return parser
|
|
33
37
|
|
|
34
|
-
def take_action(
|
|
38
|
+
def take_action(
|
|
39
|
+
self, parsed_args: argparse.Namespace
|
|
40
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
35
41
|
auth_ref = self.app.client_manager.auth_ref
|
|
36
42
|
if not auth_ref:
|
|
37
43
|
raise exceptions.AuthorizationFailure(
|
|
@@ -49,13 +55,14 @@ class IssueToken(command.ShowOne):
|
|
|
49
55
|
data['project_id'] = auth_ref.project_id
|
|
50
56
|
if auth_ref.user_id:
|
|
51
57
|
data['user_id'] = auth_ref.user_id
|
|
52
|
-
|
|
58
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
59
|
+
return col_headers, col_data
|
|
53
60
|
|
|
54
61
|
|
|
55
62
|
class RevokeToken(command.Command):
|
|
56
63
|
_description = _("Revoke existing token")
|
|
57
64
|
|
|
58
|
-
def get_parser(self, prog_name):
|
|
65
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
59
66
|
parser = super().get_parser(prog_name)
|
|
60
67
|
parser.add_argument(
|
|
61
68
|
'token',
|
|
@@ -64,7 +71,7 @@ class RevokeToken(command.Command):
|
|
|
64
71
|
)
|
|
65
72
|
return parser
|
|
66
73
|
|
|
67
|
-
def take_action(self, parsed_args):
|
|
74
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
68
75
|
identity_client = self.app.client_manager.identity
|
|
69
76
|
|
|
70
77
|
identity_client.tokens.delete(parsed_args.token)
|