python-openstackclient 8.3.0__py3-none-any.whl → 10.0.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 (292) hide show
  1. openstackclient/__init__.py +2 -6
  2. openstackclient/api/api.py +41 -23
  3. openstackclient/api/compute_v2.py +44 -25
  4. openstackclient/api/object_store_v1.py +75 -97
  5. openstackclient/api/volume_v2.py +2 -1
  6. openstackclient/api/volume_v3.py +2 -1
  7. openstackclient/common/availability_zone.py +58 -42
  8. openstackclient/common/clientmanager.py +56 -29
  9. openstackclient/common/configuration.py +10 -3
  10. openstackclient/common/envvars.py +2 -2
  11. openstackclient/common/extension.py +14 -5
  12. openstackclient/common/limits.py +10 -5
  13. openstackclient/common/module.py +14 -6
  14. openstackclient/common/pagination.py +8 -2
  15. openstackclient/common/progressbar.py +7 -6
  16. openstackclient/common/project_cleanup.py +13 -7
  17. openstackclient/common/quota.py +126 -114
  18. openstackclient/common/versions.py +8 -2
  19. openstackclient/compute/client.py +7 -3
  20. openstackclient/compute/v2/agent.py +17 -10
  21. openstackclient/compute/v2/aggregate.py +36 -22
  22. openstackclient/compute/v2/console.py +14 -8
  23. openstackclient/compute/v2/console_connection.py +11 -3
  24. openstackclient/compute/v2/flavor.py +39 -21
  25. openstackclient/compute/v2/host.py +14 -6
  26. openstackclient/compute/v2/hypervisor.py +14 -5
  27. openstackclient/compute/v2/hypervisor_stats.py +10 -2
  28. openstackclient/compute/v2/keypair.py +29 -14
  29. openstackclient/compute/v2/server.py +251 -171
  30. openstackclient/compute/v2/server_backup.py +10 -4
  31. openstackclient/compute/v2/server_event.py +21 -12
  32. openstackclient/compute/v2/server_group.py +21 -11
  33. openstackclient/compute/v2/server_image.py +19 -10
  34. openstackclient/compute/v2/server_migration.py +24 -10
  35. openstackclient/compute/v2/server_share.py +274 -0
  36. openstackclient/compute/v2/server_volume.py +10 -4
  37. openstackclient/compute/v2/service.py +14 -7
  38. openstackclient/compute/v2/usage.py +26 -21
  39. openstackclient/identity/client.py +8 -3
  40. openstackclient/identity/common.py +103 -41
  41. openstackclient/identity/v2_0/catalog.py +14 -7
  42. openstackclient/identity/v2_0/ec2creds.py +21 -10
  43. openstackclient/identity/v2_0/endpoint.py +23 -11
  44. openstackclient/identity/v2_0/project.py +25 -14
  45. openstackclient/identity/v2_0/role.py +28 -14
  46. openstackclient/identity/v2_0/role_assignment.py +9 -3
  47. openstackclient/identity/v2_0/service.py +26 -12
  48. openstackclient/identity/v2_0/token.py +12 -5
  49. openstackclient/identity/v2_0/user.py +26 -15
  50. openstackclient/identity/v3/access_rule.py +26 -12
  51. openstackclient/identity/v3/application_credential.py +59 -24
  52. openstackclient/identity/v3/catalog.py +14 -7
  53. openstackclient/identity/v3/consumer.py +22 -11
  54. openstackclient/identity/v3/credential.py +36 -16
  55. openstackclient/identity/v3/domain.py +37 -18
  56. openstackclient/identity/v3/ec2creds.py +25 -12
  57. openstackclient/identity/v3/endpoint.py +42 -20
  58. openstackclient/identity/v3/endpoint_group.py +28 -17
  59. openstackclient/identity/v3/federation_protocol.py +71 -50
  60. openstackclient/identity/v3/group.py +55 -32
  61. openstackclient/identity/v3/identity_provider.py +92 -57
  62. openstackclient/identity/v3/implied_role.py +21 -9
  63. openstackclient/identity/v3/limit.py +115 -92
  64. openstackclient/identity/v3/mapping.py +26 -13
  65. openstackclient/identity/v3/policy.py +23 -12
  66. openstackclient/identity/v3/project.py +211 -122
  67. openstackclient/identity/v3/region.py +36 -16
  68. openstackclient/identity/v3/registered_limit.py +116 -109
  69. openstackclient/identity/v3/role.py +61 -31
  70. openstackclient/identity/v3/role_assignment.py +23 -6
  71. openstackclient/identity/v3/service.py +36 -16
  72. openstackclient/identity/v3/service_provider.py +37 -15
  73. openstackclient/identity/v3/tag.py +23 -17
  74. openstackclient/identity/v3/token.py +30 -14
  75. openstackclient/identity/v3/trust.py +32 -14
  76. openstackclient/identity/v3/unscoped_saml.py +10 -2
  77. openstackclient/identity/v3/user.py +49 -26
  78. openstackclient/image/client.py +7 -3
  79. openstackclient/image/v1/image.py +33 -26
  80. openstackclient/image/v2/cache.py +14 -9
  81. openstackclient/image/v2/image.py +76 -49
  82. openstackclient/image/v2/info.py +7 -1
  83. openstackclient/image/v2/metadef_namespaces.py +109 -13
  84. openstackclient/image/v2/metadef_objects.py +28 -15
  85. openstackclient/image/v2/metadef_properties.py +24 -13
  86. openstackclient/image/v2/metadef_resource_type_association.py +14 -7
  87. openstackclient/image/v2/metadef_resource_types.py +7 -1
  88. openstackclient/image/v2/task.py +15 -6
  89. openstackclient/locale/tr_TR/LC_MESSAGES/openstackclient.po +7 -192
  90. openstackclient/network/client.py +7 -2
  91. openstackclient/network/common.py +16 -241
  92. openstackclient/network/utils.py +36 -22
  93. openstackclient/network/v2/address_group.py +27 -16
  94. openstackclient/network/v2/address_scope.py +24 -13
  95. openstackclient/network/v2/bgpvpn/bgpvpn.py +463 -0
  96. openstackclient/network/v2/bgpvpn/constants.py +30 -0
  97. openstackclient/network/v2/bgpvpn/network_association.py +214 -0
  98. openstackclient/network/v2/bgpvpn/port_association.py +490 -0
  99. openstackclient/network/v2/bgpvpn/router_association.py +288 -0
  100. openstackclient/network/v2/default_security_group_rule.py +19 -10
  101. openstackclient/network/v2/floating_ip.py +110 -159
  102. openstackclient/network/v2/floating_ip_port_forwarding.py +30 -18
  103. openstackclient/network/v2/fwaas/__init__.py +0 -0
  104. openstackclient/network/v2/fwaas/group.py +466 -0
  105. openstackclient/network/v2/fwaas/policy.py +518 -0
  106. openstackclient/network/v2/fwaas/rule.py +574 -0
  107. openstackclient/network/v2/ip_availability.py +13 -5
  108. openstackclient/network/v2/l3_conntrack_helper.py +22 -13
  109. openstackclient/network/v2/local_ip.py +24 -13
  110. openstackclient/network/v2/local_ip_association.py +14 -7
  111. openstackclient/network/v2/ndp_proxy.py +20 -11
  112. openstackclient/network/v2/network.py +129 -196
  113. openstackclient/network/v2/network_agent.py +46 -25
  114. openstackclient/network/v2/network_auto_allocated_topology.py +22 -11
  115. openstackclient/network/v2/network_flavor.py +27 -16
  116. openstackclient/network/v2/network_flavor_profile.py +23 -12
  117. openstackclient/network/v2/network_meter.py +21 -10
  118. openstackclient/network/v2/network_meter_rule.py +21 -11
  119. openstackclient/network/v2/network_qos_policy.py +25 -15
  120. openstackclient/network/v2/network_qos_rule.py +32 -17
  121. openstackclient/network/v2/network_qos_rule_type.py +13 -5
  122. openstackclient/network/v2/network_rbac.py +23 -12
  123. openstackclient/network/v2/network_segment.py +20 -11
  124. openstackclient/network/v2/network_segment_range.py +56 -29
  125. openstackclient/network/v2/network_service_provider.py +7 -1
  126. openstackclient/network/v2/network_trunk.py +38 -22
  127. openstackclient/network/v2/port.py +54 -29
  128. openstackclient/network/v2/router.py +75 -52
  129. openstackclient/network/v2/security_group.py +87 -157
  130. openstackclient/network/v2/security_group_rule.py +100 -280
  131. openstackclient/network/v2/subnet.py +49 -28
  132. openstackclient/network/v2/subnet_pool.py +30 -17
  133. openstackclient/network/v2/taas/tap_flow.py +22 -11
  134. openstackclient/network/v2/taas/tap_mirror.py +22 -11
  135. openstackclient/network/v2/taas/tap_service.py +23 -12
  136. openstackclient/object/client.py +7 -2
  137. openstackclient/object/v1/account.py +13 -6
  138. openstackclient/object/v1/container.py +25 -15
  139. openstackclient/object/v1/object.py +25 -15
  140. openstackclient/py.typed +0 -0
  141. openstackclient/shell.py +46 -10
  142. openstackclient/tests/functional/base.py +55 -20
  143. openstackclient/tests/functional/common/test_extension.py +4 -0
  144. openstackclient/tests/functional/common/test_quota.py +3 -1
  145. openstackclient/tests/functional/compute/v2/common.py +14 -13
  146. openstackclient/tests/functional/compute/v2/test_flavor.py +3 -1
  147. openstackclient/tests/functional/compute/v2/test_server.py +3 -0
  148. openstackclient/tests/functional/identity/v2/common.py +10 -6
  149. openstackclient/tests/functional/identity/v2/test_role.py +4 -4
  150. openstackclient/tests/functional/identity/v3/common.py +25 -19
  151. openstackclient/tests/functional/identity/v3/test_group.py +20 -20
  152. openstackclient/tests/functional/identity/v3/test_idp.py +3 -1
  153. openstackclient/tests/functional/identity/v3/test_limit.py +47 -0
  154. openstackclient/tests/functional/identity/v3/test_project.py +10 -10
  155. openstackclient/tests/functional/identity/v3/test_role.py +18 -18
  156. openstackclient/tests/functional/identity/v3/test_role_assignment.py +12 -12
  157. openstackclient/tests/functional/identity/v3/test_user.py +8 -8
  158. openstackclient/tests/functional/image/base.py +1 -6
  159. openstackclient/tests/functional/image/v2/test_metadef_objects.py +69 -0
  160. openstackclient/tests/functional/network/v2/common.py +5 -2
  161. openstackclient/tests/functional/network/v2/test_floating_ip.py +10 -4
  162. openstackclient/tests/functional/network/v2/test_ip_availability.py +4 -0
  163. openstackclient/tests/functional/network/v2/test_network_meter_rule.py +3 -2
  164. openstackclient/tests/functional/network/v2/test_network_segment.py +5 -0
  165. openstackclient/tests/functional/network/v2/test_subnet.py +13 -9
  166. openstackclient/tests/functional/object/v1/common.py +4 -0
  167. openstackclient/tests/functional/volume/v2/common.py +4 -0
  168. openstackclient/tests/functional/volume/v2/test_volume_snapshot.py +27 -11
  169. openstackclient/tests/functional/volume/v2/test_volume_type.py +2 -2
  170. openstackclient/tests/functional/volume/v3/common.py +4 -0
  171. openstackclient/tests/functional/volume/v3/test_volume_snapshot.py +56 -138
  172. openstackclient/tests/functional/volume/v3/test_volume_type.py +2 -2
  173. openstackclient/tests/unit/common/test_availability_zone.py +35 -49
  174. openstackclient/tests/unit/common/test_extension.py +2 -2
  175. openstackclient/tests/unit/common/test_module.py +12 -7
  176. openstackclient/tests/unit/common/test_project_cleanup.py +3 -1
  177. openstackclient/tests/unit/common/test_quota.py +62 -23
  178. openstackclient/tests/unit/compute/v2/fakes.py +25 -0
  179. openstackclient/tests/unit/compute/v2/test_flavor.py +28 -2
  180. openstackclient/tests/unit/compute/v2/test_keypair.py +6 -6
  181. openstackclient/tests/unit/compute/v2/test_server.py +17 -104
  182. openstackclient/tests/unit/compute/v2/test_server_share.py +287 -0
  183. openstackclient/tests/unit/identity/v3/fakes.py +3 -0
  184. openstackclient/tests/unit/identity/v3/test_group.py +4 -14
  185. openstackclient/tests/unit/identity/v3/test_identity_provider.py +303 -299
  186. openstackclient/tests/unit/identity/v3/test_limit.py +197 -145
  187. openstackclient/tests/unit/identity/v3/test_project.py +831 -512
  188. openstackclient/tests/unit/identity/v3/test_protocol.py +97 -88
  189. openstackclient/tests/unit/identity/v3/test_registered_limit.py +355 -220
  190. openstackclient/tests/unit/identity/v3/test_user.py +4 -4
  191. openstackclient/tests/unit/image/v2/test_image.py +16 -16
  192. openstackclient/tests/unit/image/v2/test_metadef_namespaces.py +105 -6
  193. openstackclient/tests/unit/network/test_common.py +0 -155
  194. openstackclient/tests/unit/network/v2/bgpvpn/__init__.py +0 -0
  195. openstackclient/tests/unit/network/v2/bgpvpn/fakes.py +179 -0
  196. openstackclient/tests/unit/network/v2/bgpvpn/test_bgpvpn.py +584 -0
  197. openstackclient/tests/unit/network/v2/bgpvpn/test_network_association.py +285 -0
  198. openstackclient/tests/unit/network/v2/bgpvpn/test_port_association.py +384 -0
  199. openstackclient/tests/unit/network/v2/bgpvpn/test_router_association.py +297 -0
  200. openstackclient/tests/unit/network/v2/fwaas/__init__.py +0 -0
  201. openstackclient/tests/unit/network/v2/fwaas/test_group.py +897 -0
  202. openstackclient/tests/unit/network/v2/fwaas/test_policy.py +869 -0
  203. openstackclient/tests/unit/network/v2/fwaas/test_rule.py +980 -0
  204. openstackclient/tests/unit/network/v2/taas/{test_osc_tap_flow.py → test_tap_flow.py} +18 -25
  205. openstackclient/tests/unit/network/v2/taas/{test_osc_tap_mirror.py → test_tap_mirror.py} +19 -29
  206. openstackclient/tests/unit/network/v2/taas/{test_osc_tap_service.py → test_tap_service.py} +19 -29
  207. openstackclient/tests/unit/network/v2/test_address_group.py +2 -2
  208. openstackclient/tests/unit/network/v2/{test_floating_ip_network.py → test_floating_ip.py} +3 -2
  209. openstackclient/tests/unit/network/v2/test_floating_ip_port_forwarding.py +13 -13
  210. openstackclient/tests/unit/network/v2/test_network_agent.py +8 -4
  211. openstackclient/tests/unit/network/v2/test_network_auto_allocated_topology.py +3 -3
  212. openstackclient/tests/unit/network/v2/test_network_flavor.py +2 -2
  213. openstackclient/tests/unit/network/v2/test_network_qos_policy.py +1 -1
  214. openstackclient/tests/unit/network/v2/test_network_qos_rule.py +2 -2
  215. openstackclient/tests/unit/network/v2/test_network_rbac.py +1 -1
  216. openstackclient/tests/unit/network/v2/test_network_segment.py +1 -1
  217. openstackclient/tests/unit/network/v2/test_network_segment_range.py +7 -10
  218. openstackclient/tests/unit/network/v2/test_network_trunk.py +1 -1
  219. openstackclient/tests/unit/network/v2/test_router.py +8 -9
  220. openstackclient/tests/unit/network/v2/{test_security_group_network.py → test_security_group.py} +1 -20
  221. openstackclient/tests/unit/network/v2/{test_security_group_rule_network.py → test_security_group_rule.py} +7 -41
  222. openstackclient/tests/unit/network/v2/test_subnet.py +2 -1
  223. openstackclient/tests/unit/network/v2/test_subnet_pool.py +2 -1
  224. openstackclient/tests/unit/object/v1/fakes.py +8 -7
  225. openstackclient/tests/unit/object/v1/test_container.py +65 -101
  226. openstackclient/tests/unit/object/v1/test_container_all.py +8 -1
  227. openstackclient/tests/unit/object/v1/test_object.py +44 -84
  228. openstackclient/tests/unit/object/v1/test_object_all.py +8 -1
  229. openstackclient/tests/unit/test_hacking.py +108 -0
  230. openstackclient/tests/unit/volume/v2/fakes.py +1 -0
  231. openstackclient/tests/unit/volume/v2/test_consistency_group.py +8 -2
  232. openstackclient/tests/unit/volume/v2/test_volume.py +7 -6
  233. openstackclient/tests/unit/volume/v2/test_volume_backup.py +1 -5
  234. openstackclient/tests/unit/volume/v2/test_volume_snapshot.py +2 -1
  235. openstackclient/tests/unit/volume/v2/test_volume_type.py +2 -4
  236. openstackclient/tests/unit/volume/v3/fakes.py +1 -0
  237. openstackclient/tests/unit/volume/v3/test_volume.py +94 -15
  238. openstackclient/tests/unit/volume/v3/test_volume_attachment.py +1 -1
  239. openstackclient/tests/unit/volume/v3/test_volume_backup.py +1 -5
  240. openstackclient/tests/unit/volume/v3/test_volume_snapshot.py +55 -1
  241. openstackclient/tests/unit/volume/v3/test_volume_type.py +2 -4
  242. openstackclient/volume/client.py +7 -3
  243. openstackclient/volume/v2/backup_record.py +15 -6
  244. openstackclient/volume/v2/consistency_group.py +37 -25
  245. openstackclient/volume/v2/consistency_group_snapshot.py +27 -12
  246. openstackclient/volume/v2/qos_specs.py +30 -19
  247. openstackclient/volume/v2/service.py +17 -6
  248. openstackclient/volume/v2/volume.py +69 -34
  249. openstackclient/volume/v2/volume_backend.py +19 -6
  250. openstackclient/volume/v2/volume_backup.py +48 -22
  251. openstackclient/volume/v2/volume_host.py +6 -4
  252. openstackclient/volume/v2/volume_snapshot.py +52 -26
  253. openstackclient/volume/v2/volume_transfer_request.py +33 -15
  254. openstackclient/volume/v2/volume_type.py +46 -27
  255. openstackclient/volume/v3/block_storage_cleanup.py +11 -3
  256. openstackclient/volume/v3/block_storage_cluster.py +19 -7
  257. openstackclient/volume/v3/block_storage_log_level.py +15 -6
  258. openstackclient/volume/v3/block_storage_manage.py +10 -4
  259. openstackclient/volume/v3/block_storage_resource_filter.py +17 -5
  260. openstackclient/volume/v3/service.py +16 -6
  261. openstackclient/volume/v3/volume.py +103 -46
  262. openstackclient/volume/v3/volume_attachment.py +43 -21
  263. openstackclient/volume/v3/volume_backup.py +55 -26
  264. openstackclient/volume/v3/volume_group.py +23 -13
  265. openstackclient/volume/v3/volume_group_snapshot.py +32 -13
  266. openstackclient/volume/v3/volume_group_type.py +26 -13
  267. openstackclient/volume/v3/volume_message.py +15 -7
  268. openstackclient/volume/v3/volume_snapshot.py +71 -34
  269. openstackclient/volume/v3/volume_transfer_request.py +33 -15
  270. openstackclient/volume/v3/volume_type.py +45 -27
  271. {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/METADATA +6 -6
  272. {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/RECORD +279 -267
  273. {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/WHEEL +1 -1
  274. {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/entry_points.txt +53 -1
  275. {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/AUTHORS +9 -0
  276. python_openstackclient-10.0.0.dist-info/pbr.json +1 -0
  277. openstackclient/api/image_v1.py +0 -69
  278. openstackclient/api/image_v2.py +0 -79
  279. openstackclient/network/v2/floating_ip_pool.py +0 -38
  280. openstackclient/tests/functional/image/v1/test_image.py +0 -97
  281. openstackclient/tests/unit/api/test_image_v1.py +0 -96
  282. openstackclient/tests/unit/api/test_image_v2.py +0 -96
  283. openstackclient/tests/unit/network/v2/test_floating_ip_compute.py +0 -248
  284. openstackclient/tests/unit/network/v2/test_floating_ip_pool_compute.py +0 -49
  285. openstackclient/tests/unit/network/v2/test_floating_ip_pool_network.py +0 -39
  286. openstackclient/tests/unit/network/v2/test_network_compute.py +0 -404
  287. openstackclient/tests/unit/network/v2/test_security_group_compute.py +0 -392
  288. openstackclient/tests/unit/network/v2/test_security_group_rule_compute.py +0 -555
  289. python_openstackclient-8.3.0.dist-info/pbr.json +0 -1
  290. /openstackclient/{tests/functional/image/v1 → network/v2/bgpvpn}/__init__.py +0 -0
  291. {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/licenses/LICENSE +0 -0
  292. {python_openstackclient-8.3.0.dist-info → python_openstackclient-10.0.0.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (82.0.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -67,6 +67,7 @@ server_add_floating_ip = openstackclient.compute.v2.server:AddFloatingIP
67
67
  server_add_network = openstackclient.compute.v2.server:AddNetwork
68
68
  server_add_port = openstackclient.compute.v2.server:AddPort
69
69
  server_add_security_group = openstackclient.compute.v2.server:AddServerSecurityGroup
70
+ server_add_share = openstackclient.compute.v2.server_share:AddServerShare
70
71
  server_add_volume = openstackclient.compute.v2.server:AddServerVolume
71
72
  server_backup_create = openstackclient.compute.v2.server_backup:CreateServerBackup
72
73
  server_create = openstackclient.compute.v2.server:CreateServer
@@ -99,6 +100,7 @@ server_remove_floating_ip = openstackclient.compute.v2.server:RemoveFloatingIP
99
100
  server_remove_network = openstackclient.compute.v2.server:RemoveNetwork
100
101
  server_remove_port = openstackclient.compute.v2.server:RemovePort
101
102
  server_remove_security_group = openstackclient.compute.v2.server:RemoveServerSecurityGroup
103
+ server_remove_share = openstackclient.compute.v2.server_share:RemoveServerShare
102
104
  server_remove_volume = openstackclient.compute.v2.server:RemoveServerVolume
103
105
  server_rescue = openstackclient.compute.v2.server:RescueServer
104
106
  server_resize = openstackclient.compute.v2.server:ResizeServer
@@ -107,6 +109,8 @@ server_resize_revert = openstackclient.compute.v2.server:ResizeRevert
107
109
  server_restore = openstackclient.compute.v2.server:RestoreServer
108
110
  server_resume = openstackclient.compute.v2.server:ResumeServer
109
111
  server_set = openstackclient.compute.v2.server:SetServer
112
+ server_share_list = openstackclient.compute.v2.server_share:ListServerShare
113
+ server_share_show = openstackclient.compute.v2.server_share:ShowServerShare
110
114
  server_shelve = openstackclient.compute.v2.server:ShelveServer
111
115
  server_show = openstackclient.compute.v2.server:ShowServer
112
116
  server_ssh = openstackclient.compute.v2.server:SshServer
@@ -316,6 +320,7 @@ image_metadef_namespace_delete = openstackclient.image.v2.metadef_namespaces:Del
316
320
  image_metadef_namespace_list = openstackclient.image.v2.metadef_namespaces:ListMetadefNamespace
317
321
  image_metadef_namespace_set = openstackclient.image.v2.metadef_namespaces:SetMetadefNamespace
318
322
  image_metadef_namespace_show = openstackclient.image.v2.metadef_namespaces:ShowMetadefNamespace
323
+ image_metadef_namespace_unset = openstackclient.image.v2.metadef_namespaces:UnsetMetadefNamespace
319
324
  image_metadef_object_create = openstackclient.image.v2.metadef_objects:CreateMetadefObjects
320
325
  image_metadef_object_delete = openstackclient.image.v2.metadef_objects:DeleteMetadefObject
321
326
  image_metadef_object_list = openstackclient.image.v2.metadef_objects:ListMetadefObjects
@@ -360,7 +365,6 @@ default_security_group_rule_show = openstackclient.network.v2.default_security_g
360
365
  floating_ip_create = openstackclient.network.v2.floating_ip:CreateFloatingIP
361
366
  floating_ip_delete = openstackclient.network.v2.floating_ip:DeleteFloatingIP
362
367
  floating_ip_list = openstackclient.network.v2.floating_ip:ListFloatingIP
363
- floating_ip_pool_list = openstackclient.network.v2.floating_ip_pool:ListFloatingIPPool
364
368
  floating_ip_port_forwarding_create = openstackclient.network.v2.floating_ip_port_forwarding:CreateFloatingIPPortForwarding
365
369
  floating_ip_port_forwarding_delete = openstackclient.network.v2.floating_ip_port_forwarding:DeleteFloatingIPPortForwarding
366
370
  floating_ip_port_forwarding_list = openstackclient.network.v2.floating_ip_port_forwarding:ListFloatingIPPortForwarding
@@ -502,6 +506,54 @@ subnet_pool_unset = openstackclient.network.v2.subnet_pool:UnsetSubnetPool
502
506
  subnet_set = openstackclient.network.v2.subnet:SetSubnet
503
507
  subnet_show = openstackclient.network.v2.subnet:ShowSubnet
504
508
  subnet_unset = openstackclient.network.v2.subnet:UnsetSubnet
509
+
510
+ [openstack.network.v2.bgpvpn]
511
+ bgpvpn_create = openstackclient.network.v2.bgpvpn.bgpvpn:CreateBgpvpn
512
+ bgpvpn_delete = openstackclient.network.v2.bgpvpn.bgpvpn:DeleteBgpvpn
513
+ bgpvpn_list = openstackclient.network.v2.bgpvpn.bgpvpn:ListBgpvpn
514
+ bgpvpn_network_association_create = openstackclient.network.v2.bgpvpn.network_association:CreateBgpvpnNetAssoc
515
+ bgpvpn_network_association_delete = openstackclient.network.v2.bgpvpn.network_association:DeleteBgpvpnNetAssoc
516
+ bgpvpn_network_association_list = openstackclient.network.v2.bgpvpn.network_association:ListBgpvpnNetAssoc
517
+ bgpvpn_network_association_show = openstackclient.network.v2.bgpvpn.network_association:ShowBgpvpnNetAssoc
518
+ bgpvpn_port_association_create = openstackclient.network.v2.bgpvpn.port_association:CreateBgpvpnPortAssoc
519
+ bgpvpn_port_association_delete = openstackclient.network.v2.bgpvpn.port_association:DeleteBgpvpnPortAssoc
520
+ bgpvpn_port_association_list = openstackclient.network.v2.bgpvpn.port_association:ListBgpvpnPortAssoc
521
+ bgpvpn_port_association_set = openstackclient.network.v2.bgpvpn.port_association:SetBgpvpnPortAssoc
522
+ bgpvpn_port_association_show = openstackclient.network.v2.bgpvpn.port_association:ShowBgpvpnPortAssoc
523
+ bgpvpn_port_association_unset = openstackclient.network.v2.bgpvpn.port_association:UnsetBgpvpnPortAssoc
524
+ bgpvpn_router_association_create = openstackclient.network.v2.bgpvpn.router_association:CreateBgpvpnRouterAssoc
525
+ bgpvpn_router_association_delete = openstackclient.network.v2.bgpvpn.router_association:DeleteBgpvpnRouterAssoc
526
+ bgpvpn_router_association_list = openstackclient.network.v2.bgpvpn.router_association:ListBgpvpnRouterAssoc
527
+ bgpvpn_router_association_set = openstackclient.network.v2.bgpvpn.router_association:SetBgpvpnRouterAssoc
528
+ bgpvpn_router_association_show = openstackclient.network.v2.bgpvpn.router_association:ShowBgpvpnRouterAssoc
529
+ bgpvpn_router_association_unset = openstackclient.network.v2.bgpvpn.router_association:UnsetBgpvpnRouterAssoc
530
+ bgpvpn_set = openstackclient.network.v2.bgpvpn.bgpvpn:SetBgpvpn
531
+ bgpvpn_show = openstackclient.network.v2.bgpvpn.bgpvpn:ShowBgpvpn
532
+ bgpvpn_unset = openstackclient.network.v2.bgpvpn.bgpvpn:UnsetBgpvpn
533
+
534
+ [openstack.network.v2.fwaas]
535
+ firewall_group_create = openstackclient.network.v2.fwaas.group:CreateFirewallGroup
536
+ firewall_group_delete = openstackclient.network.v2.fwaas.group:DeleteFirewallGroup
537
+ firewall_group_list = openstackclient.network.v2.fwaas.group:ListFirewallGroup
538
+ firewall_group_policy_add_rule = openstackclient.network.v2.fwaas.policy:FirewallPolicyInsertRule
539
+ firewall_group_policy_create = openstackclient.network.v2.fwaas.policy:CreateFirewallPolicy
540
+ firewall_group_policy_delete = openstackclient.network.v2.fwaas.policy:DeleteFirewallPolicy
541
+ firewall_group_policy_list = openstackclient.network.v2.fwaas.policy:ListFirewallPolicy
542
+ firewall_group_policy_remove_rule = openstackclient.network.v2.fwaas.policy:FirewallPolicyRemoveRule
543
+ firewall_group_policy_set = openstackclient.network.v2.fwaas.policy:SetFirewallPolicy
544
+ firewall_group_policy_show = openstackclient.network.v2.fwaas.policy:ShowFirewallPolicy
545
+ firewall_group_policy_unset = openstackclient.network.v2.fwaas.policy:UnsetFirewallPolicy
546
+ firewall_group_rule_create = openstackclient.network.v2.fwaas.rule:CreateFirewallRule
547
+ firewall_group_rule_delete = openstackclient.network.v2.fwaas.rule:DeleteFirewallRule
548
+ firewall_group_rule_list = openstackclient.network.v2.fwaas.rule:ListFirewallRule
549
+ firewall_group_rule_set = openstackclient.network.v2.fwaas.rule:SetFirewallRule
550
+ firewall_group_rule_show = openstackclient.network.v2.fwaas.rule:ShowFirewallRule
551
+ firewall_group_rule_unset = openstackclient.network.v2.fwaas.rule:UnsetFirewallRule
552
+ firewall_group_set = openstackclient.network.v2.fwaas.group:SetFirewallGroup
553
+ firewall_group_show = openstackclient.network.v2.fwaas.group:ShowFirewallGroup
554
+ firewall_group_unset = openstackclient.network.v2.fwaas.group:UnsetFirewallGroup
555
+
556
+ [openstack.network.v2.taas]
505
557
  tap_flow_create = openstackclient.network.v2.taas.tap_flow:CreateTapFlow
506
558
  tap_flow_delete = openstackclient.network.v2.taas.tap_flow:DeleteTapFlow
507
559
  tap_flow_list = openstackclient.network.v2.taas.tap_flow:ListTapFlow
@@ -23,11 +23,13 @@ Alfredo Moralejo <amoralej@redhat.com>
23
23
  Allain Legacy <Allain.legacy@windriver.com>
24
24
  Alvaro Lopez Garcia <aloga@ifca.unican.es>
25
25
  Amey Bhide <abhide@vmware.com>
26
+ Amit Uniyal <auniyal@redhat.com>
26
27
  Andreas Florath <Andreas.Florath@telekom.de>
27
28
  Andreas Jaeger <aj@suse.com>
28
29
  Andreas Jaeger <aj@suse.de>
29
30
  Andrey Kurilin <akurilin@mirantis.com>
30
31
  Andrey Larionov <anlarionov@gmail.com>
32
+ Andriy Kurilin <andr.kurilin@gmail.com>
31
33
  Anh Tran <anhtt@vn.fujitsu.com>
32
34
  Anindita Das <anindita.das@intel.com>
33
35
  Anita Kuno <anteaya@anteaya.info>
@@ -125,12 +127,14 @@ Dougal Matthews <dougal@redhat.com>
125
127
  Douglas Mendizábal <dmendiza@redhat.com>
126
128
  Douglas Viroel <viroel@gmail.com>
127
129
  Dr. Jens Harbott <harbott@osism.tech>
130
+ Dylan McCulloch <dylan.mcculloch@gmail.com>
128
131
  Einst Crazy <yu.changcai@99cloud.net>
129
132
  Elena Ezhova <eezhova@mirantis.com>
130
133
  Elod Illes <elod.illes@est.tech>
131
134
  Emilien Macchi <emilien@redhat.com>
132
135
  Eric Brown <browne@vmware.com>
133
136
  Eric Fried <openstack@fried.cc>
137
+ Eric Harney <eharney@redhat.com>
134
138
  Fan Zhang <zh.f@outlook.com>
135
139
  Fang Zhen <zhen.fang@easystack.cn>
136
140
  Fei Long Wang <flwang@catalyst.net.nz>
@@ -203,6 +207,7 @@ Jan Ueberacker <jan.ueberacker@inovex.de>
203
207
  Jas <singhj@us.ibm.com>
204
208
  Jaspreet Singh Rawel <jaspreetsinghrawel@gmail.com>
205
209
  Javier Pena <jpena@redhat.com>
210
+ Jay Faulkner <jay@jvf.cc>
206
211
  Jean-Philippe Evrard <jean-philippe@evrard.me>
207
212
  Jens Harbott (frickler) <j.harbott@x-ion.de>
208
213
  Jens Harbott <j.harbott@x-ion.de>
@@ -333,6 +338,7 @@ Petr Blaho <pblaho@redhat.com>
333
338
  Pierre Hanselmann <pierre.hanselmann@gmail.com>
334
339
  Pierre Prinetti <pierreprinetti@redhat.com>
335
340
  Pierre Riteau <pierre@stackhpc.com>
341
+ Piotr Sipika <psipika@bloomberg.net>
336
342
  Przemyslaw Szczerbik <przemyslaw.szczerbik@est.tech>
337
343
  Qiu Yu <qiuyu@ebaysf.com>
338
344
  Radoslaw Smigielski <radoslaw.smigielski@nokia.com>
@@ -467,6 +473,7 @@ ZhongShengping <chdzsp@163.com>
467
473
  Zhou Zhihong <zhouzhihong@cmss.chinamobile.com>
468
474
  adrian-turjak <adriant@catalyst.net.nz>
469
475
  asarfaty <asarfaty@vmware.com>
476
+ asdasd7183 <yoonsookim1102@gmail.com>
470
477
  blue55 <yllan@fiberhome.com>
471
478
  caoyuan <cao.yuan@99cloud.net>
472
479
  chengkunye <chengkun@unitedstack.com>
@@ -508,6 +515,7 @@ jiwonjang <kooriangman@gmail.com>
508
515
  jqjiang.1@gmail.com <jqjiang.1@gmail.com>
509
516
  judy-yu <yujie@cmss.chinamobile.com>
510
517
  kafka <guowang@unitedstack.com>
518
+ lajoskatona <lajos.katona@est.tech>
511
519
  licanwei <li.canwei2@zte.com.cn>
512
520
  lihaijing <lihaijing@fiberhome.com>
513
521
  likui <likui@yovole.com>
@@ -547,6 +555,7 @@ reedip <reedip.banerjee@nectechnologies.in>
547
555
  rladntjr4 <rladntjr4@gmail.com>
548
556
  root <ranasheel2000@gmail.com>
549
557
  ryanKor <equus3144@gmail.com>
558
+ seheonnn <ho78901@naver.com>
550
559
  sharat.sharma <sharat.sharma@nectechnologies.in>
551
560
  shizhihui <zhihui.shi@easystack.cn>
552
561
  songminglong <songminglong@cmss.chinamobile.com>
@@ -0,0 +1 @@
1
+ {"git_version": "b1e4be80", "is_release": true}
@@ -1,69 +0,0 @@
1
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
2
- # not use this file except in compliance with the License. You may obtain
3
- # a copy of the License at
4
- #
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- #
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
- # License for the specific language governing permissions and limitations
11
- # under the License.
12
- #
13
-
14
- """Image v1 API Library"""
15
-
16
- from openstackclient.api import api
17
-
18
-
19
- class APIv1(api.BaseAPI):
20
- """Image v1 API"""
21
-
22
- _endpoint_suffix = '/v1'
23
-
24
- def __init__(self, endpoint=None, **kwargs):
25
- super().__init__(endpoint=endpoint, **kwargs)
26
-
27
- self.endpoint = self.endpoint.rstrip('/')
28
- self._munge_url()
29
-
30
- def _munge_url(self):
31
- # Hack this until discovery is up
32
- if not self.endpoint.endswith(self._endpoint_suffix):
33
- self.endpoint = self.endpoint + self._endpoint_suffix
34
-
35
- def image_list(
36
- self, detailed=False, public=False, private=False, **filter
37
- ):
38
- """Get available images
39
-
40
- :param detailed:
41
- Retrieve detailed response from server if True
42
- :param public:
43
- Return public images if True
44
- :param private:
45
- Return private images if True
46
-
47
- If public and private are both True or both False then all images are
48
- returned. Both arguments False is equivalent to no filter and all
49
- images are returned. Both arguments True is a filter that includes
50
- both public and private images which is the same set as all images.
51
-
52
- http://docs.openstack.org/api/openstack-image-service/1.1/content/requesting-a-list-of-public-vm-images.html
53
- http://docs.openstack.org/api/openstack-image-service/1.1/content/requesting-detailed-metadata-on-public-vm-images.html
54
- http://docs.openstack.org/api/openstack-image-service/1.1/content/filtering-images-returned-via-get-images-and-get-imagesdetail.html
55
- """
56
-
57
- url = "/images"
58
- if detailed or public or private:
59
- # Because we can't all use /details
60
- url += "/detail"
61
-
62
- image_list = self.list(url, **filter)['images']
63
-
64
- if public != private:
65
- # One is True and one is False, so public represents the filter
66
- # state in either case
67
- image_list = [i for i in image_list if i['is_public'] == public]
68
-
69
- return image_list
@@ -1,79 +0,0 @@
1
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
2
- # not use this file except in compliance with the License. You may obtain
3
- # a copy of the License at
4
- #
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- #
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
- # License for the specific language governing permissions and limitations
11
- # under the License.
12
- #
13
-
14
- """Image v2 API Library"""
15
-
16
- from openstackclient.api import image_v1
17
-
18
-
19
- class APIv2(image_v1.APIv1):
20
- """Image v2 API"""
21
-
22
- _endpoint_suffix = '/v2'
23
-
24
- def _munge_url(self):
25
- # Hack this until discovery is up, and ignore parent endpoint setting
26
- if not self.endpoint.endswith(self._endpoint_suffix):
27
- self.endpoint = self.endpoint + self._endpoint_suffix
28
-
29
- def image_list(
30
- self,
31
- detailed=False,
32
- public=False,
33
- private=False,
34
- community=False,
35
- shared=False,
36
- **filter,
37
- ):
38
- """Get available images
39
-
40
- can add limit/marker
41
-
42
- :param detailed:
43
- For v1 compatibility only, ignored as v2 is always 'detailed'
44
- :param public:
45
- Return public images if True
46
- :param private:
47
- Return private images if True
48
- :param community:
49
- Return commuity images if True
50
- :param shared:
51
- Return shared images if True
52
-
53
- If public, private, community and shared are all True or all False
54
- then all images are returned. All arguments False is equivalent to no
55
- filter and all images are returned. All arguments True is a filter
56
- that includes all public, private, community and shared images which
57
- is the same set as all images.
58
-
59
- http://docs.openstack.org/api/openstack-image-service/2.0/content/list-images.html
60
- """
61
-
62
- if not public and not private and not community and not shared:
63
- # No filtering for all False
64
- filter.pop('visibility', None)
65
- elif public:
66
- filter['visibility'] = 'public'
67
- elif private:
68
- filter['visibility'] = 'private'
69
- elif community:
70
- filter['visibility'] = 'community'
71
- elif shared:
72
- filter['visibility'] = 'shared'
73
-
74
- url = "/images"
75
- if detailed:
76
- # Because we can't all use /details
77
- url += "/detail"
78
-
79
- return self.list(url, **filter)['images']
@@ -1,38 +0,0 @@
1
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
2
- # not use this file except in compliance with the License. You may obtain
3
- # a copy of the License at
4
- #
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- #
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
- # License for the specific language governing permissions and limitations
11
- # under the License.
12
-
13
- """Floating IP Pool action implementations"""
14
-
15
- from osc_lib import exceptions
16
-
17
- from openstackclient.api import compute_v2
18
- from openstackclient.i18n import _
19
- from openstackclient.network import common
20
-
21
-
22
- class ListFloatingIPPool(common.NetworkAndComputeLister):
23
- _description = _("List pools of floating IP addresses")
24
-
25
- def take_action_network(self, client, parsed_args):
26
- msg = _(
27
- "Floating ip pool operations are only available for "
28
- "Compute v2 network."
29
- )
30
- raise exceptions.CommandError(msg)
31
-
32
- def take_action_compute(self, client, parsed_args):
33
- columns = ('Name',)
34
- data = [
35
- (x['name'],) for x in compute_v2.list_floating_ip_pools(client)
36
- ]
37
-
38
- return (columns, data)
@@ -1,97 +0,0 @@
1
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
2
- # not use this file except in compliance with the License. You may obtain
3
- # a copy of the License at
4
- #
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- #
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
- # License for the specific language governing permissions and limitations
11
- # under the License.
12
-
13
- import uuid
14
-
15
- import fixtures
16
-
17
- from openstackclient.tests.functional.image import base
18
-
19
-
20
- class ImageTests(base.BaseImageTests):
21
- """Functional tests for Image commands"""
22
-
23
- def setUp(self):
24
- super().setUp()
25
-
26
- if not self.haz_v1_api:
27
- self.skipTest('No Image v1 API present')
28
-
29
- ver_fixture = fixtures.EnvironmentVariable('OS_IMAGE_API_VERSION', '1')
30
- self.useFixture(ver_fixture)
31
-
32
- self.name = uuid.uuid4().hex
33
- output = self.openstack(
34
- 'image create ' + self.name,
35
- parse_output=True,
36
- )
37
- self.image_id = output["id"]
38
- self.assertOutput(self.name, output['name'])
39
-
40
- def tearDown(self):
41
- try:
42
- self.openstack('image delete ' + self.image_id)
43
- finally:
44
- super().tearDown()
45
-
46
- def test_image_list(self):
47
- output = self.openstack('image list')
48
- self.assertIn(self.name, [img['Name'] for img in output])
49
-
50
- def test_image_attributes(self):
51
- """Test set, unset, show on attributes, tags and properties"""
52
-
53
- # Test explicit attributes
54
- self.openstack(
55
- 'image set '
56
- + '--min-disk 4 '
57
- + '--min-ram 5 '
58
- + '--disk-format qcow2 '
59
- + '--public '
60
- + self.name
61
- )
62
- output = self.openstack(
63
- 'image show ' + self.name,
64
- parse_output=True,
65
- )
66
- self.assertEqual(
67
- 4,
68
- output["min_disk"],
69
- )
70
- self.assertEqual(
71
- 5,
72
- output["min_ram"],
73
- )
74
- self.assertEqual(
75
- 'qcow2',
76
- output['disk_format'],
77
- )
78
- self.assertTrue(
79
- output["is_public"],
80
- )
81
-
82
- # Test properties
83
- self.openstack(
84
- 'image set '
85
- + '--property a=b '
86
- + '--property c=d '
87
- + '--public '
88
- + self.name
89
- )
90
- output = self.openstack(
91
- 'image show ' + self.name,
92
- parse_output=True,
93
- )
94
- self.assertEqual(
95
- {'a': 'b', 'c': 'd'},
96
- output["properties"],
97
- )
@@ -1,96 +0,0 @@
1
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
2
- # not use this file except in compliance with the License. You may obtain
3
- # a copy of the License at
4
- #
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- #
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
- # License for the specific language governing permissions and limitations
11
- # under the License.
12
- #
13
-
14
- """Image v1 API Library Tests"""
15
-
16
- from keystoneauth1 import session
17
- from requests_mock.contrib import fixture
18
-
19
- from openstackclient.api import image_v1
20
- from openstackclient.tests.unit import utils
21
-
22
-
23
- FAKE_PROJECT = 'xyzpdq'
24
- FAKE_URL = 'http://gopher.dev10.com'
25
-
26
-
27
- class TestImageAPIv1(utils.TestCase):
28
- def setUp(self):
29
- super().setUp()
30
-
31
- sess = session.Session()
32
- self.api = image_v1.APIv1(session=sess, endpoint=FAKE_URL)
33
- self.requests_mock = self.useFixture(fixture.Fixture())
34
-
35
-
36
- class TestImage(TestImageAPIv1):
37
- PUB_PROT = {
38
- 'id': '1',
39
- 'name': 'pub1',
40
- 'is_public': True,
41
- 'protected': True,
42
- }
43
- PUB_NOPROT = {
44
- 'id': '2',
45
- 'name': 'pub2-noprot',
46
- 'is_public': True,
47
- 'protected': False,
48
- }
49
- NOPUB_PROT = {
50
- 'id': '3',
51
- 'name': 'priv3',
52
- 'is_public': False,
53
- 'protected': True,
54
- }
55
- NOPUB_NOPROT = {
56
- 'id': '4',
57
- 'name': 'priv4-noprot',
58
- 'is_public': False,
59
- 'protected': False,
60
- }
61
- LIST_IMAGE_RESP = [
62
- PUB_PROT,
63
- PUB_NOPROT,
64
- NOPUB_PROT,
65
- NOPUB_NOPROT,
66
- ]
67
-
68
- def test_image_list_no_options(self):
69
- self.requests_mock.register_uri(
70
- 'GET',
71
- FAKE_URL + '/v1/images',
72
- json={'images': self.LIST_IMAGE_RESP},
73
- status_code=200,
74
- )
75
- ret = self.api.image_list()
76
- self.assertEqual(self.LIST_IMAGE_RESP, ret)
77
-
78
- def test_image_list_public(self):
79
- self.requests_mock.register_uri(
80
- 'GET',
81
- FAKE_URL + '/v1/images/detail',
82
- json={'images': self.LIST_IMAGE_RESP},
83
- status_code=200,
84
- )
85
- ret = self.api.image_list(public=True)
86
- self.assertEqual([self.PUB_PROT, self.PUB_NOPROT], ret)
87
-
88
- def test_image_list_private(self):
89
- self.requests_mock.register_uri(
90
- 'GET',
91
- FAKE_URL + '/v1/images/detail',
92
- json={'images': self.LIST_IMAGE_RESP},
93
- status_code=200,
94
- )
95
- ret = self.api.image_list(private=True)
96
- self.assertEqual([self.NOPUB_PROT, self.NOPUB_NOPROT], ret)
@@ -1,96 +0,0 @@
1
- # Licensed under the Apache License, Version 2.0 (the "License"); you may
2
- # not use this file except in compliance with the License. You may obtain
3
- # a copy of the License at
4
- #
5
- # http://www.apache.org/licenses/LICENSE-2.0
6
- #
7
- # Unless required by applicable law or agreed to in writing, software
8
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10
- # License for the specific language governing permissions and limitations
11
- # under the License.
12
- #
13
-
14
- """Image v2 API Library Tests"""
15
-
16
- from keystoneauth1 import session
17
- from requests_mock.contrib import fixture
18
-
19
- from openstackclient.api import image_v2
20
- from openstackclient.tests.unit import utils
21
-
22
-
23
- FAKE_PROJECT = 'xyzpdq'
24
- FAKE_URL = 'http://gopher.dev20.com'
25
-
26
-
27
- class TestImageAPIv2(utils.TestCase):
28
- def setUp(self):
29
- super().setUp()
30
-
31
- sess = session.Session()
32
- self.api = image_v2.APIv2(session=sess, endpoint=FAKE_URL)
33
- self.requests_mock = self.useFixture(fixture.Fixture())
34
-
35
-
36
- class TestImage(TestImageAPIv2):
37
- PUB_PROT = {
38
- 'id': '1',
39
- 'name': 'pub1',
40
- 'visibility': 'public',
41
- 'protected': True,
42
- }
43
- PUB_NOPROT = {
44
- 'id': '2',
45
- 'name': 'pub2-noprot',
46
- 'visibility': 'public',
47
- 'protected': False,
48
- }
49
- NOPUB_PROT = {
50
- 'id': '3',
51
- 'name': 'priv3',
52
- 'visibility': 'private',
53
- 'protected': True,
54
- }
55
- NOPUB_NOPROT = {
56
- 'id': '4',
57
- 'name': 'priv4-noprot',
58
- 'visibility': 'private',
59
- 'protected': False,
60
- }
61
- LIST_IMAGE_RESP = [
62
- PUB_PROT,
63
- PUB_NOPROT,
64
- NOPUB_PROT,
65
- NOPUB_NOPROT,
66
- ]
67
-
68
- def test_image_list_no_options(self):
69
- self.requests_mock.register_uri(
70
- 'GET',
71
- FAKE_URL + '/v2/images',
72
- json={'images': self.LIST_IMAGE_RESP},
73
- status_code=200,
74
- )
75
- ret = self.api.image_list()
76
- self.assertEqual(self.LIST_IMAGE_RESP, ret)
77
-
78
- def test_image_list_public(self):
79
- self.requests_mock.register_uri(
80
- 'GET',
81
- FAKE_URL + '/v2/images',
82
- json={'images': [self.PUB_PROT, self.PUB_NOPROT]},
83
- status_code=200,
84
- )
85
- ret = self.api.image_list(public=True)
86
- self.assertEqual([self.PUB_PROT, self.PUB_NOPROT], ret)
87
-
88
- def test_image_list_private(self):
89
- self.requests_mock.register_uri(
90
- 'GET',
91
- FAKE_URL + '/v2/images',
92
- json={'images': [self.NOPUB_PROT, self.NOPUB_NOPROT]},
93
- status_code=200,
94
- )
95
- ret = self.api.image_list(public=True)
96
- self.assertEqual([self.NOPUB_PROT, self.NOPUB_NOPROT], ret)