oneview-sdk 4.5.1 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (263) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +56 -0
  3. data/Gemfile +0 -0
  4. data/Guardfile +0 -0
  5. data/LICENSE +0 -0
  6. data/README.md +0 -0
  7. data/Rakefile +0 -0
  8. data/bin/oneview-sdk-ruby +0 -0
  9. data/lib/oneview-sdk.rb +0 -0
  10. data/lib/oneview-sdk/cli.rb +0 -0
  11. data/lib/oneview-sdk/client.rb +0 -0
  12. data/lib/oneview-sdk/config_loader.rb +0 -0
  13. data/lib/oneview-sdk/exceptions.rb +0 -0
  14. data/lib/oneview-sdk/image-streamer/client.rb +0 -0
  15. data/lib/oneview-sdk/image-streamer/resource/api300.rb +0 -0
  16. data/lib/oneview-sdk/image-streamer/resource/api300/artifact_bundle.rb +0 -0
  17. data/lib/oneview-sdk/image-streamer/resource/api300/build_plan.rb +0 -0
  18. data/lib/oneview-sdk/image-streamer/resource/api300/deployment_group.rb +0 -0
  19. data/lib/oneview-sdk/image-streamer/resource/api300/deployment_plan.rb +0 -0
  20. data/lib/oneview-sdk/image-streamer/resource/api300/golden_image.rb +0 -0
  21. data/lib/oneview-sdk/image-streamer/resource/api300/os_volume.rb +0 -0
  22. data/lib/oneview-sdk/image-streamer/resource/api300/plan_script.rb +0 -0
  23. data/lib/oneview-sdk/image-streamer/resource/api300/resource.rb +0 -0
  24. data/lib/oneview-sdk/image_streamer.rb +0 -0
  25. data/lib/oneview-sdk/resource.rb +54 -23
  26. data/lib/oneview-sdk/resource/api200.rb +0 -0
  27. data/lib/oneview-sdk/resource/api200/client_certificate.rb +134 -0
  28. data/lib/oneview-sdk/resource/api200/connection_template.rb +2 -1
  29. data/lib/oneview-sdk/resource/api200/datacenter.rb +0 -0
  30. data/lib/oneview-sdk/resource/api200/enclosure.rb +5 -9
  31. data/lib/oneview-sdk/resource/api200/enclosure_group.rb +2 -1
  32. data/lib/oneview-sdk/resource/api200/ethernet_network.rb +2 -2
  33. data/lib/oneview-sdk/resource/api200/event.rb +0 -0
  34. data/lib/oneview-sdk/resource/api200/fabric.rb +0 -0
  35. data/lib/oneview-sdk/resource/api200/fc_network.rb +0 -0
  36. data/lib/oneview-sdk/resource/api200/fcoe_network.rb +0 -0
  37. data/lib/oneview-sdk/resource/api200/firmware_bundle.rb +2 -1
  38. data/lib/oneview-sdk/resource/api200/firmware_driver.rb +0 -0
  39. data/lib/oneview-sdk/resource/api200/id_pool.rb +5 -3
  40. data/lib/oneview-sdk/resource/api200/interconnect.rb +0 -0
  41. data/lib/oneview-sdk/resource/api200/lig_uplink_set.rb +0 -0
  42. data/lib/oneview-sdk/resource/api200/logical_downlink.rb +0 -0
  43. data/lib/oneview-sdk/resource/api200/logical_enclosure.rb +1 -1
  44. data/lib/oneview-sdk/resource/api200/logical_interconnect.rb +4 -3
  45. data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +2 -2
  46. data/lib/oneview-sdk/resource/api200/logical_switch.rb +0 -0
  47. data/lib/oneview-sdk/resource/api200/logical_switch_group.rb +0 -0
  48. data/lib/oneview-sdk/resource/api200/managed_san.rb +0 -0
  49. data/lib/oneview-sdk/resource/api200/network_set.rb +0 -0
  50. data/lib/oneview-sdk/resource/api200/power_device.rb +1 -1
  51. data/lib/oneview-sdk/resource/api200/rack.rb +0 -0
  52. data/lib/oneview-sdk/resource/api200/resource.rb +0 -0
  53. data/lib/oneview-sdk/resource/api200/san_manager.rb +0 -0
  54. data/lib/oneview-sdk/resource/api200/server_hardware.rb +2 -2
  55. data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +0 -0
  56. data/lib/oneview-sdk/resource/api200/server_profile.rb +35 -25
  57. data/lib/oneview-sdk/resource/api200/server_profile_template.rb +24 -14
  58. data/lib/oneview-sdk/resource/api200/storage_pool.rb +0 -0
  59. data/lib/oneview-sdk/resource/api200/storage_system.rb +6 -10
  60. data/lib/oneview-sdk/resource/api200/switch.rb +4 -10
  61. data/lib/oneview-sdk/resource/api200/unmanaged_device.rb +0 -0
  62. data/lib/oneview-sdk/resource/api200/uplink_set.rb +0 -0
  63. data/lib/oneview-sdk/resource/api200/user.rb +18 -0
  64. data/lib/oneview-sdk/resource/api200/volume.rb +15 -11
  65. data/lib/oneview-sdk/resource/api200/volume_attachment.rb +3 -1
  66. data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +0 -0
  67. data/lib/oneview-sdk/resource/api200/volume_template.rb +0 -0
  68. data/lib/oneview-sdk/resource/api200/web_server_certificate.rb +97 -0
  69. data/lib/oneview-sdk/resource/api300.rb +0 -0
  70. data/lib/oneview-sdk/resource/api300/c7000.rb +0 -0
  71. data/lib/oneview-sdk/resource/api300/c7000/client_certificate.rb +22 -0
  72. data/lib/oneview-sdk/resource/api300/c7000/connection_template.rb +0 -8
  73. data/lib/oneview-sdk/resource/api300/c7000/datacenter.rb +0 -0
  74. data/lib/oneview-sdk/resource/api300/c7000/enclosure.rb +0 -0
  75. data/lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb +0 -1
  76. data/lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb +1 -0
  77. data/lib/oneview-sdk/resource/api300/c7000/event.rb +0 -0
  78. data/lib/oneview-sdk/resource/api300/c7000/fabric.rb +0 -0
  79. data/lib/oneview-sdk/resource/api300/c7000/fc_network.rb +1 -0
  80. data/lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb +1 -0
  81. data/lib/oneview-sdk/resource/api300/c7000/firmware_bundle.rb +0 -0
  82. data/lib/oneview-sdk/resource/api300/c7000/firmware_driver.rb +0 -0
  83. data/lib/oneview-sdk/resource/api300/c7000/id_pool.rb +0 -0
  84. data/lib/oneview-sdk/resource/api300/c7000/interconnect.rb +0 -0
  85. data/lib/oneview-sdk/resource/api300/{synergy/logical_switch.rb → c7000/internal_link_set.rb} +30 -7
  86. data/lib/oneview-sdk/resource/api300/c7000/lig_uplink_set.rb +0 -0
  87. data/lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb +0 -0
  88. data/lib/oneview-sdk/resource/api300/c7000/logical_enclosure.rb +9 -7
  89. data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb +2 -20
  90. data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect_group.rb +2 -0
  91. data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +0 -19
  92. data/lib/oneview-sdk/resource/api300/c7000/logical_switch_group.rb +1 -0
  93. data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +0 -0
  94. data/lib/oneview-sdk/resource/api300/c7000/network_set.rb +1 -0
  95. data/lib/oneview-sdk/resource/api300/c7000/power_device.rb +0 -0
  96. data/lib/oneview-sdk/resource/api300/c7000/rack.rb +0 -0
  97. data/lib/oneview-sdk/resource/api300/c7000/resource.rb +0 -0
  98. data/lib/oneview-sdk/resource/api300/c7000/san_manager.rb +0 -0
  99. data/lib/oneview-sdk/resource/api300/c7000/scope.rb +0 -0
  100. data/lib/oneview-sdk/resource/api300/c7000/server_hardware.rb +0 -0
  101. data/lib/oneview-sdk/resource/api300/c7000/server_hardware_type.rb +0 -0
  102. data/lib/oneview-sdk/resource/api300/c7000/server_profile.rb +0 -0
  103. data/lib/oneview-sdk/resource/api300/c7000/server_profile_template.rb +0 -0
  104. data/lib/oneview-sdk/resource/api300/c7000/storage_pool.rb +0 -0
  105. data/lib/oneview-sdk/resource/api300/c7000/storage_system.rb +0 -0
  106. data/lib/oneview-sdk/resource/api300/c7000/switch.rb +0 -0
  107. data/lib/oneview-sdk/resource/api300/c7000/unmanaged_device.rb +0 -0
  108. data/lib/oneview-sdk/resource/api300/c7000/uplink_set.rb +0 -0
  109. data/lib/oneview-sdk/resource/api300/c7000/user.rb +0 -0
  110. data/lib/oneview-sdk/resource/api300/c7000/volume.rb +0 -0
  111. data/lib/oneview-sdk/resource/api300/c7000/volume_attachment.rb +0 -0
  112. data/lib/oneview-sdk/resource/api300/c7000/volume_snapshot.rb +0 -0
  113. data/lib/oneview-sdk/resource/api300/c7000/volume_template.rb +0 -0
  114. data/lib/oneview-sdk/resource/api300/c7000/web_server_certificate.rb +22 -0
  115. data/lib/oneview-sdk/resource/api300/synergy.rb +0 -0
  116. data/lib/oneview-sdk/resource/api300/synergy/client_certificate.rb +22 -0
  117. data/lib/oneview-sdk/resource/api300/synergy/connection_template.rb +0 -8
  118. data/lib/oneview-sdk/resource/api300/synergy/datacenter.rb +0 -0
  119. data/lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb +0 -0
  120. data/lib/oneview-sdk/resource/api300/synergy/enclosure.rb +2 -2
  121. data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +0 -0
  122. data/lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb +1 -0
  123. data/lib/oneview-sdk/resource/api300/synergy/event.rb +0 -0
  124. data/lib/oneview-sdk/resource/api300/synergy/fabric.rb +1 -1
  125. data/lib/oneview-sdk/resource/api300/synergy/fc_network.rb +1 -0
  126. data/lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb +3 -15
  127. data/lib/oneview-sdk/resource/api300/synergy/firmware_bundle.rb +0 -0
  128. data/lib/oneview-sdk/resource/api300/synergy/firmware_driver.rb +0 -0
  129. data/lib/oneview-sdk/resource/api300/synergy/id_pool.rb +0 -0
  130. data/lib/oneview-sdk/resource/api300/synergy/interconnect.rb +0 -0
  131. data/lib/oneview-sdk/resource/api300/synergy/internal_link_set.rb +22 -0
  132. data/lib/oneview-sdk/resource/api300/synergy/lig_uplink_set.rb +0 -0
  133. data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +2 -14
  134. data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +0 -0
  135. data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb +0 -20
  136. data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +3 -1
  137. data/lib/oneview-sdk/resource/api300/synergy/managed_san.rb +0 -0
  138. data/lib/oneview-sdk/resource/api300/synergy/network_set.rb +2 -17
  139. data/lib/oneview-sdk/resource/api300/synergy/os_deployment_plan.rb +0 -0
  140. data/lib/oneview-sdk/resource/api300/synergy/power_device.rb +0 -0
  141. data/lib/oneview-sdk/resource/api300/synergy/rack.rb +0 -0
  142. data/lib/oneview-sdk/resource/api300/synergy/resource.rb +0 -0
  143. data/lib/oneview-sdk/resource/api300/synergy/san_manager.rb +0 -0
  144. data/lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb +0 -0
  145. data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb +0 -0
  146. data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb +0 -0
  147. data/lib/oneview-sdk/resource/api300/synergy/scope.rb +0 -0
  148. data/lib/oneview-sdk/resource/api300/synergy/server_hardware.rb +0 -0
  149. data/lib/oneview-sdk/resource/api300/synergy/server_hardware_type.rb +0 -0
  150. data/lib/oneview-sdk/resource/api300/synergy/server_profile.rb +24 -27
  151. data/lib/oneview-sdk/resource/api300/synergy/server_profile_template.rb +0 -12
  152. data/lib/oneview-sdk/resource/api300/synergy/storage_pool.rb +0 -0
  153. data/lib/oneview-sdk/resource/api300/synergy/storage_system.rb +0 -0
  154. data/lib/oneview-sdk/resource/api300/synergy/switch.rb +0 -0
  155. data/lib/oneview-sdk/resource/api300/synergy/unmanaged_device.rb +0 -0
  156. data/lib/oneview-sdk/resource/api300/synergy/uplink_set.rb +0 -0
  157. data/lib/oneview-sdk/resource/api300/synergy/user.rb +0 -0
  158. data/lib/oneview-sdk/resource/api300/synergy/volume.rb +0 -0
  159. data/lib/oneview-sdk/resource/api300/synergy/volume_attachment.rb +0 -0
  160. data/lib/oneview-sdk/resource/api300/synergy/volume_snapshot.rb +0 -0
  161. data/lib/oneview-sdk/resource/api300/synergy/volume_template.rb +0 -0
  162. data/lib/oneview-sdk/resource/api300/synergy/web_server_certificate.rb +22 -0
  163. data/lib/oneview-sdk/resource/api500.rb +0 -0
  164. data/lib/oneview-sdk/resource/api500/c7000.rb +0 -0
  165. data/lib/oneview-sdk/resource/api500/c7000/client_certificate.rb +22 -0
  166. data/lib/oneview-sdk/resource/api500/c7000/connection_template.rb +0 -0
  167. data/lib/oneview-sdk/resource/api500/c7000/datacenter.rb +0 -0
  168. data/lib/oneview-sdk/resource/api500/c7000/enclosure.rb +35 -0
  169. data/lib/oneview-sdk/resource/api500/c7000/enclosure_group.rb +21 -0
  170. data/lib/oneview-sdk/resource/api500/c7000/ethernet_network.rb +0 -0
  171. data/lib/oneview-sdk/resource/api500/c7000/event.rb +2 -2
  172. data/lib/oneview-sdk/resource/api500/c7000/fabric.rb +0 -0
  173. data/lib/oneview-sdk/resource/api500/c7000/fc_network.rb +1 -0
  174. data/lib/oneview-sdk/resource/api500/c7000/fcoe_network.rb +0 -0
  175. data/lib/oneview-sdk/resource/api500/c7000/firmware_bundle.rb +0 -0
  176. data/lib/oneview-sdk/resource/api500/c7000/firmware_driver.rb +0 -0
  177. data/lib/oneview-sdk/resource/api500/c7000/id_pool.rb +22 -0
  178. data/lib/oneview-sdk/resource/api500/c7000/interconnect.rb +8 -0
  179. data/lib/oneview-sdk/resource/api500/c7000/internal_link_set.rb +22 -0
  180. data/lib/oneview-sdk/resource/api500/c7000/lig_uplink_set.rb +0 -0
  181. data/lib/oneview-sdk/resource/api500/c7000/logical_downlink.rb +0 -0
  182. data/lib/oneview-sdk/resource/api500/c7000/logical_enclosure.rb +40 -0
  183. data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect.rb +0 -0
  184. data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect_group.rb +0 -0
  185. data/lib/oneview-sdk/resource/api500/c7000/logical_switch.rb +0 -0
  186. data/lib/oneview-sdk/resource/api500/c7000/logical_switch_group.rb +0 -0
  187. data/lib/oneview-sdk/resource/api500/c7000/managed_san.rb +10 -0
  188. data/lib/oneview-sdk/resource/api500/c7000/network_set.rb +0 -0
  189. data/lib/oneview-sdk/resource/api500/c7000/power_device.rb +0 -0
  190. data/lib/oneview-sdk/resource/api500/c7000/rack.rb +0 -0
  191. data/lib/oneview-sdk/resource/api500/c7000/resource.rb +0 -0
  192. data/lib/oneview-sdk/resource/api500/c7000/san_manager.rb +0 -0
  193. data/lib/oneview-sdk/resource/api500/c7000/scope.rb +49 -0
  194. data/lib/oneview-sdk/resource/api500/c7000/server_hardware.rb +20 -0
  195. data/lib/oneview-sdk/resource/api500/c7000/server_hardware_type.rb +1 -0
  196. data/lib/oneview-sdk/resource/api500/c7000/server_profile.rb +60 -1
  197. data/lib/oneview-sdk/resource/api500/c7000/server_profile_template.rb +86 -0
  198. data/lib/oneview-sdk/resource/api500/c7000/storage_pool.rb +57 -2
  199. data/lib/oneview-sdk/resource/api500/c7000/storage_system.rb +132 -0
  200. data/lib/oneview-sdk/resource/api500/c7000/switch.rb +7 -0
  201. data/lib/oneview-sdk/resource/api500/c7000/unmanaged_device.rb +0 -0
  202. data/lib/oneview-sdk/resource/api500/c7000/uplink_set.rb +0 -0
  203. data/lib/oneview-sdk/resource/api500/c7000/user.rb +0 -0
  204. data/lib/oneview-sdk/resource/api500/c7000/volume.rb +135 -0
  205. data/lib/oneview-sdk/resource/api500/c7000/volume_attachment.rb +24 -1
  206. data/lib/oneview-sdk/resource/api500/c7000/volume_snapshot.rb +10 -0
  207. data/lib/oneview-sdk/resource/api500/c7000/volume_template.rb +94 -3
  208. data/lib/oneview-sdk/resource/api500/c7000/web_server_certificate.rb +22 -0
  209. data/lib/oneview-sdk/resource/api500/synergy.rb +0 -0
  210. data/lib/oneview-sdk/resource/api500/synergy/client_certificate.rb +22 -0
  211. data/lib/oneview-sdk/resource/api500/synergy/connection_template.rb +0 -0
  212. data/lib/oneview-sdk/resource/api500/synergy/datacenter.rb +0 -0
  213. data/lib/oneview-sdk/resource/api500/synergy/drive_enclosure.rb +0 -0
  214. data/lib/oneview-sdk/resource/api500/synergy/enclosure.rb +35 -0
  215. data/lib/oneview-sdk/resource/api500/synergy/enclosure_group.rb +27 -0
  216. data/lib/oneview-sdk/resource/api500/synergy/ethernet_network.rb +0 -0
  217. data/lib/oneview-sdk/resource/api500/synergy/event.rb +2 -2
  218. data/lib/oneview-sdk/resource/api500/synergy/fabric.rb +0 -0
  219. data/lib/oneview-sdk/resource/api500/synergy/fc_network.rb +1 -0
  220. data/lib/oneview-sdk/resource/api500/synergy/fcoe_network.rb +0 -0
  221. data/lib/oneview-sdk/resource/api500/synergy/firmware_bundle.rb +0 -0
  222. data/lib/oneview-sdk/resource/api500/synergy/firmware_driver.rb +0 -0
  223. data/lib/oneview-sdk/resource/api500/synergy/{logical_switch.rb → id_pool.rb} +3 -3
  224. data/lib/oneview-sdk/resource/api500/synergy/interconnect.rb +17 -1
  225. data/lib/oneview-sdk/resource/api500/synergy/internal_link_set.rb +22 -0
  226. data/lib/oneview-sdk/resource/api500/synergy/lig_uplink_set.rb +0 -0
  227. data/lib/oneview-sdk/resource/api500/synergy/logical_downlink.rb +0 -0
  228. data/lib/oneview-sdk/resource/api500/synergy/logical_enclosure.rb +17 -0
  229. data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect.rb +0 -0
  230. data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect_group.rb +0 -0
  231. data/lib/oneview-sdk/resource/api500/synergy/managed_san.rb +2 -2
  232. data/lib/oneview-sdk/resource/api500/synergy/network_set.rb +0 -0
  233. data/lib/oneview-sdk/resource/api500/synergy/os_deployment_plan.rb +22 -0
  234. data/lib/oneview-sdk/resource/api500/synergy/power_device.rb +1 -1
  235. data/lib/oneview-sdk/resource/api500/synergy/rack.rb +0 -0
  236. data/lib/oneview-sdk/resource/api500/synergy/resource.rb +0 -0
  237. data/lib/oneview-sdk/resource/api500/synergy/san_manager.rb +0 -0
  238. data/lib/oneview-sdk/resource/api500/synergy/sas_interconnect.rb +0 -0
  239. data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect.rb +0 -0
  240. data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect_group.rb +0 -0
  241. data/lib/oneview-sdk/resource/api500/synergy/scope.rb +2 -2
  242. data/lib/oneview-sdk/resource/api500/synergy/server_hardware.rb +2 -2
  243. data/lib/oneview-sdk/resource/api500/synergy/server_hardware_type.rb +0 -0
  244. data/lib/oneview-sdk/resource/api500/synergy/server_profile.rb +4 -1
  245. data/lib/oneview-sdk/resource/api500/synergy/server_profile_template.rb +16 -2
  246. data/lib/oneview-sdk/resource/api500/synergy/storage_pool.rb +2 -2
  247. data/lib/oneview-sdk/resource/api500/synergy/storage_system.rb +1 -1
  248. data/lib/oneview-sdk/resource/api500/synergy/switch.rb +0 -0
  249. data/lib/oneview-sdk/resource/api500/synergy/unmanaged_device.rb +0 -0
  250. data/lib/oneview-sdk/resource/api500/synergy/uplink_set.rb +0 -0
  251. data/lib/oneview-sdk/resource/api500/synergy/user.rb +0 -0
  252. data/lib/oneview-sdk/resource/api500/synergy/volume.rb +2 -2
  253. data/lib/oneview-sdk/resource/api500/synergy/volume_attachment.rb +3 -3
  254. data/lib/oneview-sdk/resource/api500/synergy/volume_snapshot.rb +2 -2
  255. data/lib/oneview-sdk/resource/api500/synergy/volume_template.rb +2 -2
  256. data/lib/oneview-sdk/resource/api500/synergy/web_server_certificate.rb +22 -0
  257. data/lib/oneview-sdk/resource_helper.rb +30 -0
  258. data/lib/oneview-sdk/rest.rb +6 -2
  259. data/lib/oneview-sdk/scmb.rb +0 -0
  260. data/lib/oneview-sdk/ssl_helper.rb +0 -0
  261. data/lib/oneview-sdk/version.rb +1 -1
  262. data/oneview-sdk.gemspec +0 -0
  263. metadata +21 -5
