python-openstackclient 7.4.0__py3-none-any.whl → 8.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.
Files changed (264) hide show
  1. openstackclient/common/availability_zone.py +3 -6
  2. openstackclient/common/clientmanager.py +2 -1
  3. openstackclient/common/envvars.py +57 -0
  4. openstackclient/common/extension.py +3 -11
  5. openstackclient/common/limits.py +1 -1
  6. openstackclient/common/project_cleanup.py +3 -2
  7. openstackclient/common/quota.py +54 -28
  8. openstackclient/compute/client.py +7 -5
  9. openstackclient/compute/v2/agent.py +5 -5
  10. openstackclient/compute/v2/aggregate.py +17 -15
  11. openstackclient/compute/v2/console.py +10 -4
  12. openstackclient/compute/v2/console_connection.py +48 -0
  13. openstackclient/compute/v2/flavor.py +14 -18
  14. openstackclient/compute/v2/host.py +3 -3
  15. openstackclient/compute/v2/hypervisor.py +10 -4
  16. openstackclient/compute/v2/hypervisor_stats.py +1 -1
  17. openstackclient/compute/v2/keypair.py +18 -13
  18. openstackclient/compute/v2/server.py +144 -121
  19. openstackclient/compute/v2/server_backup.py +1 -1
  20. openstackclient/compute/v2/server_event.py +8 -17
  21. openstackclient/compute/v2/server_group.py +6 -6
  22. openstackclient/compute/v2/server_image.py +1 -1
  23. openstackclient/compute/v2/server_migration.py +6 -6
  24. openstackclient/compute/v2/server_volume.py +4 -4
  25. openstackclient/compute/v2/service.py +9 -13
  26. openstackclient/compute/v2/usage.py +4 -6
  27. openstackclient/identity/client.py +2 -4
  28. openstackclient/identity/common.py +95 -17
  29. openstackclient/identity/v2_0/ec2creds.py +4 -3
  30. openstackclient/identity/v2_0/endpoint.py +12 -10
  31. openstackclient/identity/v2_0/project.py +6 -6
  32. openstackclient/identity/v2_0/role.py +1 -1
  33. openstackclient/identity/v2_0/service.py +7 -7
  34. openstackclient/identity/v2_0/user.py +6 -21
  35. openstackclient/identity/v3/access_rule.py +2 -5
  36. openstackclient/identity/v3/application_credential.py +2 -2
  37. openstackclient/identity/v3/consumer.py +4 -3
  38. openstackclient/identity/v3/credential.py +6 -7
  39. openstackclient/identity/v3/domain.py +63 -44
  40. openstackclient/identity/v3/ec2creds.py +4 -3
  41. openstackclient/identity/v3/endpoint.py +104 -88
  42. openstackclient/identity/v3/endpoint_group.py +1 -1
  43. openstackclient/identity/v3/group.py +116 -72
  44. openstackclient/identity/v3/identity_provider.py +1 -2
  45. openstackclient/identity/v3/limit.py +4 -9
  46. openstackclient/identity/v3/mapping.py +4 -3
  47. openstackclient/identity/v3/policy.py +5 -8
  48. openstackclient/identity/v3/project.py +23 -6
  49. openstackclient/identity/v3/region.py +2 -5
  50. openstackclient/identity/v3/registered_limit.py +4 -8
  51. openstackclient/identity/v3/role.py +15 -16
  52. openstackclient/identity/v3/service.py +8 -8
  53. openstackclient/identity/v3/service_provider.py +3 -6
  54. openstackclient/identity/v3/tag.py +2 -2
  55. openstackclient/identity/v3/token.py +1 -2
  56. openstackclient/identity/v3/trust.py +74 -25
  57. openstackclient/identity/v3/user.py +47 -11
  58. openstackclient/image/client.py +7 -5
  59. openstackclient/image/v1/image.py +11 -15
  60. openstackclient/image/v2/cache.py +2 -4
  61. openstackclient/image/v2/image.py +41 -48
  62. openstackclient/image/v2/metadef_namespaces.py +4 -3
  63. openstackclient/image/v2/metadef_resource_type_association.py +1 -2
  64. openstackclient/image/v2/metadef_resource_types.py +1 -2
  65. openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +9 -1370
  66. openstackclient/network/client.py +4 -16
  67. openstackclient/network/common.py +16 -12
  68. openstackclient/network/utils.py +3 -3
  69. openstackclient/network/v2/address_group.py +5 -9
  70. openstackclient/network/v2/address_scope.py +2 -3
  71. openstackclient/network/v2/default_security_group_rule.py +1 -2
  72. openstackclient/network/v2/floating_ip.py +69 -47
  73. openstackclient/network/v2/floating_ip_port_forwarding.py +7 -7
  74. openstackclient/network/v2/ip_availability.py +1 -2
  75. openstackclient/network/v2/l3_conntrack_helper.py +8 -12
  76. openstackclient/network/v2/local_ip.py +24 -26
  77. openstackclient/network/v2/local_ip_association.py +4 -5
  78. openstackclient/network/v2/ndp_proxy.py +9 -10
  79. openstackclient/network/v2/network.py +12 -16
  80. openstackclient/network/v2/network_agent.py +29 -37
  81. openstackclient/network/v2/network_auto_allocated_topology.py +4 -5
  82. openstackclient/network/v2/network_flavor.py +1 -1
  83. openstackclient/network/v2/network_flavor_profile.py +5 -5
  84. openstackclient/network/v2/network_meter.py +3 -3
  85. openstackclient/network/v2/network_meter_rule.py +5 -8
  86. openstackclient/network/v2/network_qos_policy.py +4 -4
  87. openstackclient/network/v2/network_qos_rule.py +7 -16
  88. openstackclient/network/v2/network_rbac.py +4 -4
  89. openstackclient/network/v2/network_segment.py +6 -7
  90. openstackclient/network/v2/network_segment_range.py +16 -20
  91. openstackclient/network/v2/network_trunk.py +24 -16
  92. openstackclient/network/v2/port.py +28 -29
  93. openstackclient/network/v2/router.py +53 -42
  94. openstackclient/network/v2/security_group.py +13 -19
  95. openstackclient/network/v2/security_group_rule.py +10 -11
  96. openstackclient/network/v2/subnet.py +31 -30
  97. openstackclient/network/v2/subnet_pool.py +4 -4
  98. openstackclient/object/client.py +2 -3
  99. openstackclient/object/v1/container.py +2 -3
  100. openstackclient/object/v1/object.py +2 -9
  101. openstackclient/shell.py +22 -5
  102. openstackclient/tests/functional/base.py +7 -3
  103. openstackclient/tests/functional/common/test_quota.py +3 -1
  104. openstackclient/tests/functional/compute/v2/common.py +12 -6
  105. openstackclient/tests/functional/compute/v2/test_keypair.py +41 -5
  106. openstackclient/tests/functional/compute/v2/test_server.py +2 -3
  107. openstackclient/tests/functional/compute/v2/test_server_event.py +1 -1
  108. openstackclient/tests/functional/identity/v2/test_user.py +1 -1
  109. openstackclient/tests/functional/identity/v3/common.py +3 -8
  110. openstackclient/tests/functional/identity/v3/test_application_credential.py +10 -10
  111. openstackclient/tests/functional/identity/v3/test_endpoint.py +3 -3
  112. openstackclient/tests/functional/identity/v3/test_group.py +3 -3
  113. openstackclient/tests/functional/identity/v3/test_idp.py +3 -7
  114. openstackclient/tests/functional/identity/v3/test_limit.py +4 -4
  115. openstackclient/tests/functional/identity/v3/test_project.py +5 -14
  116. openstackclient/tests/functional/identity/v3/test_region.py +1 -3
  117. openstackclient/tests/functional/identity/v3/test_registered_limit.py +3 -3
  118. openstackclient/tests/functional/identity/v3/test_role.py +1 -1
  119. openstackclient/tests/functional/identity/v3/test_role_assignment.py +13 -31
  120. openstackclient/tests/functional/identity/v3/test_service_provider.py +3 -7
  121. openstackclient/tests/functional/identity/v3/test_user.py +8 -8
  122. openstackclient/tests/functional/network/v2/common.py +7 -3
  123. openstackclient/tests/functional/network/v2/test_address_group.py +4 -0
  124. openstackclient/tests/functional/network/v2/test_l3_conntrack_helper.py +15 -11
  125. openstackclient/tests/functional/network/v2/test_local_ip.py +4 -0
  126. openstackclient/tests/functional/network/v2/test_network_meter_rule.py +2 -2
  127. openstackclient/tests/functional/network/v2/test_network_ndp_proxy.py +2 -3
  128. openstackclient/tests/functional/network/v2/test_network_rbac.py +2 -2
  129. openstackclient/tests/functional/network/v2/test_network_trunk.py +1 -1
  130. openstackclient/tests/functional/network/v2/test_port.py +17 -7
  131. openstackclient/tests/functional/network/v2/test_router.py +42 -0
  132. openstackclient/tests/functional/network/v2/test_subnet_pool.py +4 -0
  133. openstackclient/tests/unit/api/test_compute_v2.py +67 -87
  134. openstackclient/tests/unit/common/test_availability_zone.py +6 -14
  135. openstackclient/tests/unit/common/test_command.py +1 -1
  136. openstackclient/tests/unit/common/test_extension.py +5 -7
  137. openstackclient/tests/unit/common/test_limits.py +1 -1
  138. openstackclient/tests/unit/common/test_project_cleanup.py +5 -6
  139. openstackclient/tests/unit/common/test_quota.py +51 -28
  140. openstackclient/tests/unit/compute/v2/fakes.py +85 -315
  141. openstackclient/tests/unit/compute/v2/test_agent.py +16 -16
  142. openstackclient/tests/unit/compute/v2/test_aggregate.py +56 -60
  143. openstackclient/tests/unit/compute/v2/test_console.py +34 -17
  144. openstackclient/tests/unit/compute/v2/test_console_connection.py +72 -0
  145. openstackclient/tests/unit/compute/v2/test_flavor.py +72 -72
  146. openstackclient/tests/unit/compute/v2/test_host.py +8 -8
  147. openstackclient/tests/unit/compute/v2/test_hypervisor.py +22 -30
  148. openstackclient/tests/unit/compute/v2/test_hypervisor_stats.py +2 -2
  149. openstackclient/tests/unit/compute/v2/test_keypair.py +36 -29
  150. openstackclient/tests/unit/compute/v2/test_server.py +693 -606
  151. openstackclient/tests/unit/compute/v2/test_server_backup.py +36 -77
  152. openstackclient/tests/unit/compute/v2/test_server_event.py +18 -20
  153. openstackclient/tests/unit/compute/v2/test_server_group.py +25 -31
  154. openstackclient/tests/unit/compute/v2/test_server_image.py +37 -78
  155. openstackclient/tests/unit/compute/v2/test_server_migration.py +41 -41
  156. openstackclient/tests/unit/compute/v2/test_server_volume.py +12 -12
  157. openstackclient/tests/unit/compute/v2/test_service.py +39 -45
  158. openstackclient/tests/unit/compute/v2/test_usage.py +5 -5
  159. openstackclient/tests/unit/identity/v2_0/fakes.py +1 -1
  160. openstackclient/tests/unit/identity/v3/test_access_rule.py +1 -3
  161. openstackclient/tests/unit/identity/v3/test_application_credential.py +48 -26
  162. openstackclient/tests/unit/identity/v3/test_domain.py +115 -105
  163. openstackclient/tests/unit/identity/v3/test_endpoint.py +167 -172
  164. openstackclient/tests/unit/identity/v3/test_group.py +353 -202
  165. openstackclient/tests/unit/identity/v3/test_mappings.py +2 -2
  166. openstackclient/tests/unit/identity/v3/test_project.py +16 -0
  167. openstackclient/tests/unit/identity/v3/test_trust.py +5 -2
  168. openstackclient/tests/unit/identity/v3/test_user.py +102 -6
  169. openstackclient/tests/unit/image/v1/fakes.py +2 -2
  170. openstackclient/tests/unit/image/v1/test_image.py +8 -9
  171. openstackclient/tests/unit/image/v2/test_image.py +84 -46
  172. openstackclient/tests/unit/integ/cli/test_shell.py +1 -2
  173. openstackclient/tests/unit/network/test_common.py +2 -2
  174. openstackclient/tests/unit/network/v2/fakes.py +405 -485
  175. openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +8 -14
  176. openstackclient/tests/unit/network/v2/test_floating_ip_network.py +62 -54
  177. openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +1 -1
  178. openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +2 -2
  179. openstackclient/tests/unit/network/v2/test_ndp_proxy.py +1 -3
  180. openstackclient/tests/unit/network/v2/test_network.py +4 -4
  181. openstackclient/tests/unit/network/v2/test_network_agent.py +15 -29
  182. openstackclient/tests/unit/network/v2/test_network_compute.py +11 -11
  183. openstackclient/tests/unit/network/v2/test_network_qos_policy.py +16 -19
  184. openstackclient/tests/unit/network/v2/test_network_qos_rule.py +79 -152
  185. openstackclient/tests/unit/network/v2/test_network_qos_rule_type.py +4 -6
  186. openstackclient/tests/unit/network/v2/test_network_rbac.py +2 -2
  187. openstackclient/tests/unit/network/v2/test_network_trunk.py +2 -2
  188. openstackclient/tests/unit/network/v2/test_port.py +21 -22
  189. openstackclient/tests/unit/network/v2/test_router.py +130 -51
  190. openstackclient/tests/unit/network/v2/test_security_group_compute.py +11 -19
  191. openstackclient/tests/unit/network/v2/test_security_group_network.py +25 -27
  192. openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +15 -17
  193. openstackclient/tests/unit/network/v2/test_security_group_rule_network.py +33 -39
  194. openstackclient/tests/unit/object/v1/test_object_all.py +4 -3
  195. openstackclient/tests/unit/test_shell.py +16 -13
  196. openstackclient/tests/unit/volume/v2/fakes.py +1 -2
  197. openstackclient/tests/unit/volume/v2/test_service.py +57 -91
  198. openstackclient/tests/unit/volume/v2/test_volume.py +109 -106
  199. openstackclient/tests/unit/volume/v2/test_volume_backup.py +141 -148
  200. openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +293 -283
  201. openstackclient/tests/unit/volume/v2/test_volume_transfer_request.py +1 -1
  202. openstackclient/tests/unit/volume/v3/fakes.py +2 -8
  203. openstackclient/tests/unit/volume/v3/test_block_storage_log_level.py +61 -71
  204. openstackclient/tests/unit/volume/v3/test_service.py +221 -141
  205. openstackclient/tests/unit/volume/v3/test_volume.py +131 -120
  206. openstackclient/tests/unit/volume/v3/test_volume_attachment.py +4 -4
  207. openstackclient/tests/unit/volume/v3/test_volume_backup.py +198 -203
  208. openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +683 -49
  209. openstackclient/tests/unit/volume/v3/test_volume_transfer_request.py +1 -1
  210. openstackclient/volume/client.py +1 -3
  211. openstackclient/volume/v2/consistency_group.py +4 -8
  212. openstackclient/volume/v2/consistency_group_snapshot.py +1 -2
  213. openstackclient/volume/v2/qos_specs.py +1 -2
  214. openstackclient/volume/v2/service.py +41 -38
  215. openstackclient/volume/v2/volume.py +71 -53
  216. openstackclient/volume/v2/volume_backup.py +15 -10
  217. openstackclient/volume/v2/volume_snapshot.py +129 -93
  218. openstackclient/volume/v2/volume_transfer_request.py +0 -3
  219. openstackclient/volume/v2/volume_type.py +10 -21
  220. openstackclient/volume/v3/block_storage_cluster.py +3 -3
  221. openstackclient/volume/v3/block_storage_log_level.py +22 -28
  222. openstackclient/volume/v3/block_storage_manage.py +1 -3
  223. openstackclient/volume/v3/service.py +105 -14
  224. openstackclient/volume/v3/volume.py +218 -58
  225. openstackclient/volume/v3/volume_attachment.py +3 -2
  226. openstackclient/volume/v3/volume_backup.py +31 -27
  227. openstackclient/volume/v3/volume_group.py +2 -1
  228. openstackclient/volume/v3/volume_group_snapshot.py +2 -1
  229. openstackclient/volume/v3/volume_snapshot.py +489 -13
  230. openstackclient/volume/v3/volume_type.py +10 -21
  231. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/AUTHORS +11 -0
  232. python_openstackclient-8.1.0.dist-info/METADATA +264 -0
  233. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/RECORD +238 -259
  234. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/WHEEL +1 -1
  235. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/entry_points.txt +7 -47
  236. python_openstackclient-8.1.0.dist-info/pbr.json +1 -0
  237. openstackclient/tests/functional/volume/v1/__init__.py +0 -0
  238. openstackclient/tests/functional/volume/v1/common.py +0 -35
  239. openstackclient/tests/functional/volume/v1/test_qos.py +0 -100
  240. openstackclient/tests/functional/volume/v1/test_service.py +0 -76
  241. openstackclient/tests/functional/volume/v1/test_snapshot.py +0 -232
  242. openstackclient/tests/functional/volume/v1/test_transfer_request.py +0 -111
  243. openstackclient/tests/functional/volume/v1/test_volume.py +0 -228
  244. openstackclient/tests/functional/volume/v1/test_volume_type.py +0 -213
  245. openstackclient/tests/unit/volume/v1/__init__.py +0 -0
  246. openstackclient/tests/unit/volume/v1/fakes.py +0 -615
  247. openstackclient/tests/unit/volume/v1/test_qos_specs.py +0 -471
  248. openstackclient/tests/unit/volume/v1/test_service.py +0 -295
  249. openstackclient/tests/unit/volume/v1/test_transfer_request.py +0 -380
  250. openstackclient/tests/unit/volume/v1/test_type.py +0 -633
  251. openstackclient/tests/unit/volume/v1/test_volume.py +0 -1447
  252. openstackclient/tests/unit/volume/v1/test_volume_backup.py +0 -435
  253. openstackclient/volume/v1/__init__.py +0 -0
  254. openstackclient/volume/v1/qos_specs.py +0 -377
  255. openstackclient/volume/v1/service.py +0 -136
  256. openstackclient/volume/v1/volume.py +0 -734
  257. openstackclient/volume/v1/volume_backup.py +0 -302
  258. openstackclient/volume/v1/volume_snapshot.py +0 -433
  259. openstackclient/volume/v1/volume_transfer_request.py +0 -200
  260. openstackclient/volume/v1/volume_type.py +0 -520
  261. python_openstackclient-7.4.0.dist-info/METADATA +0 -172
  262. python_openstackclient-7.4.0.dist-info/pbr.json +0 -1
  263. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/LICENSE +0 -0
  264. {python_openstackclient-7.4.0.dist-info → python_openstackclient-8.1.0.dist-info}/top_level.txt +0 -0
