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
@@ -45,7 +45,8 @@ module OneviewSDK
45
45
  # @return [OneviewSDK::ConnectionTemplate] Connection template
46
46
  def self.get_default(client)
47
47
  response = client.rest_get(BASE_URI + '/defaultConnectionTemplate')
48
- OneviewSDK::ConnectionTemplate.new(client, client.response_handler(response))
48
+ variant = name.split('::').at(-2)
49
+ OneviewSDK.resource_named('ConnectionTemplate', client.api_version, variant).new(client, client.response_handler(response))
49
50
  end
50
51
  end
51
52
  end
File without changes
@@ -75,14 +75,10 @@ module OneviewSDK
75
75
  ensure_client && ensure_uri
76
76
  cur_state = self.class.find_by(@client, uri: @data['uri']).first
77
77
  unless cur_state[:name] == @data['name']
78
- temp_data = [{ op: 'replace', path: '/name', value: @data['name'] }]
79
- response = @client.rest_patch(@data['uri'], { 'body' => temp_data }, @api_version)
80
- @client.response_handler(response)
78
+ patch('replace', '/name', @data['name'])
81
79
  end
82
80
  unless cur_state[:rackName] == @data['rackName']
83
- temp_data = [{ op: 'replace', path: '/rackName', value: @data['rackName'] }]
84
- response = @client.rest_patch(@data['uri'], { 'body' => temp_data }, @api_version)
85
- @client.response_handler(response)
81
+ patch('replace', '/rackName', @data['rackName'])
86
82
  end
87
83
  self
88
84
  end
@@ -117,7 +113,7 @@ module OneviewSDK
117
113
  # @return [String] Script content
118
114
  def script
119
115
  ensure_client && ensure_uri
120
- response = @client.rest_get(@data['uri'] + '/script', @api_version)
116
+ response = @client.rest_get(@data['uri'] + '/script', {}, @api_version)
121
117
  @client.response_handler(response)
122
118
  end
123
119
 
@@ -125,7 +121,7 @@ module OneviewSDK
125
121
  # @return [Hash] The enclosure envirnomental configuration
126
122
  def environmental_configuration
127
123
  ensure_client && ensure_uri
128
- response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', @api_version)
124
+ response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', {}, @api_version)
129
125
  @client.response_handler(response)
130
126
  end
131
127
 
@@ -162,7 +158,7 @@ module OneviewSDK
162
158
  uri += '&'
163
159
  end
164
160
  uri.chop! # Get rid of trailing '&' or '?'
165
- response = @client.rest_get(uri, @api_version)
161
+ response = @client.rest_get(uri, {}, @api_version)
166
162
  @client.response_handler(response)
167
163
  end
168
164
 
@@ -26,6 +26,7 @@ module OneviewSDK
26
26
  # Default values:
27
27
  @data['type'] ||= 'EnclosureGroupV200'
28
28
  @data['interconnectBayMappingCount'] ||= 8
29
+ @data['stackingMode'] ||= 'Enclosure'
29
30
  create_interconnect_bay_mapping unless @data['interconnectBayMappings']
30
31
  end
31
32
 
@@ -33,7 +34,7 @@ module OneviewSDK
33
34
  # @return [String] The script for this enclosure group
34
35
  def get_script
35
36
  ensure_client && ensure_uri
36
- response = @client.rest_get(@data['uri'] + '/script', @api_version)
37
+ response = @client.rest_get(@data['uri'] + '/script', {}, @api_version)
37
38
  @client.response_handler(response)
38
39
  end
39
40
 
@@ -45,14 +45,14 @@ module OneviewSDK
45
45
  # Gets the associated profiles
46
46
  def get_associated_profiles
47
47
  ensure_client && ensure_uri
48
- response = @client.rest_get("#{@data['uri']}/associatedProfiles", @api_version)
48
+ response = @client.rest_get("#{@data['uri']}/associatedProfiles", {}, @api_version)
49
49
  response.body
50
50
  end
51
51
 
52
52
  # Gets the associated uplink groups
53
53
  def get_associated_uplink_groups