@@ -16,6 +16,13 @@ module OneviewSDK
16
16
  module C7000
17
17
  # Switch resource implementation for API 500 C7000
18
18
  class Switch < OneviewSDK::API300::C7000::Switch
19
+
20
+ # Method is not available
21
+ # Use {#add_scope}, {#remove_scope}, and {#replace_scopes} instead.
22
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
23
+ def set_scope_uris(*)
24
+ unavailable_method
25
+ end
19
26
  end
20
27
  end
21
28
  end
File without changes
File without changes
@@ -16,6 +16,141 @@ module OneviewSDK
16
16
  module C7000
17
17
  # Volume resource implementation on API500 C7000
18
18
  class Volume < OneviewSDK::API300::C7000::Volume
19
+
20
+ # Method is not available
21
+ # @raise [OneviewSDK::MethodUnavailable] method is not available.
22
+ def set_storage_system(*)
23
+ unavailable_method
24
+ end
25
+
26
+ # Creates the volume
27
+ # @note properties and templateUri parameters are required for creation, but not afterwards; after creation, they will be removed.
28
+ # @raise [OneviewSDK::IncompleteResource] if the client is not set.
29
+ # @raise [StandardError] if the resource creation fails.
30
+ # @return [Resource] self
31
+ def create
32
+ properties = Hash[@data['properties'].map { |k, v| [k.to_sym, v] }]
33
+ family = properties[:dataProtectionLevel].nil? ? 'StoreServ' : 'StoreVirtual'
34
+ template_data = {
35
+ isRoot: true,
36
+ family: family
37
+ }
38
+ @data['templateUri'] = get_volume_template_uri(template_data) unless @data['templateUri']
39
+
40
+ OneviewSDK::Resource.instance_method(:create).bind(self).call
41
+ @data.delete('properties')
42
+ @data.delete('templateUri')
43
+ self
44
+ end
45
+
46
+ # Deletes the resource from OneView or from Oneview and storage system
47
+ # @param [Symbol] flag Delete storage system from Oneview only or in storage system as well.
48
+ # Flags: :all = removes the volume from oneview and storage system. :oneview = removes from oneview only.
49
+ # @raise [InvalidResource] if an invalid flag is passed.
50
+ # @return [true] if resource was deleted successfully.
51
+ def delete(flag = :all)
52
+ ensure_client && ensure_uri
53
+ raise InvalidResource, 'Invalid flag value, use :oneview or :all' unless flag == :oneview || flag == :all
54
+ uri = @data['uri']
55
+ uri << '?suppressDeviceUpdates=true' if flag == :oneview
56
+ response = @client.rest_delete(uri, 'If-Match' => @data['eTag'])
57
+ @client.response_handler(response)
58
+ true
59
+ end
60
+
61
+ # Sets the storage pool to the volume
62
+ # @param [OneviewSDK::StoragePool] storage_pool Storage pool.
63
+ def set_storage_pool(storage_pool)
64
+ assure_uri(storage_pool)
65
+ @data['properties'] ||= {}
66
+ @data['properties']['storagePool'] = storage_pool['uri']
67
+ end
68
+
69
+ # Sets the snapshot pool to the volume
70
+ # @param [OneviewSDK::StoragePool] storage_pool Storage Pool to use for snapshots.
71
+ def set_snapshot_pool(storage_pool)
72
+ assure_uri(storage_pool)
73
+ @data['properties'] ||= {}
74
+ @data['properties']['snapshotPool'] = storage_pool['uri']
75
+ end
76
+
77
+ # Creates a new volume on the storage system from a snapshot of a volume.
78
+ # @note Volumes can only be created on storage pools managed by the appliance.
79
+ # @param [String] snapshot_name The snapshot name.
80
+ # @param [Hash] properties Storage Pool to use for snapshots.
81
+ # @option properties [String] :provisioningType The provision type. Values: Full or Thin.
82
+ # @option properties [String] :name The name for new volume.
83
+ # @option properties [String] :isShareable Indicates whether or not the volume can be shared by multiple profiles.
84
+ # @param [OneviewSDK::VolumeTemplate] volume_template The Volume Template resource.
85
+ # @param [Boolean] is_permanent If true, indicates that the volume will persist when the profile using this volume is deleted.
86
+ # @raise [IncompleteResource] if the snapshot or volume template are not found.
87
+ # @return [OneviewSDK::Volume] The volume created.
88
+ def create_from_snapshot(snapshot_name, properties, volume_template = nil, is_permanent = true)
89
+ snapshot = get_snapshot(snapshot_name)
90
+ raise IncompleteResource, 'Snapshot not found!' unless snapshot
91
+ storage_pool_uri = nil
92
+ volume_template_uri = if volume_template.nil?
93
+ storage_pool_uri = @data['storagePoolUri']
94
+ get_volume_template_uri(isRoot: true, family: 'StoreServ')
95
+ else
96
+ raise IncompleteResource, 'Volume Template not found!' unless volume_template.retrieve!
97
+ storage_pool_uri = volume_template['storagePoolUri']
98
+ volume_template['uri']
99
+ end
100
+
101
+ data = {
102
+ 'properties' => properties.merge('storagePool' => storage_pool_uri, 'snapshotPool' => storage_pool_uri),
103
+ 'snapshotUri' => snapshot['uri'],
104
+ 'templateUri' => volume_template_uri,
105
+ 'isPermanent' => is_permanent
106
+ }
107
+
108
+ response = @client.rest_post("#{BASE_URI}/from-snapshot", { 'body' => data }, @api_version)
109
+ self.class.new(@client, client.response_handler(response))
110
+ end
111
+
112
+ # Initiates a process to import a volume (created external to OneView) for management by the appliance.
113
+ # @note Volumes can be added only on the storage system and storage pools managed by the appliance.
114
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance.
115
+ # @param [OneviewSDK::StorageSystem] storage_system The storage system in which the volume exists to be managed.
116
+ # @param [String] volume_name The name of the volume on the actual storage system.
117
+ # @param [Boolean] is_shareable Describes if the volume is shareable or private.
118
+ # @param [Hash] options The options to create a volume.
119
+ # @option options [String] :name The name for new volume.
120
+ # @option options [String] :description The description for new volume.
121
+ # @raise [OneviewSDK::IncompleteResource] if storage system is not found
122
+ # @return [OneviewSDK::Volume] The volume imported.
123
+ def self.add(client, storage_system, volume_name, is_shareable = false, options = {})
124
+ raise IncompleteResource, 'Storage system not found!' unless storage_system.retrieve!
125
+ data = options.merge('storageSystemUri' => storage_system['uri'], 'deviceVolumeName' => volume_name, 'isShareable' => is_shareable)
126
+ response = client.rest_post("#{BASE_URI}/from-existing", { 'body' => data }, client.api_version)
127
+ new(client, client.response_handler(response))
128
+ end
129
+
130
+ private
131
+
132
+ # Gets the storage volume template URI
133
+ # @param [Hash] template_data The data of storage volume template to filter the result
134
+ # @option options [Boolean] :isRoot True if storage volume template is root. False if not
135
+ # @option options [String] :family The family of storage volume template
136
+ # @return [String] the URI of storage volume template
137
+ def get_volume_template_uri(template_data)
138
+ storage_pool_uri = self['storagePoolUri'] || self['properties']['storagePool']
139
+ storage_pool = OneviewSDK::API500::C7000::StoragePool.new(@client, uri: storage_pool_uri)
140
+ raise 'StoragePool or snapshotPool must be set' unless storage_pool.retrieve!
141
+ storage_system = OneviewSDK::API500::C7000::StorageSystem.new(@client, uri: storage_pool['storageSystemUri'])
142
+ templates = storage_system.get_templates
143
+ template = templates.find { |item| item['isRoot'] == template_data[:isRoot] && item['family'] == template_data[:family] }
144
+ template['uri'] if template
145
+ end
146
+
147
+ # Generates the snapshot data
148
+ # @param [String] name The name of the snapshot
149
+ # @param [String] description The description of the snapshot
150
+ # @return [Hash] snapshot data
151
+ def generate_snapshot_data(name, description = nil)
152
+ { description: description, name: name }
153
+ end
19
154
  end
