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
|
@@ -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()
|
|
@@ -15,11 +15,14 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v3 User action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import copy
|
|
19
21
|
import logging
|
|
20
|
-
|
|
22
|
+
from typing import Any
|
|
21
23
|
|
|
22
24
|
from openstack import exceptions as sdk_exc
|
|
25
|
+
from openstack import utils as sdk_utils
|
|
23
26
|
from osc_lib import exceptions
|
|
24
27
|
from osc_lib import utils
|
|
25
28
|
|
|
@@ -31,7 +34,7 @@ from openstackclient.identity import common
|
|
|
31
34
|
LOG = logging.getLogger(__name__)
|
|
32
35
|
|
|
33
36
|
|
|
34
|
-
def _format_user(user):
|
|
37
|
+
def _format_user(user: Any) -> tuple[tuple[str, ...], Any]:
|
|
35
38
|
columns = (
|
|
36
39
|
'default_project_id',
|
|
37
40
|
'domain_id',
|
|
@@ -60,8 +63,10 @@ def _format_user(user):
|
|
|
60
63
|
)
|
|
61
64
|
|
|
62
65
|
|
|
63
|
-
def _get_options_for_user(
|
|
64
|
-
|
|
66
|
+
def _get_options_for_user(
|
|
67
|
+
identity_client: Any, parsed_args: argparse.Namespace
|
|
68
|
+
) -> dict[str, Any]:
|
|
69
|
+
options: dict[str, Any] = {}
|
|
65
70
|
if parsed_args.ignore_lockout_failure_attempts:
|
|
66
71
|
options['ignore_lockout_failure_attempts'] = True
|
|
67
72
|
if parsed_args.no_ignore_lockout_failure_attempts:
|
|
@@ -91,7 +96,7 @@ def _get_options_for_user(identity_client, parsed_args):
|
|
|
91
96
|
return options
|
|
92
97
|
|
|
93
98
|
|
|
94
|
-
def _add_user_options(parser):
|
|
99
|
+
def _add_user_options(parser: argparse.ArgumentParser) -> None:
|
|
95
100
|
# Add additional user options
|
|
96
101
|
|
|
97
102
|
parser.add_argument(
|
|
@@ -191,7 +196,7 @@ def _add_user_options(parser):
|
|
|
191
196
|
class CreateUser(command.ShowOne):
|
|
192
197
|
_description = _("Create new user")
|
|
193
198
|
|
|
194
|
-
def get_parser(self, prog_name):
|
|
199
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
195
200
|
parser = super().get_parser(prog_name)
|
|
196
201
|
parser.add_argument(
|
|
197
202
|
'name',
|
|
@@ -250,10 +255,14 @@ class CreateUser(command.ShowOne):
|
|
|
250
255
|
)
|
|
251
256
|
return parser
|
|
252
257
|
|
|
253
|
-
def take_action(
|
|
254
|
-
|
|
258
|
+
def take_action(
|
|
259
|
+
self, parsed_args: argparse.Namespace
|
|
260
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
261
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
262
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
263
|
+
)
|
|
255
264
|
|
|
256
|
-
kwargs = {}
|
|
265
|
+
kwargs: dict[str, Any] = {}
|
|
257
266
|
|
|
258
267
|
domain_id = None
|
|
259
268
|
if parsed_args.domain:
|
|
@@ -333,7 +342,7 @@ class CreateUser(command.ShowOne):
|
|
|
333
342
|
class DeleteUser(command.Command):
|
|
334
343
|
_description = _("Delete user(s)")
|
|
335
344
|
|
|
336
|
-
def get_parser(self, prog_name):
|
|
345
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
337
346
|
parser = super().get_parser(prog_name)
|
|
338
347
|
parser.add_argument(
|
|
339
348
|
'users',
|
|
@@ -348,8 +357,10 @@ class DeleteUser(command.Command):
|
|
|
348
357
|
)
|
|
349
358
|
return parser
|
|
350
359
|
|
|
351
|
-
def take_action(self, parsed_args):
|
|
352
|
-
identity_client =
|
|
360
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
361
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
362
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
363
|
+
)
|
|
353
364
|
|
|
354
365
|
domain = None
|
|
355
366
|
if parsed_args.domain:
|
|
@@ -393,7 +404,7 @@ class DeleteUser(command.Command):
|
|
|
393
404
|
class ListUser(command.Lister):
|
|
394
405
|
_description = _("List users")
|
|
395
406
|
|
|
396
|
-
def get_parser(self, prog_name):
|
|
407
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
397
408
|
parser = super().get_parser(prog_name)
|
|
398
409
|
parser.add_argument(
|
|
399
410
|
'--domain',
|
|
@@ -439,8 +450,12 @@ class ListUser(command.Lister):
|
|
|
439
450
|
)
|
|
440
451
|
return parser
|
|
441
452
|
|
|
442
|
-
def take_action(
|
|
443
|
-
|
|
453
|
+
def take_action(
|
|
454
|
+
self, parsed_args: argparse.Namespace
|
|
455
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
456
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
457
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
458
|
+
)
|
|
444
459
|
|
|
445
460
|
domain = None
|
|
446
461
|
if parsed_args.domain:
|
|
@@ -541,7 +556,7 @@ class ListUser(command.Lister):
|
|
|
541
556
|
class SetUser(command.Command):
|
|
542
557
|
_description = _("Set user properties")
|
|
543
558
|
|
|
544
|
-
def get_parser(self, prog_name):
|
|
559
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
545
560
|
parser = super().get_parser(prog_name)
|
|
546
561
|
parser.add_argument(
|
|
547
562
|
'user',
|
|
@@ -603,8 +618,10 @@ class SetUser(command.Command):
|
|
|
603
618
|
)
|
|
604
619
|
return parser
|
|
605
620
|
|
|
606
|
-
def take_action(self, parsed_args):
|
|
607
|
-
identity_client =
|
|
621
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
622
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
623
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
624
|
+
)
|
|
608
625
|
|
|
609
626
|
if parsed_args.password_prompt:
|
|
610
627
|
parsed_args.password = utils.get_password(self.app.stdin)
|
|
@@ -676,7 +693,7 @@ class SetPasswordUser(command.Command):
|
|
|
676
693
|
|
|
677
694
|
required_scope = False
|
|
678
695
|
|
|
679
|
-
def get_parser(self, prog_name):
|
|
696
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
680
697
|
parser = super().get_parser(prog_name)
|
|
681
698
|
parser.add_argument(
|
|
682
699
|
'--password',
|
|
@@ -690,15 +707,17 @@ class SetPasswordUser(command.Command):
|
|
|
690
707
|
)
|
|
691
708
|
return parser
|
|
692
709
|
|
|
693
|
-
def take_action(self, parsed_args):
|
|
694
|
-
identity_client =
|
|
710
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
711
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
712
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
713
|
+
)
|
|
695
714
|
conn = self.app.client_manager.sdk_connection
|
|
696
715
|
auth = conn.config.get_auth()
|
|
697
716
|
if auth is None:
|
|
698
717
|
# this will never happen
|
|
699
718
|
raise exceptions.CommandError('invalid authentication info')
|
|
700
719
|
|
|
701
|
-
user_id = auth.get_user_id(conn.
|
|
720
|
+
user_id = auth.get_user_id(conn.session)
|
|
702
721
|
|
|
703
722
|
# FIXME(gyee): there are two scenarios:
|
|
704
723
|
#
|
|
@@ -740,7 +759,7 @@ class SetPasswordUser(command.Command):
|
|
|
740
759
|
)
|
|
741
760
|
)
|
|
742
761
|
|
|
743
|
-
identity_client.
|
|
762
|
+
identity_client.update_password(
|
|
744
763
|
user=user_id,
|
|
745
764
|
current_password=current_password,
|
|
746
765
|
password=password,
|
|
@@ -750,7 +769,7 @@ class SetPasswordUser(command.Command):
|
|
|
750
769
|
class ShowUser(command.ShowOne):
|
|
751
770
|
_description = _("Display user details")
|
|
752
771
|
|
|
753
|
-
def get_parser(self, prog_name):
|
|
772
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
754
773
|
parser = super().get_parser(prog_name)
|
|
755
774
|
parser.add_argument(
|
|
756
775
|
'user',
|
|
@@ -764,8 +783,12 @@ class ShowUser(command.ShowOne):
|
|
|
764
783
|
)
|
|
765
784
|
return parser
|
|
766
785
|
|
|
767
|
-
def take_action(
|
|
768
|
-
|
|
786
|
+
def take_action(
|
|
787
|
+
self, parsed_args: argparse.Namespace
|
|
788
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
789
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
790
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
791
|
+
)
|
|
769
792
|
|
|
770
793
|
user_str = common._get_token_resource(
|
|
771
794
|
identity_client, 'user', parsed_args.user, parsed_args.domain
|
openstackclient/image/client.py
CHANGED
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
15
16
|
import logging
|
|
17
|
+
from typing import Any
|
|
16
18
|
|
|
17
19
|
from osc_lib import utils
|
|
18
20
|
|
|
@@ -27,7 +29,7 @@ API_NAME = 'image'
|
|
|
27
29
|
API_VERSIONS = ('1', '2')
|
|
28
30
|
|
|
29
31
|
|
|
30
|
-
def make_client(instance):
|
|
32
|
+
def make_client(instance: Any) -> Any:
|
|
31
33
|
"""Returns an image service client."""
|
|
32
34
|
LOG.debug(
|
|
33
35
|
'Image client initialized using OpenStack SDK: %s',
|
|
@@ -36,7 +38,9 @@ def make_client(instance):
|
|
|
36
38
|
return instance.sdk_connection.image
|
|
37
39
|
|
|
38
40
|
|
|
39
|
-
def build_option_parser(
|
|
41
|
+
def build_option_parser(
|
|
42
|
+
parser: argparse.ArgumentParser,
|
|
43
|
+
) -> argparse.ArgumentParser:
|
|
40
44
|
"""Hook to add global options"""
|
|
41
45
|
parser.add_argument(
|
|
42
46
|
'--os-image-api-version',
|
|
@@ -48,6 +52,6 @@ def build_option_parser(parser):
|
|
|
48
52
|
return parser
|
|
49
53
|
|
|
50
54
|
|
|
51
|
-
def check_api_version(check_version):
|
|
55
|
+
def check_api_version(check_version: str) -> bool:
|
|
52
56
|
# SDK supports auto-negotiation for us: always return True
|
|
53
57
|
return True
|