oneview-sdk 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -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/TESTING.md +0 -0
  9. data/bin/oneview-sdk-ruby +0 -0
  10. data/endpoints-support.md +221 -186
  11. data/lib/oneview-sdk.rb +4 -3
  12. data/lib/oneview-sdk/cli.rb +9 -9
  13. data/lib/oneview-sdk/client.rb +6 -6
  14. data/lib/oneview-sdk/config_loader.rb +0 -0
  15. data/lib/oneview-sdk/exceptions.rb +0 -0
  16. data/lib/oneview-sdk/image-streamer/client.rb +4 -4
  17. data/lib/oneview-sdk/image-streamer/resource/api300.rb +0 -0
  18. data/lib/oneview-sdk/image-streamer/resource/api300/artifact_bundle.rb +1 -1
  19. data/lib/oneview-sdk/image-streamer/resource/api300/build_plan.rb +0 -0
  20. data/lib/oneview-sdk/image-streamer/resource/api300/deployment_group.rb +0 -0
  21. data/lib/oneview-sdk/image-streamer/resource/api300/deployment_plan.rb +0 -0
  22. data/lib/oneview-sdk/image-streamer/resource/api300/golden_image.rb +1 -1
  23. data/lib/oneview-sdk/image-streamer/resource/api300/os_volume.rb +0 -0
  24. data/lib/oneview-sdk/image-streamer/resource/api300/plan_script.rb +0 -0
  25. data/lib/oneview-sdk/image-streamer/resource/api300/resource.rb +0 -0
  26. data/lib/oneview-sdk/image_streamer.rb +0 -0
  27. data/lib/oneview-sdk/resource.rb +5 -6
  28. data/lib/oneview-sdk/resource/api200.rb +0 -0
  29. data/lib/oneview-sdk/resource/api200/client_certificate.rb +0 -0
  30. data/lib/oneview-sdk/resource/api200/connection_template.rb +0 -0
  31. data/lib/oneview-sdk/resource/api200/datacenter.rb +0 -0
  32. data/lib/oneview-sdk/resource/api200/enclosure.rb +5 -6
  33. data/lib/oneview-sdk/resource/api200/enclosure_group.rb +0 -0
  34. data/lib/oneview-sdk/resource/api200/ethernet_network.rb +0 -0
  35. data/lib/oneview-sdk/resource/api200/event.rb +0 -0
  36. data/lib/oneview-sdk/resource/api200/fabric.rb +0 -0
  37. data/lib/oneview-sdk/resource/api200/fc_network.rb +0 -0
  38. data/lib/oneview-sdk/resource/api200/fcoe_network.rb +0 -0
  39. data/lib/oneview-sdk/resource/api200/firmware_bundle.rb +0 -0
  40. data/lib/oneview-sdk/resource/api200/firmware_driver.rb +0 -0
  41. data/lib/oneview-sdk/resource/api200/id_pool.rb +0 -0
  42. data/lib/oneview-sdk/resource/api200/interconnect.rb +1 -1
  43. data/lib/oneview-sdk/resource/api200/lig_uplink_set.rb +0 -0
  44. data/lib/oneview-sdk/resource/api200/logical_downlink.rb +0 -0
  45. data/lib/oneview-sdk/resource/api200/logical_enclosure.rb +0 -0
  46. data/lib/oneview-sdk/resource/api200/logical_interconnect.rb +0 -0
  47. data/lib/oneview-sdk/resource/api200/logical_interconnect_group.rb +6 -6
  48. data/lib/oneview-sdk/resource/api200/logical_switch.rb +5 -3
  49. data/lib/oneview-sdk/resource/api200/logical_switch_group.rb +0 -0
  50. data/lib/oneview-sdk/resource/api200/login_detail.rb +27 -0
  51. data/lib/oneview-sdk/resource/api200/managed_san.rb +0 -0
  52. data/lib/oneview-sdk/resource/api200/network_set.rb +0 -0
  53. data/lib/oneview-sdk/resource/api200/power_device.rb +0 -0
  54. data/lib/oneview-sdk/resource/api200/rack.rb +8 -1
  55. data/lib/oneview-sdk/resource/api200/resource.rb +0 -0
  56. data/lib/oneview-sdk/resource/api200/san_manager.rb +0 -0
  57. data/lib/oneview-sdk/resource/api200/server_hardware.rb +10 -4
  58. data/lib/oneview-sdk/resource/api200/server_hardware_type.rb +1 -1
  59. data/lib/oneview-sdk/resource/api200/server_profile.rb +2 -2
  60. data/lib/oneview-sdk/resource/api200/server_profile_template.rb +0 -0
  61. data/lib/oneview-sdk/resource/api200/storage_pool.rb +6 -0
  62. data/lib/oneview-sdk/resource/api200/storage_system.rb +7 -1
  63. data/lib/oneview-sdk/resource/api200/switch.rb +1 -1
  64. data/lib/oneview-sdk/resource/api200/unmanaged_device.rb +0 -0
  65. data/lib/oneview-sdk/resource/api200/uplink_set.rb +0 -0
  66. data/lib/oneview-sdk/resource/api200/user.rb +5 -4
  67. data/lib/oneview-sdk/resource/api200/version.rb +27 -0
  68. data/lib/oneview-sdk/resource/api200/volume.rb +21 -17
  69. data/lib/oneview-sdk/resource/api200/volume_attachment.rb +0 -0
  70. data/lib/oneview-sdk/resource/api200/volume_snapshot.rb +0 -0
  71. data/lib/oneview-sdk/resource/api200/volume_template.rb +7 -10
  72. data/lib/oneview-sdk/resource/api200/web_server_certificate.rb +0 -0
  73. data/lib/oneview-sdk/resource/api300.rb +1 -1
  74. data/lib/oneview-sdk/resource/api300/c7000.rb +0 -0
  75. data/lib/oneview-sdk/resource/api300/c7000/client_certificate.rb +0 -0
  76. data/lib/oneview-sdk/resource/api300/c7000/connection_template.rb +0 -0
  77. data/lib/oneview-sdk/resource/api300/c7000/datacenter.rb +0 -0
  78. data/lib/oneview-sdk/resource/api300/c7000/enclosure.rb +0 -0
  79. data/lib/oneview-sdk/resource/api300/c7000/enclosure_group.rb +0 -0
  80. data/lib/oneview-sdk/resource/api300/c7000/ethernet_network.rb +0 -0
  81. data/lib/oneview-sdk/resource/api300/c7000/event.rb +0 -0
  82. data/lib/oneview-sdk/resource/api300/c7000/fabric.rb +0 -0
  83. data/lib/oneview-sdk/resource/api300/c7000/fc_network.rb +0 -0
  84. data/lib/oneview-sdk/resource/api300/c7000/fcoe_network.rb +0 -0
  85. data/lib/oneview-sdk/resource/api300/c7000/firmware_bundle.rb +0 -0
  86. data/lib/oneview-sdk/resource/api300/c7000/firmware_driver.rb +0 -0
  87. data/lib/oneview-sdk/resource/api300/c7000/id_pool.rb +0 -0
  88. data/lib/oneview-sdk/resource/api300/c7000/interconnect.rb +0 -0
  89. data/lib/oneview-sdk/resource/api300/c7000/internal_link_set.rb +0 -0
  90. data/lib/oneview-sdk/resource/api300/c7000/lig_uplink_set.rb +0 -0
  91. data/lib/oneview-sdk/resource/api300/c7000/logical_downlink.rb +0 -0
  92. data/lib/oneview-sdk/resource/api300/c7000/logical_enclosure.rb +0 -0
  93. data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect.rb +0 -0
  94. data/lib/oneview-sdk/resource/api300/c7000/logical_interconnect_group.rb +0 -0
  95. data/lib/oneview-sdk/resource/api300/c7000/logical_switch.rb +0 -0
  96. data/lib/oneview-sdk/resource/api300/c7000/logical_switch_group.rb +0 -0
  97. data/lib/oneview-sdk/resource/api300/c7000/login_detail.rb +23 -0
  98. data/lib/oneview-sdk/resource/api300/c7000/managed_san.rb +0 -0
  99. data/lib/oneview-sdk/resource/api300/c7000/network_set.rb +0 -0
  100. data/lib/oneview-sdk/resource/api300/c7000/power_device.rb +0 -0
  101. data/lib/oneview-sdk/resource/api300/c7000/rack.rb +0 -0
  102. data/lib/oneview-sdk/resource/api300/c7000/resource.rb +0 -0
  103. data/lib/oneview-sdk/resource/api300/c7000/san_manager.rb +0 -0
  104. data/lib/oneview-sdk/resource/api300/c7000/scope.rb +3 -5
  105. data/lib/oneview-sdk/resource/api300/c7000/server_hardware.rb +0 -0
  106. data/lib/oneview-sdk/resource/api300/c7000/server_hardware_type.rb +0 -0
  107. data/lib/oneview-sdk/resource/api300/c7000/server_profile.rb +0 -0
  108. data/lib/oneview-sdk/resource/api300/c7000/server_profile_template.rb +0 -0
  109. data/lib/oneview-sdk/resource/api300/c7000/storage_pool.rb +0 -0
  110. data/lib/oneview-sdk/resource/api300/c7000/storage_system.rb +0 -0
  111. data/lib/oneview-sdk/resource/api300/c7000/switch.rb +0 -0
  112. data/lib/oneview-sdk/resource/api300/c7000/unmanaged_device.rb +0 -0
  113. data/lib/oneview-sdk/resource/api300/c7000/uplink_set.rb +0 -0
  114. data/lib/oneview-sdk/resource/api300/c7000/user.rb +0 -0
  115. data/lib/oneview-sdk/resource/api300/c7000/version.rb +23 -0
  116. data/lib/oneview-sdk/resource/api300/c7000/volume.rb +0 -0
  117. data/lib/oneview-sdk/resource/api300/c7000/volume_attachment.rb +0 -0
  118. data/lib/oneview-sdk/resource/api300/c7000/volume_snapshot.rb +0 -0
  119. data/lib/oneview-sdk/resource/api300/c7000/volume_template.rb +0 -0
  120. data/lib/oneview-sdk/resource/api300/c7000/web_server_certificate.rb +0 -0
  121. data/lib/oneview-sdk/resource/api300/synergy.rb +0 -0
  122. data/lib/oneview-sdk/resource/api300/synergy/client_certificate.rb +0 -0
  123. data/lib/oneview-sdk/resource/api300/synergy/connection_template.rb +0 -0
  124. data/lib/oneview-sdk/resource/api300/synergy/datacenter.rb +0 -0
  125. data/lib/oneview-sdk/resource/api300/synergy/drive_enclosure.rb +0 -0
  126. data/lib/oneview-sdk/resource/api300/synergy/enclosure.rb +1 -1
  127. data/lib/oneview-sdk/resource/api300/synergy/enclosure_group.rb +0 -0
  128. data/lib/oneview-sdk/resource/api300/synergy/ethernet_network.rb +0 -0
  129. data/lib/oneview-sdk/resource/api300/synergy/event.rb +0 -0
  130. data/lib/oneview-sdk/resource/api300/synergy/fabric.rb +0 -0
  131. data/lib/oneview-sdk/resource/api300/synergy/fc_network.rb +0 -0
  132. data/lib/oneview-sdk/resource/api300/synergy/fcoe_network.rb +0 -0
  133. data/lib/oneview-sdk/resource/api300/synergy/firmware_bundle.rb +0 -0
  134. data/lib/oneview-sdk/resource/api300/synergy/firmware_driver.rb +0 -0
  135. data/lib/oneview-sdk/resource/api300/synergy/id_pool.rb +0 -0
  136. data/lib/oneview-sdk/resource/api300/synergy/interconnect.rb +0 -0
  137. data/lib/oneview-sdk/resource/api300/synergy/internal_link_set.rb +0 -0
  138. data/lib/oneview-sdk/resource/api300/synergy/lig_uplink_set.rb +0 -0
  139. data/lib/oneview-sdk/resource/api300/synergy/logical_downlink.rb +0 -0
  140. data/lib/oneview-sdk/resource/api300/synergy/logical_enclosure.rb +0 -0
  141. data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect.rb +0 -0
  142. data/lib/oneview-sdk/resource/api300/synergy/logical_interconnect_group.rb +0 -0
  143. data/lib/oneview-sdk/resource/api300/synergy/login_detail.rb +23 -0
  144. data/lib/oneview-sdk/resource/api300/synergy/managed_san.rb +0 -0
  145. data/lib/oneview-sdk/resource/api300/synergy/network_set.rb +0 -0
  146. data/lib/oneview-sdk/resource/api300/synergy/os_deployment_plan.rb +0 -0
  147. data/lib/oneview-sdk/resource/api300/synergy/power_device.rb +0 -0
  148. data/lib/oneview-sdk/resource/api300/synergy/rack.rb +0 -0
  149. data/lib/oneview-sdk/resource/api300/synergy/resource.rb +0 -0
  150. data/lib/oneview-sdk/resource/api300/synergy/san_manager.rb +0 -0
  151. data/lib/oneview-sdk/resource/api300/synergy/sas_interconnect.rb +0 -0
  152. data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect.rb +0 -0
  153. data/lib/oneview-sdk/resource/api300/synergy/sas_logical_interconnect_group.rb +0 -0
  154. data/lib/oneview-sdk/resource/api300/synergy/scope.rb +0 -0
  155. data/lib/oneview-sdk/resource/api300/synergy/server_hardware.rb +0 -0
  156. data/lib/oneview-sdk/resource/api300/synergy/server_hardware_type.rb +0 -0
  157. data/lib/oneview-sdk/resource/api300/synergy/server_profile.rb +0 -0
  158. data/lib/oneview-sdk/resource/api300/synergy/server_profile_template.rb +0 -0
  159. data/lib/oneview-sdk/resource/api300/synergy/storage_pool.rb +0 -0
  160. data/lib/oneview-sdk/resource/api300/synergy/storage_system.rb +0 -0
  161. data/lib/oneview-sdk/resource/api300/synergy/switch.rb +0 -0
  162. data/lib/oneview-sdk/resource/api300/synergy/unmanaged_device.rb +0 -0
  163. data/lib/oneview-sdk/resource/api300/synergy/uplink_set.rb +0 -0
  164. data/lib/oneview-sdk/resource/api300/synergy/user.rb +0 -0
  165. data/lib/oneview-sdk/resource/api300/synergy/version.rb +23 -0
  166. data/lib/oneview-sdk/resource/api300/synergy/volume.rb +0 -0
  167. data/lib/oneview-sdk/resource/api300/synergy/volume_attachment.rb +0 -0
  168. data/lib/oneview-sdk/resource/api300/synergy/volume_snapshot.rb +0 -0
  169. data/lib/oneview-sdk/resource/api300/synergy/volume_template.rb +0 -0
  170. data/lib/oneview-sdk/resource/api300/synergy/web_server_certificate.rb +0 -0
  171. data/lib/oneview-sdk/resource/api500.rb +1 -1
  172. data/lib/oneview-sdk/resource/api500/c7000.rb +0 -0
  173. data/lib/oneview-sdk/resource/api500/c7000/client_certificate.rb +0 -0
  174. data/lib/oneview-sdk/resource/api500/c7000/connection_template.rb +0 -0
  175. data/lib/oneview-sdk/resource/api500/c7000/datacenter.rb +0 -0
  176. data/lib/oneview-sdk/resource/api500/c7000/enclosure.rb +0 -0
  177. data/lib/oneview-sdk/resource/api500/c7000/enclosure_group.rb +0 -0
  178. data/lib/oneview-sdk/resource/api500/c7000/ethernet_network.rb +0 -0
  179. data/lib/oneview-sdk/resource/api500/c7000/event.rb +0 -0
  180. data/lib/oneview-sdk/resource/api500/c7000/fabric.rb +0 -0
  181. data/lib/oneview-sdk/resource/api500/c7000/fc_network.rb +0 -0
  182. data/lib/oneview-sdk/resource/api500/c7000/fcoe_network.rb +0 -0
  183. data/lib/oneview-sdk/resource/api500/c7000/firmware_bundle.rb +0 -0
  184. data/lib/oneview-sdk/resource/api500/c7000/firmware_driver.rb +0 -0
  185. data/lib/oneview-sdk/resource/api500/c7000/id_pool.rb +0 -0
  186. data/lib/oneview-sdk/resource/api500/c7000/interconnect.rb +0 -0
  187. data/lib/oneview-sdk/resource/api500/c7000/internal_link_set.rb +0 -0
  188. data/lib/oneview-sdk/resource/api500/c7000/lig_uplink_set.rb +0 -0
  189. data/lib/oneview-sdk/resource/api500/c7000/logical_downlink.rb +0 -0
  190. data/lib/oneview-sdk/resource/api500/c7000/logical_enclosure.rb +0 -0
  191. data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect.rb +0 -0
  192. data/lib/oneview-sdk/resource/api500/c7000/logical_interconnect_group.rb +0 -0
  193. data/lib/oneview-sdk/resource/api500/c7000/logical_switch.rb +0 -0
  194. data/lib/oneview-sdk/resource/api500/c7000/logical_switch_group.rb +0 -0
  195. data/lib/oneview-sdk/resource/api500/c7000/login_detail.rb +23 -0
  196. data/lib/oneview-sdk/resource/api500/c7000/managed_san.rb +0 -0
  197. data/lib/oneview-sdk/resource/api500/c7000/network_set.rb +0 -0
  198. data/lib/oneview-sdk/resource/api500/c7000/power_device.rb +0 -0
  199. data/lib/oneview-sdk/resource/api500/c7000/rack.rb +0 -0
  200. data/lib/oneview-sdk/resource/api500/c7000/resource.rb +0 -0
  201. data/lib/oneview-sdk/resource/api500/c7000/san_manager.rb +0 -0
  202. data/lib/oneview-sdk/resource/api500/c7000/scope.rb +0 -0
  203. data/lib/oneview-sdk/resource/api500/c7000/server_hardware.rb +0 -0
  204. data/lib/oneview-sdk/resource/api500/c7000/server_hardware_type.rb +0 -0
  205. data/lib/oneview-sdk/resource/api500/c7000/server_profile.rb +0 -0
  206. data/lib/oneview-sdk/resource/api500/c7000/server_profile_template.rb +0 -0
  207. data/lib/oneview-sdk/resource/api500/c7000/storage_pool.rb +7 -1
  208. data/lib/oneview-sdk/resource/api500/c7000/storage_system.rb +3 -3
  209. data/lib/oneview-sdk/resource/api500/c7000/switch.rb +0 -0
  210. data/lib/oneview-sdk/resource/api500/c7000/unmanaged_device.rb +0 -0
  211. data/lib/oneview-sdk/resource/api500/c7000/uplink_set.rb +0 -0
  212. data/lib/oneview-sdk/resource/api500/c7000/user.rb +0 -0
  213. data/lib/oneview-sdk/resource/api500/c7000/version.rb +23 -0
  214. data/lib/oneview-sdk/resource/api500/c7000/volume.rb +21 -14
  215. data/lib/oneview-sdk/resource/api500/c7000/volume_attachment.rb +0 -0
  216. data/lib/oneview-sdk/resource/api500/c7000/volume_snapshot.rb +0 -0
  217. data/lib/oneview-sdk/resource/api500/c7000/volume_template.rb +3 -5
  218. data/lib/oneview-sdk/resource/api500/c7000/web_server_certificate.rb +0 -0
  219. data/lib/oneview-sdk/resource/api500/synergy.rb +0 -0
  220. data/lib/oneview-sdk/resource/api500/synergy/client_certificate.rb +0 -0
  221. data/lib/oneview-sdk/resource/api500/synergy/connection_template.rb +0 -0
  222. data/lib/oneview-sdk/resource/api500/synergy/datacenter.rb +0 -0
  223. data/lib/oneview-sdk/resource/api500/synergy/drive_enclosure.rb +0 -0
  224. data/lib/oneview-sdk/resource/api500/synergy/enclosure.rb +0 -0
  225. data/lib/oneview-sdk/resource/api500/synergy/enclosure_group.rb +0 -0
  226. data/lib/oneview-sdk/resource/api500/synergy/ethernet_network.rb +0 -0
  227. data/lib/oneview-sdk/resource/api500/synergy/event.rb +0 -0
  228. data/lib/oneview-sdk/resource/api500/synergy/fabric.rb +0 -0
  229. data/lib/oneview-sdk/resource/api500/synergy/fc_network.rb +0 -0
  230. data/lib/oneview-sdk/resource/api500/synergy/fcoe_network.rb +0 -0
  231. data/lib/oneview-sdk/resource/api500/synergy/firmware_bundle.rb +0 -0
  232. data/lib/oneview-sdk/resource/api500/synergy/firmware_driver.rb +0 -0
  233. data/lib/oneview-sdk/resource/api500/synergy/id_pool.rb +0 -0
  234. data/lib/oneview-sdk/resource/api500/synergy/interconnect.rb +0 -0
  235. data/lib/oneview-sdk/resource/api500/synergy/internal_link_set.rb +0 -0
  236. data/lib/oneview-sdk/resource/api500/synergy/lig_uplink_set.rb +0 -0
  237. data/lib/oneview-sdk/resource/api500/synergy/logical_downlink.rb +0 -0
  238. data/lib/oneview-sdk/resource/api500/synergy/logical_enclosure.rb +0 -0
  239. data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect.rb +0 -0
  240. data/lib/oneview-sdk/resource/api500/synergy/logical_interconnect_group.rb +0 -0
  241. data/lib/oneview-sdk/resource/api500/synergy/login_detail.rb +23 -0
  242. data/lib/oneview-sdk/resource/api500/synergy/managed_san.rb +0 -0
  243. data/lib/oneview-sdk/resource/api500/synergy/network_set.rb +0 -0
  244. data/lib/oneview-sdk/resource/api500/synergy/os_deployment_plan.rb +0 -0
  245. data/lib/oneview-sdk/resource/api500/synergy/power_device.rb +0 -0
  246. data/lib/oneview-sdk/resource/api500/synergy/rack.rb +0 -0
  247. data/lib/oneview-sdk/resource/api500/synergy/resource.rb +0 -0
  248. data/lib/oneview-sdk/resource/api500/synergy/san_manager.rb +0 -0
  249. data/lib/oneview-sdk/resource/api500/synergy/sas_interconnect.rb +0 -0
  250. data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect.rb +0 -0
  251. data/lib/oneview-sdk/resource/api500/synergy/sas_logical_interconnect_group.rb +0 -0
  252. data/lib/oneview-sdk/resource/api500/synergy/scope.rb +0 -0
  253. data/lib/oneview-sdk/resource/api500/synergy/server_hardware.rb +0 -0
  254. data/lib/oneview-sdk/resource/api500/synergy/server_hardware_type.rb +0 -0
  255. data/lib/oneview-sdk/resource/api500/synergy/server_profile.rb +0 -0
  256. data/lib/oneview-sdk/resource/api500/synergy/server_profile_template.rb +0 -0
  257. data/lib/oneview-sdk/resource/api500/synergy/storage_pool.rb +0 -0
  258. data/lib/oneview-sdk/resource/api500/synergy/storage_system.rb +0 -0
  259. data/lib/oneview-sdk/resource/api500/synergy/switch.rb +0 -0
  260. data/lib/oneview-sdk/resource/api500/synergy/unmanaged_device.rb +0 -0
  261. data/lib/oneview-sdk/resource/api500/synergy/uplink_set.rb +0 -0
  262. data/lib/oneview-sdk/resource/api500/synergy/user.rb +0 -0
  263. data/lib/oneview-sdk/resource/api500/synergy/version.rb +23 -0
  264. data/lib/oneview-sdk/resource/api500/synergy/volume.rb +0 -0
  265. data/lib/oneview-sdk/resource/api500/synergy/volume_attachment.rb +0 -0
  266. data/lib/oneview-sdk/resource/api500/synergy/volume_snapshot.rb +0 -0
  267. data/lib/oneview-sdk/resource/api500/synergy/volume_template.rb +0 -0
  268. data/lib/oneview-sdk/resource/api500/synergy/web_server_certificate.rb +0 -0
  269. data/lib/oneview-sdk/resource_helper.rb +0 -0
  270. data/lib/oneview-sdk/rest.rb +7 -6
  271. data/lib/oneview-sdk/scmb.rb +0 -0
  272. data/lib/oneview-sdk/ssl_helper.rb +3 -2
  273. data/lib/oneview-sdk/version.rb +1 -1
  274. data/oneview-sdk.gemspec +3 -2
  275. metadata +31 -7
