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
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
3
|
+
# not use this file except in compliance with the License. You may obtain
|
|
4
|
+
# a copy of the License at
|
|
5
|
+
#
|
|
6
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
#
|
|
8
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
10
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
11
|
+
# License for the specific language governing permissions and limitations
|
|
12
|
+
# under the License.
|
|
13
|
+
|
|
14
|
+
"""Volume v3 consistency group snapshot action implementations"""
|
|
15
|
+
|
|
16
|
+
import argparse
|
|
17
|
+
import logging
|
|
18
|
+
from collections.abc import Iterable, Sequence
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
21
|
+
from osc_lib import exceptions
|
|
22
|
+
from osc_lib import utils
|
|
23
|
+
|
|
24
|
+
from openstackclient import command
|
|
25
|
+
from openstackclient.i18n import _
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
LOG = logging.getLogger(__name__)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class CreateConsistencyGroupSnapshot(command.ShowOne):
|
|
32
|
+
_description = _("Create new consistency group snapshot.")
|
|
33
|
+
|
|
34
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
35
|
+
parser = super().get_parser(prog_name)
|
|
36
|
+
parser.add_argument(
|
|
37
|
+
"snapshot_name",
|
|
38
|
+
metavar="<snapshot-name>",
|
|
39
|
+
nargs="?",
|
|
40
|
+
help=_("Name of new consistency group snapshot (default to None)"),
|
|
41
|
+
)
|
|
42
|
+
parser.add_argument(
|
|
43
|
+
"--consistency-group",
|
|
44
|
+
metavar="<consistency-group>",
|
|
45
|
+
help=_(
|
|
46
|
+
"Consistency group to snapshot (name or ID) "
|
|
47
|
+
"(default to be the same as <snapshot-name>)"
|
|
48
|
+
),
|
|
49
|
+
)
|
|
50
|
+
parser.add_argument(
|
|
51
|
+
"--description",
|
|
52
|
+
metavar="<description>",
|
|
53
|
+
help=_("Description of this consistency group snapshot"),
|
|
54
|
+
)
|
|
55
|
+
return parser
|
|
56
|
+
|
|
57
|
+
def take_action(
|
|
58
|
+
self, parsed_args: argparse.Namespace
|
|
59
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
60
|
+
volume_client = self.app.client_manager.volume
|
|
61
|
+
consistency_group = parsed_args.consistency_group
|
|
62
|
+
if not parsed_args.consistency_group:
|
|
63
|
+
# If "--consistency-group" not specified, then consistency_group
|
|
64
|
+
# will be the same as the new consistency group snapshot name
|
|
65
|
+
consistency_group = parsed_args.snapshot_name
|
|
66
|
+
consistency_group_id = utils.find_resource(
|
|
67
|
+
volume_client.consistencygroups, consistency_group
|
|
68
|
+
).id
|
|
69
|
+
consistency_group_snapshot = volume_client.cgsnapshots.create(
|
|
70
|
+
consistency_group_id,
|
|
71
|
+
name=parsed_args.snapshot_name,
|
|
72
|
+
description=parsed_args.description,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
col_headers, col_data = zip(
|
|
76
|
+
*sorted(consistency_group_snapshot._info.items())
|
|
77
|
+
)
|
|
78
|
+
return col_headers, col_data
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
class DeleteConsistencyGroupSnapshot(command.Command):
|
|
82
|
+
_description = _("Delete consistency group snapshot(s).")
|
|
83
|
+
|
|
84
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
85
|
+
parser = super().get_parser(prog_name)
|
|
86
|
+
parser.add_argument(
|
|
87
|
+
"consistency_group_snapshot",
|
|
88
|
+
metavar="<consistency-group-snapshot>",
|
|
89
|
+
nargs="+",
|
|
90
|
+
help=_("Consistency group snapshot(s) to delete (name or ID)"),
|
|
91
|
+
)
|
|
92
|
+
return parser
|
|
93
|
+
|
|
94
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
95
|
+
volume_client = self.app.client_manager.volume
|
|
96
|
+
result = 0
|
|
97
|
+
|
|
98
|
+
for snapshot in parsed_args.consistency_group_snapshot:
|
|
99
|
+
try:
|
|
100
|
+
snapshot_id = utils.find_resource(
|
|
101
|
+
volume_client.cgsnapshots, snapshot
|
|
102
|
+
).id
|
|
103
|
+
|
|
104
|
+
volume_client.cgsnapshots.delete(snapshot_id)
|
|
105
|
+
except Exception as e:
|
|
106
|
+
result += 1
|
|
107
|
+
LOG.error(
|
|
108
|
+
_(
|
|
109
|
+
"Failed to delete consistency group snapshot "
|
|
110
|
+
"with name or ID '%(snapshot)s': %(e)s"
|
|
111
|
+
),
|
|
112
|
+
{'snapshot': snapshot, 'e': e},
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
if result > 0:
|
|
116
|
+
total = len(parsed_args.consistency_group_snapshot)
|
|
117
|
+
msg = _(
|
|
118
|
+
"%(result)s of %(total)s consistency group snapshots "
|
|
119
|
+
"failed to delete."
|
|
120
|
+
) % {'result': result, 'total': total}
|
|
121
|
+
raise exceptions.CommandError(msg)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
class ListConsistencyGroupSnapshot(command.Lister):
|
|
125
|
+
_description = _("List consistency group snapshots.")
|
|
126
|
+
|
|
127
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
128
|
+
parser = super().get_parser(prog_name)
|
|
129
|
+
parser.add_argument(
|
|
130
|
+
'--all-projects',
|
|
131
|
+
action="store_true",
|
|
132
|
+
help=_(
|
|
133
|
+
'Show detail for all projects (admin only) (defaults to False)'
|
|
134
|
+
),
|
|
135
|
+
)
|
|
136
|
+
parser.add_argument(
|
|
137
|
+
'--long',
|
|
138
|
+
action="store_true",
|
|
139
|
+
help=_('List additional fields in output'),
|
|
140
|
+
)
|
|
141
|
+
parser.add_argument(
|
|
142
|
+
'--status',
|
|
143
|
+
metavar="<status>",
|
|
144
|
+
choices=[
|
|
145
|
+
'available',
|
|
146
|
+
'error',
|
|
147
|
+
'creating',
|
|
148
|
+
'deleting',
|
|
149
|
+
'error_deleting',
|
|
150
|
+
],
|
|
151
|
+
help=_(
|
|
152
|
+
'Filters results by a status ("available", "error", '
|
|
153
|
+
'"creating", "deleting" or "error_deleting")'
|
|
154
|
+
),
|
|
155
|
+
)
|
|
156
|
+
parser.add_argument(
|
|
157
|
+
'--consistency-group',
|
|
158
|
+
metavar="<consistency-group>",
|
|
159
|
+
help=_('Filters results by a consistency group (name or ID)'),
|
|
160
|
+
)
|
|
161
|
+
return parser
|
|
162
|
+
|
|
163
|
+
def take_action(
|
|
164
|
+
self, parsed_args: argparse.Namespace
|
|
165
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
166
|
+
if parsed_args.long:
|
|
167
|
+
columns = [
|
|
168
|
+
'ID',
|
|
169
|
+
'Status',
|
|
170
|
+
'ConsistencyGroup ID',
|
|
171
|
+
'Name',
|
|
172
|
+
'Description',
|
|
173
|
+
'Created At',
|
|
174
|
+
]
|
|
175
|
+
else:
|
|
176
|
+
columns = ['ID', 'Status', 'Name']
|
|
177
|
+
volume_client = self.app.client_manager.volume
|
|
178
|
+
consistency_group_id = None
|
|
179
|
+
if parsed_args.consistency_group:
|
|
180
|
+
consistency_group_id = utils.find_resource(
|
|
181
|
+
volume_client.consistencygroups,
|
|
182
|
+
parsed_args.consistency_group,
|
|
183
|
+
).id
|
|
184
|
+
search_opts = {
|
|
185
|
+
'all_tenants': parsed_args.all_projects,
|
|
186
|
+
'status': parsed_args.status,
|
|
187
|
+
'consistencygroup_id': consistency_group_id,
|
|
188
|
+
}
|
|
189
|
+
consistency_group_snapshots = volume_client.cgsnapshots.list(
|
|
190
|
+
detailed=True,
|
|
191
|
+
search_opts=search_opts,
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
return (
|
|
195
|
+
columns,
|
|
196
|
+
(
|
|
197
|
+
utils.get_item_properties(s, columns)
|
|
198
|
+
for s in consistency_group_snapshots
|
|
199
|
+
),
|
|
200
|
+
)
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
class ShowConsistencyGroupSnapshot(command.ShowOne):
|
|
204
|
+
_description = _("Display consistency group snapshot details")
|
|
205
|
+
|
|
206
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
207
|
+
parser = super().get_parser(prog_name)
|
|
208
|
+
parser.add_argument(
|
|
209
|
+
"consistency_group_snapshot",
|
|
210
|
+
metavar="<consistency-group-snapshot>",
|
|
211
|
+
help=_("Consistency group snapshot to display (name or ID)"),
|
|
212
|
+
)
|
|
213
|
+
return parser
|
|
214
|
+
|
|
215
|
+
def take_action(
|
|
216
|
+
self, parsed_args: argparse.Namespace
|
|
217
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
218
|
+
volume_client = self.app.client_manager.volume
|
|
219
|
+
consistency_group_snapshot = utils.find_resource(
|
|
220
|
+
volume_client.cgsnapshots, parsed_args.consistency_group_snapshot
|
|
221
|
+
)
|
|
222
|
+
col_headers, col_data = zip(
|
|
223
|
+
*sorted(consistency_group_snapshot._info.items())
|
|
224
|
+
)
|
|
225
|
+
return col_headers, col_data
|
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
# Copyright 2015 iWeb Technologies Inc.
|
|
2
|
+
#
|
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
4
|
+
# not use this file except in compliance with the License. You may obtain
|
|
5
|
+
# a copy of the License at
|
|
6
|
+
#
|
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
#
|
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
11
|
+
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
12
|
+
# License for the specific language governing permissions and limitations
|
|
13
|
+
# under the License.
|
|
14
|
+
|
|
15
|
+
"""Volume v3 QoS action implementations"""
|
|
16
|
+
|
|
17
|
+
import argparse
|
|
18
|
+
import logging
|
|
19
|
+
from collections.abc import Iterable, Sequence
|
|
20
|
+
from typing import Any
|
|
21
|
+
|
|
22
|
+
from osc_lib.cli import format_columns
|
|
23
|
+
from osc_lib.cli import parseractions
|
|
24
|
+
from osc_lib import exceptions
|
|
25
|
+
from osc_lib import utils
|
|
26
|
+
|
|
27
|
+
from openstackclient import command
|
|
28
|
+
from openstackclient.i18n import _
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
LOG = logging.getLogger(__name__)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class AssociateQos(command.Command):
|
|
35
|
+
_description = _("Associate a QoS specification to a volume type")
|
|
36
|
+
|
|
37
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
38
|
+
parser = super().get_parser(prog_name)
|
|
39
|
+
parser.add_argument(
|
|
40
|
+
'qos_spec',
|
|
41
|
+
metavar='<qos-spec>',
|
|
42
|
+
help=_('QoS specification to modify (name or ID)'),
|
|
43
|
+
)
|
|
44
|
+
parser.add_argument(
|
|
45
|
+
'volume_type',
|
|
46
|
+
metavar='<volume-type>',
|
|
47
|
+
help=_('Volume type to associate the QoS (name or ID)'),
|
|
48
|
+
)
|
|
49
|
+
return parser
|
|
50
|
+
|
|
51
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
52
|
+
volume_client = self.app.client_manager.volume
|
|
53
|
+
qos_spec = utils.find_resource(
|
|
54
|
+
volume_client.qos_specs, parsed_args.qos_spec
|
|
55
|
+
)
|
|
56
|
+
volume_type = utils.find_resource(
|
|
57
|
+
volume_client.volume_types, parsed_args.volume_type
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
volume_client.qos_specs.associate(qos_spec.id, volume_type.id)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class CreateQos(command.ShowOne):
|
|
64
|
+
_description = _("Create new QoS specification")
|
|
65
|
+
|
|
66
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
67
|
+
parser = super().get_parser(prog_name)
|
|
68
|
+
parser.add_argument(
|
|
69
|
+
'name',
|
|
70
|
+
metavar='<name>',
|
|
71
|
+
help=_('New QoS specification name'),
|
|
72
|
+
)
|
|
73
|
+
consumer_choices = ['front-end', 'back-end', 'both']
|
|
74
|
+
parser.add_argument(
|
|
75
|
+
'--consumer',
|
|
76
|
+
metavar='<consumer>',
|
|
77
|
+
choices=consumer_choices,
|
|
78
|
+
default='both',
|
|
79
|
+
help=(
|
|
80
|
+
_(
|
|
81
|
+
'Consumer of the QoS. Valid consumers: %s '
|
|
82
|
+
"(defaults to 'both')"
|
|
83
|
+
)
|
|
84
|
+
% utils.format_list(consumer_choices)
|
|
85
|
+
),
|
|
86
|
+
)
|
|
87
|
+
parser.add_argument(
|
|
88
|
+
'--property',
|
|
89
|
+
metavar='<key=value>',
|
|
90
|
+
action=parseractions.KeyValueAction,
|
|
91
|
+
help=_(
|
|
92
|
+
'Set a QoS specification property '
|
|
93
|
+
'(repeat option to set multiple properties)'
|
|
94
|
+
),
|
|
95
|
+
)
|
|
96
|
+
return parser
|
|
97
|
+
|
|
98
|
+
def take_action(
|
|
99
|
+
self, parsed_args: argparse.Namespace
|
|
100
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
101
|
+
volume_client = self.app.client_manager.volume
|
|
102
|
+
specs = {}
|
|
103
|
+
specs.update({'consumer': parsed_args.consumer})
|
|
104
|
+
|
|
105
|
+
if parsed_args.property:
|
|
106
|
+
specs.update(parsed_args.property)
|
|
107
|
+
|
|
108
|
+
qos_spec = volume_client.qos_specs.create(parsed_args.name, specs)
|
|
109
|
+
|
|
110
|
+
qos_spec._info.update(
|
|
111
|
+
{
|
|
112
|
+
'properties': format_columns.DictColumn(
|
|
113
|
+
qos_spec._info.pop('specs')
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
)
|
|
117
|
+
col_headers, col_data = zip(*sorted(qos_spec._info.items()))
|
|
118
|
+
return col_headers, col_data
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class DeleteQos(command.Command):
|
|
122
|
+
_description = _("Delete QoS specification")
|
|
123
|
+
|
|
124
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
125
|
+
parser = super().get_parser(prog_name)
|
|
126
|
+
parser.add_argument(
|
|
127
|
+
'qos_specs',
|
|
128
|
+
metavar='<qos-spec>',
|
|
129
|
+
nargs="+",
|
|
130
|
+
help=_('QoS specification(s) to delete (name or ID)'),
|
|
131
|
+
)
|
|
132
|
+
parser.add_argument(
|
|
133
|
+
'--force',
|
|
134
|
+
action='store_true',
|
|
135
|
+
default=False,
|
|
136
|
+
help=_("Allow to delete in-use QoS specification(s)"),
|
|
137
|
+
)
|
|
138
|
+
return parser
|
|
139
|
+
|
|
140
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
141
|
+
volume_client = self.app.client_manager.volume
|
|
142
|
+
result = 0
|
|
143
|
+
|
|
144
|
+
for i in parsed_args.qos_specs:
|
|
145
|
+
try:
|
|
146
|
+
qos_spec = utils.find_resource(volume_client.qos_specs, i)
|
|
147
|
+
volume_client.qos_specs.delete(qos_spec.id, parsed_args.force)
|
|
148
|
+
except Exception as e:
|
|
149
|
+
result += 1
|
|
150
|
+
LOG.error(
|
|
151
|
+
_(
|
|
152
|
+
"Failed to delete QoS specification with "
|
|
153
|
+
"name or ID '%(qos)s': %(e)s"
|
|
154
|
+
),
|
|
155
|
+
{'qos': i, 'e': e},
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
if result > 0:
|
|
159
|
+
total = len(parsed_args.qos_specs)
|
|
160
|
+
msg = _(
|
|
161
|
+
"%(result)s of %(total)s QoS specifications failed to delete."
|
|
162
|
+
) % {'result': result, 'total': total}
|
|
163
|
+
raise exceptions.CommandError(msg)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class DisassociateQos(command.Command):
|
|
167
|
+
_description = _("Disassociate a QoS specification from a volume type")
|
|
168
|
+
|
|
169
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
170
|
+
parser = super().get_parser(prog_name)
|
|
171
|
+
parser.add_argument(
|
|
172
|
+
'qos_spec',
|
|
173
|
+
metavar='<qos-spec>',
|
|
174
|
+
help=_('QoS specification to modify (name or ID)'),
|
|
175
|
+
)
|
|
176
|
+
volume_type_group = parser.add_mutually_exclusive_group()
|
|
177
|
+
volume_type_group.add_argument(
|
|
178
|
+
'--volume-type',
|
|
179
|
+
metavar='<volume-type>',
|
|
180
|
+
help=_('Volume type to disassociate the QoS from (name or ID)'),
|
|
181
|
+
)
|
|
182
|
+
volume_type_group.add_argument(
|
|
183
|
+
'--all',
|
|
184
|
+
action='store_true',
|
|
185
|
+
default=False,
|
|
186
|
+
help=_('Disassociate the QoS from every volume type'),
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
return parser
|
|
190
|
+
|
|
191
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
192
|
+
volume_client = self.app.client_manager.volume
|
|
193
|
+
qos_spec = utils.find_resource(
|
|
194
|
+
volume_client.qos_specs, parsed_args.qos_spec
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
if parsed_args.volume_type:
|
|
198
|
+
volume_type = utils.find_resource(
|
|
199
|
+
volume_client.volume_types, parsed_args.volume_type
|
|
200
|
+
)
|
|
201
|
+
volume_client.qos_specs.disassociate(qos_spec.id, volume_type.id)
|
|
202
|
+
elif parsed_args.all:
|
|
203
|
+
volume_client.qos_specs.disassociate_all(qos_spec.id)
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
class ListQos(command.Lister):
|
|
207
|
+
_description = _("List QoS specifications")
|
|
208
|
+
|
|
209
|
+
def take_action(
|
|
210
|
+
self, parsed_args: argparse.Namespace
|
|
211
|
+
) -> tuple[Sequence[str], Iterable[tuple[Any, ...]]]:
|
|
212
|
+
volume_client = self.app.client_manager.volume
|
|
213
|
+
qos_specs_list = volume_client.qos_specs.list()
|
|
214
|
+
|
|
215
|
+
for qos in qos_specs_list:
|
|
216
|
+
try:
|
|
217
|
+
qos_associations = volume_client.qos_specs.get_associations(
|
|
218
|
+
qos,
|
|
219
|
+
)
|
|
220
|
+
if qos_associations:
|
|
221
|
+
associations = [
|
|
222
|
+
association.name for association in qos_associations
|
|
223
|
+
]
|
|
224
|
+
qos._info.update({'associations': associations})
|
|
225
|
+
except Exception as ex:
|
|
226
|
+
if type(ex).__name__ == 'NotFound':
|
|
227
|
+
qos._info.update({'associations': None})
|
|
228
|
+
else:
|
|
229
|
+
raise
|
|
230
|
+
|
|
231
|
+
display_columns = (
|
|
232
|
+
'ID',
|
|
233
|
+
'Name',
|
|
234
|
+
'Consumer',
|
|
235
|
+
'Associations',
|
|
236
|
+
'Properties',
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
columns = ('ID', 'Name', 'Consumer', 'Associations', 'Specs')
|
|
240
|
+
return (
|
|
241
|
+
display_columns,
|
|
242
|
+
(
|
|
243
|
+
utils.get_dict_properties(
|
|
244
|
+
s._info,
|
|
245
|
+
columns,
|
|
246
|
+
formatters={
|
|
247
|
+
'Specs': format_columns.DictColumn,
|
|
248
|
+
'Associations': format_columns.ListColumn,
|
|
249
|
+
},
|
|
250
|
+
)
|
|
251
|
+
for s in qos_specs_list
|
|
252
|
+
),
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
class SetQos(command.Command):
|
|
257
|
+
_description = _("Set QoS specification properties")
|
|
258
|
+
|
|
259
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
260
|
+
parser = super().get_parser(prog_name)
|
|
261
|
+
parser.add_argument(
|
|
262
|
+
'qos_spec',
|
|
263
|
+
metavar='<qos-spec>',
|
|
264
|
+
help=_('QoS specification to modify (name or ID)'),
|
|
265
|
+
)
|
|
266
|
+
parser.add_argument(
|
|
267
|
+
'--no-property',
|
|
268
|
+
dest='no_property',
|
|
269
|
+
action='store_true',
|
|
270
|
+
help=_(
|
|
271
|
+
'Remove all properties from <qos-spec> '
|
|
272
|
+
'(specify both --no-property and --property to remove the '
|
|
273
|
+
'current properties before setting new properties)'
|
|
274
|
+
),
|
|
275
|
+
)
|
|
276
|
+
parser.add_argument(
|
|
277
|
+
'--property',
|
|
278
|
+
metavar='<key=value>',
|
|
279
|
+
action=parseractions.KeyValueAction,
|
|
280
|
+
help=_(
|
|
281
|
+
'Property to add or modify for this QoS specification '
|
|
282
|
+
'(repeat option to set multiple properties)'
|
|
283
|
+
),
|
|
284
|
+
)
|
|
285
|
+
return parser
|
|
286
|
+
|
|
287
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
288
|
+
volume_client = self.app.client_manager.volume
|
|
289
|
+
qos_spec = utils.find_resource(
|
|
290
|
+
volume_client.qos_specs, parsed_args.qos_spec
|
|
291
|
+
)
|
|
292
|
+
|
|
293
|
+
result = 0
|
|
294
|
+
if parsed_args.no_property:
|
|
295
|
+
try:
|
|
296
|
+
key_list = list(qos_spec._info['specs'].keys())
|
|
297
|
+
volume_client.qos_specs.unset_keys(qos_spec.id, key_list)
|
|
298
|
+
except Exception as e:
|
|
299
|
+
LOG.error(_("Failed to clean qos properties: %s"), e)
|
|
300
|
+
result += 1
|
|
301
|
+
|
|
302
|
+
if parsed_args.property:
|
|
303
|
+
try:
|
|
304
|
+
volume_client.qos_specs.set_keys(
|
|
305
|
+
qos_spec.id,
|
|
306
|
+
parsed_args.property,
|
|
307
|
+
)
|
|
308
|
+
except Exception as e:
|
|
309
|
+
LOG.error(_("Failed to set qos property: %s"), e)
|
|
310
|
+
result += 1
|
|
311
|
+
|
|
312
|
+
if result > 0:
|
|
313
|
+
raise exceptions.CommandError(
|
|
314
|
+
_("One or more of the set operations failed")
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
class ShowQos(command.ShowOne):
|
|
319
|
+
_description = _("Display QoS specification details")
|
|
320
|
+
|
|
321
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
322
|
+
parser = super().get_parser(prog_name)
|
|
323
|
+
parser.add_argument(
|
|
324
|
+
'qos_spec',
|
|
325
|
+
metavar='<qos-spec>',
|
|
326
|
+
help=_('QoS specification to display (name or ID)'),
|
|
327
|
+
)
|
|
328
|
+
return parser
|
|
329
|
+
|
|
330
|
+
def take_action(
|
|
331
|
+
self, parsed_args: argparse.Namespace
|
|
332
|
+
) -> tuple[Sequence[str], Iterable[Any]]:
|
|
333
|
+
volume_client = self.app.client_manager.volume
|
|
334
|
+
qos_spec = utils.find_resource(
|
|
335
|
+
volume_client.qos_specs, parsed_args.qos_spec
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
qos_associations = volume_client.qos_specs.get_associations(qos_spec)
|
|
339
|
+
if qos_associations:
|
|
340
|
+
associations = [
|
|
341
|
+
association.name for association in qos_associations
|
|
342
|
+
]
|
|
343
|
+
qos_spec._info.update(
|
|
344
|
+
{'associations': format_columns.ListColumn(associations)}
|
|
345
|
+
)
|
|
346
|
+
qos_spec._info.update(
|
|
347
|
+
{
|
|
348
|
+
'properties': format_columns.DictColumn(
|
|
349
|
+
qos_spec._info.pop('specs')
|
|
350
|
+
)
|
|
351
|
+
}
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
col_headers, col_data = zip(*sorted(qos_spec._info.items()))
|
|
355
|
+
return col_headers, col_data
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
class UnsetQos(command.Command):
|
|
359
|
+
_description = _("Unset QoS specification properties")
|
|
360
|
+
|
|
361
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
362
|
+
parser = super().get_parser(prog_name)
|
|
363
|
+
parser.add_argument(
|
|
364
|
+
'qos_spec',
|
|
365
|
+
metavar='<qos-spec>',
|
|
366
|
+
help=_('QoS specification to modify (name or ID)'),
|
|
367
|
+
)
|
|
368
|
+
parser.add_argument(
|
|
369
|
+
'--property',
|
|
370
|
+
metavar='<key>',
|
|
371
|
+
action='append',
|
|
372
|
+
default=[],
|
|
373
|
+
help=_(
|
|
374
|
+
'Property to remove from the QoS specification. '
|
|
375
|
+
'(repeat option to unset multiple properties)'
|
|
376
|
+
),
|
|
377
|
+
)
|
|
378
|
+
return parser
|
|
379
|
+
|
|
380
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
381
|
+
volume_client = self.app.client_manager.volume
|
|
382
|
+
qos_spec = utils.find_resource(
|
|
383
|
+
volume_client.qos_specs, parsed_args.qos_spec
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
if parsed_args.property:
|
|
387
|
+
volume_client.qos_specs.unset_keys(
|
|
388
|
+
qos_spec.id, parsed_args.property
|
|
389
|
+
)
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
"""Service action implementations"""
|
|
16
16
|
|
|
17
|
+
import argparse
|
|
18
|
+
from collections.abc import Iterable
|
|
19
|
+
from typing import Any
|
|
20
|
+
|
|
17
21
|
from openstack import utils as sdk_utils
|
|
18
22
|
from osc_lib import exceptions
|
|
19
23
|
from osc_lib import utils
|
|
@@ -25,7 +29,7 @@ from openstackclient.i18n import _
|
|
|
25
29
|
class ListService(command.Lister):
|
|
26
30
|
_description = _("List service command")
|
|
27
31
|
|
|
28
|
-
def get_parser(self, prog_name):
|
|
32
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
29
33
|
parser = super().get_parser(prog_name)
|
|
30
34
|
parser.add_argument(
|
|
31
35
|
"--host",
|
|
@@ -45,8 +49,12 @@ class ListService(command.Lister):
|
|
|
45
49
|
)
|
|
46
50
|
return parser
|
|
47
51
|
|
|
48
|
-
def take_action(
|
|
49
|
-
|
|
52
|
+
def take_action(
|
|
53
|
+
self, parsed_args: argparse.Namespace
|
|
54
|
+
) -> tuple[tuple[str, ...], Iterable[tuple[Any, ...]]]:
|
|
55
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
56
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
57
|
+
)
|
|
50
58
|
|
|
51
59
|
columns: tuple[str, ...] = (
|
|
52
60
|
"binary",
|
|
@@ -93,7 +101,7 @@ class ListService(command.Lister):
|
|
|
93
101
|
class SetService(command.Command):
|
|
94
102
|
_description = _("Set volume service properties")
|
|
95
103
|
|
|
96
|
-
def get_parser(self, prog_name):
|
|
104
|
+
def get_parser(self, prog_name: str) -> argparse.ArgumentParser:
|
|
97
105
|
parser = super().get_parser(prog_name)
|
|
98
106
|
parser.add_argument(
|
|
99
107
|
"host",
|
|
@@ -122,7 +130,7 @@ class SetService(command.Command):
|
|
|
122
130
|
)
|
|
123
131
|
return parser
|
|
124
132
|
|
|
125
|
-
def take_action(self, parsed_args):
|
|
133
|
+
def take_action(self, parsed_args: argparse.Namespace) -> None:
|
|
126
134
|
if parsed_args.disable_reason and not parsed_args.disable:
|
|
127
135
|
msg = _(
|
|
128
136
|
"Cannot specify option --disable-reason without "
|
|
@@ -130,7 +138,9 @@ class SetService(command.Command):
|
|
|
130
138
|
)
|
|
131
139
|
raise exceptions.CommandError(msg)
|
|
132
140
|
|
|
133
|
-
volume_client =
|
|
141
|
+
volume_client = sdk_utils.ensure_service_version(
|
|
142
|
+
self.app.client_manager.sdk_connection.volume, '3'
|
|
143
|
+
)
|
|
134
144
|
|
|
135
145
|
service = volume_client.find_service(
|
|
136
146
|
parsed_args.service, ignore_missing=False, host=parsed_args.host
|