54
54
  ensure_client && ensure_uri
55
- response = @client.rest_get("#{@data['uri']}/associatedUplinkGroups", @api_version)
55
+ response = @client.rest_get("#{@data['uri']}/associatedUplinkGroups", {}, @api_version)
56
56
  response.body
57
57
  end
58
58
  end
File without changes
File without changes
File without changes
File without changes
@@ -23,7 +23,8 @@ module OneviewSDK
23
23
  def self.add(client, file_path, timeout = OneviewSDK::Rest::READ_TIMEOUT)
24
24
  options = { 'header' => { 'uploadfilename' => File.basename(file_path) } }
25
25
  result = client.upload_file(file_path, BASE_URI, options, timeout)
26
- OneviewSDK::FirmwareDriver.new(client, result)
26
+ variant = name.split('::').at(-2)
27
+ OneviewSDK.resource_named('FirmwareDriver', client.api_version, variant).new(client, result)
27
28
  end
28
29
  end
29
30
  end
File without changes
@@ -13,7 +13,7 @@ require_relative 'resource'
13
13
 
14
14
  module OneviewSDK
15
15
  module API200
16
- # Id pool resource implementation
16
+ # Id Pool resource implementation
17
17
  class IDPool < Resource
18
18
  BASE_URI = '/rest/id-pools'.freeze
19
19
 
@@ -32,13 +32,12 @@ module OneviewSDK
32
32
  # Gets a pool along with the list of ranges present in it.
33
33
  # @param [String] pool_type The type of the pool. Values: (ipv4, vmac, vsn, vwwn)
34
34
  # @raise [OneviewSDK::IncompleteResource] if the client
35
- # @return [OneviewSDK::API200::IDPool] The response with IDs list, count and if this is a valid allocator
35
+ # @return [OneviewSDK::IDPool] The response with IDs list, count and if this is a valid allocator
36
36
  def get_pool(pool_type)
37
37
  ensure_client
38
38
  response = @client.rest_get("#{BASE_URI}/#{pool_type}")
39
39
  body = @client.response_handler(response)
40
40
  set_all(body)
41
- self
42
41
  end
43
42
 
44
43
  # Allocates one or more IDs from a according the amount informed
@@ -66,6 +65,7 @@ module OneviewSDK
66
65
  # @return [Hash] The hash with eTag and list of ID's
67
66
  def check_range_availability(pool_type, *id_list)
68
67
  ensure_client
68
+ return {} if id_list.flatten.empty?
69
69
  response = @client.rest_get("#{BASE_URI}/#{pool_type}/checkrangeavailability?idList=#{id_list.flatten.join('&idList=')}")
70
70
  @client.response_handler(response)
71
71
  end
@@ -76,6 +76,7 @@ module OneviewSDK
76
76
  # @raise [OneviewSDK::IncompleteResource] if the client is not set
77
77
  # @return [Hash] The list of IDs collected
78
78
  def collect_ids(pool_type, *id_list)
79
+ raise IncompleteResource, 'The list of IDs informed is empty.' if id_list.flatten.empty?
79
80
  ensure_client
80
81
  response = @client.rest_put("#{BASE_URI}/#{pool_type}/collector", 'body' => { 'idList' => id_list.flatten })
81
82
  @client.response_handler(response)
@@ -99,6 +100,7 @@ module OneviewSDK
99
100
  # @return [Boolean] Returns true if is valid
100
101
  def validate_id_list(pool_type, *id_list)
101
102
  ensure_client
103
+ return {} if id_list.flatten.empty?
102
104
  response = @client.rest_put("#{BASE_URI}/#{pool_type}/validate", 'body' => { 'idList' => id_list.flatten })
103
105
  body = @client.response_handler(response)
104
106
  body['valid']
File without changes
File without changes
File without changes
@@ -56,7 +56,7 @@ module OneviewSDK
56
56
  # @return [String] script
57
57
  def get_script
58
58
  ensure_client && ensure_uri