@@ -13,6 +13,7 @@ require_relative 'oneview-sdk/version'
13
13
  require_relative 'oneview-sdk/exceptions'
14
14
  require_relative 'oneview-sdk/client'
15
15
  require_relative 'oneview-sdk/resource'
16
+ require_relative 'oneview-sdk/resource_helper'
16
17
  Dir[File.dirname(__FILE__) + '/oneview-sdk/resource/*.rb'].each { |file| require file }
17
18
  require_relative 'oneview-sdk/scmb'
18
19
  require_relative 'oneview-sdk/image_streamer'
@@ -20,9 +21,9 @@ require_relative 'oneview-sdk/cli'
20
21
 
21
22
  # Module for interacting with the HPE OneView API
22
23
  module OneviewSDK
23
- env_sdk = %w(ONEVIEWSDK_URL ONEVIEWSDK_USER ONEVIEWSDK_PASSWORD ONEVIEWSDK_TOKEN ONEVIEWSDK_DOMAIN)
24
- env_sdk.concat %w(ONEVIEWSDK_SSL_ENABLED ONEVIEWSDK_API_VERSION ONEVIEWSDK_VARIANT)
25
- env_i3s = %w(I3S_URL I3S_SSL_ENABLED)
24
+ env_sdk = %w[ONEVIEWSDK_URL ONEVIEWSDK_USER ONEVIEWSDK_PASSWORD ONEVIEWSDK_TOKEN ONEVIEWSDK_DOMAIN]
25
+ env_sdk.concat %w[ONEVIEWSDK_SSL_ENABLED ONEVIEWSDK_API_VERSION ONEVIEWSDK_VARIANT]
26
+ env_i3s = %w[I3S_URL I3S_SSL_ENABLED]
26
27
  ENV_VARS = env_sdk.concat(env_i3s).freeze