20
155
  end
21
156
  end
@@ -14,8 +14,31 @@ require_relative '../../api300/c7000/volume_attachment'
14
14
  module OneviewSDK
15
15
  module API500
16
16
  module C7000
17
- # Storage volume attachment resource implementation for API500 C7000
17
+ # Storage Volume Attachment resource implementation for API500 C7000
18
18
  class VolumeAttachment < OneviewSDK::API300::C7000::VolumeAttachment
19
+
20
+ # Create a resource object, associate it with a client, and set its properties.
21
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
22
+ # @param [Hash] params The options for this resource (key-value pairs)
23
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
24
+ def initialize(client, params = {}, api_ver = nil)
25
+ # Default values:
26
+ @data ||= {}
27
+ @data['type'] ||= @data[:type] || 'StorageVolumeAttachmentV2'
28
+ super
29
+ end
30
+
31
+ # Method is not available
32
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
33
+ def get_paths
34
+ unavailable_method
35
+ end
36
+
37
+ # Method is not available
38
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
39
+ def get_path(*)
40
+ unavailable_method
41
+ end
19
42
  end
20
43
  end
21
44
  end
@@ -16,6 +16,16 @@ module OneviewSDK
16
16
  module C7000
17
17
  # Volume snapshot resource implementation for API500 C7000