59
- response = @client.rest_get("#{@data['uri']}/script", @api_version)
59
+ response = @client.rest_get("#{@data['uri']}/script", {}, @api_version)
60
60
  response.body
61
61
  end
62
62
 
@@ -78,13 +78,14 @@ module OneviewSDK
78
78
  ensure_client && ensure_uri
79
79
  results = OneviewSDK::Resource.find_by(@client, {}, @data['uri'] + '/internalVlans')
80
80
  internal_networks = []
81
+ variant = self.class.name.split('::').at(-2)
81
82
  results.each do |vlan|
82
83
  net = if vlan['generalNetworkUri'].include? 'ethernet-network'
83
- OneviewSDK::EthernetNetwork.new(@client, uri: vlan['generalNetworkUri'])
84
+ OneviewSDK.resource_named('EthernetNetwork', @client.api_version, variant).new(@client, uri: vlan['generalNetworkUri'])
84
85
  elsif vlan['generalNetworkUri'].include? 'fc-network'
85
- OneviewSDK::FCNetwork.new(@client, uri: vlan['generalNetworkUri'])
86
+ OneviewSDK.resource_named('FCNetwork', @client.api_version, variant).new(@client, uri: vlan['generalNetworkUri'])
86
87
  else
87
- OneviewSDK::FCoENetwork.new(@client, uri: vlan['generalNetworkUri'])
88
+ OneviewSDK.resource_named('FCoENetwork', @client.api_version, variant).new(@client, uri: vlan['generalNetworkUri'])
88
89
  end
89
90
  net.retrieve!
90
91
  internal_networks.push(net)
@@ -38,7 +38,7 @@ module OneviewSDK
38
38
  # @param [OneviewSDK::Client] client The client object for the OneView appliance
39
39
  # @return [Hash] The logical interconnect group settings
40
40
  def self.get_default_settings(client)
41
- response = client.rest_get(BASE_URI + '/defaultSettings', client.api_version)
41
+ response = client.rest_get(BASE_URI + '/defaultSettings', {}, client.api_version)
42
42
  client.response_handler(response)
43
43
  end
44
44
 
@@ -79,7 +79,7 @@ module OneviewSDK
79
79
  # @return [Hash] The logical interconnect group settings
80
80
  def get_settings
81
81
  get_uri = @data['uri'] + '/settings'
82
- response = @client.rest_get(get_uri, @api_version)
82
+ response = @client.rest_get(get_uri, {}, @api_version)
83
83
  @client.response_handler(response)
84
84
  end
85
85
 
File without changes
File without changes
File without changes
@@ -155,7 +155,7 @@ module OneviewSDK
155
155
  uri += '&'
156
156
  end
157
157
  uri.chop! # Get rid of trailing '&' or '?'
158
- response = @client.rest_get(uri, @api_version)
158
+ response = @client.rest_get(uri, {}, @api_version)
159
159
  @client.response_handler(response)
160
160
  end
161
161
 
File without changes
File without changes
File without changes
@@ -165,7 +165,7 @@ module OneviewSDK
165
165
  # Gets the settings that describe the environmental configuration
166
166
  def environmental_configuration
167
167
  ensure_client && ensure_uri
168
- response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', @api_version)
168
+ response = @client.rest_get(@data['uri'] + '/environmentalConfiguration', {}, @api_version)
169
169
  @client.response_handler(response)
170
170
  end
171
171
 
@@ -194,7 +194,7 @@ module OneviewSDK
194
194
  uri += '&'
195
195
  end
196
196
  uri.chop! # Get rid of trailing '&' or '?'
197
- response = @client.rest_get(uri, @api_version)
197
+ response = @client.rest_get(uri, {}, @api_version)
198
198
  @client.response_handler(response)
199
199
  end
200
200
 
@@ -10,11 +10,13 @@
10
10
  # language governing permissions and limitations under the License.
11
11
 
12
12
  require_relative 'resource'
13
+ require_relative '../../resource_helper'
13
14
 
14
15
  module OneviewSDK
15
16
  module API200
16
17
  # Server profile resource implementation
17
18
  class ServerProfile < Resource