27
28
 
28
29
  SUPPORTED_API_VERSIONS = [200, 300, 500].freeze
@@ -73,7 +73,7 @@ module OneviewSDK
73
73
  class_option :log_level,
74
74
  desc: 'Log level to use',
75
75
  aliases: '-l',
76
- enum: %w(debug info warn error),
76
+ enum: %w[debug info warn error],
77
77
  default: :warn
78
78
 
79
79
  map ['-v', '--version'] => :version
@@ -108,7 +108,7 @@ module OneviewSDK
108
108
  method_option :format,
109
109
  desc: 'Output format',
110
110
  aliases: '-f',
111
- enum: %w(json yaml human),
111
+ enum: %w[json yaml human],
112
112
  default: 'human'
113
113
  desc 'env', 'Show environment variables for oneview-sdk-ruby'
114
114
  # Show environment variables for oneview-sdk-ruby
@@ -117,7 +117,7 @@ module OneviewSDK
117
117
  OneviewSDK::ENV_VARS.each { |k| data[k] = ENV[k] }
118
118
  if @options['format'] == 'human'
119
119
  data.each do |key, value|
120
- value = "'#{value}'" if value && !%w(true false).include?(value)
120
+ value = "'#{value}'" if value && !%w[true false].include?(value)
121
121
  printf "%-#{data.keys.max_by(&:length).length}s = %s\n", key, value || 'nil'