18
18
  class VolumeSnapshot < OneviewSDK::API300::C7000::VolumeSnapshot
19
+
20
+ # Create a resource object, associate it with a client, and set its properties.
21
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
22
+ # @param [Hash] params The options for this resource (key-value pairs)
23
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
24
+ def initialize(client, params = {}, api_ver = nil)
25
+ super
26
+ # Removing the type property in API500
27
+ @data.delete('type')
28
+ end
19
29
  end
20
30
  end
21
31
  end
@@ -9,13 +9,104 @@
9
9
  # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
10
  # language governing permissions and limitations under the License.
11
11
 
12
- require_relative '../../api300/c7000/volume_template'
12
+ require_relative 'resource'
13
13
 
14
14
  module OneviewSDK
15
15
  module API500
16
16
  module C7000
17
- # Volume Template resource implementation for API500 Synergy
18
- class VolumeTemplate < OneviewSDK::API300::C7000::VolumeTemplate
17
+ # Volume Template resource implementation for API500 C7000
18
+ class VolumeTemplate < Resource
19
+ BASE_URI = '/rest/storage-volume-templates'.freeze
20
+
21
+ # Delete resource from OneView
22
+ # @return [true] if resource was deleted successfully
23
+ def delete
24
+ ensure_client && ensure_uri
25
+ response = @client.rest_delete(@data['uri'], { 'If-Match' => @data['eTag'] }, @api_version)
26
+ @client.response_handler(response)
27
+ true
28
+ end
29
+
30
+ # Sets the root template
31
+ # @param [VolumeTemplate] root_template The Volume Template resource
32
+ def set_root_template(root_template)
33
+ self['properties'] = root_template['properties'].clone
34
+ self['rootTemplateUri'] = root_template['uri']
35
+ end
36
+
37
+ # Sets the "locked" property of property passed to true or false
38
+ # @param [String] property The property for change value
39
+ # @param [Boolean] locked The value to set to "locked" property. Default: true.
40
+ # @raise [OneviewSDK::IncompleteResource] if the rootTemplateUri or properties are not set
41
+ def lock(property, locked = true)
42
+ verify_if_root_template_is_set!
43
+ self['properties'][property.to_s]['meta']['locked'] = locked
44
+ end
45
+
46
+ # Sets the "locked" property of property passed to false
47
+ # @param [String] property The property for change value
48
+ # @raise [OneviewSDK::IncompleteResource] if the rootTemplateUri or properties are not set
49
+ def unlock(property)
50
+ lock(property, false)
51
+ end
52
+
53
+ # Verify if property is locked
54
+ # @param [String] property The property
55
+ # @raise [OneviewSDK::IncompleteResource] if the rootTemplateUri or properties are not set
56
+ # @return [Boolean] true if property is locked or false if not
57
+ def locked?(property)
58
+ verify_if_root_template_is_set!
59
+ self['properties'][property.to_s]['meta']['locked']
60
+ end
61
+
62
+ # Sets the value of property
63
+ # @param [String] property The property for change value
64
+ # @param [Object] value The new value of property
65
+ # @raise [OneviewSDK::IncompleteResource] if the rootTemplateUri or properties are not set
66
+ def set_default_value(property, value)
67
+ verify_if_root_template_is_set!
68
+ value = value['uri'] if value.is_a?(Resource)
69
+ self['properties'][property.to_s]['default'] = value
70
+ end
71
+
72
+ # Gets the value of property
73
+ # @param [String] property The property to get value
74
+ # @raise [OneviewSDK::IncompleteResource] if the rootTemplateUri or properties are not set
75
+ # @return [Object] the default value of property
76
+ def get_default_value(property)
77
+ verify_if_root_template_is_set!
78
+ self['properties'][property.to_s]['default']
79
+ end
80
+
81
+ # Retrieves a collection of all storage systems that is applicable to this storage volume template
82
+ # @raise [OneviewSDK::IncompleteResource] if the client or the URI is not set
83
+ # @return [Array] collection of Storage Systems
84
+ def get_compatible_systems
85
+ ensure_client && ensure_uri
86
+ self.class.find_with_pagination(@client, self['compatibleStorageSystemsUri'])
87
+ end
88
+
89
+ # Gets the storage templates that are connected on the specified networks based on the storage system port's expected network connectivity.
90
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
91
+ # @param [Array] networks Set of networks to filter the storage templates connected
92
+ # @param [Hash] attributes Hash containing the attributes name and value to filter storage templates
93
+ # @return [Array] the collection of volume templates
94
+ def self.get_reachable_volume_templates(client, networks = [], attributes = {})
95
+ uri = self::BASE_URI + '/reachable-volume-templates'
96
+ unless networks.empty?
97
+ network_uris = networks.map { |item| item['uri'] }
98
+ uri += "?networks='#{network_uris.join(',')}'"
99
+ end
100
+ find_by(client, attributes, uri)
101
+ end
102
+
103
+ private
104
+
105
+ # Verify if rootTemplateUri or properties are set
106
+ # @raise [OneviewSDK::IncompleteResource] if the rootTemplateUri or properties were set set before
107
+ def verify_if_root_template_is_set!
108
+ raise IncompleteResource, 'Must set a valid root template' if self['rootTemplateUri'].nil? || self['properties'].nil?
109
+ end
19
110
  end