19
+ include OneviewSDK::ResourceHelper
18
20
  BASE_URI = '/rest/server-profiles'.freeze
19
21
  UNIQUE_IDENTIFIERS = %w(name uri associatedServer serialNumber serverHardwareUri).freeze
20
22
 
@@ -26,30 +28,34 @@ module OneviewSDK
26
28
 
27
29
  # Sets the Server Hardware for the resource
28
30
  # @param [OneviewSDK::ServerHardware] server_hardware Server Hardware resource
31
+ # @raise [OneviewSDK::IncompleteResource] if server hardware not found
29
32
  def set_server_hardware(server_hardware)
30
- self['serverHardwareUri'] = server_hardware['uri'] if server_hardware['uri'] || server_hardware.retrieve!
31
- raise "Resource #{server_hardware['name']} could not be found!" unless server_hardware['uri']
33
+ raise 'Server Hardware could not be found!' unless server_hardware.retrieve!
34
+ self['serverHardwareUri'] = server_hardware['uri']
32
35
  end
33
36
 
34
37
  # Sets the Server Hardware Type for the resource
35
38
  # @param [OneviewSDK::ServerHardwareType] server_hardware_type Type of the desired Server Hardware
39
+ # @raise [OneviewSDK::IncompleteResource] if server hardware type not found
36
40
  def set_server_hardware_type(server_hardware_type)
37
- self['serverHardwareTypeUri'] = server_hardware_type['uri'] if server_hardware_type['uri'] || server_hardware_type.retrieve!
38
- raise "Resource #{server_hardware_type['name']} could not be found!" unless server_hardware_type['uri']
41
+ raise 'Server Hardware Type could not be found!' unless server_hardware_type.retrieve!
42
+ self['serverHardwareTypeUri'] = server_hardware_type['uri']
39
43
  end
40
44
 
41
45
  # Sets the Enclosure Group for the resource
42
46
  # @param [OneviewSDK::EnclosureGroup] enclosure_group Enclosure Group that the Server is a member
47
+ # @raise [OneviewSDK::IncompleteResource] if enclosure group not found
43
48
  def set_enclosure_group(enclosure_group)
44
- self['enclosureGroupUri'] = enclosure_group['uri'] if enclosure_group['uri'] || enclosure_group.retrieve!
45
- raise "Resource #{enclosure_group['name']} could not be found!" unless enclosure_group['uri']
49
+ raise 'Enclosure Group could not be found!' unless enclosure_group.retrieve!
50
+ self['enclosureGroupUri'] = enclosure_group['uri']
46
51
  end
47
52
 
48
- # Sets the Enclosure Group for the resource
53
+ # Sets the Enclosure for the resource
49
54
  # @param [OneviewSDK::Enclosure] enclosure Enclosure that the Server is a member
55
+ # @raise [OneviewSDK::IncompleteResource] if enclosure not found
50
56
  def set_enclosure(enclosure)
51
- self['enclosureUri'] = enclosure['uri'] if enclosure['uri'] || enclosure.retrieve!
52
- raise "Resource #{enclosure['name']} could not be found!" unless enclosure['uri']
57
+ raise 'Enclosure could not be found!' unless enclosure.retrieve!
58
+ self['enclosureUri'] = enclosure['uri']
53
59
  end
54
60
 
55
61
  # Gets the preview of manual and automatic updates required to make the server profile consistent with its template.
@@ -88,14 +94,7 @@ module OneviewSDK
88
94
 
89
95
  # Updates the server profile from the server profile template.
90
96
  def update_from_template
91
- ensure_client & ensure_uri
92
- patch_operation = { 'op' => 'replace', 'path' => '/templateCompliance', 'value' => 'Compliant' }
93
- patch_options = {
94
- 'If-Match' => self['eTag'],
95
- 'body' => [patch_operation]
96
- }
97
- response = @client.rest_patch(self['uri'], patch_options)
98
- @client.response_handler(response)
97
+ patch('replace', '/templateCompliance', 'Compliant', 'If-Match' => self['eTag'])
99
98
  end
100
99
 
