python-openstackclient 9.0.0__py3-none-any.whl → 10.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openstackclient/__init__.py +2 -6
- openstackclient/api/api.py +41 -23
- openstackclient/api/compute_v2.py +44 -25
- openstackclient/api/object_store_v1.py +75 -97
- openstackclient/api/volume_v2.py +2 -1
- openstackclient/api/volume_v3.py +2 -1
- openstackclient/common/availability_zone.py +59 -43
- openstackclient/common/clientmanager.py +56 -29
- openstackclient/common/configuration.py +10 -3
- openstackclient/common/envvars.py +2 -2
- openstackclient/common/extension.py +14 -5
- openstackclient/common/limits.py +10 -5
- openstackclient/common/module.py +36 -34
- openstackclient/common/pagination.py +50 -6
- openstackclient/common/progressbar.py +7 -6
- openstackclient/common/project_cleanup.py +11 -6
- openstackclient/common/quota.py +105 -103
- openstackclient/common/versions.py +8 -2
- openstackclient/compute/client.py +7 -3
- openstackclient/compute/v2/agent.py +17 -10
- openstackclient/compute/v2/aggregate.py +36 -22
- openstackclient/compute/v2/console.py +14 -8
- openstackclient/compute/v2/console_connection.py +11 -3
- openstackclient/compute/v2/flavor.py +42 -22
- openstackclient/compute/v2/host.py +14 -6
- openstackclient/compute/v2/hypervisor.py +16 -5
- openstackclient/compute/v2/hypervisor_stats.py +10 -2
- openstackclient/compute/v2/keypair.py +35 -16
- openstackclient/compute/v2/server.py +268 -179
- openstackclient/compute/v2/server_backup.py +10 -4
- openstackclient/compute/v2/server_event.py +28 -12
- openstackclient/compute/v2/server_group.py +23 -11
- openstackclient/compute/v2/server_image.py +19 -10
- openstackclient/compute/v2/server_migration.py +27 -10
- openstackclient/compute/v2/server_share.py +274 -0
- openstackclient/compute/v2/server_volume.py +13 -5
- openstackclient/compute/v2/service.py +17 -8
- openstackclient/compute/v2/usage.py +28 -23
- openstackclient/identity/client.py +8 -3
- openstackclient/identity/common.py +82 -47
- openstackclient/identity/v2_0/catalog.py +14 -7
- openstackclient/identity/v2_0/ec2creds.py +21 -10
- openstackclient/identity/v2_0/endpoint.py +23 -11
- openstackclient/identity/v2_0/project.py +25 -14
- openstackclient/identity/v2_0/role.py +28 -14
- openstackclient/identity/v2_0/role_assignment.py +9 -3
- openstackclient/identity/v2_0/service.py +23 -11
- openstackclient/identity/v2_0/token.py +12 -5
- openstackclient/identity/v2_0/user.py +26 -15
- openstackclient/identity/v3/access_rule.py +32 -12
- openstackclient/identity/v3/application_credential.py +66 -24
- openstackclient/identity/v3/catalog.py +14 -7
- openstackclient/identity/v3/consumer.py +22 -11
- openstackclient/identity/v3/credential.py +39 -17
- openstackclient/identity/v3/domain.py +40 -19
- openstackclient/identity/v3/ec2creds.py +25 -12
- openstackclient/identity/v3/endpoint.py +98 -64
- openstackclient/identity/v3/endpoint_group.py +28 -17
- openstackclient/identity/v3/federation_protocol.py +44 -20
- openstackclient/identity/v3/group.py +64 -40
- openstackclient/identity/v3/identity_provider.py +95 -57
- openstackclient/identity/v3/implied_role.py +21 -9
- openstackclient/identity/v3/limit.py +42 -17
- openstackclient/identity/v3/mapping.py +58 -28
- openstackclient/identity/v3/policy.py +23 -12
- openstackclient/identity/v3/project.py +59 -26
- openstackclient/identity/v3/region.py +39 -17
- openstackclient/identity/v3/registered_limit.py +41 -16
- openstackclient/identity/v3/role.py +62 -31
- openstackclient/identity/v3/role_assignment.py +25 -7
- openstackclient/identity/v3/service.py +39 -17
- openstackclient/identity/v3/service_provider.py +40 -16
- openstackclient/identity/v3/tag.py +23 -6
- openstackclient/identity/v3/token.py +30 -14
- openstackclient/identity/v3/trust.py +39 -18
- openstackclient/identity/v3/unscoped_saml.py +10 -2
- openstackclient/identity/v3/user.py +86 -36
- openstackclient/image/client.py +7 -3
- openstackclient/image/v1/image.py +33 -26
- openstackclient/image/v2/cache.py +16 -11
- openstackclient/image/v2/image.py +88 -56
- openstackclient/image/v2/info.py +7 -1
- openstackclient/image/v2/metadef_namespaces.py +117 -20
- openstackclient/image/v2/metadef_objects.py +32 -19
- openstackclient/image/v2/metadef_properties.py +30 -16
- openstackclient/image/v2/metadef_resource_type_association.py +14 -7
- openstackclient/image/v2/metadef_resource_types.py +7 -1
- openstackclient/image/v2/task.py +25 -27
- openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
- openstackclient/network/client.py +7 -2
- openstackclient/network/common.py +16 -241
- openstackclient/network/utils.py +27 -54
- openstackclient/network/v2/address_group.py +39 -16
- openstackclient/network/v2/address_scope.py +36 -20
- openstackclient/network/v2/bgpvpn/bgpvpn.py +477 -0
- openstackclient/network/v2/bgpvpn/constants.py +30 -0
- openstackclient/network/v2/bgpvpn/network_association.py +226 -0
- openstackclient/network/v2/bgpvpn/port_association.py +504 -0
- openstackclient/network/v2/bgpvpn/router_association.py +301 -0
- openstackclient/network/v2/default_security_group_rule.py +31 -14
- openstackclient/network/v2/floating_ip.py +121 -162
- openstackclient/network/v2/floating_ip_port_forwarding.py +41 -19
- openstackclient/network/v2/fwaas/__init__.py +0 -0
- openstackclient/network/v2/fwaas/group.py +499 -0
- openstackclient/network/v2/fwaas/policy.py +518 -0
- openstackclient/network/v2/fwaas/rule.py +610 -0
- openstackclient/network/v2/ip_availability.py +25 -8
- openstackclient/network/v2/l3_conntrack_helper.py +35 -13
- openstackclient/network/v2/local_ip.py +27 -13
- openstackclient/network/v2/local_ip_association.py +17 -7
- openstackclient/network/v2/ndp_proxy.py +23 -11
- openstackclient/network/v2/network.py +213 -213
- openstackclient/network/v2/network_agent.py +77 -34
- openstackclient/network/v2/network_auto_allocated_topology.py +27 -15
- openstackclient/network/v2/network_flavor.py +45 -21
- openstackclient/network/v2/network_flavor_profile.py +42 -17
- openstackclient/network/v2/network_meter.py +39 -15
- openstackclient/network/v2/network_meter_rule.py +40 -12
- openstackclient/network/v2/network_qos_policy.py +39 -21
- openstackclient/network/v2/network_qos_rule.py +48 -18
- openstackclient/network/v2/network_qos_rule_type.py +28 -9
- openstackclient/network/v2/network_rbac.py +34 -16
- openstackclient/network/v2/network_segment.py +32 -11
- openstackclient/network/v2/network_segment_range.py +70 -31
- openstackclient/network/v2/network_service_provider.py +7 -1
- openstackclient/network/v2/network_trunk.py +41 -22
- openstackclient/network/v2/port.py +141 -40
- openstackclient/network/v2/router.py +101 -67
- openstackclient/network/v2/security_group.py +97 -198
- openstackclient/network/v2/security_group_rule.py +115 -282
- openstackclient/network/v2/subnet.py +63 -34
- openstackclient/network/v2/subnet_pool.py +42 -24
- openstackclient/network/v2/taas/tap_flow.py +35 -14
- openstackclient/network/v2/taas/tap_mirror.py +28 -14
- openstackclient/network/v2/taas/tap_service.py +26 -12
- openstackclient/object/client.py +7 -2
- openstackclient/object/v1/account.py +13 -6
- openstackclient/object/v1/container.py +28 -16
- openstackclient/object/v1/object.py +28 -16
- openstackclient/py.typed +0 -0
- openstackclient/shell.py +46 -10
- openstackclient/tests/functional/base.py +55 -20
- openstackclient/tests/functional/common/test_extension.py +4 -0
- openstackclient/tests/functional/common/test_quota.py +3 -1
- openstackclient/tests/functional/compute/v2/common.py +14 -13
- openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
- openstackclient/tests/functional/compute/v2/test_server.py +3 -0
- openstackclient/tests/functional/identity/v2/common.py +10 -6
- openstackclient/tests/functional/identity/v2/test_role.py +4 -4
- openstackclient/tests/functional/identity/v3/common.py +59 -19
- openstackclient/tests/functional/identity/v3/test_application_credential.py +1 -1
- openstackclient/tests/functional/identity/v3/test_group.py +20 -20
- openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
- openstackclient/tests/functional/identity/v3/test_mapping.py +81 -0
- openstackclient/tests/functional/identity/v3/test_project.py +10 -10
- openstackclient/tests/functional/identity/v3/test_role.py +18 -18
- openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
- openstackclient/tests/functional/identity/v3/test_user.py +8 -8
- openstackclient/tests/functional/image/base.py +1 -6
- openstackclient/tests/functional/network/v2/common.py +5 -2
- openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
- openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
- openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
- openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
- openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
- openstackclient/tests/functional/object/v1/common.py +4 -0
- openstackclient/tests/functional/volume/v2/common.py +4 -0
- openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
- openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
- openstackclient/tests/functional/volume/v3/common.py +4 -0
- openstackclient/tests/functional/volume/v3/test_volume_group.py +163 -0
- openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +11 -7
- openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
- openstackclient/tests/unit/common/test_availability_zone.py +35 -49
- openstackclient/tests/unit/common/test_extension.py +2 -2
- openstackclient/tests/unit/common/test_limits.py +1 -1
- openstackclient/tests/unit/common/test_module.py +82 -44
- openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
- openstackclient/tests/unit/common/test_quota.py +15 -26
- openstackclient/tests/unit/compute/v2/fakes.py +26 -57
- openstackclient/tests/unit/compute/v2/test_agent.py +4 -4
- openstackclient/tests/unit/compute/v2/test_aggregate.py +1 -1
- openstackclient/tests/unit/compute/v2/test_console.py +2 -2
- openstackclient/tests/unit/compute/v2/test_console_connection.py +1 -1
- openstackclient/tests/unit/compute/v2/test_flavor.py +29 -3
- openstackclient/tests/unit/compute/v2/test_host.py +3 -3
- openstackclient/tests/unit/compute/v2/test_hypervisor.py +2 -2
- openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +1 -1
- openstackclient/tests/unit/compute/v2/test_keypair.py +7 -7
- openstackclient/tests/unit/compute/v2/test_server.py +26 -111
- openstackclient/tests/unit/compute/v2/test_server_backup.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_event.py +2 -2
- openstackclient/tests/unit/compute/v2/test_server_group.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_image.py +1 -1
- openstackclient/tests/unit/compute/v2/test_server_migration.py +4 -4
- openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
- openstackclient/tests/unit/compute/v2/test_server_volume.py +2 -2
- openstackclient/tests/unit/compute/v2/test_service.py +3 -3
- openstackclient/tests/unit/compute/v2/test_usage.py +1 -1
- openstackclient/tests/unit/identity/v2_0/fakes.py +3 -7
- openstackclient/tests/unit/identity/v2_0/test_endpoint.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_project.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_service.py +1 -1
- openstackclient/tests/unit/identity/v2_0/test_token.py +2 -2
- openstackclient/tests/unit/identity/v2_0/test_user.py +1 -1
- openstackclient/tests/unit/identity/v3/fakes.py +8 -38
- openstackclient/tests/unit/identity/v3/test_access_rule.py +3 -3
- openstackclient/tests/unit/identity/v3/test_application_credential.py +4 -4
- openstackclient/tests/unit/identity/v3/test_credential.py +5 -5
- openstackclient/tests/unit/identity/v3/test_domain.py +5 -5
- openstackclient/tests/unit/identity/v3/test_endpoint.py +6 -6
- openstackclient/tests/unit/identity/v3/test_endpoint_group.py +1 -1
- openstackclient/tests/unit/identity/v3/test_group.py +12 -22
- openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
- openstackclient/tests/unit/identity/v3/test_implied_role.py +1 -1
- openstackclient/tests/unit/identity/v3/test_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_mappings.py +163 -79
- openstackclient/tests/unit/identity/v3/test_project.py +28 -5
- openstackclient/tests/unit/identity/v3/test_protocol.py +3 -3
- openstackclient/tests/unit/identity/v3/test_region.py +5 -5
- openstackclient/tests/unit/identity/v3/test_registered_limit.py +5 -5
- openstackclient/tests/unit/identity/v3/test_role.py +8 -8
- openstackclient/tests/unit/identity/v3/test_role_assignment.py +1 -1
- openstackclient/tests/unit/identity/v3/test_service.py +5 -5
- openstackclient/tests/unit/identity/v3/test_token.py +2 -2
- openstackclient/tests/unit/identity/v3/test_trust.py +4 -4
- openstackclient/tests/unit/identity/v3/test_user.py +77 -10
- openstackclient/tests/unit/image/v2/test_image.py +11 -11
- openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
- openstackclient/tests/unit/network/test_common.py +0 -155
- openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
- openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
- openstackclient/tests/unit/network/v2/fakes.py +5 -77
- openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
- openstackclient/tests/unit/network/v2/fwaas/test_group.py +923 -0
- openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
- openstackclient/tests/unit/network/v2/fwaas/test_rule.py +1005 -0
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
- openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
- openstackclient/tests/unit/network/v2/test_address_group.py +26 -2
- openstackclient/tests/unit/network/v2/test_address_scope.py +24 -0
- openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +27 -2
- openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +37 -13
- openstackclient/tests/unit/network/v2/test_ip_availability.py +25 -0
- openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +29 -3
- openstackclient/tests/unit/network/v2/test_network.py +74 -12
- openstackclient/tests/unit/network/v2/test_network_agent.py +58 -5
- openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
- openstackclient/tests/unit/network/v2/test_network_flavor.py +26 -2
- openstackclient/tests/unit/network/v2/test_network_flavor_profile.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_meter.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_qos_policy.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
- openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +24 -0
- openstackclient/tests/unit/network/v2/test_network_rbac.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment.py +25 -1
- openstackclient/tests/unit/network/v2/test_network_segment_range.py +31 -10
- openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
- openstackclient/tests/unit/network/v2/test_port.py +166 -0
- openstackclient/tests/unit/network/v2/test_router.py +36 -16
- openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +11 -8
- openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +28 -37
- openstackclient/tests/unit/network/v2/test_subnet.py +30 -5
- openstackclient/tests/unit/network/v2/test_subnet_pool.py +26 -1
- openstackclient/tests/unit/object/v1/fakes.py +8 -7
- openstackclient/tests/unit/object/v1/test_container.py +65 -101
- openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
- openstackclient/tests/unit/object/v1/test_object.py +44 -84
- openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
- openstackclient/tests/unit/test_hacking.py +108 -0
- openstackclient/tests/unit/volume/v2/fakes.py +21 -140
- openstackclient/tests/unit/volume/v2/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +8 -1
- openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
- openstackclient/tests/unit/volume/v3/fakes.py +205 -100
- openstackclient/tests/unit/volume/v3/test_backup_record.py +114 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group.py +720 -0
- openstackclient/tests/unit/volume/v3/test_consistency_group_snapshot.py +354 -0
- openstackclient/tests/unit/volume/v3/test_qos_specs.py +455 -0
- openstackclient/tests/unit/volume/v3/test_volume.py +60 -3
- openstackclient/tests/unit/volume/v3/test_volume_attachment.py +3 -1
- openstackclient/tests/unit/volume/v3/test_volume_backend.py +158 -0
- openstackclient/tests/unit/volume/v3/test_volume_backup.py +6 -14
- openstackclient/tests/unit/volume/v3/test_volume_group_type.py +65 -0
- openstackclient/tests/unit/volume/v3/test_volume_host.py +115 -0
- openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +61 -1
- openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
- openstackclient/volume/client.py +7 -3
- openstackclient/volume/v2/backup_record.py +15 -6
- openstackclient/volume/v2/consistency_group.py +29 -17
- openstackclient/volume/v2/consistency_group_snapshot.py +25 -10
- openstackclient/volume/v2/qos_specs.py +28 -17
- openstackclient/volume/v2/service.py +17 -6
- openstackclient/volume/v2/volume.py +60 -30
- openstackclient/volume/v2/volume_backend.py +19 -6
- openstackclient/volume/v2/volume_backup.py +48 -23
- openstackclient/volume/v2/volume_host.py +6 -4
- openstackclient/volume/v2/volume_snapshot.py +49 -24
- openstackclient/volume/v2/volume_transfer_request.py +31 -13
- openstackclient/volume/v2/volume_type.py +43 -24
- openstackclient/volume/v3/backup_record.py +94 -0
- openstackclient/volume/v3/block_storage_cleanup.py +11 -3
- openstackclient/volume/v3/block_storage_cluster.py +19 -7
- openstackclient/volume/v3/block_storage_log_level.py +15 -6
- openstackclient/volume/v3/block_storage_manage.py +10 -4
- openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
- openstackclient/volume/v3/consistency_group.py +400 -0
- openstackclient/volume/v3/consistency_group_snapshot.py +225 -0
- openstackclient/volume/v3/qos_specs.py +389 -0
- openstackclient/volume/v3/service.py +16 -6
- openstackclient/volume/v3/volume.py +92 -40
- openstackclient/volume/v3/volume_attachment.py +47 -21
- openstackclient/volume/v3/volume_backend.py +130 -0
- openstackclient/volume/v3/volume_backup.py +55 -27
- openstackclient/volume/v3/volume_group.py +23 -13
- openstackclient/volume/v3/volume_group_snapshot.py +34 -17
- openstackclient/volume/v3/volume_group_type.py +27 -14
- openstackclient/volume/v3/volume_host.py +74 -0
- openstackclient/volume/v3/volume_message.py +18 -8
- openstackclient/volume/v3/volume_snapshot.py +70 -32
- openstackclient/volume/v3/volume_transfer_request.py +31 -13
- openstackclient/volume/v3/volume_type.py +42 -24
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/METADATA +7 -8
- python_openstackclient-10.1.0.dist-info/RECORD +524 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/WHEEL +1 -1
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/entry_points.txt +77 -25
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/AUTHORS +9 -0
- python_openstackclient-10.1.0.dist-info/pbr.json +1 -0
- openstackclient/api/image_v1.py +0 -69
- openstackclient/api/image_v2.py +0 -79
- openstackclient/network/v2/floating_ip_pool.py +0 -38
- openstackclient/tests/functional/image/v1/test_image.py +0 -97
- openstackclient/tests/unit/api/test_image_v1.py +0 -96
- openstackclient/tests/unit/api/test_image_v2.py +0 -96
- openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
- openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
- openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
- openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
- openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
- python_openstackclient-9.0.0.dist-info/RECORD +0 -499
- python_openstackclient-9.0.0.dist-info/pbr.json +0 -1
- /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_openstackclient-9.0.0.dist-info → python_openstackclient-10.1.0.dist-info}/top_level.txt +0 -0
|
@@ -13,8 +13,11 @@
|
|
|
13
13
|
|
|
14
14
|
"""Identity v3 Endpoint Group action implementations"""
|
|
15
15
|
|
|
16
|
+
import argparse
|
|
17
|
+
from collections.abc import Iterable, Sequence
|
|
16
18
|
import json
|
|
17
19
|
import logging
|
|
20
|
+
from typing import Any
|
|
18
21
|
|
|
19
22
|
from osc_lib import exceptions
|
|
20
23
|
from osc_lib import utils
|
|
@@ -30,7 +33,7 @@ LOG = logging.getLogger(__name__)
|
|
|
30
33
|
class _FiltersReader:
|
|
31
34
|
_description = _("Helper class capable of reading filters from files")
|
|
32
35
|
|
|
33
|
-
def _read_filters(self, path):
|
|
36
|
+
def _read_filters(self, path: str) -> Any:
|
|
34
37
|
"""Read and parse rules from path
|
|
35
38
|
|
|
36
39
|
Expect the file to contain a valid JSON structure.
|
|
@@ -62,7 +65,7 @@ class _FiltersReader:
|
|
|
62
65
|
class AddProjectToEndpointGroup(command.Command):
|
|
63
66
|
_description = _("Add a project to an endpoint group")
|
|
64
67
|
|
|
65
|
-
def get_parser(self, prog_name):
|
|
68
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
66
69
|
parser = super().get_parser(prog_name)
|
|
67
70
|
parser.add_argument(
|
|
68
71
|
'endpointgroup',
|
|
@@ -77,7 +80,7 @@ class AddProjectToEndpointGroup(command.Command):
|
|
|
77
80
|
common.add_project_domain_option_to_parser(parser)
|
|
78
81
|
return parser
|
|
79
82
|
|
|
80
|
-
def take_action(self, parsed_args):
|
|
83
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
81
84
|
client = self.app.client_manager.identity
|
|
82
85
|
|
|
83
86
|
endpointgroup = utils.find_resource(
|
|
@@ -96,7 +99,7 @@ class AddProjectToEndpointGroup(command.Command):
|
|
|
96
99
|
class CreateEndpointGroup(command.ShowOne, _FiltersReader):
|
|
97
100
|
_description = _("Create new endpoint group")
|
|
98
101
|
|
|
99
|
-
def get_parser(self, prog_name):
|
|
102
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
100
103
|
parser = super().get_parser(prog_name)
|
|
101
104
|
parser.add_argument(
|
|
102
105
|
'name',
|
|
@@ -114,7 +117,9 @@ class CreateEndpointGroup(command.ShowOne, _FiltersReader):
|
|
|
114
117
|
)
|
|
115
118
|
return parser
|
|
116
119
|
|
|
117
|
-
def take_action(
|
|
120
|
+
def take_action(
|
|
121
|
+
self, parsed_args: argparse.Namespace
|
|
122
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
118
123
|
identity_client = self.app.client_manager.identity
|
|
119
124
|
|
|
120
125
|
filters = None
|
|
@@ -130,13 +135,14 @@ class CreateEndpointGroup(command.ShowOne, _FiltersReader):
|
|
|
130
135
|
info = {}
|
|
131
136
|
endpoint_group._info.pop('links')
|
|
132
137
|
info.update(endpoint_group._info)
|
|
133
|
-
|
|
138
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
139
|
+
return col_headers, col_data
|
|
134
140
|
|
|
135
141
|
|
|
136
142
|
class DeleteEndpointGroup(command.Command):
|
|
137
143
|
_description = _("Delete endpoint group(s)")
|
|
138
144
|
|
|
139
|
-
def get_parser(self, prog_name):
|
|
145
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
140
146
|
parser = super().get_parser(prog_name)
|
|
141
147
|
parser.add_argument(
|
|
142
148
|
'endpointgroup',
|
|
@@ -146,7 +152,7 @@ class DeleteEndpointGroup(command.Command):
|
|
|
146
152
|
)
|
|
147
153
|
return parser
|
|
148
154
|
|
|
149
|
-
def take_action(self, parsed_args):
|
|
155
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
150
156
|
identity_client = self.app.client_manager.identity
|
|
151
157
|
result = 0
|
|
152
158
|
for i in parsed_args.endpointgroup:
|
|
@@ -176,7 +182,7 @@ class DeleteEndpointGroup(command.Command):
|
|
|
176
182
|
class ListEndpointGroup(command.Lister):
|
|
177
183
|
_description = _("List endpoint groups")
|
|
178
184
|
|
|
179
|
-
def get_parser(self, prog_name):
|
|
185
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
180
186
|
parser = super().get_parser(prog_name)
|
|
181
187
|
list_group = parser.add_mutually_exclusive_group()
|
|
182
188
|
list_group.add_argument(
|
|
@@ -196,7 +202,9 @@ class ListEndpointGroup(command.Lister):
|
|
|
196
202
|
)
|
|
197
203
|
return parser
|
|
198
204
|
|
|
199
|
-
def take_action(
|
|
205
|
+
def take_action(
|
|
206
|
+
self, parsed_args: argparse.Namespace
|
|
207
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
200
208
|
client = self.app.client_manager.identity
|
|
201
209
|
|
|
202
210
|
endpointgroup = None
|
|
@@ -241,7 +249,7 @@ class ListEndpointGroup(command.Lister):
|
|
|
241
249
|
class RemoveProjectFromEndpointGroup(command.Command):
|
|
242
250
|
_description = _("Remove project from endpoint group")
|
|
243
251
|
|
|
244
|
-
def get_parser(self, prog_name):
|
|
252
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
245
253
|
parser = super().get_parser(prog_name)
|
|
246
254
|
parser.add_argument(
|
|
247
255
|
'endpointgroup',
|
|
@@ -256,7 +264,7 @@ class RemoveProjectFromEndpointGroup(command.Command):
|
|
|
256
264
|
common.add_project_domain_option_to_parser(parser)
|
|
257
265
|
return parser
|
|
258
266
|
|
|
259
|
-
def take_action(self, parsed_args):
|
|
267
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
260
268
|
client = self.app.client_manager.identity
|
|
261
269
|
|
|
262
270
|
endpointgroup = utils.find_resource(
|
|
@@ -275,7 +283,7 @@ class RemoveProjectFromEndpointGroup(command.Command):
|
|
|
275
283
|
class SetEndpointGroup(command.Command, _FiltersReader):
|
|
276
284
|
_description = _("Set endpoint group properties")
|
|
277
285
|
|
|
278
|
-
def get_parser(self, prog_name):
|
|
286
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
279
287
|
parser = super().get_parser(prog_name)
|
|
280
288
|
parser.add_argument(
|
|
281
289
|
'endpointgroup',
|
|
@@ -300,7 +308,7 @@ class SetEndpointGroup(command.Command, _FiltersReader):
|
|
|
300
308
|
)
|
|
301
309
|
return parser
|
|
302
310
|
|
|
303
|
-
def take_action(self, parsed_args):
|
|
311
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
304
312
|
identity_client = self.app.client_manager.identity
|
|
305
313
|
endpointgroup = utils.find_resource(
|
|
306
314
|
identity_client.endpoint_groups, parsed_args.endpointgroup
|
|
@@ -321,7 +329,7 @@ class SetEndpointGroup(command.Command, _FiltersReader):
|
|
|
321
329
|
class ShowEndpointGroup(command.ShowOne):
|
|
322
330
|
_description = _("Display endpoint group details")
|
|
323
331
|
|
|
324
|
-
def get_parser(self, prog_name):
|
|
332
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
325
333
|
parser = super().get_parser(prog_name)
|
|
326
334
|
parser.add_argument(
|
|
327
335
|
'endpointgroup',
|
|
@@ -330,7 +338,9 @@ class ShowEndpointGroup(command.ShowOne):
|
|
|
330
338
|
)
|
|
331
339
|
return parser
|
|
332
340
|
|
|
333
|
-
def take_action(
|
|
341
|
+
def take_action(
|
|
342
|
+
self, parsed_args: argparse.Namespace
|
|
343
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
334
344
|
identity_client = self.app.client_manager.identity
|
|
335
345
|
endpoint_group = utils.find_resource(
|
|
336
346
|
identity_client.endpoint_groups, parsed_args.endpointgroup
|
|
@@ -339,4 +349,5 @@ class ShowEndpointGroup(command.ShowOne):
|
|
|
339
349
|
info = {}
|
|
340
350
|
endpoint_group._info.pop('links')
|
|
341
351
|
info.update(endpoint_group._info)
|
|
342
|
-
|
|
352
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
353
|
+
return col_headers, col_data
|
|
@@ -14,19 +14,25 @@
|
|
|
14
14
|
|
|
15
15
|
"""Identity v3 Protocols actions implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
17
19
|
import logging
|
|
20
|
+
from typing import Any
|
|
18
21
|
|
|
22
|
+
from openstack.identity.v3 import federation_protocol as _federation_protocol
|
|
23
|
+
from openstack import utils as sdk_utils
|
|
19
24
|
from osc_lib import exceptions
|
|
20
25
|
from osc_lib import utils
|
|
21
26
|
|
|
22
27
|
from openstackclient import command
|
|
23
28
|
from openstackclient.i18n import _
|
|
24
29
|
|
|
25
|
-
|
|
26
30
|
LOG = logging.getLogger(__name__)
|
|
27
31
|
|
|
28
32
|
|
|
29
|
-
def _format_protocol(
|
|
33
|
+
def _format_protocol(
|
|
34
|
+
protocol: _federation_protocol.FederationProtocol,
|
|
35
|
+
) -> tuple[tuple[str, ...], tuple[Any, ...]]:
|
|
30
36
|
columns = ('name', 'idp_id', 'mapping_id')
|
|
31
37
|
column_headers = ('id', 'identity_provider', 'mapping')
|
|
32
38
|
return (
|
|
@@ -38,7 +44,7 @@ def _format_protocol(protocol):
|
|
|
38
44
|
class CreateProtocol(command.ShowOne):
|
|
39
45
|
_description = _("Create new federation protocol")
|
|
40
46
|
|
|
41
|
-
def get_parser(self, prog_name):
|
|
47
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
42
48
|
parser = super().get_parser(prog_name)
|
|
43
49
|
parser.add_argument(
|
|
44
50
|
'federation_protocol',
|
|
@@ -66,12 +72,16 @@ class CreateProtocol(command.ShowOne):
|
|
|
66
72
|
|
|
67
73
|
return parser
|
|
68
74
|
|
|
69
|
-
def take_action(
|
|
70
|
-
|
|
75
|
+
def take_action(
|
|
76
|
+
self, parsed_args: argparse.Namespace
|
|
77
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
78
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
79
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
80
|
+
)
|
|
71
81
|
|
|
72
82
|
protocol = identity_client.create_federation_protocol(
|
|
73
83
|
name=parsed_args.federation_protocol,
|
|
74
|
-
|
|
84
|
+
idp=parsed_args.identity_provider,
|
|
75
85
|
mapping_id=parsed_args.mapping,
|
|
76
86
|
)
|
|
77
87
|
|
|
@@ -81,7 +91,7 @@ class CreateProtocol(command.ShowOne):
|
|
|
81
91
|
class DeleteProtocol(command.Command):
|
|
82
92
|
_description = _("Delete federation protocol(s)")
|
|
83
93
|
|
|
84
|
-
def get_parser(self, prog_name):
|
|
94
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
85
95
|
parser = super().get_parser(prog_name)
|
|
86
96
|
parser.add_argument(
|
|
87
97
|
'federation_protocol',
|
|
@@ -101,14 +111,16 @@ class DeleteProtocol(command.Command):
|
|
|
101
111
|
|
|
102
112
|
return parser
|
|
103
113
|
|
|
104
|
-
def take_action(self, parsed_args):
|
|
105
|
-
identity_client =
|
|
114
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
115
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
116
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
117
|
+
)
|
|
106
118
|
|
|
107
119
|
result = 0
|
|
108
120
|
for i in parsed_args.federation_protocol:
|
|
109
121
|
try:
|
|
110
122
|
identity_client.delete_federation_protocol(
|
|
111
|
-
|
|
123
|
+
idp=parsed_args.identity_provider,
|
|
112
124
|
protocol=i,
|
|
113
125
|
ignore_missing=False,
|
|
114
126
|
)
|
|
@@ -134,7 +146,7 @@ class DeleteProtocol(command.Command):
|
|
|
134
146
|
class ListProtocols(command.Lister):
|
|
135
147
|
_description = _("List federation protocols")
|
|
136
148
|
|
|
137
|
-
def get_parser(self, prog_name):
|
|
149
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
138
150
|
parser = super().get_parser(prog_name)
|
|
139
151
|
parser.add_argument(
|
|
140
152
|
'--identity-provider',
|
|
@@ -145,8 +157,12 @@ class ListProtocols(command.Lister):
|
|
|
145
157
|
|
|
146
158
|
return parser
|
|
147
159
|
|
|
148
|
-
def take_action(
|
|
149
|
-
|
|
160
|
+
def take_action(
|
|
161
|
+
self, parsed_args: argparse.Namespace
|
|
162
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
163
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
164
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
165
|
+
)
|
|
150
166
|
|
|
151
167
|
protocols = identity_client.federation_protocols(
|
|
152
168
|
parsed_args.identity_provider
|
|
@@ -163,7 +179,7 @@ class ListProtocols(command.Lister):
|
|
|
163
179
|
class SetProtocol(command.Command):
|
|
164
180
|
_description = _("Set federation protocol properties")
|
|
165
181
|
|
|
166
|
-
def get_parser(self, prog_name):
|
|
182
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
167
183
|
parser = super().get_parser(prog_name)
|
|
168
184
|
parser.add_argument(
|
|
169
185
|
'federation_protocol',
|
|
@@ -186,8 +202,12 @@ class SetProtocol(command.Command):
|
|
|
186
202
|
)
|
|
187
203
|
return parser
|
|
188
204
|
|
|
189
|
-
def take_action(
|
|
190
|
-
|
|
205
|
+
def take_action(
|
|
206
|
+
self, parsed_args: argparse.Namespace
|
|
207
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
208
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
209
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
210
|
+
)
|
|
191
211
|
|
|
192
212
|
kwargs = {'idp_id': parsed_args.identity_provider}
|
|
193
213
|
if parsed_args.federation_protocol:
|
|
@@ -202,7 +222,7 @@ class SetProtocol(command.Command):
|
|
|
202
222
|
class ShowProtocol(command.ShowOne):
|
|
203
223
|
_description = _("Display federation protocol details")
|
|
204
224
|
|
|
205
|
-
def get_parser(self, prog_name):
|
|
225
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
206
226
|
parser = super().get_parser(prog_name)
|
|
207
227
|
parser.add_argument(
|
|
208
228
|
'federation_protocol',
|
|
@@ -220,11 +240,15 @@ class ShowProtocol(command.ShowOne):
|
|
|
220
240
|
)
|
|
221
241
|
return parser
|
|
222
242
|
|
|
223
|
-
def take_action(
|
|
224
|
-
|
|
243
|
+
def take_action(
|
|
244
|
+
self, parsed_args: argparse.Namespace
|
|
245
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
246
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
247
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
248
|
+
)
|
|
225
249
|
|
|
226
250
|
protocol = identity_client.get_federation_protocol(
|
|
227
|
-
|
|
251
|
+
idp=parsed_args.identity_provider,
|
|
228
252
|
protocol=parsed_args.federation_protocol,
|
|
229
253
|
)
|
|
230
254
|
return _format_protocol(protocol)
|
|
@@ -15,9 +15,14 @@
|
|
|
15
15
|
|
|
16
16
|
"""Group 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 openstack import exceptions as sdk_exc
|
|
24
|
+
from openstack.identity.v3 import group as _group
|
|
25
|
+
from openstack import utils as sdk_utils
|
|
21
26
|
from osc_lib import exceptions
|
|
22
27
|
from osc_lib import utils
|
|
23
28
|
|
|
@@ -25,11 +30,12 @@ from openstackclient import command
|
|
|
25
30
|
from openstackclient.i18n import _
|
|
26
31
|
from openstackclient.identity import common
|
|
27
32
|
|
|
28
|
-
|
|
29
33
|
LOG = logging.getLogger(__name__)
|
|
30
34
|
|
|
31
35
|
|
|
32
|
-
def _format_group(
|
|
36
|
+
def _format_group(
|
|
37
|
+
group: _group.Group,
|
|
38
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
33
39
|
columns = (
|
|
34
40
|
'description',
|
|
35
41
|
'domain_id',
|
|
@@ -51,7 +57,7 @@ def _format_group(group):
|
|
|
51
57
|
class AddUserToGroup(command.Command):
|
|
52
58
|
_description = _("Add user to group")
|
|
53
59
|
|
|
54
|
-
def get_parser(self, prog_name):
|
|
60
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
55
61
|
parser = super().get_parser(prog_name)
|
|
56
62
|
parser.add_argument(
|
|
57
63
|
'group',
|
|
@@ -71,8 +77,10 @@ class AddUserToGroup(command.Command):
|
|
|
71
77
|
common.add_user_domain_option_to_parser(parser)
|
|
72
78
|
return parser
|
|
73
79
|
|
|
74
|
-
def take_action(self, parsed_args):
|
|
75
|
-
identity_client =
|
|
80
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
81
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
82
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
83
|
+
)
|
|
76
84
|
|
|
77
85
|
group_id = common.find_group_id_sdk(
|
|
78
86
|
identity_client, parsed_args.group, parsed_args.group_domain
|
|
@@ -111,7 +119,7 @@ class AddUserToGroup(command.Command):
|
|
|
111
119
|
class CheckUserInGroup(command.Command):
|
|
112
120
|
_description = _("Check user membership in group")
|
|
113
121
|
|
|
114
|
-
def get_parser(self, prog_name):
|
|
122
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
115
123
|
parser = super().get_parser(prog_name)
|
|
116
124
|
parser.add_argument(
|
|
117
125
|
'group',
|
|
@@ -127,8 +135,10 @@ class CheckUserInGroup(command.Command):
|
|
|
127
135
|
common.add_user_domain_option_to_parser(parser)
|
|
128
136
|
return parser
|
|
129
137
|
|
|
130
|
-
def take_action(self, parsed_args):
|
|
131
|
-
identity_client =
|
|
138
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
139
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
140
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
141
|
+
)
|
|
132
142
|
|
|
133
143
|
user_id = common.find_user_id_sdk(
|
|
134
144
|
identity_client,
|
|
@@ -168,7 +178,7 @@ class CheckUserInGroup(command.Command):
|
|
|
168
178
|
class CreateGroup(command.ShowOne):
|
|
169
179
|
_description = _("Create new group")
|
|
170
180
|
|
|
171
|
-
def get_parser(self, prog_name):
|
|
181
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
172
182
|
parser = super().get_parser(prog_name)
|
|
173
183
|
parser.add_argument(
|
|
174
184
|
'name',
|
|
@@ -192,8 +202,12 @@ class CreateGroup(command.ShowOne):
|
|
|
192
202
|
)
|
|
193
203
|
return parser
|
|
194
204
|
|
|
195
|
-
def take_action(
|
|
196
|
-
|
|
205
|
+
def take_action(
|
|
206
|
+
self, parsed_args: argparse.Namespace
|
|
207
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
208
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
209
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
210
|
+
)
|
|
197
211
|
|
|
198
212
|
kwargs = {}
|
|
199
213
|
if parsed_args.name:
|
|
@@ -230,7 +244,7 @@ class CreateGroup(command.ShowOne):
|
|
|
230
244
|
class DeleteGroup(command.Command):
|
|
231
245
|
_description = _("Delete group(s)")
|
|
232
246
|
|
|
233
|
-
def get_parser(self, prog_name):
|
|
247
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
234
248
|
parser = super().get_parser(prog_name)
|
|
235
249
|
parser.add_argument(
|
|
236
250
|
'groups',
|
|
@@ -245,8 +259,10 @@ class DeleteGroup(command.Command):
|
|
|
245
259
|
)
|
|
246
260
|
return parser
|
|
247
261
|
|
|
248
|
-
def take_action(self, parsed_args):
|
|
249
|
-
identity_client =
|
|
262
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
263
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
264
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
265
|
+
)
|
|
250
266
|
|
|
251
267
|
errors = 0
|
|
252
268
|
for group in parsed_args.groups:
|
|
@@ -277,7 +293,7 @@ class DeleteGroup(command.Command):
|
|
|
277
293
|
class ListGroup(command.Lister):
|
|
278
294
|
_description = _("List groups")
|
|
279
295
|
|
|
280
|
-
def get_parser(self, prog_name):
|
|
296
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
281
297
|
parser = super().get_parser(prog_name)
|
|
282
298
|
parser.add_argument(
|
|
283
299
|
'--domain',
|
|
@@ -298,8 +314,12 @@ class ListGroup(command.Lister):
|
|
|
298
314
|
)
|
|
299
315
|
return parser
|
|
300
316
|
|
|
301
|
-
def take_action(
|
|
302
|
-
|
|
317
|
+
def take_action(
|
|
318
|
+
self, parsed_args: argparse.Namespace
|
|
319
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
320
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
321
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
322
|
+
)
|
|
303
323
|
|
|
304
324
|
domain = None
|
|
305
325
|
if parsed_args.domain:
|
|
@@ -307,25 +327,21 @@ class ListGroup(command.Lister):
|
|
|
307
327
|
identity_client, parsed_args.domain
|
|
308
328
|
)
|
|
309
329
|
|
|
310
|
-
|
|
311
|
-
|
|
330
|
+
if not parsed_args.user:
|
|
331
|
+
if domain:
|
|
332
|
+
data = list(identity_client.groups(domain_id=domain))
|
|
333
|
+
else:
|
|
334
|
+
data = list(identity_client.groups())
|
|
335
|
+
else:
|
|
312
336
|
user = common.find_user_id_sdk(
|
|
313
337
|
identity_client,
|
|
314
338
|
parsed_args.user,
|
|
315
339
|
parsed_args.user_domain,
|
|
316
340
|
)
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
data = identity_client.user_groups(user, domain_id=domain)
|
|
322
|
-
else:
|
|
323
|
-
data = identity_client.user_groups(user)
|
|
324
|
-
else:
|
|
325
|
-
if domain:
|
|
326
|
-
data = identity_client.groups(domain_id=domain)
|
|
327
|
-
else:
|
|
328
|
-
data = identity_client.groups()
|
|
341
|
+
# NOTE(0weng): The API doesn't actually support filtering
|
|
342
|
+
# additionally by domain_id, so this doesn't really do
|
|
343
|
+
# anything.
|
|
344
|
+
data = list(identity_client.user_groups(user))
|
|
329
345
|
|
|
330
346
|
# List groups
|
|
331
347
|
columns: tuple[str, ...] = ('ID', 'Name')
|
|
@@ -348,7 +364,7 @@ class ListGroup(command.Lister):
|
|
|
348
364
|
class RemoveUserFromGroup(command.Command):
|
|
349
365
|
_description = _("Remove user from group")
|
|
350
366
|
|
|
351
|
-
def get_parser(self, prog_name):
|
|
367
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
352
368
|
parser = super().get_parser(prog_name)
|
|
353
369
|
parser.add_argument(
|
|
354
370
|
'group',
|
|
@@ -368,8 +384,10 @@ class RemoveUserFromGroup(command.Command):
|
|
|
368
384
|
common.add_user_domain_option_to_parser(parser)
|
|
369
385
|
return parser
|
|
370
386
|
|
|
371
|
-
def take_action(self, parsed_args):
|
|
372
|
-
identity_client =
|
|
387
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
388
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
389
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
390
|
+
)
|
|
373
391
|
|
|
374
392
|
group_id = common.find_group_id_sdk(
|
|
375
393
|
identity_client, parsed_args.group, parsed_args.group_domain
|
|
@@ -408,7 +426,7 @@ class RemoveUserFromGroup(command.Command):
|
|
|
408
426
|
class SetGroup(command.Command):
|
|
409
427
|
_description = _("Set group properties")
|
|
410
428
|
|
|
411
|
-
def get_parser(self, prog_name):
|
|
429
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
412
430
|
parser = super().get_parser(prog_name)
|
|
413
431
|
parser.add_argument(
|
|
414
432
|
'group',
|
|
@@ -432,8 +450,10 @@ class SetGroup(command.Command):
|
|
|
432
450
|
)
|
|
433
451
|
return parser
|
|
434
452
|
|
|
435
|
-
def take_action(self, parsed_args):
|
|
436
|
-
identity_client =
|
|
453
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
454
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
455
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
456
|
+
)
|
|
437
457
|
group = common.find_group_id_sdk(
|
|
438
458
|
identity_client, parsed_args.group, parsed_args.domain
|
|
439
459
|
)
|
|
@@ -449,7 +469,7 @@ class SetGroup(command.Command):
|
|
|
449
469
|
class ShowGroup(command.ShowOne):
|
|
450
470
|
_description = _("Display group details")
|
|
451
471
|
|
|
452
|
-
def get_parser(self, prog_name):
|
|
472
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
453
473
|
parser = super().get_parser(prog_name)
|
|
454
474
|
parser.add_argument(
|
|
455
475
|
'group',
|
|
@@ -463,8 +483,12 @@ class ShowGroup(command.ShowOne):
|
|
|
463
483
|
)
|
|
464
484
|
return parser
|
|
465
485
|
|
|
466
|
-
def take_action(
|
|
467
|
-
|
|
486
|
+
def take_action(
|
|
487
|
+
self, parsed_args: argparse.Namespace
|
|
488
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
489
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
490
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
491
|
+
)
|
|
468
492
|
|
|
469
493
|
if parsed_args.domain:
|
|
470
494
|
domain = common.find_domain_id_sdk(
|