20
111
  end
21
112
  end
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api300/c7000/web_server_certificate'
13
+
14
+ module OneviewSDK
15
+ module API500
16
+ module C7000
17
+ # Client certificate resource implementation for API500 C7000
18
+ class WebServerCertificate < OneviewSDK::API300::C7000::WebServerCertificate
19
+ end
20
+ end
21
+ end
22
+ end
File without changes
@@ -0,0 +1,22 @@
1
+ # (C) Copyright 2017 Hewlett Packard Enterprise Development LP
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # You may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software distributed
8
+ # under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9
+ # CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
10
+ # language governing permissions and limitations under the License.
11
+
12
+ require_relative '../../api300/synergy/client_certificate'
13
+
14
+ module OneviewSDK
15
+ module API500
16
+ module Synergy
17
+ # Client certificate resource implementation for API500 Synergy
18
+ class ClientCertificate < OneviewSDK::API300::Synergy::ClientCertificate
19
+ end
20
+ end
21
+ end
22
+ end
@@ -16,6 +16,41 @@ module OneviewSDK
16
16
  module Synergy
17
17
  # Enclosure resource implementation for API500 Synergy
18
18
  class Enclosure < OneviewSDK::API300::Synergy::Enclosure
19
+
20
+ # Create a resource object, associate it with a client, and set its properties.
21
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
22
+ # @param [Hash] params The options for this resource (key-value pairs)
23
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
24
+ def initialize(client, params = {}, api_ver = nil)
25
+ @data ||= {}
26
+ # Default values:
27
+ @data['type'] ||= 'EnclosureV400'
28
+ super
29
+ end
30
+
31
+ # Updates the name and rackName (and it uses PATCH).
32
+ # Overrides because is necessary to return the current state of the object and current eTag.
33
+ # @param [Hash] attributes attributes to be updated
34
+ # @return [OneviewSDK::Enclosure] self
35
+ def update(attributes = {})
36
+ super(attributes)
37
+ retrieve!
38
+ self
39
+ end
40
+
41
+ # Performs a specific patch operation.
42
+ # @param [String] operation The operation to be performed
43
+ # @param [String] path The path of operation
44
+ # @param [String] value The value
45
+ # @return [Hash] hash with response
46
+ # @note The scopeUris attribute is subject to incompatible changes in future release versions.
47
+ def patch(operation, path, value = nil)
48
+ ensure_client && ensure_uri
49
+ body = [{ 'op' => operation, 'path' => path, 'value' => value }]
50
+ patch_options = { 'If-Match' => @data['eTag'] }
51
+ response = @client.rest_patch(@data['uri'], patch_options.merge('body' => body), @api_version)
52
+ @client.response_handler(response)
53
+ end
19
54
  end
