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
|
@@ -15,8 +15,12 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v3 Access Rule 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
|
|
|
@@ -31,7 +35,7 @@ LOG = logging.getLogger(__name__)
|
|
|
31
35
|
class DeleteAccessRule(command.Command):
|
|
32
36
|
_description = _("Delete access rule(s)")
|
|
33
37
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
38
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
39
|
parser = super().get_parser(prog_name)
|
|
36
40
|
parser.add_argument(
|
|
37
41
|
'access_rule',
|
|
@@ -41,14 +45,19 @@ class DeleteAccessRule(command.Command):
|
|
|
41
45
|
)
|
|
42
46
|
return parser
|
|
43
47
|
|
|
44
|
-
def take_action(self, parsed_args):
|
|
45
|
-
identity_client =
|
|
48
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
49
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
50
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
51
|
+
)
|
|
46
52
|
conn = self.app.client_manager.sdk_connection
|
|
47
53
|
auth = conn.config.get_auth()
|
|
48
54
|
if auth is None:
|
|
49
55
|
# this will never happen
|
|
50
56
|
raise exceptions.CommandError('invalid authentication info')
|
|
51
|
-
user_id = auth.get_user_id(conn.
|
|
57
|
+
user_id = auth.get_user_id(conn.session)
|
|
58
|
+
if user_id is None:
|
|
59
|
+
# this will never happen
|
|
60
|
+
raise exceptions.CommandError('invalid authentication info')
|
|
52
61
|
|
|
53
62
|
errors = 0
|
|
54
63
|
for ac in parsed_args.access_rule:
|
|
@@ -73,7 +82,7 @@ class DeleteAccessRule(command.Command):
|
|
|
73
82
|
class ListAccessRule(command.Lister):
|
|
74
83
|
_description = _("List access rules")
|
|
75
84
|
|
|
76
|
-
def get_parser(self, prog_name):
|
|
85
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
77
86
|
parser = super().get_parser(prog_name)
|
|
78
87
|
parser.add_argument(
|
|
79
88
|
'--user',
|
|
@@ -83,8 +92,12 @@ class ListAccessRule(command.Lister):
|
|
|
83
92
|
common.add_user_domain_option_to_parser(parser)
|
|
84
93
|
return parser
|
|
85
94
|
|
|
86
|
-
def take_action(
|
|
87
|
-
|
|
95
|
+
def take_action(
|
|
96
|
+
self, parsed_args: argparse.Namespace
|
|
97
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
98
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
99
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
100
|
+
)
|
|
88
101
|
if parsed_args.user:
|
|
89
102
|
user_id = common.find_user(
|
|
90
103
|
identity_client, parsed_args.user, parsed_args.user_domain
|
|
@@ -95,7 +108,7 @@ class ListAccessRule(command.Lister):
|
|
|
95
108
|
if auth is None:
|
|
96
109
|
# this will never happen
|
|
97
110
|
raise exceptions.CommandError('invalid authentication info')
|
|
98
|
-
user_id = auth.get_user_id(conn.
|
|
111
|
+
user_id = auth.get_user_id(conn.session)
|
|
99
112
|
|
|
100
113
|
columns = ('ID', 'Service', 'Method', 'Path')
|
|
101
114
|
data = identity_client.access_rules(user=user_id)
|
|
@@ -115,7 +128,7 @@ class ListAccessRule(command.Lister):
|
|
|
115
128
|
class ShowAccessRule(command.ShowOne):
|
|
116
129
|
_description = _("Display access rule details")
|
|
117
130
|
|
|
118
|
-
def get_parser(self, prog_name):
|
|
131
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
119
132
|
parser = super().get_parser(prog_name)
|
|
120
133
|
parser.add_argument(
|
|
121
134
|
'access_rule',
|
|
@@ -124,14 +137,21 @@ class ShowAccessRule(command.ShowOne):
|
|
|
124
137
|
)
|
|
125
138
|
return parser
|
|
126
139
|
|
|
127
|
-
def take_action(
|
|
128
|
-
|
|
140
|
+
def take_action(
|
|
141
|
+
self, parsed_args: argparse.Namespace
|
|
142
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
143
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
144
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
145
|
+
)
|
|
129
146
|
conn = self.app.client_manager.sdk_connection
|
|
130
147
|
auth = conn.config.get_auth()
|
|
131
148
|
if auth is None:
|
|
132
149
|
# this will never happen
|
|
133
150
|
raise exceptions.CommandError('invalid authentication info')
|
|
134
|
-
user_id = auth.get_user_id(conn.
|
|
151
|
+
user_id = auth.get_user_id(conn.session)
|
|
152
|
+
if user_id is None:
|
|
153
|
+
# this will never happen
|
|
154
|
+
raise exceptions.CommandError('invalid authentication info')
|
|
135
155
|
|
|
136
156
|
access_rule = identity_client.get_access_rule(
|
|
137
157
|
user_id, parsed_args.access_rule
|
|
@@ -15,13 +15,19 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v3 Application Credential action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import datetime
|
|
19
21
|
import json
|
|
20
22
|
import logging
|
|
21
|
-
|
|
23
|
+
from typing import Any
|
|
22
24
|
import uuid
|
|
23
25
|
|
|
24
26
|
from cliff import columns as cliff_columns
|
|
27
|
+
from openstack.identity.v3 import (
|
|
28
|
+
application_credential as _application_credential,
|
|
29
|
+
)
|
|
30
|
+
from openstack import utils as sdk_utils
|
|
25
31
|
from osc_lib import exceptions
|
|
26
32
|
from osc_lib import utils
|
|
27
33
|
|
|
@@ -32,16 +38,18 @@ from openstackclient.identity import common
|
|
|
32
38
|
LOG = logging.getLogger(__name__)
|
|
33
39
|
|
|
34
40
|
|
|
35
|
-
class RolesColumn(cliff_columns.FormattableColumn[
|
|
41
|
+
class RolesColumn(cliff_columns.FormattableColumn[Any]):
|
|
36
42
|
"""Generate a formatted string of role names."""
|
|
37
43
|
|
|
38
|
-
def human_readable(self):
|
|
39
|
-
return utils.format_list(list(r['name'] for r in self._value))
|
|
44
|
+
def human_readable(self) -> str:
|
|
45
|
+
return utils.format_list(list(r['name'] for r in self._value)) or ""
|
|
40
46
|
|
|
41
47
|
|
|
42
48
|
def _format_application_credential(
|
|
43
|
-
application_credential,
|
|
44
|
-
|
|
49
|
+
application_credential: _application_credential.ApplicationCredential,
|
|
50
|
+
*,
|
|
51
|
+
include_secret: bool = False,
|
|
52
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
45
53
|
column_headers: tuple[str, ...] = (
|
|
46
54
|
'ID',
|
|
47
55
|
'Name',
|
|
@@ -74,7 +82,11 @@ def _format_application_credential(
|
|
|
74
82
|
)
|
|
75
83
|
|
|
76
84
|
|
|
77
|
-
def _format_application_credentials(
|
|
85
|
+
def _format_application_credentials(
|
|
86
|
+
application_credentials: Iterable[
|
|
87
|
+
_application_credential.ApplicationCredential
|
|
88
|
+
],
|
|
89
|
+
) -> tuple[tuple[str, ...], Any]:
|
|
78
90
|
column_headers = (
|
|
79
91
|
'ID',
|
|
80
92
|
'Name',
|
|
@@ -108,7 +120,7 @@ def _format_application_credentials(application_credentials):
|
|
|
108
120
|
|
|
109
121
|
|
|
110
122
|
# TODO(stephenfin): Move this to osc_lib since it's useful elsewhere
|
|
111
|
-
def is_uuid_like(value) -> bool:
|
|
123
|
+
def is_uuid_like(value: str) -> bool:
|
|
112
124
|
"""Returns validation of a value as a UUID.
|
|
113
125
|
|
|
114
126
|
:param val: Value to verify
|
|
@@ -131,7 +143,7 @@ def is_uuid_like(value) -> bool:
|
|
|
131
143
|
class CreateApplicationCredential(command.ShowOne):
|
|
132
144
|
_description = _("Create new application credential")
|
|
133
145
|
|
|
134
|
-
def get_parser(self, prog_name):
|
|
146
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
135
147
|
parser = super().get_parser(prog_name)
|
|
136
148
|
parser.add_argument(
|
|
137
149
|
'name',
|
|
@@ -203,15 +215,22 @@ class CreateApplicationCredential(command.ShowOne):
|
|
|
203
215
|
)
|
|
204
216
|
return parser
|
|
205
217
|
|
|
206
|
-
def take_action(
|
|
207
|
-
|
|
218
|
+
def take_action(
|
|
219
|
+
self, parsed_args: argparse.Namespace
|
|
220
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
221
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
222
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
223
|
+
)
|
|
208
224
|
conn = self.app.client_manager.sdk_connection
|
|
209
225
|
auth = conn.config.get_auth()
|
|
210
226
|
if auth is None:
|
|
211
227
|
# this will never happen
|
|
212
228
|
raise exceptions.CommandError('invalid authentication info')
|
|
213
229
|
|
|
214
|
-
user_id = auth.get_user_id(conn.
|
|
230
|
+
user_id = auth.get_user_id(conn.session)
|
|
231
|
+
if user_id is None:
|
|
232
|
+
msg = _("failed to retrieve auth info for current session")
|
|
233
|
+
raise exceptions.CommandError(msg)
|
|
215
234
|
|
|
216
235
|
role_ids = []
|
|
217
236
|
for role in parsed_args.roles:
|
|
@@ -266,7 +285,7 @@ class CreateApplicationCredential(command.ShowOne):
|
|
|
266
285
|
class DeleteApplicationCredential(command.Command):
|
|
267
286
|
_description = _("Delete application credentials(s)")
|
|
268
287
|
|
|
269
|
-
def get_parser(self, prog_name):
|
|
288
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
270
289
|
parser = super().get_parser(prog_name)
|
|
271
290
|
parser.add_argument(
|
|
272
291
|
'application_credential',
|
|
@@ -276,15 +295,21 @@ class DeleteApplicationCredential(command.Command):
|
|
|
276
295
|
)
|
|
277
296
|
return parser
|
|
278
297
|
|
|
279
|
-
def take_action(self, parsed_args):
|
|
280
|
-
identity_client =
|
|
298
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
299
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
300
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
301
|
+
)
|
|
302
|
+
|
|
281
303
|
conn = self.app.client_manager.sdk_connection
|
|
282
304
|
auth = conn.config.get_auth()
|
|
283
305
|
if auth is None:
|
|
284
306
|
# this will never happen
|
|
285
307
|
raise exceptions.CommandError('invalid authentication info')
|
|
286
308
|
|
|
287
|
-
user_id = auth.get_user_id(conn.
|
|
309
|
+
user_id = auth.get_user_id(conn.session)
|
|
310
|
+
if user_id is None:
|
|
311
|
+
msg = _("failed to retrieve auth info for current session")
|
|
312
|
+
raise exceptions.CommandError(msg)
|
|
288
313
|
|
|
289
314
|
errors = 0
|
|
290
315
|
for ac in parsed_args.application_credential:
|
|
@@ -319,7 +344,7 @@ class DeleteApplicationCredential(command.Command):
|
|
|
319
344
|
class ListApplicationCredential(command.Lister):
|
|
320
345
|
_description = _("List application credentials")
|
|
321
346
|
|
|
322
|
-
def get_parser(self, prog_name):
|
|
347
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
323
348
|
parser = super().get_parser(prog_name)
|
|
324
349
|
parser.add_argument(
|
|
325
350
|
'--user',
|
|
@@ -329,8 +354,12 @@ class ListApplicationCredential(command.Lister):
|
|
|
329
354
|
common.add_user_domain_option_to_parser(parser)
|
|
330
355
|
return parser
|
|
331
356
|
|
|
332
|
-
def take_action(
|
|
333
|
-
|
|
357
|
+
def take_action(
|
|
358
|
+
self, parsed_args: argparse.Namespace
|
|
359
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
360
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
361
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
362
|
+
)
|
|
334
363
|
if parsed_args.user:
|
|
335
364
|
user_id = common.find_user_id_sdk(
|
|
336
365
|
identity_client, parsed_args.user, parsed_args.user_domain
|
|
@@ -341,7 +370,11 @@ class ListApplicationCredential(command.Lister):
|
|
|
341
370
|
if auth is None:
|
|
342
371
|
# this will never happen
|
|
343
372
|
raise exceptions.CommandError('invalid authentication info')
|
|
344
|
-
|
|
373
|
+
_user_id = auth.get_user_id(conn.session)
|
|
374
|
+
if _user_id is None:
|
|
375
|
+
# this will never happen
|
|
376
|
+
raise exceptions.CommandError('invalid authentication info')
|
|
377
|
+
user_id = _user_id
|
|
345
378
|
|
|
346
379
|
application_credentials = identity_client.application_credentials(
|
|
347
380
|
user=user_id
|
|
@@ -353,7 +386,7 @@ class ListApplicationCredential(command.Lister):
|
|
|
353
386
|
class ShowApplicationCredential(command.ShowOne):
|
|
354
387
|
_description = _("Display application credential details")
|
|
355
388
|
|
|
356
|
-
def get_parser(self, prog_name):
|
|
389
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
357
390
|
parser = super().get_parser(prog_name)
|
|
358
391
|
parser.add_argument(
|
|
359
392
|
'application_credential',
|
|
@@ -362,14 +395,23 @@ class ShowApplicationCredential(command.ShowOne):
|
|
|
362
395
|
)
|
|
363
396
|
return parser
|
|
364
397
|
|
|
365
|
-
def take_action(
|
|
366
|
-
|
|
398
|
+
def take_action(
|
|
399
|
+
self, parsed_args: argparse.Namespace
|
|
400
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
401
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
402
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
403
|
+
)
|
|
404
|
+
|
|
367
405
|
conn = self.app.client_manager.sdk_connection
|
|
368
406
|
auth = conn.config.get_auth()
|
|
369
407
|
if auth is None:
|
|
370
408
|
# this will never happen
|
|
371
409
|
raise exceptions.CommandError('invalid authentication info')
|
|
372
|
-
|
|
410
|
+
|
|
411
|
+
user_id = auth.get_user_id(conn.session)
|
|
412
|
+
if user_id is None:
|
|
413
|
+
msg = _("failed to retrieve auth info for current session")
|
|
414
|
+
raise exceptions.CommandError(msg)
|
|
373
415
|
|
|
374
416
|
application_credential = identity_client.find_application_credential(
|
|
375
417
|
user_id, parsed_args.application_credential, ignore_missing=False
|
|
@@ -12,8 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
"""Identity v3 Service Catalog action implementations"""
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
16
|
+
from collections.abc import Iterable, Sequence
|
|
15
17
|
import logging
|
|
16
|
-
|
|
18
|
+
from typing import Any
|
|
17
19
|
|
|
18
20
|
from cliff import columns as cliff_columns
|
|
19
21
|
from osc_lib import exceptions
|
|
@@ -26,8 +28,8 @@ from openstackclient.i18n import _
|
|
|
26
28
|
LOG = logging.getLogger(__name__)
|
|
27
29
|
|
|
28
30
|
|
|
29
|
-
class EndpointsColumn(cliff_columns.FormattableColumn[
|
|
30
|
-
def human_readable(self):
|
|
31
|
+
class EndpointsColumn(cliff_columns.FormattableColumn[Any]):
|
|
32
|
+
def human_readable(self) -> str:
|
|
31
33
|
if not self._value:
|
|
32
34
|
return ""
|
|
33
35
|
ret = ''
|
|
@@ -41,7 +43,9 @@ class EndpointsColumn(cliff_columns.FormattableColumn[ty.Any]):
|
|
|
41
43
|
class ListCatalog(command.Lister):
|
|
42
44
|
_description = _("List services in the service catalog")
|
|
43
45
|
|
|
44
|
-
def take_action(
|
|
46
|
+
def take_action(
|
|
47
|
+
self, parsed_args: argparse.Namespace
|
|
48
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
45
49
|
# Trigger auth if it has not happened yet
|
|
46
50
|
auth_ref = self.app.client_manager.auth_ref
|
|
47
51
|
if not auth_ref:
|
|
@@ -69,7 +73,7 @@ class ListCatalog(command.Lister):
|
|
|
69
73
|
class ShowCatalog(command.ShowOne):
|
|
70
74
|
_description = _("Display service catalog details")
|
|
71
75
|
|
|
72
|
-
def get_parser(self, prog_name):
|
|
76
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
73
77
|
parser = super().get_parser(prog_name)
|
|
74
78
|
parser.add_argument(
|
|
75
79
|
'service',
|
|
@@ -78,7 +82,9 @@ class ShowCatalog(command.ShowOne):
|
|
|
78
82
|
)
|
|
79
83
|
return parser
|
|
80
84
|
|
|
81
|
-
def take_action(
|
|
85
|
+
def take_action(
|
|
86
|
+
self, parsed_args: argparse.Namespace
|
|
87
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
82
88
|
# Trigger auth if it has not happened yet
|
|
83
89
|
auth_ref = self.app.client_manager.auth_ref
|
|
84
90
|
if not auth_ref:
|
|
@@ -102,4 +108,5 @@ class ShowCatalog(command.ShowOne):
|
|
|
102
108
|
LOG.error(_('service %s not found\n'), parsed_args.service)
|
|
103
109
|
return ((), ())
|
|
104
110
|
|
|
105
|
-
|
|
111
|
+
col_headers, col_data = zip(*sorted(data.items()))
|
|
112
|
+
return col_headers, col_data
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v3 Consumer action implementations"""
|
|
17
17
|
|
|
18
|
+
import argparse
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
18
20
|
import logging
|
|
21
|
+
from typing import Any
|
|
19
22
|
|
|
20
23
|
from osc_lib import exceptions
|
|
21
24
|
from osc_lib import utils
|
|
@@ -30,7 +33,7 @@ LOG = logging.getLogger(__name__)
|
|
|
30
33
|
class CreateConsumer(command.ShowOne):
|
|
31
34
|
_description = _("Create new consumer")
|
|
32
35
|
|
|
33
|
-
def get_parser(self, prog_name):
|
|
36
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
34
37
|
parser = super().get_parser(prog_name)
|
|
35
38
|
parser.add_argument(
|
|
36
39
|
'--description',
|
|
@@ -39,19 +42,22 @@ class CreateConsumer(command.ShowOne):
|
|
|
39
42
|
)
|
|
40
43
|
return parser
|
|
41
44
|
|
|
42
|
-
def take_action(
|
|
45
|
+
def take_action(
|
|
46
|
+
self, parsed_args: argparse.Namespace
|
|
47
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
43
48
|
identity_client = self.app.client_manager.identity
|
|
44
49
|
consumer = identity_client.oauth1.consumers.create(
|
|
45
50
|
parsed_args.description
|
|
46
51
|
)
|
|
47
52
|
consumer._info.pop('links', None)
|
|
48
|
-
|
|
53
|
+
col_headers, col_data = zip(*sorted(consumer._info.items()))
|
|
54
|
+
return col_headers, col_data
|
|
49
55
|
|
|
50
56
|
|
|
51
57
|
class DeleteConsumer(command.Command):
|
|
52
58
|
_description = _("Delete consumer(s)")
|
|
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
|
'consumer',
|
|
@@ -61,7 +67,7 @@ class DeleteConsumer(command.Command):
|
|
|
61
67
|
)
|
|
62
68
|
return parser
|
|
63
69
|
|
|
64
|
-
def take_action(self, parsed_args):
|
|
70
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
65
71
|
identity_client = self.app.client_manager.identity
|
|
66
72
|
result = 0
|
|
67
73
|
for i in parsed_args.consumer:
|
|
@@ -92,7 +98,9 @@ class DeleteConsumer(command.Command):
|
|
|
92
98
|
class ListConsumer(command.Lister):
|
|
93
99
|
_description = _("List consumers")
|
|
94
100
|
|
|
95
|
-
def take_action(
|
|
101
|
+
def take_action(
|
|
102
|
+
self, parsed_args: argparse.Namespace
|
|
103
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
96
104
|
columns = ('ID', 'Description')
|
|
97
105
|
data = self.app.client_manager.identity.oauth1.consumers.list()
|
|
98
106
|
return (
|
|
@@ -111,7 +119,7 @@ class ListConsumer(command.Lister):
|
|
|
111
119
|
class SetConsumer(command.Command):
|
|
112
120
|
_description = _("Set consumer properties")
|
|
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
|
'consumer',
|
|
@@ -125,7 +133,7 @@ class SetConsumer(command.Command):
|
|
|
125
133
|
)
|
|
126
134
|
return parser
|
|
127
135
|
|
|
128
|
-
def take_action(self, parsed_args):
|
|
136
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
129
137
|
identity_client = self.app.client_manager.identity
|
|
130
138
|
consumer = utils.find_resource(
|
|
131
139
|
identity_client.oauth1.consumers, parsed_args.consumer
|
|
@@ -142,7 +150,7 @@ class SetConsumer(command.Command):
|
|
|
142
150
|
class ShowConsumer(command.ShowOne):
|
|
143
151
|
_description = _("Display consumer details")
|
|
144
152
|
|
|
145
|
-
def get_parser(self, prog_name):
|
|
153
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
146
154
|
parser = super().get_parser(prog_name)
|
|
147
155
|
parser.add_argument(
|
|
148
156
|
'consumer',
|
|
@@ -151,11 +159,14 @@ class ShowConsumer(command.ShowOne):
|
|
|
151
159
|
)
|
|
152
160
|
return parser
|
|
153
161
|
|
|
154
|
-
def take_action(
|
|
162
|
+
def take_action(
|
|
163
|
+
self, parsed_args: argparse.Namespace
|
|
164
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
155
165
|
identity_client = self.app.client_manager.identity
|
|
156
166
|
consumer = utils.find_resource(
|
|
157
167
|
identity_client.oauth1.consumers, parsed_args.consumer
|
|
158
168
|
)
|
|
159
169
|
|
|
160
170
|
consumer._info.pop('links', None)
|
|
161
|
-
|
|
171
|
+
col_headers, col_data = zip(*sorted(consumer._info.items()))
|
|
172
|
+
return col_headers, col_data
|
|
@@ -15,8 +15,13 @@
|
|
|
15
15
|
|
|
16
16
|
"""Identity v3 Credential 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.identity.v3 import credential as _credential
|
|
24
|
+
from openstack import utils as sdk_utils
|
|
20
25
|
from osc_lib import exceptions
|
|
21
26
|
from osc_lib import utils
|
|
22
27
|
|
|
@@ -24,11 +29,12 @@ from openstackclient import command
|
|
|
24
29
|
from openstackclient.i18n import _
|
|
25
30
|
from openstackclient.identity import common
|
|
26
31
|
|
|
27
|
-
|
|
28
32
|
LOG = logging.getLogger(__name__)
|
|
29
33
|
|
|
30
34
|
|
|
31
|
-
def _format_credential(
|
|
35
|
+
def _format_credential(
|
|
36
|
+
credential: _credential.Credential,
|
|
37
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
32
38
|
columns = (
|
|
33
39
|
'blob',
|
|
34
40
|
'id',
|
|
@@ -48,7 +54,7 @@ def _format_credential(credential):
|
|
|
48
54
|
class CreateCredential(command.ShowOne):
|
|
49
55
|
_description = _("Create new credential")
|
|
50
56
|
|
|
51
|
-
def get_parser(self, prog_name):
|
|
57
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
52
58
|
parser = super().get_parser(prog_name)
|
|
53
59
|
parser.add_argument(
|
|
54
60
|
'user',
|
|
@@ -75,8 +81,12 @@ class CreateCredential(command.ShowOne):
|
|
|
75
81
|
)
|
|
76
82
|
return parser
|
|
77
83
|
|
|
78
|
-
def take_action(
|
|
79
|
-
|
|
84
|
+
def take_action(
|
|
85
|
+
self, parsed_args: argparse.Namespace
|
|
86
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
87
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
88
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
89
|
+
)
|
|
80
90
|
user_id = identity_client.find_user(
|
|
81
91
|
parsed_args.user, ignore_missing=False
|
|
82
92
|
).id
|
|
@@ -99,7 +109,7 @@ class CreateCredential(command.ShowOne):
|
|
|
99
109
|
class DeleteCredential(command.Command):
|
|
100
110
|
_description = _("Delete credential(s)")
|
|
101
111
|
|
|
102
|
-
def get_parser(self, prog_name):
|
|
112
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
103
113
|
parser = super().get_parser(prog_name)
|
|
104
114
|
parser.add_argument(
|
|
105
115
|
'credential',
|
|
@@ -109,8 +119,10 @@ class DeleteCredential(command.Command):
|
|
|
109
119
|
)
|
|
110
120
|
return parser
|
|
111
121
|
|
|
112
|
-
def take_action(self, parsed_args):
|
|
113
|
-
identity_client =
|
|
122
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
123
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
124
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
125
|
+
)
|
|
114
126
|
result = 0
|
|
115
127
|
for i in parsed_args.credential:
|
|
116
128
|
try:
|
|
@@ -137,7 +149,7 @@ class DeleteCredential(command.Command):
|
|
|
137
149
|
class ListCredential(command.Lister):
|
|
138
150
|
_description = _("List credentials")
|
|
139
151
|
|
|
140
|
-
def get_parser(self, prog_name):
|
|
152
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
141
153
|
parser = super().get_parser(prog_name)
|
|
142
154
|
parser.add_argument(
|
|
143
155
|
'--user',
|
|
@@ -152,8 +164,12 @@ class ListCredential(command.Lister):
|
|
|
152
164
|
)
|
|
153
165
|
return parser
|
|
154
166
|
|
|
155
|
-
def take_action(
|
|
156
|
-
|
|
167
|
+
def take_action(
|
|
168
|
+
self, parsed_args: argparse.Namespace
|
|
169
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
170
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
171
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
172
|
+
)
|
|
157
173
|
|
|
158
174
|
kwargs = {}
|
|
159
175
|
if parsed_args.user:
|
|
@@ -190,7 +206,7 @@ class ListCredential(command.Lister):
|
|
|
190
206
|
class SetCredential(command.Command):
|
|
191
207
|
_description = _("Set credential properties")
|
|
192
208
|
|
|
193
|
-
def get_parser(self, prog_name):
|
|
209
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
194
210
|
parser = super().get_parser(prog_name)
|
|
195
211
|
parser.add_argument(
|
|
196
212
|
'credential',
|
|
@@ -224,8 +240,10 @@ class SetCredential(command.Command):
|
|
|
224
240
|
)
|
|
225
241
|
return parser
|
|
226
242
|
|
|
227
|
-
def take_action(self, parsed_args):
|
|
228
|
-
identity_client =
|
|
243
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
244
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
245
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
246
|
+
)
|
|
229
247
|
|
|
230
248
|
user_id = identity_client.find_user(
|
|
231
249
|
parsed_args.user, ignore_missing=False
|
|
@@ -250,7 +268,7 @@ class SetCredential(command.Command):
|
|
|
250
268
|
class ShowCredential(command.ShowOne):
|
|
251
269
|
_description = _("Display credential details")
|
|
252
270
|
|
|
253
|
-
def get_parser(self, prog_name):
|
|
271
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
254
272
|
parser = super().get_parser(prog_name)
|
|
255
273
|
parser.add_argument(
|
|
256
274
|
'credential',
|
|
@@ -259,8 +277,12 @@ class ShowCredential(command.ShowOne):
|
|
|
259
277
|
)
|
|
260
278
|
return parser
|
|
261
279
|
|
|
262
|
-
def take_action(
|
|
263
|
-
|
|
280
|
+
def take_action(
|
|
281
|
+
self, parsed_args: argparse.Namespace
|
|
282
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
283
|
+
identity_client = sdk_utils.ensure_service_version(
|
|
284
|
+
self.app.client_manager.sdk_connection.identity, '3'
|
|
285
|
+
)
|
|
264
286
|
credential = identity_client.get_credential(parsed_args.credential)
|
|
265
287
|
|
|
266
288
|
return _format_credential(credential)
|