122
122
  end
123
123
  else
@@ -135,7 +135,7 @@ module OneviewSDK
135
135
  method_option :format,
136
136
  desc: 'Output format',
137
137
  aliases: '-f',
138
- enum: %w(json yaml human),
138
+ enum: %w[json yaml human],
139
139
  default: 'human'
140
140
  desc 'list TYPE', 'List names of resources'
141
141
  # List names of resources
@@ -150,7 +150,7 @@ module OneviewSDK
150
150
  method_option :format,
151
151
  desc: 'Output format',
152
152
  aliases: '-f',
153
- enum: %w(json yaml human),
153
+ enum: %w[json yaml human],
154
154
  default: 'human'
155
155
  method_option :attribute,
156
156
  type: :string,
@@ -177,7 +177,7 @@ module OneviewSDK
177
177
  method_option :format,
178
178
  desc: 'Output format',
179
179
  aliases: '-f',
180
- enum: %w(json yaml human),
180
+ enum: %w[json yaml human],
181
181
  default: 'human'
182
182
  method_option :attribute,
183
183
  type: :string,
@@ -218,7 +218,7 @@ module OneviewSDK
218
218
  method_option :format,
219
219
  desc: 'Output format',
220
220
  aliases: '-f',
221
- enum: %w(json yaml raw),
221
+ enum: %w[json yaml raw],
222
222
  default: 'json'
