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
|
@@ -15,8 +15,12 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v3 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
|
|
|
23
|
+
from openstack import utils as sdk_utils
|
|
20
24
|
from osc_lib import exceptions
|
|
21
25
|
from osc_lib import utils
|
|
22
26
|
|
|
@@ -28,7 +32,7 @@ from openstackclient.identity import common
|
|
|
28
32
|
LOG = logging.getLogger(__name__)
|
|
29
33
|
|
|
30
34
|
|
|
31
|
-
def _format_service(service):
|
|
35
|
+
def _format_service(service: Any) -> tuple[tuple[str, ...], Any]:
|
|
32
36
|
columns = (
|
|
33
37
|
'id',
|
|
34
38
|
'name',
|
|
@@ -56,7 +60,7 @@ def _format_service(service):
|
|
|
56
60
|
class CreateService(command.ShowOne):
|
|
57
61
|
_description = _("Create new service")
|
|
58
62
|
|
|
59
|
-
def get_parser(self, prog_name):
|
|
63
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
60
64
|
parser = super().get_parser(prog_name)
|
|
61
65
|
parser.add_argument(
|
|
62
66
|
'type',
|
|
@@ -90,8 +94,12 @@ class CreateService(command.ShowOne):
|
|
|
90
94
|
)
|
|
91
95
|
return parser
|
|
92
96
|
|
|
93
|
-
def take_action(
|
|
94
|
-
|
|
97
|
+
def take_action(
|
|
98
|
+
self, parsed_args: argparse.Namespace
|
|
99
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
100
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
101
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
102
|
+
)
|
|
95
103
|
|
|
96
104
|
service = identity_client.create_service(
|
|
97
105
|
name=parsed_args.name,
|
|
@@ -106,7 +114,7 @@ class CreateService(command.ShowOne):
|
|
|
106
114
|
class DeleteService(command.Command):
|
|
107
115
|
_description = _("Delete service(s)")
|
|
108
116
|
|
|
109
|
-
def get_parser(self, prog_name):
|
|
117
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
110
118
|
parser = super().get_parser(prog_name)
|
|
111
119
|
parser.add_argument(
|
|
112
120
|
'service',
|
|
@@ -116,8 +124,10 @@ class DeleteService(command.Command):
|
|
|
116
124
|
)
|
|
117
125
|
return parser
|
|
118
126
|
|
|
119
|
-
def take_action(self, parsed_args):
|
|
120
|
-
identity_client =
|
|
127
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
128
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
129
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
130
|
+
)
|
|
121
131
|
result = 0
|
|
122
132
|
for i in parsed_args.service:
|
|
123
133
|
try:
|
|
@@ -145,7 +155,7 @@ class DeleteService(command.Command):
|
|
|
145
155
|
class ListService(command.Lister):
|
|
146
156
|
_description = _("List services")
|
|
147
157
|
|
|
148
|
-
def get_parser(self, prog_name):
|
|
158
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
149
159
|
parser = super().get_parser(prog_name)
|
|
150
160
|
parser.add_argument(
|
|
151
161
|
'--long',
|
|
@@ -155,8 +165,12 @@ class ListService(command.Lister):
|
|
|
155
165
|
)
|
|
156
166
|
return parser
|
|
157
167
|
|
|
158
|
-
def take_action(
|
|
159
|
-
|
|
168
|
+
def take_action(
|
|
169
|
+
self, parsed_args: argparse.Namespace
|
|
170
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
171
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
172
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
173
|
+
)
|
|
160
174
|
|
|
161
175
|
columns: tuple[str, ...] = ('id', 'name', 'type')
|
|
162
176
|
column_headers: tuple[str, ...] = ('ID', 'Name', 'Type')
|
|
@@ -175,7 +189,7 @@ class ListService(command.Lister):
|
|
|
175
189
|
class SetService(command.Command):
|
|
176
190
|
_description = _("Set service properties")
|
|
177
191
|
|
|
178
|
-
def get_parser(self, prog_name):
|
|
192
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
179
193
|
parser = super().get_parser(prog_name)
|
|
180
194
|
parser.add_argument(
|
|
181
195
|
'service',
|
|
@@ -214,8 +228,10 @@ class SetService(command.Command):
|
|
|
214
228
|
)
|
|
215
229
|
return parser
|
|
216
230
|
|
|
217
|
-
def take_action(self, parsed_args):
|
|
218
|
-
identity_client =
|
|
231
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
232
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
233
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
234
|
+
)
|
|
219
235
|
|
|
220
236
|
service = common.find_service_sdk(identity_client, parsed_args.service)
|
|
221
237
|
kwargs = {}
|
|
@@ -234,7 +250,7 @@ class SetService(command.Command):
|
|
|
234
250
|
class ShowService(command.ShowOne):
|
|
235
251
|
_description = _("Display service details")
|
|
236
252
|
|
|
237
|
-
def get_parser(self, prog_name):
|
|
253
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
238
254
|
parser = super().get_parser(prog_name)
|
|
239
255
|
parser.add_argument(
|
|
240
256
|
'service',
|
|
@@ -243,8 +259,12 @@ class ShowService(command.ShowOne):
|
|
|
243
259
|
)
|
|
244
260
|
return parser
|
|
245
261
|
|
|
246
|
-
def take_action(
|
|
247
|
-
|
|
262
|
+
def take_action(
|
|
263
|
+
self, parsed_args: argparse.Namespace
|
|
264
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
265
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
266
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
267
|
+
)
|
|
248
268
|
|
|
249
269
|
service = common.find_service_sdk(identity_client, parsed_args.service)
|
|
250
270
|
|
|
@@ -13,8 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
"""Service Provider action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
17
|
+
from collections.abc import Iterable, Sequence
|
|
16
18
|
import logging
|
|
19
|
+
from typing import Any
|
|
17
20
|
|
|
21
|
+
from openstack import utils as sdk_utils
|
|
18
22
|
from osc_lib import exceptions
|
|
19
23
|
from osc_lib import utils
|
|
20
24
|
|
|
@@ -25,7 +29,7 @@ from openstackclient.i18n import _
|
|
|
25
29
|
LOG = logging.getLogger(__name__)
|
|
26
30
|
|
|
27
31
|
|
|
28
|
-
def _format_service_provider(sp):
|
|
32
|
+
def _format_service_provider(sp: Any) -> tuple[tuple[str, ...], Any]:
|
|
29
33
|
column_headers = (
|
|
30
34
|
'id',
|
|
31
35
|
'enabled',
|
|
@@ -51,7 +55,7 @@ def _format_service_provider(sp):
|
|
|
51
55
|
class CreateServiceProvider(command.ShowOne):
|
|
52
56
|
_description = _("Create new service provider")
|
|
53
57
|
|
|
54
|
-
def get_parser(self, prog_name):
|
|
58
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
55
59
|
parser = super().get_parser(prog_name)
|
|
56
60
|
parser.add_argument(
|
|
57
61
|
'service_provider_id',
|
|
@@ -98,8 +102,12 @@ class CreateServiceProvider(command.ShowOne):
|
|
|
98
102
|
|
|
99
103
|
return parser
|
|
100
104
|
|
|
101
|
-
def take_action(
|
|
102
|
-
|
|
105
|
+
def take_action(
|
|
106
|
+
self, parsed_args: argparse.Namespace
|
|
107
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
108
|
+
service_client = sdk_utils.ensure_service_version(
|
|
109
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
110
|
+
)
|
|
103
111
|
|
|
104
112
|
kwargs = {}
|
|
105
113
|
|
|
@@ -125,7 +133,7 @@ class CreateServiceProvider(command.ShowOne):
|
|
|
125
133
|
class DeleteServiceProvider(command.Command):
|
|
126
134
|
_description = _("Delete service provider(s)")
|
|
127
135
|
|
|
128
|
-
def get_parser(self, prog_name):
|
|
136
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
129
137
|
parser = super().get_parser(prog_name)
|
|
130
138
|
parser.add_argument(
|
|
131
139
|
'service_provider',
|
|
@@ -135,8 +143,10 @@ class DeleteServiceProvider(command.Command):
|
|
|
135
143
|
)
|
|
136
144
|
return parser
|
|
137
145
|
|
|
138
|
-
def take_action(self, parsed_args):
|
|
139
|
-
service_client =
|
|
146
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
147
|
+
service_client = sdk_utils.ensure_service_version(
|
|
148
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
149
|
+
)
|
|
140
150
|
result = 0
|
|
141
151
|
for i in parsed_args.service_provider:
|
|
142
152
|
try:
|
|
@@ -162,8 +172,12 @@ class DeleteServiceProvider(command.Command):
|
|
|
162
172
|
class ListServiceProvider(command.Lister):
|
|
163
173
|
_description = _("List service providers")
|
|
164
174
|
|
|
165
|
-
def take_action(
|
|
166
|
-
|
|
175
|
+
def take_action(
|
|
176
|
+
self, parsed_args: argparse.Namespace
|
|
177
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
178
|
+
service_client = sdk_utils.ensure_service_version(
|
|
179
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
180
|
+
)
|
|
167
181
|
data = service_client.service_providers()
|
|
168
182
|
|
|
169
183
|
column_headers = (
|
|
@@ -191,7 +205,7 @@ class ListServiceProvider(command.Lister):
|
|
|
191
205
|
class SetServiceProvider(command.ShowOne):
|
|
192
206
|
_description = _("Set service provider properties")
|
|
193
207
|
|
|
194
|
-
def get_parser(self, prog_name):
|
|
208
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
195
209
|
parser = super().get_parser(prog_name)
|
|
196
210
|
parser.add_argument(
|
|
197
211
|
'service_provider',
|
|
@@ -233,8 +247,12 @@ class SetServiceProvider(command.ShowOne):
|
|
|
233
247
|
)
|
|
234
248
|
return parser
|
|
235
249
|
|
|
236
|
-
def take_action(
|
|
237
|
-
|
|
250
|
+
def take_action(
|
|
251
|
+
self, parsed_args: argparse.Namespace
|
|
252
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
253
|
+
service_client = sdk_utils.ensure_service_version(
|
|
254
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
255
|
+
)
|
|
238
256
|
|
|
239
257
|
kwargs = {}
|
|
240
258
|
|
|
@@ -261,7 +279,7 @@ class SetServiceProvider(command.ShowOne):
|
|
|
261
279
|
class ShowServiceProvider(command.ShowOne):
|
|
262
280
|
_description = _("Display service provider details")
|
|
263
281
|
|
|
264
|
-
def get_parser(self, prog_name):
|
|
282
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
265
283
|
parser = super().get_parser(prog_name)
|
|
266
284
|
parser.add_argument(
|
|
267
285
|
'service_provider',
|
|
@@ -270,8 +288,12 @@ class ShowServiceProvider(command.ShowOne):
|
|
|
270
288
|
)
|
|
271
289
|
return parser
|
|
272
290
|
|
|
273
|
-
def take_action(
|
|
274
|
-
|
|
291
|
+
def take_action(
|
|
292
|
+
self, parsed_args: argparse.Namespace
|
|
293
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
294
|
+
service_client = sdk_utils.ensure_service_version(
|
|
295
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
296
|
+
)
|
|
275
297
|
service_provider = service_client.find_service_provider(
|
|
276
298
|
parsed_args.service_provider,
|
|
277
299
|
ignore_missing=False,
|
|
@@ -11,16 +11,27 @@
|
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
13
|
import argparse
|
|
14
|
+
from collections.abc import Sequence
|
|
15
|
+
from typing import Any
|
|
14
16
|
|
|
15
17
|
from openstackclient.i18n import _
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
class _CommaListAction(argparse.Action):
|
|
19
|
-
def __call__(
|
|
20
|
-
|
|
21
|
+
def __call__(
|
|
22
|
+
self,
|
|
23
|
+
parser: argparse.ArgumentParser,
|
|
24
|
+
namespace: argparse.Namespace,
|
|
25
|
+
values: str | Sequence[Any] | None,
|
|
26
|
+
option_string: str | None = None,
|
|
27
|
+
) -> None:
|
|
28
|
+
values = values.split(',') if isinstance(values, str) else values
|
|
29
|
+
setattr(namespace, self.dest, values)
|
|
21
30
|
|
|
22
31
|
|
|
23
|
-
def add_tag_filtering_option_to_parser(
|
|
32
|
+
def add_tag_filtering_option_to_parser(
|
|
33
|
+
parser: argparse.ArgumentParser, collection_name: str
|
|
34
|
+
) -> None:
|
|
24
35
|
parser.add_argument(
|
|
25
36
|
'--tags',
|
|
26
37
|
metavar='<tag>[,<tag>,...]',
|
|
@@ -63,7 +74,9 @@ def add_tag_filtering_option_to_parser(parser, collection_name):
|
|
|
63
74
|
)
|
|
64
75
|
|
|
65
76
|
|
|
66
|
-
def get_tag_filtering_args(
|
|
77
|
+
def get_tag_filtering_args(
|
|
78
|
+
parsed_args: argparse.Namespace, args: dict[str, Any]
|
|
79
|
+
) -> None:
|
|
67
80
|
if parsed_args.tags:
|
|
68
81
|
args['tags'] = ','.join(parsed_args.tags)
|
|
69
82
|
if parsed_args.tags_any:
|
|
@@ -74,7 +87,9 @@ def get_tag_filtering_args(parsed_args, args):
|
|
|
74
87
|
args['not-tags-any'] = ','.join(parsed_args.not_tags_any)
|
|
75
88
|
|
|
76
89
|
|
|
77
|
-
def add_tag_option_to_parser_for_create(
|
|
90
|
+
def add_tag_option_to_parser_for_create(
|
|
91
|
+
parser: argparse.ArgumentParser, resource_name: str
|
|
92
|
+
) -> None:
|
|
78
93
|
tag_group = parser.add_mutually_exclusive_group()
|
|
79
94
|
tag_group.add_argument(
|
|
80
95
|
'--tag',
|
|
@@ -89,7 +104,9 @@ def add_tag_option_to_parser_for_create(parser, resource_name):
|
|
|
89
104
|
)
|
|
90
105
|
|
|
91
106
|
|
|
92
|
-
def add_tag_option_to_parser_for_set(
|
|
107
|
+
def add_tag_option_to_parser_for_set(
|
|
108
|
+
parser: argparse.ArgumentParser, resource_name: str
|
|
109
|
+
) -> None:
|
|
93
110
|
parser.add_argument(
|
|
94
111
|
'--tag',
|
|
95
112
|
action='append',
|
|
@@ -123,14 +140,3 @@ def add_tag_option_to_parser_for_set(parser, resource_name):
|
|
|
123
140
|
)
|
|
124
141
|
% resource_name,
|
|
125
142
|
)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
def update_tags_in_args(parsed_args, obj, args):
|
|
129
|
-
if parsed_args.clear_tags:
|
|
130
|
-
args['tags'] = []
|
|
131
|
-
obj.tags = []
|
|
132
|
-
if parsed_args.remove_tags:
|
|
133
|
-
args['tags'] = sorted(set(obj.tags) - set(parsed_args.remove_tags))
|
|
134
|
-
return
|
|
135
|
-
if parsed_args.tags:
|
|
136
|
-
args['tags'] = sorted(set(obj.tags).union(set(parsed_args.tags)))
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v3 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
|
from osc_lib import utils
|
|
20
24
|
|
|
@@ -26,7 +30,7 @@ from openstackclient.identity import common
|
|
|
26
30
|
class AuthorizeRequestToken(command.ShowOne):
|
|
27
31
|
_description = _("Authorize a request token")
|
|
28
32
|
|
|
29
|
-
def get_parser(self, prog_name):
|
|
33
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
30
34
|
parser = super().get_parser(prog_name)
|
|
31
35
|
parser.add_argument(
|
|
32
36
|
'--request-key',
|
|
@@ -48,7 +52,9 @@ class AuthorizeRequestToken(command.ShowOne):
|
|
|
48
52
|
)
|
|
49
53
|
return parser
|
|
50
54
|
|
|
51
|
-
def take_action(
|
|
55
|
+
def take_action(
|
|
56
|
+
self, parsed_args: argparse.Namespace
|
|
57
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
52
58
|
identity_client = self.app.client_manager.identity
|
|
53
59
|
|
|
54
60
|
# NOTE(stevemar): We want a list of role ids
|
|
@@ -64,13 +70,14 @@ class AuthorizeRequestToken(command.ShowOne):
|
|
|
64
70
|
parsed_args.request_key, roles
|
|
65
71
|
)
|
|
66
72
|
|
|
67
|
-
|
|
73
|
+
col_headers, col_data = zip(*sorted(verifier_pin._info.items()))
|
|
74
|
+
return col_headers, col_data
|
|
68
75
|
|
|
69
76
|
|
|
70
77
|
class CreateAccessToken(command.ShowOne):
|
|
71
78
|
_description = _("Create an access token")
|
|
72
79
|
|
|
73
|
-
def get_parser(self, prog_name):
|
|
80
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
74
81
|
parser = super().get_parser(prog_name)
|
|
75
82
|
parser.add_argument(
|
|
76
83
|
'--consumer-key',
|
|
@@ -104,7 +111,9 @@ class CreateAccessToken(command.ShowOne):
|
|
|
104
111
|
)
|
|
105
112
|
return parser
|
|
106
113
|
|
|
107
|
-
def take_action(
|
|
114
|
+
def take_action(
|
|
115
|
+
self, parsed_args: argparse.Namespace
|
|
116
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
108
117
|
token_client = self.app.client_manager.identity.oauth1.access_tokens
|
|
109
118
|
access_token = token_client.create(
|
|
110
119
|
parsed_args.consumer_key,
|
|
@@ -113,13 +122,14 @@ class CreateAccessToken(command.ShowOne):
|
|
|
113
122
|
parsed_args.request_secret,
|
|
114
123
|
parsed_args.verifier,
|
|
115
124
|
)
|
|
116
|
-
|
|
125
|
+
col_headers, col_data = zip(*sorted(access_token._info.items()))
|
|
126
|
+
return col_headers, col_data
|
|
117
127
|
|
|
118
128
|
|
|
119
129
|
class CreateRequestToken(command.ShowOne):
|
|
120
130
|
_description = _("Create a request token")
|
|
121
131
|
|
|
122
|
-
def get_parser(self, prog_name):
|
|
132
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
123
133
|
parser = super().get_parser(prog_name)
|
|
124
134
|
parser.add_argument(
|
|
125
135
|
'--consumer-key',
|
|
@@ -148,7 +158,9 @@ class CreateRequestToken(command.ShowOne):
|
|
|
148
158
|
)
|
|
149
159
|
return parser
|
|
150
160
|
|
|
151
|
-
def take_action(
|
|
161
|
+
def take_action(
|
|
162
|
+
self, parsed_args: argparse.Namespace
|
|
163
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
152
164
|
identity_client = self.app.client_manager.identity
|
|
153
165
|
|
|
154
166
|
if parsed_args.domain:
|
|
@@ -168,7 +180,8 @@ class CreateRequestToken(command.ShowOne):
|
|
|
168
180
|
request_token = token_client.create(
|
|
169
181
|
parsed_args.consumer_key, parsed_args.consumer_secret, project.id
|
|
170
182
|
)
|
|
171
|
-
|
|
183
|
+
col_headers, col_data = zip(*sorted(request_token._info.items()))
|
|
184
|
+
return col_headers, col_data
|
|
172
185
|
|
|
173
186
|
|
|
174
187
|
class IssueToken(command.ShowOne):
|
|
@@ -177,11 +190,13 @@ class IssueToken(command.ShowOne):
|
|
|
177
190
|
# scoped token is optional
|
|
178
191
|
required_scope = False
|
|
179
192
|
|
|
180
|
-
def get_parser(self, prog_name):
|
|
193
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
181
194
|
parser = super().get_parser(prog_name)
|
|
182
195
|
return parser
|
|
183
196
|
|
|
184
|
-
def take_action(
|
|
197
|
+
def take_action(
|
|
198
|
+
self, parsed_args: argparse.Namespace
|
|
199
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
185
200
|
auth_ref = self.app.client_manager.auth_ref
|
|
186
201
|
if not auth_ref:
|
|
187
202
|
raise exceptions.AuthorizationFailure(
|
|
@@ -207,13 +222,14 @@ class IssueToken(command.ShowOne):
|
|
|
207
222
|
# deployment system. When that happens, this will have to relay
|
|
208
223
|
# scope information and IDs like we do for projects and domains.
|
|
209
224
|
data['system'] = 'all'
|
|
210
|
-
|
|
225
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
226
|
+
return col_headers, col_data
|
|
211
227
|
|
|
212
228
|
|
|
213
229
|
class RevokeToken(command.Command):
|
|
214
230
|
_description = _("Revoke existing token")
|
|
215
231
|
|
|
216
|
-
def get_parser(self, prog_name):
|
|
232
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
217
233
|
parser = super().get_parser(prog_name)
|
|
218
234
|
parser.add_argument(
|
|
219
235
|
'token',
|
|
@@ -222,7 +238,7 @@ class RevokeToken(command.Command):
|
|
|
222
238
|
)
|
|
223
239
|
return parser
|
|
224
240
|
|
|
225
|
-
def take_action(self, parsed_args):
|
|
241
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
226
242
|
identity_client = self.app.client_manager.identity
|
|
227
243
|
|
|
228
244
|
identity_client.tokens.revoke_token(parsed_args.token)
|
|
@@ -13,11 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
"""Identity v3 Trust action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
17
|
+
from collections.abc import Iterable, Sequence
|
|
16
18
|
import datetime
|
|
17
19
|
import itertools
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from openstack import exceptions as sdk_exceptions
|
|
24
|
+
from openstack import utils as sdk_utils
|
|
21
25
|
from osc_lib import exceptions
|
|
22
26
|
from osc_lib import utils
|
|
23
27
|
|
|
@@ -29,7 +33,7 @@ from openstackclient.identity import common
|
|
|
29
33
|
LOG = logging.getLogger(__name__)
|
|
30
34
|
|
|
31
35
|
|
|
32
|
-
def _format_trust(trust):
|
|
36
|
+
def _format_trust(trust: Any) -> tuple[tuple[str, ...], Any]:
|
|
33
37
|
columns = (
|
|
34
38
|
'expires_at',
|
|
35
39
|
'id',
|
|
@@ -51,7 +55,7 @@ def _format_trust(trust):
|
|
|
51
55
|
class CreateTrust(command.ShowOne):
|
|
52
56
|
_description = _("Create new trust")
|
|
53
57
|
|
|
54
|
-
def get_parser(self, prog_name):
|
|
58
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
55
59
|
parser = super().get_parser(prog_name)
|
|
56
60
|
parser.add_argument(
|
|
57
61
|
'trustor',
|
|
@@ -112,10 +116,14 @@ class CreateTrust(command.ShowOne):
|
|
|
112
116
|
)
|
|
113
117
|
return parser
|
|
114
118
|
|
|
115
|
-
def take_action(
|
|
116
|
-
|
|
119
|
+
def take_action(
|
|
120
|
+
self, parsed_args: argparse.Namespace
|
|
121
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
122
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
123
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
124
|
+
)
|
|
117
125
|
|
|
118
|
-
kwargs = {}
|
|
126
|
+
kwargs: dict[str, Any] = {}
|
|
119
127
|
|
|
120
128
|
# NOTE(stevemar): Find the two users, project and roles that
|
|
121
129
|
# are necessary for making a trust usable, the API dictates that
|
|
@@ -203,7 +211,7 @@ class CreateTrust(command.ShowOne):
|
|
|
203
211
|
class DeleteTrust(command.Command):
|
|
204
212
|
_description = _("Delete trust(s)")
|
|
205
213
|
|
|
206
|
-
def get_parser(self, prog_name):
|
|
214
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
207
215
|
parser = super().get_parser(prog_name)
|
|
208
216
|
parser.add_argument(
|
|
209
217
|
'trust',
|
|
@@ -213,8 +221,10 @@ class DeleteTrust(command.Command):
|
|
|
213
221
|
)
|
|
214
222
|
return parser
|
|
215
223
|
|
|
216
|
-
def take_action(self, parsed_args):
|
|
217
|
-
identity_client =
|
|
224
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
225
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
226
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
227
|
+
)
|
|
218
228
|
|
|
219
229
|
errors = 0
|
|
220
230
|
for trust in parsed_args.trust:
|
|
@@ -245,7 +255,7 @@ class DeleteTrust(command.Command):
|
|
|
245
255
|
class ListTrust(command.Lister):
|
|
246
256
|
_description = _("List trusts")
|
|
247
257
|
|
|
248
|
-
def get_parser(self, prog_name):
|
|
258
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
249
259
|
parser = super().get_parser(prog_name)
|
|
250
260
|
parser.add_argument(
|
|
251
261
|
'--trustor',
|
|
@@ -275,8 +285,12 @@ class ListTrust(command.Lister):
|
|
|
275
285
|
)
|
|
276
286
|
return parser
|
|
277
287
|
|
|
278
|
-
def take_action(
|
|
279
|
-
|
|
288
|
+
def take_action(
|
|
289
|
+
self, parsed_args: argparse.Namespace
|
|
290
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
291
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
292
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
293
|
+
)
|
|
280
294
|
auth_ref = self.app.client_manager.auth_ref
|
|
281
295
|
|
|
282
296
|
if parsed_args.authuser and any(
|
|
@@ -395,7 +409,7 @@ class ListTrust(command.Lister):
|
|
|
395
409
|
class ShowTrust(command.ShowOne):
|
|
396
410
|
_description = _("Display trust details")
|
|
397
411
|
|
|
398
|
-
def get_parser(self, prog_name):
|
|
412
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
399
413
|
parser = super().get_parser(prog_name)
|
|
400
414
|
parser.add_argument(
|
|
401
415
|
'trust',
|
|
@@ -404,8 +418,12 @@ class ShowTrust(command.ShowOne):
|
|
|
404
418
|
)
|
|
405
419
|
return parser
|
|
406
420
|
|
|
407
|
-
def take_action(
|
|
408
|
-
|
|
421
|
+
def take_action(
|
|
422
|
+
self, parsed_args: argparse.Namespace
|
|
423
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
424
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
425
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
426
|
+
)
|
|
409
427
|
trust = identity_client.find_trust(
|
|
410
428
|
parsed_args.trust, ignore_missing=False
|
|
411
429
|
)
|
|
@@ -17,6 +17,10 @@ The first step of federated auth is to fetch an unscoped token. From there,
|
|
|
17
17
|
the user can list domains and projects they are allowed to access, and request
|
|
18
18
|
a scoped token."""
|
|
19
19
|
|
|
20
|
+
import argparse
|
|
21
|
+
from collections.abc import Iterable
|
|
22
|
+
from typing import Any
|
|
23
|
+
|
|
20
24
|
from osc_lib import utils
|
|
21
25
|
|
|
22
26
|
from openstackclient import command
|
|
@@ -26,7 +30,9 @@ from openstackclient.i18n import _
|
|
|
26
30
|
class ListAccessibleDomains(command.Lister):
|
|
27
31
|
_description = _("List accessible domains")
|
|
28
32
|
|
|
29
|
-
def take_action(
|
|
33
|
+
def take_action(
|
|
34
|
+
self, parsed_args: argparse.Namespace
|
|
35
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
30
36
|
columns = ('ID', 'Enabled', 'Name', 'Description')
|
|
31
37
|
identity_client = self.app.client_manager.identity
|
|
32
38
|
data = identity_client.federation.domains.list()
|
|
@@ -46,7 +52,9 @@ class ListAccessibleDomains(command.Lister):
|
|
|
46
52
|
class ListAccessibleProjects(command.Lister):
|
|
47
53
|
_description = _("List accessible projects")
|
|
48
54
|
|
|
49
|
-
def take_action(
|
|
55
|
+
def take_action(
|
|
56
|
+
self, parsed_args: argparse.Namespace
|
|
57
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
50
58
|
columns = ('ID', 'Domain ID', 'Enabled', 'Name')
|
|
51
59
|
identity_client = self.app.client_manager.identity
|
|
52
60
|
data = identity_client.federation.projects.list()
|