@@ -1,520 +0,0 @@
1
- # Copyright 2012-2013 OpenStack Foundation
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
-
16
- """Volume v1 Type action implementations"""
17
-
18
- import functools
19
- import logging
20
-
21
- from cliff import columns as cliff_columns
22
- from osc_lib.cli import format_columns
23
- from osc_lib.cli import parseractions
24
- from osc_lib.command import command
25
- from osc_lib import exceptions
26
- from osc_lib import utils
27
-
28
- from openstackclient.i18n import _
29
-
30
-
31
- LOG = logging.getLogger(__name__)
32
-
33
-
34
- class EncryptionInfoColumn(cliff_columns.FormattableColumn):
35
- """Formattable column for encryption info column.
36
-
37
- Unlike the parent FormattableColumn class, the initializer of the
38
- class takes encryption_data as the second argument.
39
- osc_lib.utils.get_item_properties instantiate cliff FormattableColumn
40
- object with a single parameter "column value", so you need to pass
41
- a partially initialized class like
42
- ``functools.partial(EncryptionInfoColumn encryption_data)``.
43
- """
44
-
45
- def __init__(self, value, encryption_data=None):
46
- super().__init__(value)
47
- self._encryption_data = encryption_data or {}
48
-
49
- def _get_encryption_info(self):
50
- type_id = self._value
51
- return self._encryption_data.get(type_id)
52
-
53
- def human_readable(self):
54
- encryption_info = self._get_encryption_info()
55
- if encryption_info:
56
- return utils.format_dict(encryption_info)
57
- else:
58
- return '-'
59
-
60
- def machine_readable(self):
61
- return self._get_encryption_info()
62
-
63
-
64
- def _create_encryption_type(volume_client, volume_type, parsed_args):
65
- if not parsed_args.encryption_provider:
66
- msg = _(
67
- "'--encryption-provider' should be specified while "
68
- "creating a new encryption type"
69
- )
70
- raise exceptions.CommandError(msg)
71
- # set the default of control location while creating
72
- control_location = 'front-end'
73
- if parsed_args.encryption_control_location:
74
- control_location = parsed_args.encryption_control_location
75
- body = {
76
- 'provider': parsed_args.encryption_provider,
77
- 'cipher': parsed_args.encryption_cipher,
78
- 'key_size': parsed_args.encryption_key_size,
79
- 'control_location': control_location,
80
- }
81
- encryption = volume_client.volume_encryption_types.create(
82
- volume_type, body
83
- )
84
- return encryption
85
-
86
-
87
- class CreateVolumeType(command.ShowOne):
88
- _description = _("Create new volume type")
89
-
90
- def get_parser(self, prog_name):
91
- parser = super().get_parser(prog_name)
92
- parser.add_argument(
93
- 'name',
94
- metavar='<name>',
95
- help=_('Volume type name'),
96
- )
97
- parser.add_argument(
98
- '--property',
99
- metavar='<key=value>',
100
- action=parseractions.KeyValueAction,
101
- help=_(
102
- 'Set a property on this volume type '
103
- '(repeat option to set multiple properties)'
104
- ),
105
- )
106
- # TODO(Huanxuan Ao): Add choices for each "--encryption-*" option.
107
- parser.add_argument(
108
- '--encryption-provider',
109
- metavar='<provider>',
110
- help=_(
111
- 'Set the encryption provider format for '
112
- 'this volume type (e.g "luks" or "plain") (admin only) '
113
- '(This option is required when setting encryption type '
114
- 'of a volume. Consider using other encryption options '
115
- 'such as: "--encryption-cipher", "--encryption-key-size" '
116
- 'and "--encryption-control-location")'
117
- ),
118
- )
119
- parser.add_argument(
120
- '--encryption-cipher',
121
- metavar='<cipher>',
122
- help=_(
123
- 'Set the encryption algorithm or mode for this '
124
- 'volume type (e.g "aes-xts-plain64") (admin only)'
125
- ),
126
- )
127
- parser.add_argument(
128
- '--encryption-key-size',
129
- metavar='<key-size>',
130
- type=int,
131
- help=_(
132
- 'Set the size of the encryption key of this '
133
- 'volume type (e.g "128" or "256") (admin only)'
134
- ),
135
- )
136
- parser.add_argument(
137
- '--encryption-control-location',
138
- metavar='<control-location>',
139
- choices=['front-end', 'back-end'],
140
- help=_(
141
- 'Set the notional service where the encryption is '
142
- 'performed ("front-end" or "back-end") (admin only) '
143
- '(The default value for this option is "front-end" '
144
- 'when setting encryption type of a volume. Consider '
145
- 'using other encryption options such as: '
146
- '"--encryption-cipher", "--encryption-key-size" and '
147
- '"--encryption-provider")'
148
- ),
149
- )
150
- return parser
151
-
152
- def take_action(self, parsed_args):
153
- volume_client = self.app.client_manager.volume
154
- volume_type = volume_client.volume_types.create(parsed_args.name)
155
- volume_type._info.pop('extra_specs')
156
- if parsed_args.property:
157
- result = volume_type.set_keys(parsed_args.property)
158
- volume_type._info.update(
159
- {'properties': format_columns.DictColumn(result)}
160
- )
161
- if (
162
- parsed_args.encryption_provider
163
- or parsed_args.encryption_cipher
164
- or parsed_args.encryption_key_size
165
- or parsed_args.encryption_control_location
166
- ):
167
- try:
168
- # create new encryption
169
- encryption = _create_encryption_type(
170
- volume_client, volume_type, parsed_args
171
- )
172
- except Exception as e:
173
- LOG.error(
174
- _(
175
- "Failed to set encryption information for this "
176
- "volume type: %s"
177
- ),
178
- e,
179
- )
180
- # add encryption info in result
181
- encryption._info.pop("volume_type_id", None)
182
- volume_type._info.update(
183
- {'encryption': format_columns.DictColumn(encryption._info)}
184
- )
185
- volume_type._info.pop("os-volume-type-access:is_public", None)
186
-
187
- return zip(*sorted(volume_type._info.items()))
188
-
189
-
190
- class DeleteVolumeType(command.Command):
191
- _description = _("Delete volume type(s)")
192
-
193
- def get_parser(self, prog_name):
194
- parser = super().get_parser(prog_name)
195
- parser.add_argument(
196
- 'volume_types',
197
- metavar='<volume-type>',
198
- nargs='+',
199
- help=_('Volume type(s) to delete (name or ID)'),
200
- )
201
- return parser
202
-
203
- def take_action(self, parsed_args):
204
- volume_client = self.app.client_manager.volume
205
- result = 0
206
-
207
- for volume_type in parsed_args.volume_types:
208
- try:
209
- vol_type = utils.find_resource(
210
- volume_client.volume_types, volume_type
211
- )
212
-
213
- volume_client.volume_types.delete(vol_type)
214
- except Exception as e:
215
- result += 1
216
- LOG.error(
217
- _(
218
- "Failed to delete volume type with "
219
- "name or ID '%(volume_type)s': %(e)s"
220
- )
221
- % {'volume_type': volume_type, 'e': e}
222
- )
223
-
224
- if result > 0:
225
- total = len(parsed_args.volume_types)
226
- msg = _(
227
- "%(result)s of %(total)s volume types failed " "to delete."
228
- ) % {'result': result, 'total': total}
229
- raise exceptions.CommandError(msg)
230
-
231
-
232
- class ListVolumeType(command.Lister):
233
- _description = _("List volume types")
234
-
235
- def get_parser(self, prog_name):
236
- parser = super().get_parser(prog_name)
237
- parser.add_argument(
238
- '--long',
239
- action='store_true',
240
- default=False,
241
- help=_('List additional fields in output'),
242
- )
243
- parser.add_argument(
244
- "--encryption-type",
245
- action="store_true",
246
- help=_(
247
- "Display encryption information for each volume type "
248
- "(admin only)"
249
- ),
250
- )
251
- return parser
252
-
253
- def take_action(self, parsed_args):
254
- volume_client = self.app.client_manager.volume
255
- if parsed_args.long:
256
- columns = ['ID', 'Name', 'Is Public', 'Extra Specs']
257
- column_headers = ['ID', 'Name', 'Is Public', 'Properties']
258
- else:
259
- columns = ['ID', 'Name', 'Is Public']
260
- column_headers = ['ID', 'Name', 'Is Public']
261
- data = volume_client.volume_types.list()
262
-
263
- formatters = {'Extra Specs': format_columns.DictColumn}
264
-
265
- if parsed_args.encryption_type:
266
- encryption = {}
267
- for d in volume_client.volume_encryption_types.list():
268
- volume_type_id = d._info['volume_type_id']
269
- # remove some redundant information
270
- del_key = [
271
- 'deleted',
272
- 'created_at',
273
- 'updated_at',
274
- 'deleted_at',
275
- 'volume_type_id',
276
- ]
277
- for key in del_key:
278
- d._info.pop(key, None)
279
- # save the encryption information with their volume type ID
280
- encryption[volume_type_id] = d._info
281
- # We need to get volume type ID, then show encryption
282
- # information according to the ID, so use "id" to keep
283
- # difference to the real "ID" column.
284
- columns += ['id']
285
- column_headers += ['Encryption']
286
-
287
- _EncryptionInfoColumn = functools.partial(
288
- EncryptionInfoColumn, encryption_data=encryption
289
- )
290
- formatters['id'] = _EncryptionInfoColumn
291
-
292
- return (
293
- column_headers,
294
- (
295
- utils.get_item_properties(
296
- s,
297
- columns,
298
- formatters=formatters,
299
- )
300
- for s in data
301
- ),
302
- )
303
-
304
-
305
- class SetVolumeType(command.Command):
306
- _description = _("Set volume type properties")
307
-
308
- def get_parser(self, prog_name):
309
- parser = super().get_parser(prog_name)
310
- parser.add_argument(
311
- 'volume_type',
312
- metavar='<volume-type>',
313
- help=_('Volume type to modify (name or ID)'),
314
- )
315
- parser.add_argument(
316
- '--property',
317
- metavar='<key=value>',
318
- action=parseractions.KeyValueAction,
319
- help=_(
320
- 'Set a property on this volume type '
321
- '(repeat option to set multiple properties)'
322
- ),
323
- )
324
- # TODO(Huanxuan Ao): Add choices for each "--encryption-*" option.
325
- parser.add_argument(
326
- '--encryption-provider',
327
- metavar='<provider>',
328
- help=_(
329
- 'Set the encryption provider format for '
330
- 'this volume type (e.g "luks" or "plain") (admin only) '
331
- '(This option is required when setting encryption type '
332
- 'of a volume. Consider using other encryption options '
333
- 'such as: "--encryption-cipher", "--encryption-key-size" '
334
- 'and "--encryption-control-location")'
335
- ),
336
- )
337
- parser.add_argument(
338
- '--encryption-cipher',
339
- metavar='<cipher>',
340
- help=_(
341
- 'Set the encryption algorithm or mode for this '
342
- 'volume type (e.g "aes-xts-plain64") (admin only)'
343
- ),
344
- )
345
- parser.add_argument(
346
- '--encryption-key-size',
347
- metavar='<key-size>',
348
- type=int,
349
- help=_(
350
- 'Set the size of the encryption key of this '
351
- 'volume type (e.g "128" or "256") (admin only)'
352
- ),
353
- )
354
- parser.add_argument(
355
- '--encryption-control-location',
356
- metavar='<control-location>',
357
- choices=['front-end', 'back-end'],
358
- help=_(
359
- 'Set the notional service where the encryption is '
360
- 'performed ("front-end" or "back-end") (admin only) '
361
- '(The default value for this option is "front-end" '
362
- 'when setting encryption type of a volume. Consider '
363
- 'using other encryption options such as: '
364
- '"--encryption-cipher", "--encryption-key-size" and '
365
- '"--encryption-provider")'
366
- ),
367
- )
368
- return parser
369
-
370
- def take_action(self, parsed_args):
371
- volume_client = self.app.client_manager.volume
372
- volume_type = utils.find_resource(
373
- volume_client.volume_types, parsed_args.volume_type
374
- )
375
-
376
- result = 0
377
- if parsed_args.property:
378
- try:
379
- volume_type.set_keys(parsed_args.property)
380
- except Exception as e:
381
- LOG.error(_("Failed to set volume type property: %s"), e)
382
- result += 1
383
-
384
- if (
385
- parsed_args.encryption_provider
386
- or parsed_args.encryption_cipher
387
- or parsed_args.encryption_key_size
388
- or parsed_args.encryption_control_location
389
- ):
390
- try:
391
- _create_encryption_type(
392
- volume_client, volume_type, parsed_args
393
- )
394
- except Exception as e:
395
- LOG.error(
396
- _(
397
- "Failed to set encryption information for this "
398
- "volume type: %s"
399
- ),
400
- e,
401
- )
402
- result += 1
403
-
404
- if result > 0:
405
- raise exceptions.CommandError(
406
- _("Command Failed: One or more of" " the operations failed")
407
- )
408
-
409
-
410
- class ShowVolumeType(command.ShowOne):
411
- _description = _("Display volume type details")
412
-
413
- def get_parser(self, prog_name):
414
- parser = super().get_parser(prog_name)
415
- parser.add_argument(
416
- "volume_type",
417
- metavar="<volume-type>",
418
- help=_("Volume type to display (name or ID)"),
419
- )
420
- parser.add_argument(
421
- "--encryption-type",
422
- action="store_true",
423
- help=_(
424
- "Display encryption information of this volume type "
425
- "(admin only)"
426
- ),
427
- )
428
- return parser
429
-
430
- def take_action(self, parsed_args):
431
- volume_client = self.app.client_manager.volume
432
- volume_type = utils.find_resource(
433
- volume_client.volume_types, parsed_args.volume_type
434
- )
435
- properties = format_columns.DictColumn(
436
- volume_type._info.pop('extra_specs')
437
- )
438
- volume_type._info.update({'properties': properties})
439
- if parsed_args.encryption_type:
440
- # show encryption type information for this volume type
441
- try:
442
- encryption = volume_client.volume_encryption_types.get(
443
- volume_type.id
444
- )
445
- encryption._info.pop("volume_type_id", None)
446
- volume_type._info.update(
447
- {'encryption': format_columns.DictColumn(encryption._info)}
448
- )
449
- except Exception as e:
450
- LOG.error(
451
- _(
452
- "Failed to display the encryption information "
453
- "of this volume type: %s"
454
- ),
455
- e,
456
- )
457
- volume_type._info.pop("os-volume-type-access:is_public", None)
458
- return zip(*sorted(volume_type._info.items()))
459
-
460
-
461
- class UnsetVolumeType(command.Command):
462
- _description = _("Unset volume type properties")
463
-
464
- def get_parser(self, prog_name):
465
- parser = super().get_parser(prog_name)
466
- parser.add_argument(
467
- 'volume_type',
468
- metavar='<volume-type>',
469
- help=_('Volume type to modify (name or ID)'),
470
- )
471
- parser.add_argument(
472
- '--property',
473
- metavar='<key>',
474
- action='append',
475
- help=_(
476
- 'Remove a property from this volume type '
477
- '(repeat option to remove multiple properties)'
478
- ),
479
- )
480
- parser.add_argument(
481
- "--encryption-type",
482
- action="store_true",
483
- help=_(
484
- "Remove the encryption type for this volume type "
485
- "(admin only)"
486
- ),
487
- )
488
- return parser
489
-
490
- def take_action(self, parsed_args):
491
- volume_client = self.app.client_manager.volume
492
- volume_type = utils.find_resource(
493
- volume_client.volume_types,
494
- parsed_args.volume_type,
495
- )
496
-
497
- result = 0
498
- if parsed_args.property:
499
- try:
500
- volume_type.unset_keys(parsed_args.property)
501
- except Exception as e:
502
- LOG.error(_("Failed to unset volume type property: %s"), e)
503
- result += 1
504
- if parsed_args.encryption_type:
505
- try:
506
- volume_client.volume_encryption_types.delete(volume_type)
507
- except Exception as e:
508
- LOG.error(
509
- _(
510
- "Failed to remove the encryption type for this "
511
- "volume type: %s"
512
- ),
513
- e,
514
- )
515
- result += 1
516
-
517
- if result > 0:
518
- raise exceptions.CommandError(
519
- _("Command Failed: One or more of" " the operations failed")
520
- )
@@ -1,172 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: python-openstackclient
3
- Version: 7.4.0
4
- Summary: OpenStack Command-line Client
5
- Home-page: https://docs.openstack.org/python-openstackclient/latest/
6
- Author: OpenStack
7
- Author-email: openstack-discuss@lists.openstack.org
8
- Classifier: Environment :: OpenStack
9
- Classifier: Intended Audience :: Information Technology
10
- Classifier: Intended Audience :: System Administrators
11
- Classifier: License :: OSI Approved :: Apache Software License
12
- Classifier: Operating System :: POSIX :: Linux
13
- Classifier: Programming Language :: Python
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.12
19
- Requires-Python: >=3.9
20
- License-File: LICENSE
21
- License-File: AUTHORS
22
- Requires-Dist: pbr !=2.1.0,>=2.0.0
23
- Requires-Dist: cryptography >=2.7
24
- Requires-Dist: cliff >=3.5.0
25
- Requires-Dist: iso8601 >=0.1.11
26
- Requires-Dist: openstacksdk >=3.3.0
27
- Requires-Dist: osc-lib >=2.3.0
28
- Requires-Dist: oslo.i18n >=3.15.3
29
- Requires-Dist: python-keystoneclient >=3.22.0
30
- Requires-Dist: python-cinderclient >=3.3.0
31
- Requires-Dist: requests >=2.27.0
32
- Requires-Dist: stevedore >=2.0.1
33
-
34
- ========================
35
- Team and repository tags
36
- ========================
37
-
38
- .. image:: https://governance.openstack.org/tc/badges/python-openstackclient.svg
39
- :target: https://governance.openstack.org/tc/reference/tags/index.html
40
-
41
- .. Change things from this point on
42
-
43
- ===============
44
- OpenStackClient
45
- ===============
46
-
47
- .. image:: https://img.shields.io/pypi/v/python-openstackclient.svg
48
- :target: https://pypi.org/project/python-openstackclient/
49
- :alt: Latest Version
50
-
51
- OpenStackClient (aka OSC) is a command-line client for OpenStack that brings
52
- the command set for Compute, Identity, Image, Network, Object Store and Block
53
- Storage APIs together in a single shell with a uniform command structure.
54
-
55
- The primary goal is to provide a unified shell command structure and a common
56
- language to describe operations in OpenStack.
57
-
58
- * `PyPi`_ - package installation
59
- * `Online Documentation`_
60
- * `Launchpad project`_ - bugs and feature requests
61
- * `Blueprints`_ - feature specifications (historical only)
62
- * `Source`_
63
- * `Developer`_ - getting started as a developer
64
- * `Contributing`_ - contributing code
65
- * `Testing`_ - testing code
66
- * IRC: #openstack-sdks on OFTC (irc.oftc.net)
67
- * License: Apache 2.0
68
-
69
- .. _PyPi: https://pypi.org/project/python-openstackclient
70
- .. _Online Documentation: https://docs.openstack.org/python-openstackclient/latest/
71
- .. _Blueprints: https://blueprints.launchpad.net/python-openstackclient
72
- .. _`Launchpad project`: https://bugs.launchpad.net/python-openstackclient
73
- .. _Source: https://opendev.org/openstack/python-openstackclient
74
- .. _Developer: https://docs.openstack.org/project-team-guide/project-setup/python.html
75
- .. _Contributing: https://docs.openstack.org/infra/manual/developers.html
76
- .. _Testing: https://docs.openstack.org/python-openstackclient/latest/contributor/developing.html#testing
77
- .. _Release Notes: https://docs.openstack.org/releasenotes/python-openstackclient
78
-
79
- Getting Started
80
- ===============
81
-
82
- OpenStack Client can be installed from PyPI using pip::
83
-
84
- pip install python-openstackclient
85
-
86
- There are a few variants on getting help. A list of global options and supported
87
- commands is shown with ``--help``::
88
-
89
- openstack --help
90
-
91
- There is also a ``help`` command that can be used to get help text for a specific
92
- command::
93
-
94
- openstack help
95
- openstack help server create
96
-
97
- If you want to make changes to the OpenStackClient for testing and contribution,
98
- make any changes and then run::
99
-
100
- python setup.py develop
101
-
102
- or::
103
-
104
- pip install -e .
105
-
106
- Configuration
107
- =============
108
-
109
- The CLI is configured via environment variables and command-line
110
- options as listed in https://docs.openstack.org/python-openstackclient/latest/cli/authentication.html.
111
-
112
- Authentication using username/password is most commonly used:
113
-
114
- - For a local user, your configuration will look like the one below::
115
-
116
- export OS_AUTH_URL=<url-to-openstack-identity>
117
- export OS_IDENTITY_API_VERSION=3
118
- export OS_PROJECT_NAME=<project-name>
119
- export OS_PROJECT_DOMAIN_NAME=<project-domain-name>
120
- export OS_USERNAME=<username>
121
- export OS_USER_DOMAIN_NAME=<user-domain-name>
122
- export OS_PASSWORD=<password> # (optional)
123
-
124
- The corresponding command-line options look very similar::
125
-
126
- --os-auth-url <url>
127
- --os-identity-api-version 3
128
- --os-project-name <project-name>
129
- --os-project-domain-name <project-domain-name>
130
- --os-username <username>
131
- --os-user-domain-name <user-domain-name>
132
- [--os-password <password>]
133
-
134
- - For a federated user, your configuration will look the so::
135
-
136
- export OS_PROJECT_NAME=<project-name>
137
- export OS_PROJECT_DOMAIN_NAME=<project-domain-name>
138
- export OS_AUTH_URL=<url-to-openstack-identity>
139
- export OS_IDENTITY_API_VERSION=3
140
- export OS_AUTH_PLUGIN=openid
141
- export OS_AUTH_TYPE=v3oidcpassword
142
- export OS_USERNAME=<username-in-idp>
143
- export OS_PASSWORD=<password-in-idp>
144
- export OS_IDENTITY_PROVIDER=<the-desired-idp-in-keystone>
145
- export OS_CLIENT_ID=<the-client-id-configured-in-the-idp>
146
- export OS_CLIENT_SECRET=<the-client-secred-configured-in-the-idp>
147
- export OS_OPENID_SCOPE=<the-scopes-of-desired-attributes-to-claim-from-idp>
148
- export OS_PROTOCOL=<the-protocol-used-in-the-apache2-oidc-proxy>
149
- export OS_ACCESS_TOKEN_TYPE=<the-access-token-type-used-by-your-idp>
150
- export OS_DISCOVERY_ENDPOINT=<the-well-known-endpoint-of-the-idp>
151
-
152
- The corresponding command-line options look very similar::
153
-
154
- --os-project-name <project-name>
155
- --os-project-domain-name <project-domain-name>
156
- --os-auth-url <url-to-openstack-identity>
157
- --os-identity-api-version 3
158
- --os-auth-plugin openid
159
- --os-auth-type v3oidcpassword
160
- --os-username <username-in-idp>
161
- --os-password <password-in-idp>
162
- --os-identity-provider <the-desired-idp-in-keystone>
163
- --os-client-id <the-client-id-configured-in-the-idp>
164
- --os-client-secret <the-client-secred-configured-in-the-idp>
165
- --os-openid-scope <the-scopes-of-desired-attributes-to-claim-from-idp>
166
- --os-protocol <the-protocol-used-in-the-apache2-oidc-proxy>
167
- --os-access-token-type <the-access-token-type-used-by-your-idp>
168
- --os-discovery-endpoint <the-well-known-endpoint-of-the-idp>
169
-
170
- If a password is not provided above (in plaintext), you will be interactively
171
- prompted to provide one securely.
172
-
@@ -1 +0,0 @@
1
- {"git_version": "4b7e32ca", "is_release": true}