223
223
  method_option :data,
224
224
  desc: 'Data to pass in the request body (in JSON format)',
@@ -384,7 +384,7 @@ module OneviewSDK
384
384
  method_option :format,
385
385
  desc: 'Output format',
386
386
  aliases: '-f',
387
- enum: %w(json yaml),
387
+ enum: %w[json yaml],
388
388
  default: 'json'
389
389
  desc 'to_file TYPE NAME', 'Save resource details to file'
390
390
  # Save resource details to file
@@ -436,7 +436,7 @@ module OneviewSDK
436
436
  method_option :format,
437
437
  desc: 'Output format',
438
438
  aliases: '-f',
439
- enum: %w(json yaml raw),
439
+ enum: %w[json yaml raw],
440
440
  default: 'json'
441
441
  scmb_examples = "\n oneview-sdk-ruby scmb -r 'scmb.ethernet-networks.#'"
442
442
  scmb_examples << "\n oneview-sdk-ruby scmb -r 'scmb.ethernet-networks.Created'"
@@ -17,9 +17,9 @@ require_relative 'ssl_helper'
17
17
  module OneviewSDK
18
18
  # The client defines the connection to the OneView server and handles communication with it.
19
19
  class Client
20
- attr_reader :max_api_version
20
+ attr_reader :max_api_version, :log_level
21
21
  attr_accessor :url, :user, :token, :password, :domain, :ssl_enabled, :api_version, \