101
100
  # @!group Helpers
@@ -130,7 +129,8 @@ module OneviewSDK
130
129
  serverHardwareTypeUri: @data['serverHardwareTypeUri'],
131
130
  serverGroupUri: @data['enclosureGroupUri']
132
131
  }
133
- OneviewSDK::ServerHardware.find_by(@client, params)
132
+ variant = self.class.name.split('::').at(-2)
133
+ OneviewSDK.resource_named('ServerHardware', @client.api_version, variant).find_by(@client, params)
134
134
  rescue StandardError => e
135
135
  raise IncompleteResource, "Failed to get available hardware. Message: #{e.message}"
136
136
  end
@@ -165,8 +165,9 @@ module OneviewSDK
165
165
  # @option connection_options [String] 'wwpnType' Specifies the type of WWN address to be porgrammed on the FlexNIC.
166
166
  # The value can be 'Virtual', 'Physical' or 'UserDefined'.
167
167
  def add_connection(network, connection_options = {})
168
+ connection_options = Hash[connection_options.map { |k, v| [k.to_s, v] }]
168
169
  self['connections'] = [] unless self['connections']
169
- connection_options['id'] ||= 0 unless connection_options[:id] # Letting OneView treat the ID registering
170
+ connection_options['id'] ||= 0
170
171
  connection_options['networkUri'] = network['uri'] if network['uri'] || network.retrieve!
171
172
  self['connections'] << connection_options
172
173
  end
@@ -192,13 +193,16 @@ module OneviewSDK
192
193
  # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted.
193
194
  # If false, then the volume will be deleted when the profile is deleted.
194
195
  # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations.
196
+ # @raise [OneviewSDK::IncompleteResource] if volume not found
195
197
  # @return Returns the connection hash if found, otherwise returns nil
196
198
  def add_volume_attachment(volume, attachment_options = {})
199
+ raise IncompleteResource, 'Volume not found!' unless volume.retrieve!
200
+ # Convert symbols keys to string
201
+ attachment_options = Hash[attachment_options.map { |k, v| [k.to_s, v] }]
197
202
  self['sanStorage'] ||= {}
198
203
  self['sanStorage']['volumeAttachments'] ||= []
204
+ self['sanStorage']['manageSanStorage'] ||= true
199
205
  attachment_options['id'] ||= 0
200
-
201
- volume.retrieve! unless volume['uri'] || volume['storagePoolUri'] || volume['storageSystemUri']
202
206
  attachment_options['volumeUri'] = volume['uri']
203
207
  attachment_options['volumeStoragePoolUri'] = volume['storagePoolUri']
204
208
  attachment_options['volumeStorageSystemUri'] = volume['storageSystemUri']
@@ -207,7 +211,7 @@ module OneviewSDK
207
211
  end
208
212
 
209
213
  # Adds volume attachment entry and creates a new Volume associated in the Server profile
210
- # @param [OneviewSDK::Volume] volume Volume Resource to add an attachment
214
+ # @param [OneviewSDK::StoragePool] storage_pool StoragePool Resource to add an attachment
211
215
  # @param [Hash] volume_options Options to create a new Volume.
212
216
  # Please refer to OneviewSDK::Volume documentation for the data necessary to create a new Volume.
213
217
  # @param [Hash] attachment_options Options of the new attachment
@@ -217,8 +221,13 @@ module OneviewSDK
217
221
  # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted.
218
222
  # If false, then the volume will be deleted when the profile is deleted.
219
223
  # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations.
224
+ # @raise [OneviewSDK::IncompleteResource] if storage pool not found
220
225
  # @return Returns the connection hash if found, otherwise returns nil
221
226
  def create_volume_with_attachment(storage_pool, volume_options, attachment_options = {})
227
+ raise IncompleteResource, 'Storage Pool not found!' unless storage_pool.retrieve!
228
+ # Convert symbols keys to string in volume_options and attachment_options
229
+ volume_options = Hash[volume_options.map { |k, v| [k.to_s, v] }]
230
+ attachment_options = Hash[attachment_options.map { |k, v| [k.to_s, v] }]
222
231
  self['sanStorage'] ||= {}