20
55
  end
21
56
  end
@@ -16,6 +16,33 @@ module OneviewSDK
16
16
  module Synergy
17
17
  # Enclosure group resource implementation on API500 Synergy
18
18
  class EnclosureGroup < OneviewSDK::API300::Synergy::EnclosureGroup
19
+ # Create a resource object, associate it with a client, and set its properties.
20
+ # @param [OneviewSDK::Client] client The client object for the OneView appliance
21
+ # @param [Hash] params The options for this resource (key-value pairs)
22
+ # @param [Integer] api_ver The api version to use when interracting with this resource.
23
+ def initialize(client, params = {}, api_ver = nil)
24
+ @data ||= {}
25
+ # Default values:
26
+ @data['type'] ||= 'EnclosureGroupV400'
27
+ super
28
+ end
29
+
30
+ # Method is not available
31
+ # @raise [OneviewSDK::MethodUnavailable] method is not available
32
+ def get_script(*)
33
+ unavailable_method
34
+ end
35
+
36
+ # Updates an enclosure group
37
+ # @param [Hash] attributes The attributes to add/change for this resource (key-value pairs)
38
+ # @raise [OneviewSDK::IncompleteResource] if the client or uri is not set
39
+ # @raise [StandardError] if the resource save fails
40
+ # @return [Resource] self
41
+ def update(attributes = {})
42
+ super(attributes)
43
+ retrieve!
44
+ self
45
+ end
19
46
  end
20
47
  end
21
48
  end