22
- :logger, :log_level, :cert_store, :print_wait_dots, :timeout
22
+ :logger, :cert_store, :print_wait_dots, :timeout
23
23
 
24
24
  include Rest
25
25
 
@@ -42,7 +42,7 @@ module OneviewSDK
42
42
  options = Hash[options.map { |k, v| [k.to_sym, v] }] # Convert string hash keys to symbols
43
43
  STDOUT.sync = true
44
44
  @logger = options[:logger] || Logger.new(STDOUT)
45
- [:debug, :info, :warn, :error, :level=].each { |m| raise InvalidClient, "Logger must respond to #{m} method " unless @logger.respond_to?(m) }
45
+ %i[debug info warn error level=].each { |m| raise InvalidClient, "Logger must respond to #{m} method " unless @logger.respond_to?(m) }
46
46
  self.log_level = options[:log_level] || :info
47
47
  @print_wait_dots = options.fetch(:print_wait_dots, false)
48
48
  @url = options[:url] || ENV['ONEVIEWSDK_URL']
@@ -56,8 +56,8 @@ module OneviewSDK
56
56
  OneviewSDK.api_version = @api_version unless OneviewSDK.api_version_updated? || !OneviewSDK::SUPPORTED_API_VERSIONS.include?(@api_version)
57
57
  @ssl_enabled = true
58
58
  if ENV.key?('ONEVIEWSDK_SSL_ENABLED')
59
- if %w(true false 1 0).include?(ENV['ONEVIEWSDK_SSL_ENABLED'])
60
- @ssl_enabled = !%w(false 0).include?(ENV['ONEVIEWSDK_SSL_ENABLED'])
59
+ if %w[true false 1 0].include?(ENV['ONEVIEWSDK_SSL_ENABLED'])
60
+ @ssl_enabled = !%w[false 0].include?(ENV['ONEVIEWSDK_SSL_ENABLED'])
61
61
  else
62
62
  @logger.warn "Unrecognized ssl_enabled value '#{ENV['ONEVIEWSDK_SSL_ENABLED']}'. Valid options are 'true' & 'false'"
63
63
  end
@@ -191,7 +191,7 @@ module OneviewSDK
191
191
  response = rest_api(:get, '/rest/version', options)
192
192
  version = response_handler(response)['currentVersion']
193
193
  raise ConnectionError, "Couldn't get API version" unless version
194
- version = version.to_i if version.class != Fixnum
194
+ version = version.to_i if version.class != Integer
195
195
  version
196
196
  rescue ConnectionError
197
197
  @logger.warn "Failed to get OneView max api version. Using default (#{OneviewSDK::DEFAULT_API_VERSION})"
File without changes
File without changes
@@ -39,7 +39,7 @@ module OneviewSDK
39
39
  options = Hash[options.map { |k, v| [k.to_sym, v] }] # Convert string hash keys to symbols
40
40
  STDOUT.sync = true
41
41
  @logger = options[:logger] || Logger.new(STDOUT)
42
- [:debug, :info, :warn, :error, :level=].each { |m| raise InvalidClient, "Logger must respond to #{m} method " unless @logger.respond_to?(m) }
42
+ %i[debug info warn error level=].each { |m| raise InvalidClient, "Logger must respond to #{m} method " unless @logger.respond_to?(m) }
43
43
  self.log_level = options[:log_level] || :info
44
44
  @print_wait_dots = options.fetch(:print_wait_dots, false)
45
45
  @url = options[:url] || ENV['I3S_URL']
@@ -54,8 +54,8 @@ module OneviewSDK
54
54
  OneviewSDK::ImageStreamer.api_version_updated? || !OneviewSDK::ImageStreamer::SUPPORTED_API_VERSIONS.include?(@api_version)
55
55
  @ssl_enabled = true
56
56
  if ENV.key?('I3S_SSL_ENABLED')
57
- if %w(true false 1 0).include?(ENV['I3S_SSL_ENABLED'])
58
- @ssl_enabled = !%w(false 0).include?(ENV['I3S_SSL_ENABLED'])
57
+ if %w[true false 1 0].include?(ENV['I3S_SSL_ENABLED'])
58
+ @ssl_enabled = !%w[false 0].include?(ENV['I3S_SSL_ENABLED'])
59
59
  else
60
60
  @logger.warn "Unrecognized ssl_enabled value '#{ENV['I3S_SSL_ENABLED']}'. Valid options are 'true' & 'false'"
61
61
  end
@@ -88,7 +88,7 @@ module OneviewSDK
88
88
  response = rest_api(:get, '/rest/version', options)
89
89
  version = response_handler(response)['currentVersion']
90
90
  raise ConnectionError, "Couldn't get API version" unless version
91
- version = version.to_i if version.class != Fixnum
91
+ version = version.to_i if version.class != Integer
92
92
  version
93
93
  rescue ConnectionError
94
94
  @logger.warn "Failed to get Image Streamer max api version. Using default (#{OneviewSDK::ImageStreamer::DEFAULT_API_VERSION})"
@@ -16,7 +16,7 @@ module OneviewSDK
16
16
  module API300
17
17
  # Artifacts Bundle resource implementation for Image Streamer
18
18
  class ArtifactBundle < Resource