223
232
  self['sanStorage']['volumeAttachments'] ||= []
224
233
  attachment_options['id'] ||= 0
@@ -233,7 +242,7 @@ module OneviewSDK
233
242
  attachment_options["volume#{k.to_s[0].capitalize}#{k.to_s[1, k.to_s.length - 1]}"] = v
234
243
  end
235
244
 
236
- attachment_options['volumeStoragePoolUri'] = storage_pool['uri'] if storage_pool['uri'] || storage_pool.retrieve!
245
+ attachment_options['volumeStoragePoolUri'] = storage_pool['uri']
237
246
 
238
247
  # Since the volume is being created in this method, it needs to be nil
239
248
  attachment_options['volumeUri'] = nil
@@ -247,7 +256,9 @@ module OneviewSDK
247
256
  attachment_options['lunType'] ||= 'Auto'
248
257
  attachment_options['lun'] ||= nil
249
258
  attachment_options['storagePaths'] ||= []
259
+ attachment_options['volumeShareable'] = false
250
260
 
261
+ self['sanStorage']['manageSanStorage'] ||= true
251
262
  self['sanStorage']['volumeAttachments'] << attachment_options
252
263
  end
253
264
 
@@ -354,8 +365,7 @@ module OneviewSDK
354
365
  # @option query [String] 'sort' The number of resources to return. A count of -1 requests all the items.
355
366
  def self.get_available_storage_systems(client, query = nil)
356
367
  query_uri = build_query(query) if query
357
- response = client.rest_get("#{BASE_URI}/available-storage-systems#{query_uri}")
358
- client.response_handler(response)
368
+ find_with_pagination(client, "#{BASE_URI}/available-storage-systems#{query_uri}")
359
369
  end
360
370
 
361
371
  # Get the available targets based on the query parameters
@@ -17,6 +17,10 @@ module OneviewSDK
17
17
  class ServerProfileTemplate < Resource
18
18
  BASE_URI = '/rest/server-profile-templates'.freeze
19
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.
20
24
  def initialize(client, params = {}, api_ver = nil)
21
25
  super
22
26
  # Default values
@@ -82,8 +86,9 @@ module OneviewSDK
82
86
  # @option connection_options [String] 'wwpnType' Specifies the type of WWN address to be porgrammed on the FlexNIC.
83
87
  # The value can be 'Virtual', 'Physical' or 'UserDefined'.
84
88
  def add_connection(network, connection_options = {})
89
+ connection_options = Hash[connection_options.map { |k, v| [k.to_s, v] }]
85
90
  self['connections'] = [] unless self['connections']
86
- connection_options['id'] = 0 # Letting OneView treat the ID registering
91
+ connection_options['id'] ||= 0
87
92
  connection_options['networkUri'] = network['uri'] if network['uri'] || network.retrieve!
88
93
  self['connections'] << connection_options
89
94
  end
@@ -109,22 +114,25 @@ module OneviewSDK
109
114
  # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted.
110
115
  # If false, then the volume will be deleted when the profile is deleted.
111
116
  # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations.
117
+ # @raise [OneviewSDK::IncompleteResource] if volume not found
112
118
  # @return Returns the connection hash if found, otherwise returns nil
113
119
  def add_volume_attachment(volume, attachment_options = {})
120
+ raise IncompleteResource, 'Volume not found!' unless volume.retrieve!
121
+ # Convert symbols keys to string
122
+ attachment_options = Hash[attachment_options.map { |k, v| [k.to_s, v] }]
114
123
  self['sanStorage'] ||= {}
115
124
  self['sanStorage']['volumeAttachments'] ||= []
125
+ self['sanStorage']['manageSanStorage'] ||= true
116
126
  attachment_options['id'] ||= 0
117
-
118
- volume.retrieve! unless volume['uri'] || volume['storagePoolUri'] || volume['storageSystemUri']
119
127
  attachment_options['volumeUri'] = volume['uri']
