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
|
"""Image V2 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.image.v2 import metadef_namespace as _metadef_namespace
|
|
20
24
|
from osc_lib.cli import format_columns
|
|
21
25
|
from osc_lib import exceptions
|
|
22
26
|
from osc_lib import utils
|
|
@@ -31,7 +35,9 @@ _formatters = {
|
|
|
31
35
|
LOG = logging.getLogger(__name__)
|
|
32
36
|
|
|
33
37
|
|
|
34
|
-
def _format_namespace(
|
|
38
|
+
def _format_namespace(
|
|
39
|
+
namespace: _metadef_namespace.MetadefNamespace,
|
|
40
|
+
) -> dict[str, Any]:
|
|
35
41
|
info = {}
|
|
36
42
|
|
|
37
43
|
fields_to_show = [
|
|
@@ -41,23 +47,22 @@ def _format_namespace(namespace):
|
|
|
41
47
|
'namespace',
|
|
42
48
|
'owner',
|
|
43
49
|
'protected',
|
|
50
|
+
'tags',
|
|
44
51
|
'schema',
|
|
45
52
|
'updated_at',
|
|
46
53
|
'visibility',
|
|
47
54
|
]
|
|
48
55
|
|
|
49
|
-
|
|
56
|
+
data = namespace.to_dict(ignore_none=True, original_names=True)
|
|
50
57
|
|
|
51
58
|
# split out the usual key and the properties which are top-level
|
|
52
|
-
for key in
|
|
59
|
+
for key in data:
|
|
53
60
|
if key in fields_to_show:
|
|
54
|
-
info[key] =
|
|
61
|
+
info[key] = data.get(key)
|
|
55
62
|
elif key == "resource_type_associations":
|
|
56
|
-
info[key] = [
|
|
57
|
-
resource_type['name'] for resource_type in namespace.get(key)
|
|
58
|
-
]
|
|
63
|
+
info[key] = [resource_type['name'] for resource_type in data[key]]
|
|
59
64
|
elif key == 'properties':
|
|
60
|
-
info['properties'] = list(
|
|
65
|
+
info['properties'] = list(data[key].keys())
|
|
61
66
|
|
|
62
67
|
return info
|
|
63
68
|
|
|
@@ -65,7 +70,7 @@ def _format_namespace(namespace):
|
|
|
65
70
|
class CreateMetadefNamespace(command.ShowOne):
|
|
66
71
|
_description = _("Create a metadef namespace")
|
|
67
72
|
|
|
68
|
-
def get_parser(self, prog_name):
|
|
73
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
69
74
|
parser = super().get_parser(prog_name)
|
|
70
75
|
parser.add_argument(
|
|
71
76
|
"namespace",
|
|
@@ -114,7 +119,9 @@ class CreateMetadefNamespace(command.ShowOne):
|
|
|
114
119
|
)
|
|
115
120
|
return parser
|
|
116
121
|
|
|
117
|
-
def take_action(
|
|
122
|
+
def take_action(
|
|
123
|
+
self, parsed_args: argparse.Namespace
|
|
124
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
118
125
|
image_client = self.app.client_manager.image
|
|
119
126
|
filter_keys = ['namespace', 'display_name', 'description']
|
|
120
127
|
kwargs = {}
|
|
@@ -133,13 +140,14 @@ class CreateMetadefNamespace(command.ShowOne):
|
|
|
133
140
|
data = image_client.create_metadef_namespace(**kwargs)
|
|
134
141
|
info = _format_namespace(data)
|
|
135
142
|
|
|
136
|
-
|
|
143
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
144
|
+
return col_headers, col_data
|
|
137
145
|
|
|
138
146
|
|
|
139
147
|
class DeleteMetadefNamespace(command.Command):
|
|
140
148
|
_description = _("Delete metadef namespace")
|
|
141
149
|
|
|
142
|
-
def get_parser(self, prog_name):
|
|
150
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
143
151
|
parser = super().get_parser(prog_name)
|
|
144
152
|
parser.add_argument(
|
|
145
153
|
"namespace",
|
|
@@ -149,7 +157,7 @@ class DeleteMetadefNamespace(command.Command):
|
|
|
149
157
|
)
|
|
150
158
|
return parser
|
|
151
159
|
|
|
152
|
-
def take_action(self, parsed_args):
|
|
160
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
153
161
|
image_client = self.app.client_manager.image
|
|
154
162
|
|
|
155
163
|
result = 0
|
|
@@ -179,7 +187,7 @@ class DeleteMetadefNamespace(command.Command):
|
|
|
179
187
|
class ListMetadefNamespace(command.Lister):
|
|
180
188
|
_description = _("List metadef namespaces")
|
|
181
189
|
|
|
182
|
-
def get_parser(self, prog_name):
|
|
190
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
183
191
|
parser = super().get_parser(prog_name)
|
|
184
192
|
parser.add_argument(
|
|
185
193
|
"--resource-types",
|
|
@@ -193,7 +201,9 @@ class ListMetadefNamespace(command.Lister):
|
|
|
193
201
|
)
|
|
194
202
|
return parser
|
|
195
203
|
|
|
196
|
-
def take_action(
|
|
204
|
+
def take_action(
|
|
205
|
+
self, parsed_args: argparse.Namespace
|
|
206
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
197
207
|
image_client = self.app.client_manager.image
|
|
198
208
|
filter_keys = ['resource_types', 'visibility']
|
|
199
209
|
kwargs = {}
|
|
@@ -221,7 +231,7 @@ class ListMetadefNamespace(command.Lister):
|
|
|
221
231
|
class SetMetadefNamespace(command.Command):
|
|
222
232
|
_description = _("Set metadef namespace properties")
|
|
223
233
|
|
|
224
|
-
def get_parser(self, prog_name):
|
|
234
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
225
235
|
parser = super().get_parser(prog_name)
|
|
226
236
|
parser.add_argument(
|
|
227
237
|
"namespace",
|
|
@@ -270,9 +280,20 @@ class SetMetadefNamespace(command.Command):
|
|
|
270
280
|
dest="is_protected",
|
|
271
281
|
help=_("Allow metadef namespace to be deleted (default)"),
|
|
272
282
|
)
|
|
283
|
+
parser.add_argument(
|
|
284
|
+
"--tag",
|
|
285
|
+
metavar="<tag>",
|
|
286
|
+
action='append',
|
|
287
|
+
default=[],
|
|
288
|
+
dest='tags',
|
|
289
|
+
help=_(
|
|
290
|
+
"Set a tag on this metadef namespace "
|
|
291
|
+
"(repeat option to set multiple tags)"
|
|
292
|
+
),
|
|
293
|
+
)
|
|
273
294
|
return parser
|
|
274
295
|
|
|
275
|
-
def take_action(self, parsed_args):
|
|
296
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
276
297
|
image_client = self.app.client_manager.image
|
|
277
298
|
|
|
278
299
|
namespace = parsed_args.namespace
|
|
@@ -293,11 +314,26 @@ class SetMetadefNamespace(command.Command):
|
|
|
293
314
|
|
|
294
315
|
image_client.update_metadef_namespace(namespace, **kwargs)
|
|
295
316
|
|
|
317
|
+
errors = 0
|
|
318
|
+
for tag in parsed_args.tags:
|
|
319
|
+
try:
|
|
320
|
+
image_client.add_tag_to_metadef_namespace(namespace, tag)
|
|
321
|
+
except Exception:
|
|
322
|
+
LOG.error(_("Tag set failed for tag %s"), tag)
|
|
323
|
+
errors += 1
|
|
324
|
+
|
|
325
|
+
if errors > 0:
|
|
326
|
+
msg = _("Failed to set %(errors)s of %(total)s tags.") % {
|
|
327
|
+
'errors': errors,
|
|
328
|
+
'total': len(parsed_args.tags),
|
|
329
|
+
}
|
|
330
|
+
raise exceptions.CommandError(msg)
|
|
331
|
+
|
|
296
332
|
|
|
297
333
|
class ShowMetadefNamespace(command.ShowOne):
|
|
298
334
|
_description = _("Show a metadef namespace")
|
|
299
335
|
|
|
300
|
-
def get_parser(self, prog_name):
|
|
336
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
301
337
|
parser = super().get_parser(prog_name)
|
|
302
338
|
parser.add_argument(
|
|
303
339
|
"namespace",
|
|
@@ -306,7 +342,9 @@ class ShowMetadefNamespace(command.ShowOne):
|
|
|
306
342
|
)
|
|
307
343
|
return parser
|
|
308
344
|
|
|
309
|
-
def take_action(
|
|
345
|
+
def take_action(
|
|
346
|
+
self, parsed_args: argparse.Namespace
|
|
347
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
310
348
|
image_client = self.app.client_manager.image
|
|
311
349
|
|
|
312
350
|
namespace = parsed_args.namespace
|
|
@@ -314,4 +352,63 @@ class ShowMetadefNamespace(command.ShowOne):
|
|
|
314
352
|
data = image_client.get_metadef_namespace(namespace)
|
|
315
353
|
info = _format_namespace(data)
|
|
316
354
|
|
|
317
|
-
|
|
355
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
356
|
+
return col_headers, col_data
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
class UnsetMetadefNamespace(command.Command):
|
|
360
|
+
_description = _("Unset metadef namespace tags")
|
|
361
|
+
|
|
362
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
363
|
+
parser = super().get_parser(prog_name)
|
|
364
|
+
parser.add_argument(
|
|
365
|
+
"namespace",
|
|
366
|
+
metavar="<namespace>",
|
|
367
|
+
help=_("Metadef namespace to modify (name)"),
|
|
368
|
+
)
|
|
369
|
+
tag_group = parser.add_mutually_exclusive_group(required=True)
|
|
370
|
+
tag_group.add_argument(
|
|
371
|
+
"--tag",
|
|
372
|
+
metavar="<tag>",
|
|
373
|
+
action='append',
|
|
374
|
+
default=[],
|
|
375
|
+
dest='tags',
|
|
376
|
+
help=_(
|
|
377
|
+
"Unset a tag on this metadef namespace "
|
|
378
|
+
"(repeat option to unset multiple tags)"
|
|
379
|
+
),
|
|
380
|
+
)
|
|
381
|
+
tag_group.add_argument(
|
|
382
|
+
"--all-tags",
|
|
383
|
+
action="store_true",
|
|
384
|
+
default=False,
|
|
385
|
+
help=_("Unset all metadef tags"),
|
|
386
|
+
)
|
|
387
|
+
return parser
|
|
388
|
+
|
|
389
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
390
|
+
image_client = self.app.client_manager.image
|
|
391
|
+
|
|
392
|
+
namespace = image_client.get_metadef_namespace(parsed_args.namespace)
|
|
393
|
+
|
|
394
|
+
errors = 0
|
|
395
|
+
if parsed_args.all_tags:
|
|
396
|
+
namespace = image_client.remove_tags_from_metadef_namespace(
|
|
397
|
+
namespace
|
|
398
|
+
)
|
|
399
|
+
elif parsed_args.tags:
|
|
400
|
+
for tag in parsed_args.tags:
|
|
401
|
+
try:
|
|
402
|
+
image_client.remove_tag_from_metadef_namespace(
|
|
403
|
+
namespace, tag
|
|
404
|
+
)
|
|
405
|
+
except Exception:
|
|
406
|
+
LOG.error(_("tag unset failed for tag %s"), tag)
|
|
407
|
+
errors += 1
|
|
408
|
+
|
|
409
|
+
if errors > 0:
|
|
410
|
+
msg = _("Failed to unset %(errors)s of %(total)s tags.") % {
|
|
411
|
+
'errors': errors,
|
|
412
|
+
'total': len(parsed_args.tags),
|
|
413
|
+
}
|
|
414
|
+
raise exceptions.CommandError(msg)
|
|
@@ -15,8 +15,12 @@
|
|
|
15
15
|
|
|
16
16
|
"""Image V2 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.image.v2 import metadef_object as _metadef_object
|
|
20
24
|
from osc_lib import exceptions
|
|
21
25
|
from osc_lib import utils
|
|
22
26
|
|
|
@@ -27,7 +31,9 @@ from openstackclient.i18n import _
|
|
|
27
31
|
LOG = logging.getLogger(__name__)
|
|
28
32
|
|
|
29
33
|
|
|
30
|
-
def _format_object(
|
|
34
|
+
def _format_object(
|
|
35
|
+
md_object: _metadef_object.MetadefObject,
|
|
36
|
+
) -> tuple[tuple[str, ...], Iterable[Any]]:
|
|
31
37
|
fields_to_show = (
|
|
32
38
|
'created_at',
|
|
33
39
|
'description',
|
|
@@ -40,17 +46,14 @@ def _format_object(md_object):
|
|
|
40
46
|
|
|
41
47
|
return (
|
|
42
48
|
fields_to_show,
|
|
43
|
-
utils.get_item_properties(
|
|
44
|
-
md_object,
|
|
45
|
-
fields_to_show,
|
|
46
|
-
),
|
|
49
|
+
utils.get_item_properties(md_object, fields_to_show),
|
|
47
50
|
)
|
|
48
51
|
|
|
49
52
|
|
|
50
53
|
class CreateMetadefObjects(command.ShowOne):
|
|
51
54
|
_description = _("Create a metadef object")
|
|
52
55
|
|
|
53
|
-
def get_parser(self, prog_name):
|
|
56
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
54
57
|
parser = super().get_parser(prog_name)
|
|
55
58
|
parser.add_argument(
|
|
56
59
|
"--namespace",
|
|
@@ -64,7 +67,9 @@ class CreateMetadefObjects(command.ShowOne):
|
|
|
64
67
|
)
|
|
65
68
|
return parser
|
|
66
69
|
|
|
67
|
-
def take_action(
|
|
70
|
+
def take_action(
|
|
71
|
+
self, parsed_args: argparse.Namespace
|
|
72
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
68
73
|
image_client = self.app.client_manager.image
|
|
69
74
|
|
|
70
75
|
namespace = image_client.get_metadef_namespace(
|
|
@@ -83,7 +88,7 @@ class CreateMetadefObjects(command.ShowOne):
|
|
|
83
88
|
class ShowMetadefObjects(command.ShowOne):
|
|
84
89
|
_description = _("Show a particular metadef object")
|
|
85
90
|
|
|
86
|
-
def get_parser(self, prog_name):
|
|
91
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
87
92
|
parser = super().get_parser(prog_name)
|
|
88
93
|
parser.add_argument(
|
|
89
94
|
"namespace",
|
|
@@ -97,7 +102,9 @@ class ShowMetadefObjects(command.ShowOne):
|
|
|
97
102
|
)
|
|
98
103
|
return parser
|
|
99
104
|
|
|
100
|
-
def take_action(
|
|
105
|
+
def take_action(
|
|
106
|
+
self, parsed_args: argparse.Namespace
|
|
107
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
101
108
|
image_client = self.app.client_manager.image
|
|
102
109
|
|
|
103
110
|
namespace = parsed_args.namespace
|
|
@@ -113,7 +120,7 @@ class ShowMetadefObjects(command.ShowOne):
|
|
|
113
120
|
class DeleteMetadefObject(command.Command):
|
|
114
121
|
_description = _("Delete metadata definitions object(s)")
|
|
115
122
|
|
|
116
|
-
def get_parser(self, prog_name):
|
|
123
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
117
124
|
parser = super().get_parser(prog_name)
|
|
118
125
|
parser.add_argument(
|
|
119
126
|
"namespace",
|
|
@@ -131,13 +138,14 @@ class DeleteMetadefObject(command.Command):
|
|
|
131
138
|
)
|
|
132
139
|
return parser
|
|
133
140
|
|
|
134
|
-
def take_action(self, parsed_args):
|
|
141
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
135
142
|
image_client = self.app.client_manager.image
|
|
136
143
|
|
|
137
144
|
namespace = parsed_args.namespace
|
|
138
145
|
|
|
139
146
|
if not parsed_args.objects:
|
|
140
|
-
|
|
147
|
+
image_client.delete_all_metadef_objects(namespace)
|
|
148
|
+
return
|
|
141
149
|
|
|
142
150
|
result = 0
|
|
143
151
|
for obj in parsed_args.objects:
|
|
@@ -166,7 +174,7 @@ class DeleteMetadefObject(command.Command):
|
|
|
166
174
|
class ListMetadefObjects(command.Lister):
|
|
167
175
|
_description = _("List metadef objects inside a specific namespace.")
|
|
168
176
|
|
|
169
|
-
def get_parser(self, prog_name):
|
|
177
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
170
178
|
parser = super().get_parser(prog_name)
|
|
171
179
|
parser.add_argument(
|
|
172
180
|
"namespace",
|
|
@@ -175,7 +183,9 @@ class ListMetadefObjects(command.Lister):
|
|
|
175
183
|
)
|
|
176
184
|
return parser
|
|
177
185
|
|
|
178
|
-
def take_action(
|
|
186
|
+
def take_action(
|
|
187
|
+
self, parsed_args: argparse.Namespace
|
|
188
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
179
189
|
image_client = self.app.client_manager.image
|
|
180
190
|
|
|
181
191
|
namespace = parsed_args.namespace
|
|
@@ -198,7 +208,7 @@ class ListMetadefObjects(command.Lister):
|
|
|
198
208
|
class SetMetadefObject(command.Command):
|
|
199
209
|
_description = _("Update a metadef object")
|
|
200
210
|
|
|
201
|
-
def get_parser(self, prog_name):
|
|
211
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
202
212
|
parser = super().get_parser(prog_name)
|
|
203
213
|
parser.add_argument(
|
|
204
214
|
"namespace",
|
|
@@ -216,7 +226,7 @@ class SetMetadefObject(command.Command):
|
|
|
216
226
|
)
|
|
217
227
|
return parser
|
|
218
228
|
|
|
219
|
-
def take_action(self, parsed_args):
|
|
229
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
220
230
|
image_client = self.app.client_manager.image
|
|
221
231
|
|
|
222
232
|
object = image_client.get_metadef_object(
|
|
@@ -236,7 +246,7 @@ class ShowMetadefObjectProperty(command.ShowOne):
|
|
|
236
246
|
"Describe a specific metadata definitions property inside an object."
|
|
237
247
|
)
|
|
238
248
|
|
|
239
|
-
def get_parser(self, prog_name):
|
|
249
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
240
250
|
parser = super().get_parser(prog_name)
|
|
241
251
|
parser.add_argument(
|
|
242
252
|
"namespace",
|
|
@@ -254,7 +264,9 @@ class ShowMetadefObjectProperty(command.ShowOne):
|
|
|
254
264
|
)
|
|
255
265
|
return parser
|
|
256
266
|
|
|
257
|
-
def take_action(
|
|
267
|
+
def take_action(
|
|
268
|
+
self, parsed_args: argparse.Namespace
|
|
269
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
258
270
|
image_client = self.app.client_manager.image
|
|
259
271
|
|
|
260
272
|
namespace_name = parsed_args.namespace
|
|
@@ -274,4 +286,5 @@ class ShowMetadefObjectProperty(command.ShowOne):
|
|
|
274
286
|
}
|
|
275
287
|
raise exceptions.CommandError(msg)
|
|
276
288
|
|
|
277
|
-
|
|
289
|
+
col_headers, col_data = zip(*sorted(prop.items()))
|
|
290
|
+
return col_headers, col_data
|
|
@@ -12,9 +12,13 @@
|
|
|
12
12
|
# License for the specific language governing permissions and limitations
|
|
13
13
|
# under the License.
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
16
|
+
from collections.abc import Iterable, Sequence
|
|
15
17
|
import json
|
|
16
18
|
import logging
|
|
19
|
+
from typing import Any
|
|
17
20
|
|
|
21
|
+
from openstack.image.v2 import metadef_property as _metadef_property
|
|
18
22
|
from osc_lib import exceptions
|
|
19
23
|
from osc_lib import utils
|
|
20
24
|
|
|
@@ -25,10 +29,12 @@ from openstackclient.i18n import _
|
|
|
25
29
|
LOG = logging.getLogger(__name__)
|
|
26
30
|
|
|
27
31
|
|
|
28
|
-
def _format_property(
|
|
29
|
-
prop
|
|
32
|
+
def _format_property(
|
|
33
|
+
prop: _metadef_property.MetadefProperty,
|
|
34
|
+
) -> dict[str, Any]:
|
|
35
|
+
data = prop.to_dict(ignore_none=True, original_names=True)
|
|
30
36
|
return {
|
|
31
|
-
key:
|
|
37
|
+
key: data[key]
|
|
32
38
|
for key in [
|
|
33
39
|
'namespace_name',
|
|
34
40
|
'name',
|
|
@@ -50,14 +56,14 @@ def _format_property(prop):
|
|
|
50
56
|
'max_items',
|
|
51
57
|
'allow_additional_items',
|
|
52
58
|
]
|
|
53
|
-
if key in
|
|
59
|
+
if key in data
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
|
|
57
63
|
class CreateMetadefProperty(command.ShowOne):
|
|
58
64
|
_description = _("Create a metadef property")
|
|
59
65
|
|
|
60
|
-
def get_parser(self, prog_name):
|
|
66
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
61
67
|
parser = super().get_parser(prog_name)
|
|
62
68
|
parser.add_argument(
|
|
63
69
|
"--name",
|
|
@@ -85,7 +91,9 @@ class CreateMetadefProperty(command.ShowOne):
|
|
|
85
91
|
)
|
|
86
92
|
return parser
|
|
87
93
|
|
|
88
|
-
def take_action(
|
|
94
|
+
def take_action(
|
|
95
|
+
self, parsed_args: argparse.Namespace
|
|
96
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
89
97
|
image_client = self.app.client_manager.image
|
|
90
98
|
|
|
91
99
|
kwargs = {
|
|
@@ -108,13 +116,14 @@ class CreateMetadefProperty(command.ShowOne):
|
|
|
108
116
|
)
|
|
109
117
|
info = _format_property(data)
|
|
110
118
|
|
|
111
|
-
|
|
119
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
120
|
+
return col_headers, col_data
|
|
112
121
|
|
|
113
122
|
|
|
114
123
|
class DeleteMetadefProperty(command.Command):
|
|
115
124
|
_description = _("Delete metadef propert(ies)")
|
|
116
125
|
|
|
117
|
-
def get_parser(self, prog_name):
|
|
126
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
118
127
|
parser = super().get_parser(prog_name)
|
|
119
128
|
parser.add_argument(
|
|
120
129
|
"namespace",
|
|
@@ -133,7 +142,7 @@ class DeleteMetadefProperty(command.Command):
|
|
|
133
142
|
)
|
|
134
143
|
return parser
|
|
135
144
|
|
|
136
|
-
def take_action(self, parsed_args):
|
|
145
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
137
146
|
image_client = self.app.client_manager.image
|
|
138
147
|
|
|
139
148
|
if not parsed_args.properties:
|
|
@@ -174,7 +183,7 @@ class DeleteMetadefProperty(command.Command):
|
|
|
174
183
|
class ListMetadefProperties(command.Lister):
|
|
175
184
|
_description = _("List metadef properties")
|
|
176
185
|
|
|
177
|
-
def get_parser(self, prog_name):
|
|
186
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
178
187
|
parser = super().get_parser(prog_name)
|
|
179
188
|
parser.add_argument(
|
|
180
189
|
"namespace",
|
|
@@ -183,7 +192,9 @@ class ListMetadefProperties(command.Lister):
|
|
|
183
192
|
)
|
|
184
193
|
return parser
|
|
185
194
|
|
|
186
|
-
def take_action(
|
|
195
|
+
def take_action(
|
|
196
|
+
self, parsed_args: argparse.Namespace
|
|
197
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
187
198
|
image_client = self.app.client_manager.image
|
|
188
199
|
props = image_client.metadef_properties(parsed_args.namespace)
|
|
189
200
|
columns = ['name', 'title', 'type']
|
|
@@ -202,7 +213,7 @@ class ListMetadefProperties(command.Lister):
|
|
|
202
213
|
class SetMetadefProperty(command.Command):
|
|
203
214
|
_description = _("Update metadef namespace property")
|
|
204
215
|
|
|
205
|
-
def get_parser(self, prog_name):
|
|
216
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
206
217
|
parser = super().get_parser(prog_name)
|
|
207
218
|
parser.add_argument(
|
|
208
219
|
"--name",
|
|
@@ -230,7 +241,7 @@ class SetMetadefProperty(command.Command):
|
|
|
230
241
|
)
|
|
231
242
|
return parser
|
|
232
243
|
|
|
233
|
-
def take_action(self, parsed_args):
|
|
244
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
234
245
|
image_client = self.app.client_manager.image
|
|
235
246
|
|
|
236
247
|
# We need to pass the values for *all* attributes as kwargs to
|
|
@@ -267,7 +278,7 @@ class SetMetadefProperty(command.Command):
|
|
|
267
278
|
class ShowMetadefProperty(command.ShowOne):
|
|
268
279
|
_description = _("Show a particular metadef property")
|
|
269
280
|
|
|
270
|
-
def get_parser(self, prog_name):
|
|
281
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
271
282
|
parser = super().get_parser(prog_name)
|
|
272
283
|
parser.add_argument(
|
|
273
284
|
"namespace",
|
|
@@ -281,7 +292,9 @@ class ShowMetadefProperty(command.ShowOne):
|
|
|
281
292
|
)
|
|
282
293
|
return parser
|
|
283
294
|
|
|
284
|
-
def take_action(
|
|
295
|
+
def take_action(
|
|
296
|
+
self, parsed_args: argparse.Namespace
|
|
297
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
285
298
|
image_client = self.app.client_manager.image
|
|
286
299
|
data = image_client.get_metadef_property(
|
|
287
300
|
parsed_args.property,
|
|
@@ -289,4 +302,5 @@ class ShowMetadefProperty(command.ShowOne):
|
|
|
289
302
|
)
|
|
290
303
|
info = _format_property(data)
|
|
291
304
|
|
|
292
|
-
|
|
305
|
+
col_headers, col_data = zip(*sorted(info.items()))
|
|
306
|
+
return col_headers, col_data
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
# License for the specific language governing permissions and limitations
|
|
11
11
|
# under the License.
|
|
12
12
|
|
|
13
|
+
import argparse
|
|
14
|
+
from collections.abc import Iterable, Sequence
|
|
13
15
|
import logging
|
|
16
|
+
from typing import Any
|
|
14
17
|
|
|
15
18
|
from osc_lib import exceptions
|
|
16
19
|
from osc_lib import utils
|
|
@@ -21,7 +24,7 @@ from openstackclient.i18n import _
|
|
|
21
24
|
LOG = logging.getLogger(__name__)
|
|
22
25
|
|
|
23
26
|
|
|
24
|
-
def _get_columns(item):
|
|
27
|
+
def _get_columns(item: Any) -> tuple[tuple[str, ...], tuple[str, ...]]:
|
|
25
28
|
hidden_columns = ['location']
|
|
26
29
|
return utils.get_osc_show_columns_for_sdk_resource(
|
|
27
30
|
item, {}, hidden_columns
|
|
@@ -31,7 +34,7 @@ def _get_columns(item):
|
|
|
31
34
|
class CreateMetadefResourceTypeAssociation(command.ShowOne):
|
|
32
35
|
_description = _("Create metadef resource type association")
|
|
33
36
|
|
|
34
|
-
def get_parser(self, prog_name):
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
38
|
parser = super().get_parser(prog_name)
|
|
36
39
|
parser.add_argument(
|
|
37
40
|
"namespace",
|
|
@@ -56,7 +59,9 @@ class CreateMetadefResourceTypeAssociation(command.ShowOne):
|
|
|
56
59
|
)
|
|
57
60
|
return parser
|
|
58
61
|
|
|
59
|
-
def take_action(
|
|
62
|
+
def take_action(
|
|
63
|
+
self, parsed_args: argparse.Namespace
|
|
64
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
60
65
|
image_client = self.app.client_manager.image
|
|
61
66
|
kwargs = {}
|
|
62
67
|
|
|
@@ -79,7 +84,7 @@ class CreateMetadefResourceTypeAssociation(command.ShowOne):
|
|
|
79
84
|
class DeleteMetadefResourceTypeAssociation(command.Command):
|
|
80
85
|
_description = _("Delete metadef resource type association")
|
|
81
86
|
|
|
82
|
-
def get_parser(self, prog_name):
|
|
87
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
83
88
|
parser = super().get_parser(prog_name)
|
|
84
89
|
parser.add_argument(
|
|
85
90
|
"metadef_namespace",
|
|
@@ -107,7 +112,7 @@ class DeleteMetadefResourceTypeAssociation(command.Command):
|
|
|
107
112
|
)
|
|
108
113
|
return parser
|
|
109
114
|
|
|
110
|
-
def take_action(self, parsed_args):
|
|
115
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
111
116
|
image_client = self.app.client_manager.image
|
|
112
117
|
|
|
113
118
|
result = 0
|
|
@@ -160,7 +165,7 @@ class DeleteMetadefResourceTypeAssociation(command.Command):
|
|
|
160
165
|
class ListMetadefResourceTypeAssociations(command.Lister):
|
|
161
166
|
_description = _("List metadef resource type associations")
|
|
162
167
|
|
|
163
|
-
def get_parser(self, prog_name):
|
|
168
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
164
169
|
parser = super().get_parser(prog_name)
|
|
165
170
|
parser.add_argument(
|
|
166
171
|
"metadef_namespace",
|
|
@@ -169,7 +174,9 @@ class ListMetadefResourceTypeAssociations(command.Lister):
|
|
|
169
174
|
)
|
|
170
175
|
return parser
|
|
171
176
|
|
|
172
|
-
def take_action(
|
|
177
|
+
def take_action(
|
|
178
|
+
self, parsed_args: argparse.Namespace
|
|
179
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
173
180
|
image_client = self.app.client_manager.image
|
|
174
181
|
data = image_client.metadef_resource_type_associations(
|
|
175
182
|
parsed_args.metadef_namespace,
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
"""Image V2 Action Implementations"""
|
|
14
14
|
|
|
15
|
+
import argparse
|
|
16
|
+
from collections.abc import Iterable, Sequence
|
|
17
|
+
from typing import Any
|
|
18
|
+
|
|
15
19
|
from osc_lib import utils
|
|
16
20
|
|
|
17
21
|
from openstackclient import command
|
|
@@ -21,7 +25,9 @@ from openstackclient.i18n import _
|
|
|
21
25
|
class ListMetadefResourceTypes(command.Lister):
|
|
22
26
|
_description = _("List metadef resource types")
|
|
23
27
|
|
|
24
|
-
def take_action(
|
|
28
|
+
def take_action(
|
|
29
|
+
self, parsed_args: argparse.Namespace
|
|
30
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
25
31
|
image_client = self.app.client_manager.image
|
|
26
32
|
data = image_client.metadef_resource_types()
|
|
27
33
|
columns = ['Name']
|