19
- ACCEPTED_FORMATS = %w(.zip .ZIP).freeze # Supported upload extensions
19
+ ACCEPTED_FORMATS = %w[.zip .ZIP].freeze # Supported upload extensions
20
20
 
21
21
  BASE_URI = '/rest/artifact-bundles'.freeze
22
22
  BACKUPS_URI = "#{BASE_URI}/backups".freeze
@@ -17,7 +17,7 @@ module OneviewSDK
17
17
  # Golden Image resource implementation for Image Streamer
18
18
  class GoldenImage < Resource
19
19
  BASE_URI = '/rest/golden-images'.freeze
20
- ACCEPTED_FORMATS = %w(.zip .ZIP).freeze # Supported upload extensions
20
+ ACCEPTED_FORMATS = %w[.zip .ZIP].freeze # Supported upload extensions
21
21
 
22
22
  # Create a resource object, associate it with a client, and set its properties.
23
23
  # @param [OneviewSDK::ImageStreamer::Client] client The client object for the Image Streamer appliance
File without changes
@@ -17,7 +17,7 @@ module OneviewSDK
17
17
  # Resource base class that defines all common resource functionality.
18
18
  class Resource
19
19
  BASE_URI = '/rest'.freeze
20
- UNIQUE_IDENTIFIERS = %w(name uri).freeze # Ordered list of unique attributes to search by
20
+ UNIQUE_IDENTIFIERS = %w[name uri].freeze # Ordered list of unique attributes to search by
21
21
  DEFAULT_REQUEST_HEADER = {}.freeze
22
22
 
23
23
  attr_accessor \
@@ -50,7 +50,7 @@ module OneviewSDK
50
50
  # @param [Hash] header The header options for the request (key-value pairs)
51
51
  # @return [Boolean] Whether or not retrieve was successful
52
52
  def retrieve!(header = self.class::DEFAULT_REQUEST_HEADER)
53
- retrieval_keys = self.class::UNIQUE_IDENTIFIERS.select { |k| !@data[k].nil? }
53
+ retrieval_keys = self.class::UNIQUE_IDENTIFIERS.reject { |k| @data[k].nil? }
54
54
  raise IncompleteResource, "Must set resource #{self.class::UNIQUE_IDENTIFIERS.join(' or ')} before trying to retrieve!" if retrieval_keys.empty?
55
55
  retrieval_keys.each do |k|
56
56
  results = self.class.find_by(@client, { k => @data[k] }, self.class::BASE_URI, header)
@@ -66,7 +66,7 @@ module OneviewSDK
66
66
  # @param [Hash] header The header options for the request (key-value pairs)
67
67
  # @return [Boolean] Whether or not resource exists
68
68
  def exists?(header = self.class::DEFAULT_REQUEST_HEADER)
69
- retrieval_keys = self.class::UNIQUE_IDENTIFIERS.select { |k| !@data[k].nil? }
69
+ retrieval_keys = self.class::UNIQUE_IDENTIFIERS.reject { |k| @data[k].nil? }
70
70
  raise IncompleteResource, "Must set resource #{self.class::UNIQUE_IDENTIFIERS.join(' or ')} before trying to retrieve!" if retrieval_keys.empty?
71
71
  retrieval_keys.each do |k|
72
72
  results = self.class.find_by(@client, { k => @data[k] }, self.class::BASE_URI, header)
@@ -133,7 +133,6 @@ module OneviewSDK
133
133
  # @return The value set for the given key
134
134
  def []=(key, value)
135
135
  set(key, value)
136
- value
137
136
  end
138
137
 
139
138
  # Check equality of 2 resources. Same as eql?(other)
@@ -234,7 +233,7 @@ module OneviewSDK
234
233
  # @note If a .yml or .yaml file extension is given in the file_path, the format will be set automatically
235
234
  # @return [True] The Resource was saved successfully
236
235
  def to_file(file_path, format = :json)
237
- format = :yml if %w(.yml .yaml).include? File.extname(file_path)
236
+ format = :yml if %w[.yml .yaml].include? File.extname(file_path)
238
237
  temp_data = { type: self.class.name, api_version: @api_version, data: @data }
239
238
  case format.to_sym
240
239
  when :json
@@ -379,7 +378,7 @@ module OneviewSDK
379
378
 
380
379
  # Fail for methods that are not available for one resource
381
380
  def unavailable_method
382
- raise MethodUnavailable, "The method ##{caller[0][/`.*'/][1..-2]} is unavailable for this resource"
381
+ raise MethodUnavailable, "The method ##{caller(1..1).first[/`.*'/][1..-2]} is unavailable for this resource"
383
382
  end
384
383
 
385
384
  private
File without changes
@@ -21,7 +21,7 @@ module OneviewSDK
21
21
  include OneviewSDK::ResourceHelper::ConfigurationOperation
22
22
 
23
23
  BASE_URI = '/rest/enclosures'.freeze
24
- UNIQUE_IDENTIFIERS = %w(name uri serialNumber activeOaPreferredIP standbyOaPreferredIP).freeze
24
+ UNIQUE_IDENTIFIERS = %w[name uri serialNumber activeOaPreferredIP standbyOaPreferredIP].freeze
25
25
 
26
26
  # Remove resource from OneView
27
27
  # @return [true] if resource was removed successfully
@@ -37,7 +37,6 @@ module OneviewSDK
37
37
  @data['type'] ||= 'EnclosureV200'
38
38
  end
39
39
 
40
-
41
40
  # Method is not available
42
41
  # @raise [OneviewSDK::MethodUnavailable] method is not available
43
42
  def create(*)
@@ -55,15 +54,15 @@ module OneviewSDK
55
54
  # @return [OneviewSDK::Enclosure] self
56
55
  def add
57
56
  ensure_client
58
- required_attributes = %w(enclosureGroupUri hostname username password licensingIntent)
57
+ required_attributes = %w[enclosureGroupUri hostname username password licensingIntent]
59
58
  required_attributes.each { |k| raise IncompleteResource, "Missing required attribute: '#{k}'" unless @data.key?(k) }
60
59
 