120
128
  attachment_options['volumeStoragePoolUri'] = volume['storagePoolUri']
121
- attachment_options['volumeStorageSystemUri'] = volume['storageSystemUri']
129
+ attachment_options['volumeStorageSystemUri'] = volume['storageSystemUri'] if volume['storageSystemUri']
122
130
 
123
131
  self['sanStorage']['volumeAttachments'] << attachment_options
124
132
  end
125
133
 
126
134
  # Adds a volume attachment entry with new volume in Server profile template
127
- # @param [OneviewSDK::Volume] volume Volume Resource to add an attachment
135
+ # @param [OneviewSDK::StoragePool] storage_pool StoragePool Resource to add an attachment
128
136
  # @param [Hash] volume_options Options to create a new Volume.
129
137
  # Please refer to OneviewSDK::Volume documentation for the data necessary to create a new Volume.
130
138
  # @param [Hash] attachment_options Options of the new attachment
@@ -134,8 +142,13 @@ module OneviewSDK
134
142
  # @option attachment_options [Boolean] 'permanent' Required. If true, indicates that the volume will persist when the profile is deleted.
135
143
  # If false, then the volume will be deleted when the profile is deleted.
136
144
  # @option attachment_options [Array] 'storagePaths' A list of host-to-target path associations.
145
+ # @raise [OneviewSDK::IncompleteResource] if storage pool not found
137
146
  # @return Returns the connection hash if found, otherwise returns nil
138
147
  def create_volume_with_attachment(storage_pool, volume_options, attachment_options = {})
148
+ raise IncompleteResource, 'Storage Pool not found!' unless storage_pool.retrieve!
149
+ # Convert symbols keys to string in volume_options and attachment_options
150
+ volume_options = Hash[volume_options.map { |k, v| [k.to_s, v] }]
151
+ attachment_options = Hash[attachment_options.map { |k, v| [k.to_s, v] }]
139
152
  self['sanStorage'] ||= {}
140
153
  self['sanStorage']['volumeAttachments'] ||= []
141
154
  attachment_options['id'] ||= 0
@@ -150,21 +163,17 @@ module OneviewSDK
150
163
  attachment_options["volume#{k.to_s[0].capitalize}#{k.to_s[1, k.to_s.length - 1]}"] = v
151
164
  end
152
165
 
153
- attachment_options['volumeStoragePoolUri'] = storage_pool['uri'] if storage_pool['uri'] || storage_pool.retrieve!
154
-
155
- # Since the volume is being created in this method, it needs to be nil
156
- attachment_options['volumeUri'] = nil
157
- attachment_options['volumeStorageSystemUri'] = nil
158
-
166
+ attachment_options['volumeStoragePoolUri'] = storage_pool['uri']
159
167
  # volumeProvisionedCapacityBytes is not following the same pattern in Volume
160
168
  attachment_options['volumeProvisionedCapacityBytes'] ||= attachment_options.delete('volumeRequestedCapacity')
161
169
 
162
170
  # Defaults
171
+ attachment_options['volumeUri'] = nil
172
+ attachment_options['volumeStorageSystemUri'] = nil
163
173
  attachment_options['permanent'] ||= true
164
- attachment_options['lunType'] ||= 'Auto'
165
- attachment_options['lun'] ||= nil
166
- attachment_options['storagePaths'] ||= []
174
+ attachment_options['volumeShareable'] = false
167
175
 
176
+ self['sanStorage']['manageSanStorage'] ||= true
168
177
  self['sanStorage']['volumeAttachments'] << attachment_options
169
178
  end
170
179
 
@@ -184,6 +193,7 @@ module OneviewSDK
184
193
  end
185
194
 
186
195
  # Gets the available server hardwares
196
+ # @raise [OneviewSDK::IncompleteResource] if serverHardwareTypeUri or enclosureGroupUri is missing
187
197
  # @return [Array<OneviewSDK::ServerHardware>] Array of ServerHardware resources that matches this
188
198
  # profile template's server hardware type and enclosure group and who's state is 'NoProfileApplied'
189
199
  def get_available_hardware