61
- optional_attrs = %w(enclosureUri firmwareBaselineUri force forceInstallFirmware state unmanagedEnclosure updateFirmwareOn)
60
+ optional_attrs = %w[enclosureUri firmwareBaselineUri force forceInstallFirmware state unmanagedEnclosure updateFirmwareOn]
62
61
  temp_data = @data.select { |k, _v| required_attributes.include?(k) || optional_attrs.include?(k) }
63
62
  response = @client.rest_post(self.class::BASE_URI, { 'body' => temp_data }, @api_version)
64
63
  new_data = @client.response_handler(response)
65
- old_name = @data.select { |k, _v| %w(name rackName).include?(k) } # Save name (if given)
66
- %w(username password hostname).each { |k| @data.delete(k) } # These are no longer needed
64
+ old_name = @data.select { |k, _v| %w[name rackName].include?(k) } # Save name (if given)
65
+ %w[username password hostname].each { |k| @data.delete(k) } # These are no longer needed
67
66
  set_all(new_data)
68
67
  set_all(old_name)
69
68
  update
File without changes
File without changes
@@ -17,7 +17,7 @@ module OneviewSDK
17
17
  class Interconnect < Resource
18
18
  BASE_URI = '/rest/interconnects'.freeze
19
19
  TYPE_URI = '/rest/interconnect-types'.freeze
20
- UNIQUE_IDENTIFIERS = %w(name uri serialNumber).freeze
20
+ UNIQUE_IDENTIFIERS = %w[name uri serialNumber].freeze
21
21
 
22
22
  # Create a resource object, associate it with a client, and set its properties.
23
23
  # @param [OneviewSDK::Client] client The client object for the OneView appliance
@@ -63,10 +63,9 @@ module OneviewSDK
63
63
  end
64
64
  end
65
65
 
66
- unless entry_already_present
67
- new_entry = new_interconnect_entry_template(bay, interconnect_type['uri'])
68
- @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] << new_entry
69
- end
66
+ return if entry_already_present
67
+ new_entry = new_interconnect_entry_template(bay, interconnect_type['uri'])
68
+ @data['interconnectMapTemplate']['interconnectMapEntryTemplates'] << new_entry
70
69
  end
71
70
 
72
71
  # Adds an uplink set
@@ -85,12 +84,13 @@ module OneviewSDK
85
84
 
86
85
  # Create the resource on OneView using the current data
87
86
  # @note Calls the refresh method to set additional data
87
+ # @param [Hash] header The header options for the request (key-value pairs)
88
88
  # @raise [OneviewSDK::IncompleteResource] if the client is not set
89
89
  # @raise [StandardError] if the resource creation fails
90
90
  # @return [Resource] self
91
- def create
91
+ def create(header = {})
92
92
  verify_interconnects_before_save!
93
- super
93
+ super(DEFAULT_REQUEST_HEADER.merge(header))
94
94
  end
95
95
 
96
96
  # Set data and save to OneView
@@ -31,16 +31,18 @@ module OneviewSDK
31
31
  end
32
32
 
33
33
  # Create method
34
+ # @param [Hash] header The header options for the request (key-value pairs)
34
35
  # @raise [OneviewSDK::IncompleteResource] if the client is not set
35
36
  # @raise [StandardError] if the resource creation fails
36
37
  # @return [OneviewSDK::LogicalSwitch] self
37
- def create
38
+ def create(header = {})
38
39
  ensure_client
39
40
  request_body = {}
40
41
  request_body['logicalSwitchCredentials'] = generate_logical_switch_credentials
41
42
  request_body['logicalSwitch'] = @data.clone
42
43
  request_body['logicalSwitch']['switchCredentialConfiguration'] = generate_logical_switch_credential_configuration
43
- response = @client.rest_post(self.class::BASE_URI, { 'body' => request_body }, @api_version)
44
+ options = DEFAULT_REQUEST_HEADER.merge(header).merge('body' => request_body)
45
+ response = @client.rest_post(self.class::BASE_URI, options, @api_version)
44
46
  body = @client.response_handler(response)
45
47
  set_all(body)
46
48
  self
@@ -99,7 +101,7 @@ module OneviewSDK
99
101
  # @return [Array] List of connection properties for each logical switch
100
102
  def generate_logical_switch_credentials
101
103
  credentials = []
102
- @logical_switch_credentials.each do |_, switch|
104
+ @logical_switch_credentials.each_value do |switch|
103
105
  switch_credentials = []
104
106
  switch_credentials << {
105
107
  'valueFormat' => 'Unknown',
@@ -0,0 +1,27 @@
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
+ module OneviewSDK
13
+ module API200
14
+ # Login Details resource implementation
15
+ class LoginDetail
16
+ BASE_URI = '/rest/logindetails'.freeze
17
+
18
+ # Gets the login details
19
+ # @param [OneviewSDK::client] client access for resource endpoint
20
+ # @return [Hash] Response to the api call
21
+ def self.get_login_details(client)
22
+ response = client.rest_get(BASE_URI)
23
+ client.response_handler(response)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -16,7 +16,7 @@ module OneviewSDK
16
16
  # Rack resource implementation
17
17
  class Rack < Resource
18
18
  BASE_URI = '/rest/racks'.freeze
19
- UNIQUE_IDENTIFIERS = %w(name uri serialNumber).freeze
19
+ UNIQUE_IDENTIFIERS = %w[name uri serialNumber].freeze
20
20
 
21
21
  # Add the resource on OneView using the current data
22
22
  # @note Calls the refresh method to set additional data
@@ -51,6 +51,13 @@ module OneviewSDK
51
51
  unavailable_method
52
52
  end
53
53
 
54
+ # Updates a rack
55
+ # @param [Hash] attributes attributes to be updated
56
+ # @return [OneviewSDK::Rack] self
57
+ def update(attributes = {}, header = { 'If-Match' => '*' })
58
+ super(attributes, header)
59
+ end
60
+
54
61
  # Adds the rack resource with specified options
55
62
  # @param [OneviewSDK::Resource] resource Resource to be added
56
63
  # @param [String] options rack options