ibm_cloud_power 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (330) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +255 -0
  4. data/Rakefile +10 -0
  5. data/docs/CloneTaskReference.md +19 -0
  6. data/docs/CloneTaskStatus.md +23 -0
  7. data/docs/ClonedVolume.md +19 -0
  8. data/docs/ClonedVolumeDetail.md +19 -0
  9. data/docs/CloudInstance.md +37 -0
  10. data/docs/CloudInstanceCreate.md +29 -0
  11. data/docs/CloudInstanceReference.md +31 -0
  12. data/docs/CloudInstanceUpdate.md +25 -0
  13. data/docs/CloudInstanceUsageLimits.md +37 -0
  14. data/docs/CreateDataVolume.md +29 -0
  15. data/docs/CreateImage.md +37 -0
  16. data/docs/Error.md +19 -0
  17. data/docs/Event.md +33 -0
  18. data/docs/EventUser.md +21 -0
  19. data/docs/Events.md +17 -0
  20. data/docs/ExportImage.md +23 -0
  21. data/docs/IPAddressRange.md +19 -0
  22. data/docs/Image.md +39 -0
  23. data/docs/ImageReference.md +33 -0
  24. data/docs/ImageSpecifications.md +29 -0
  25. data/docs/ImageVolume.md +23 -0
  26. data/docs/Images.md +17 -0
  27. data/docs/MinMaxDefault.md +21 -0
  28. data/docs/MultiVolumesCreate.md +29 -0
  29. data/docs/Network.md +37 -0
  30. data/docs/NetworkCreate.md +29 -0
  31. data/docs/NetworkIpAddressMetrics.md +23 -0
  32. data/docs/NetworkPort.md +29 -0
  33. data/docs/NetworkPortCreate.md +19 -0
  34. data/docs/NetworkPortPvmInstance.md +19 -0
  35. data/docs/NetworkPortUpdate.md +19 -0
  36. data/docs/NetworkPorts.md +17 -0
  37. data/docs/NetworkReference.md +27 -0
  38. data/docs/NetworkUpdate.md +23 -0
  39. data/docs/Networks.md +17 -0
  40. data/docs/Operations.md +21 -0
  41. data/docs/PCloudEventsApi.md +114 -0
  42. data/docs/PCloudImagesApi.md +342 -0
  43. data/docs/PCloudInstancesApi.md +148 -0
  44. data/docs/PCloudNetworksApi.md +504 -0
  45. data/docs/PCloudPVMInstancesApi.md +809 -0
  46. data/docs/PCloudSAPApi.md +150 -0
  47. data/docs/PCloudSnapshotsApi.md +200 -0
  48. data/docs/PCloudSystemPoolsApi.md +54 -0
  49. data/docs/PCloudTasksApi.md +100 -0
  50. data/docs/PCloudTenantsApi.md +102 -0
  51. data/docs/PCloudTenantsSSHKeysApi.md +248 -0
  52. data/docs/PCloudVolumesApi.md +746 -0
  53. data/docs/PVMInstance.md +77 -0
  54. data/docs/PVMInstanceAction.md +17 -0
  55. data/docs/PVMInstanceAddNetwork.md +19 -0
  56. data/docs/PVMInstanceCapture.md +29 -0
  57. data/docs/PVMInstanceClone.md +31 -0
  58. data/docs/PVMInstanceConsole.md +17 -0
  59. data/docs/PVMInstanceCreate.md +53 -0
  60. data/docs/PVMInstanceFault.md +23 -0
  61. data/docs/PVMInstanceHealth.md +21 -0
  62. data/docs/PVMInstanceMultiCreate.md +21 -0
  63. data/docs/PVMInstanceNetwork.md +33 -0
  64. data/docs/PVMInstanceNetworks.md +17 -0
  65. data/docs/PVMInstanceOperation.md +19 -0
  66. data/docs/PVMInstanceReference.md +71 -0
  67. data/docs/PVMInstanceRemoveNetwork.md +17 -0
  68. data/docs/PVMInstanceUpdate.md +33 -0
  69. data/docs/PVMInstanceUpdateResponse.md +27 -0
  70. data/docs/PVMInstanceVolumeUpdate.md +17 -0
  71. data/docs/PVMInstances.md +17 -0
  72. data/docs/PeeringNetwork.md +21 -0
  73. data/docs/PinPolicy.md +16 -0
  74. data/docs/SAPCreate.md +33 -0
  75. data/docs/SAPProfile.md +25 -0
  76. data/docs/SAPProfileReference.md +19 -0
  77. data/docs/SAPProfiles.md +17 -0
  78. data/docs/SRC.md +19 -0
  79. data/docs/SSHKey.md +21 -0
  80. data/docs/SSHKeys.md +17 -0
  81. data/docs/Snapshot.md +35 -0
  82. data/docs/SnapshotCreate.md +21 -0
  83. data/docs/SnapshotCreateResponse.md +17 -0
  84. data/docs/SnapshotRestore.md +17 -0
  85. data/docs/SnapshotUpdate.md +19 -0
  86. data/docs/Snapshots.md +17 -0
  87. data/docs/SoftwareLicenses.md +25 -0
  88. data/docs/StockImage.md +21 -0
  89. data/docs/System.md +21 -0
  90. data/docs/SystemPool.md +31 -0
  91. data/docs/Task.md +33 -0
  92. data/docs/TaskReference.md +19 -0
  93. data/docs/Tenant.md +29 -0
  94. data/docs/TenantUpdate.md +19 -0
  95. data/docs/UpdateVolume.md +23 -0
  96. data/docs/VirtualCores.md +21 -0
  97. data/docs/Volume.md +41 -0
  98. data/docs/VolumeInfo.md +19 -0
  99. data/docs/VolumeReference.md +43 -0
  100. data/docs/Volumes.md +17 -0
  101. data/docs/VolumesClone.md +31 -0
  102. data/docs/VolumesCloneAsyncRequest.md +19 -0
  103. data/docs/VolumesCloneCancel.md +17 -0
  104. data/docs/VolumesCloneCreate.md +19 -0
  105. data/docs/VolumesCloneDetail.md +33 -0
  106. data/docs/VolumesCloneExecute.md +19 -0
  107. data/docs/VolumesCloneRequest.md +19 -0
  108. data/docs/VolumesCloneResponse.md +17 -0
  109. data/docs/VolumesClones.md +17 -0
  110. data/git_push.sh +58 -0
  111. data/ibm_cloud_power.gemspec +38 -0
  112. data/lib/ibm_cloud_power.rb +144 -0
  113. data/lib/ibm_cloud_power/api/p_cloud_events_api.rb +163 -0
  114. data/lib/ibm_cloud_power/api/p_cloud_images_api.rb +473 -0
  115. data/lib/ibm_cloud_power/api/p_cloud_instances_api.rb +210 -0
  116. data/lib/ibm_cloud_power/api/p_cloud_networks_api.rb +719 -0
  117. data/lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb +1166 -0
  118. data/lib/ibm_cloud_power/api/p_cloud_sap_api.rb +216 -0
  119. data/lib/ibm_cloud_power/api/p_cloud_snapshots_api.rb +288 -0
  120. data/lib/ibm_cloud_power/api/p_cloud_system_pools_api.rb +82 -0
  121. data/lib/ibm_cloud_power/api/p_cloud_tasks_api.rb +142 -0
  122. data/lib/ibm_cloud_power/api/p_cloud_tenants_api.rb +150 -0
  123. data/lib/ibm_cloud_power/api/p_cloud_tenants_ssh_keys_api.rb +356 -0
  124. data/lib/ibm_cloud_power/api/p_cloud_volumes_api.rb +1065 -0
  125. data/lib/ibm_cloud_power/api_client.rb +387 -0
  126. data/lib/ibm_cloud_power/api_error.rb +57 -0
  127. data/lib/ibm_cloud_power/configuration.rb +241 -0
  128. data/lib/ibm_cloud_power/models/clone_task_reference.rb +229 -0
  129. data/lib/ibm_cloud_power/models/clone_task_status.rb +285 -0
  130. data/lib/ibm_cloud_power/models/cloned_volume.rb +219 -0
  131. data/lib/ibm_cloud_power/models/cloned_volume_detail.rb +227 -0
  132. data/lib/ibm_cloud_power/models/cloud_instance.rb +361 -0
  133. data/lib/ibm_cloud_power/models/cloud_instance_create.rb +294 -0
  134. data/lib/ibm_cloud_power/models/cloud_instance_reference.rb +315 -0
  135. data/lib/ibm_cloud_power/models/cloud_instance_update.rb +249 -0
  136. data/lib/ibm_cloud_power/models/cloud_instance_usage_limits.rb +334 -0
  137. data/lib/ibm_cloud_power/models/create_data_volume.rb +313 -0
  138. data/lib/ibm_cloud_power/models/create_image.rb +360 -0
  139. data/lib/ibm_cloud_power/models/error.rb +217 -0
  140. data/lib/ibm_cloud_power/models/event.rb +357 -0
  141. data/lib/ibm_cloud_power/models/event_user.rb +234 -0
  142. data/lib/ibm_cloud_power/models/events.rb +216 -0
  143. data/lib/ibm_cloud_power/models/export_image.rb +249 -0
  144. data/lib/ibm_cloud_power/models/image.rb +351 -0
  145. data/lib/ibm_cloud_power/models/image_reference.rb +333 -0
  146. data/lib/ibm_cloud_power/models/image_specifications.rb +269 -0
  147. data/lib/ibm_cloud_power/models/image_volume.rb +259 -0
  148. data/lib/ibm_cloud_power/models/images.rb +216 -0
  149. data/lib/ibm_cloud_power/models/ip_address_range.rb +229 -0
  150. data/lib/ibm_cloud_power/models/min_max_default.rb +244 -0
  151. data/lib/ibm_cloud_power/models/multi_volumes_create.rb +313 -0
  152. data/lib/ibm_cloud_power/models/network.rb +395 -0
  153. data/lib/ibm_cloud_power/models/network_create.rb +314 -0
  154. data/lib/ibm_cloud_power/models/network_ip_address_metrics.rb +260 -0
  155. data/lib/ibm_cloud_power/models/network_port.rb +293 -0
  156. data/lib/ibm_cloud_power/models/network_port_create.rb +219 -0
  157. data/lib/ibm_cloud_power/models/network_port_pvm_instance.rb +220 -0
  158. data/lib/ibm_cloud_power/models/network_port_update.rb +219 -0
  159. data/lib/ibm_cloud_power/models/network_ports.rb +216 -0
  160. data/lib/ibm_cloud_power/models/network_reference.rb +325 -0
  161. data/lib/ibm_cloud_power/models/network_update.rb +243 -0
  162. data/lib/ibm_cloud_power/models/networks.rb +216 -0
  163. data/lib/ibm_cloud_power/models/operations.rb +287 -0
  164. data/lib/ibm_cloud_power/models/peering_network.rb +241 -0
  165. data/lib/ibm_cloud_power/models/pin_policy.rb +37 -0
  166. data/lib/ibm_cloud_power/models/pvm_instance.rb +612 -0
  167. data/lib/ibm_cloud_power/models/pvm_instance_action.rb +248 -0
  168. data/lib/ibm_cloud_power/models/pvm_instance_add_network.rb +224 -0
  169. data/lib/ibm_cloud_power/models/pvm_instance_capture.rb +317 -0
  170. data/lib/ibm_cloud_power/models/pvm_instance_clone.rb +328 -0
  171. data/lib/ibm_cloud_power/models/pvm_instance_console.rb +214 -0
  172. data/lib/ibm_cloud_power/models/pvm_instance_create.rb +483 -0
  173. data/lib/ibm_cloud_power/models/pvm_instance_fault.rb +240 -0
  174. data/lib/ibm_cloud_power/models/pvm_instance_health.rb +230 -0
  175. data/lib/ibm_cloud_power/models/pvm_instance_multi_create.rb +279 -0
  176. data/lib/ibm_cloud_power/models/pvm_instance_network.rb +290 -0
  177. data/lib/ibm_cloud_power/models/pvm_instance_networks.rb +216 -0
  178. data/lib/ibm_cloud_power/models/pvm_instance_operation.rb +262 -0
  179. data/lib/ibm_cloud_power/models/pvm_instance_reference.rb +566 -0
  180. data/lib/ibm_cloud_power/models/pvm_instance_remove_network.rb +209 -0
  181. data/lib/ibm_cloud_power/models/pvm_instance_update.rb +322 -0
  182. data/lib/ibm_cloud_power/models/pvm_instance_update_response.rb +292 -0
  183. data/lib/ibm_cloud_power/models/pvm_instance_volume_update.rb +214 -0
  184. data/lib/ibm_cloud_power/models/pvm_instances.rb +216 -0
  185. data/lib/ibm_cloud_power/models/sap_create.rb +311 -0
  186. data/lib/ibm_cloud_power/models/sap_profile.rb +310 -0
  187. data/lib/ibm_cloud_power/models/sap_profile_reference.rb +229 -0
  188. data/lib/ibm_cloud_power/models/sap_profiles.rb +216 -0
  189. data/lib/ibm_cloud_power/models/snapshot.rb +321 -0
  190. data/lib/ibm_cloud_power/models/snapshot_create.rb +236 -0
  191. data/lib/ibm_cloud_power/models/snapshot_create_response.rb +214 -0
  192. data/lib/ibm_cloud_power/models/snapshot_restore.rb +211 -0
  193. data/lib/ibm_cloud_power/models/snapshot_update.rb +219 -0
  194. data/lib/ibm_cloud_power/models/snapshots.rb +216 -0
  195. data/lib/ibm_cloud_power/models/software_licenses.rb +257 -0
  196. data/lib/ibm_cloud_power/models/src.rb +219 -0
  197. data/lib/ibm_cloud_power/models/ssh_key.rb +239 -0
  198. data/lib/ibm_cloud_power/models/ssh_keys.rb +216 -0
  199. data/lib/ibm_cloud_power/models/stock_image.rb +230 -0
  200. data/lib/ibm_cloud_power/models/system.rb +239 -0
  201. data/lib/ibm_cloud_power/models/system_pool.rb +277 -0
  202. data/lib/ibm_cloud_power/models/task.rb +334 -0
  203. data/lib/ibm_cloud_power/models/task_reference.rb +229 -0
  204. data/lib/ibm_cloud_power/models/tenant.rb +295 -0
  205. data/lib/ibm_cloud_power/models/tenant_update.rb +221 -0
  206. data/lib/ibm_cloud_power/models/update_volume.rb +239 -0
  207. data/lib/ibm_cloud_power/models/virtual_cores.rb +253 -0
  208. data/lib/ibm_cloud_power/models/volume.rb +356 -0
  209. data/lib/ibm_cloud_power/models/volume_info.rb +219 -0
  210. data/lib/ibm_cloud_power/models/volume_reference.rb +396 -0
  211. data/lib/ibm_cloud_power/models/volumes.rb +216 -0
  212. data/lib/ibm_cloud_power/models/volumes_clone.rb +284 -0
  213. data/lib/ibm_cloud_power/models/volumes_clone_async_request.rb +231 -0
  214. data/lib/ibm_cloud_power/models/volumes_clone_cancel.rb +209 -0
  215. data/lib/ibm_cloud_power/models/volumes_clone_create.rb +231 -0
  216. data/lib/ibm_cloud_power/models/volumes_clone_detail.rb +296 -0
  217. data/lib/ibm_cloud_power/models/volumes_clone_execute.rb +224 -0
  218. data/lib/ibm_cloud_power/models/volumes_clone_request.rb +231 -0
  219. data/lib/ibm_cloud_power/models/volumes_clone_response.rb +211 -0
  220. data/lib/ibm_cloud_power/models/volumes_clones.rb +211 -0
  221. data/lib/ibm_cloud_power/version.rb +15 -0
  222. data/spec/api/p_cloud_events_api_spec.rb +62 -0
  223. data/spec/api/p_cloud_images_api_spec.rb +117 -0
  224. data/spec/api/p_cloud_instances_api_spec.rb +69 -0
  225. data/spec/api/p_cloud_networks_api_spec.rb +161 -0
  226. data/spec/api/p_cloud_pvm_instances_api_spec.rb +240 -0
  227. data/spec/api/p_cloud_sap_api_spec.rb +70 -0
  228. data/spec/api/p_cloud_snapshots_api_spec.rb +83 -0
  229. data/spec/api/p_cloud_system_pools_api_spec.rb +46 -0
  230. data/spec/api/p_cloud_tasks_api_spec.rb +57 -0
  231. data/spec/api/p_cloud_tenants_api_spec.rb +58 -0
  232. data/spec/api/p_cloud_tenants_ssh_keys_api_spec.rb +95 -0
  233. data/spec/api/p_cloud_volumes_api_spec.rb +223 -0
  234. data/spec/api_client_spec.rb +226 -0
  235. data/spec/configuration_spec.rb +42 -0
  236. data/spec/models/clone_task_reference_spec.rb +47 -0
  237. data/spec/models/clone_task_status_spec.rb +63 -0
  238. data/spec/models/cloned_volume_detail_spec.rb +47 -0
  239. data/spec/models/cloned_volume_spec.rb +47 -0
  240. data/spec/models/cloud_instance_create_spec.rb +77 -0
  241. data/spec/models/cloud_instance_reference_spec.rb +83 -0
  242. data/spec/models/cloud_instance_spec.rb +101 -0
  243. data/spec/models/cloud_instance_update_spec.rb +65 -0
  244. data/spec/models/cloud_instance_usage_limits_spec.rb +101 -0
  245. data/spec/models/create_data_volume_spec.rb +81 -0
  246. data/spec/models/create_image_spec.rb +109 -0
  247. data/spec/models/error_spec.rb +47 -0
  248. data/spec/models/event_spec.rb +93 -0
  249. data/spec/models/event_user_spec.rb +53 -0
  250. data/spec/models/events_spec.rb +41 -0
  251. data/spec/models/export_image_spec.rb +59 -0
  252. data/spec/models/image_reference_spec.rb +89 -0
  253. data/spec/models/image_spec.rb +107 -0
  254. data/spec/models/image_specifications_spec.rb +77 -0
  255. data/spec/models/image_volume_spec.rb +59 -0
  256. data/spec/models/images_spec.rb +41 -0
  257. data/spec/models/ip_address_range_spec.rb +47 -0
  258. data/spec/models/min_max_default_spec.rb +53 -0
  259. data/spec/models/multi_volumes_create_spec.rb +81 -0
  260. data/spec/models/network_create_spec.rb +81 -0
  261. data/spec/models/network_ip_address_metrics_spec.rb +59 -0
  262. data/spec/models/network_port_create_spec.rb +47 -0
  263. data/spec/models/network_port_pvm_instance_spec.rb +47 -0
  264. data/spec/models/network_port_spec.rb +77 -0
  265. data/spec/models/network_port_update_spec.rb +47 -0
  266. data/spec/models/network_ports_spec.rb +41 -0
  267. data/spec/models/network_reference_spec.rb +75 -0
  268. data/spec/models/network_spec.rb +105 -0
  269. data/spec/models/network_update_spec.rb +59 -0
  270. data/spec/models/networks_spec.rb +41 -0
  271. data/spec/models/operations_spec.rb +65 -0
  272. data/spec/models/peering_network_spec.rb +53 -0
  273. data/spec/models/pin_policy_spec.rb +35 -0
  274. data/spec/models/pvm_instance_action_spec.rb +45 -0
  275. data/spec/models/pvm_instance_add_network_spec.rb +47 -0
  276. data/spec/models/pvm_instance_capture_spec.rb +81 -0
  277. data/spec/models/pvm_instance_clone_spec.rb +87 -0
  278. data/spec/models/pvm_instance_console_spec.rb +41 -0
  279. data/spec/models/pvm_instance_create_spec.rb +161 -0
  280. data/spec/models/pvm_instance_fault_spec.rb +59 -0
  281. data/spec/models/pvm_instance_health_spec.rb +53 -0
  282. data/spec/models/pvm_instance_multi_create_spec.rb +61 -0
  283. data/spec/models/pvm_instance_network_spec.rb +89 -0
  284. data/spec/models/pvm_instance_networks_spec.rb +41 -0
  285. data/spec/models/pvm_instance_operation_spec.rb +51 -0
  286. data/spec/models/pvm_instance_reference_spec.rb +207 -0
  287. data/spec/models/pvm_instance_remove_network_spec.rb +41 -0
  288. data/spec/models/pvm_instance_spec.rb +225 -0
  289. data/spec/models/pvm_instance_update_response_spec.rb +75 -0
  290. data/spec/models/pvm_instance_update_spec.rb +93 -0
  291. data/spec/models/pvm_instance_volume_update_spec.rb +41 -0
  292. data/spec/models/pvm_instances_spec.rb +41 -0
  293. data/spec/models/sap_create_spec.rb +89 -0
  294. data/spec/models/sap_profile_reference_spec.rb +47 -0
  295. data/spec/models/sap_profile_spec.rb +69 -0
  296. data/spec/models/sap_profiles_spec.rb +41 -0
  297. data/spec/models/snapshot_create_response_spec.rb +41 -0
  298. data/spec/models/snapshot_create_spec.rb +53 -0
  299. data/spec/models/snapshot_restore_spec.rb +41 -0
  300. data/spec/models/snapshot_spec.rb +95 -0
  301. data/spec/models/snapshot_update_spec.rb +47 -0
  302. data/spec/models/snapshots_spec.rb +41 -0
  303. data/spec/models/software_licenses_spec.rb +65 -0
  304. data/spec/models/src_spec.rb +47 -0
  305. data/spec/models/ssh_key_spec.rb +53 -0
  306. data/spec/models/ssh_keys_spec.rb +41 -0
  307. data/spec/models/stock_image_spec.rb +53 -0
  308. data/spec/models/system_pool_spec.rb +83 -0
  309. data/spec/models/system_spec.rb +53 -0
  310. data/spec/models/task_reference_spec.rb +47 -0
  311. data/spec/models/task_spec.rb +89 -0
  312. data/spec/models/tenant_spec.rb +77 -0
  313. data/spec/models/tenant_update_spec.rb +47 -0
  314. data/spec/models/update_volume_spec.rb +59 -0
  315. data/spec/models/virtual_cores_spec.rb +53 -0
  316. data/spec/models/volume_info_spec.rb +47 -0
  317. data/spec/models/volume_reference_spec.rb +119 -0
  318. data/spec/models/volume_spec.rb +113 -0
  319. data/spec/models/volumes_clone_async_request_spec.rb +47 -0
  320. data/spec/models/volumes_clone_cancel_spec.rb +41 -0
  321. data/spec/models/volumes_clone_create_spec.rb +47 -0
  322. data/spec/models/volumes_clone_detail_spec.rb +89 -0
  323. data/spec/models/volumes_clone_execute_spec.rb +47 -0
  324. data/spec/models/volumes_clone_request_spec.rb +47 -0
  325. data/spec/models/volumes_clone_response_spec.rb +47 -0
  326. data/spec/models/volumes_clone_spec.rb +83 -0
  327. data/spec/models/volumes_clones_spec.rb +41 -0
  328. data/spec/models/volumes_spec.rb +41 -0
  329. data/spec/spec_helper.rb +111 -0
  330. metadata +519 -0
@@ -0,0 +1,214 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module IbmCloudPower
16
+ class PVMInstanceConsole
17
+ # The URL to the noVNC console for the PVM instance
18
+ attr_accessor :console_url
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'console_url' => :'consoleURL'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'console_url' => :'String'
31
+ }
32
+ end
33
+
34
+ # List of attributes with nullable: true
35
+ def self.openapi_nullable
36
+ Set.new([
37
+ ])
38
+ end
39
+
40
+ # Initializes the object
41
+ # @param [Hash] attributes Model attributes in the form of hash
42
+ def initialize(attributes = {})
43
+ if (!attributes.is_a?(Hash))
44
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::PVMInstanceConsole` initialize method"
45
+ end
46
+
47
+ # check to see if the attribute exists and convert string to symbol for hash key
48
+ attributes = attributes.each_with_object({}) { |(k, v), h|
49
+ if (!self.class.attribute_map.key?(k.to_sym))
50
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::PVMInstanceConsole`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
51
+ end
52
+ h[k.to_sym] = v
53
+ }
54
+
55
+ if attributes.key?(:'console_url')
56
+ self.console_url = attributes[:'console_url']
57
+ end
58
+ end
59
+
60
+ # Show invalid properties with the reasons. Usually used together with valid?
61
+ # @return Array for valid properties with the reasons
62
+ def list_invalid_properties
63
+ invalid_properties = Array.new
64
+ if @console_url.nil?
65
+ invalid_properties.push('invalid value for "console_url", console_url cannot be nil.')
66
+ end
67
+
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ return false if @console_url.nil?
75
+ true
76
+ end
77
+
78
+ # Checks equality by comparing each attribute.
79
+ # @param [Object] Object to be compared
80
+ def ==(o)
81
+ return true if self.equal?(o)
82
+ self.class == o.class &&
83
+ console_url == o.console_url
84
+ end
85
+
86
+ # @see the `==` method
87
+ # @param [Object] Object to be compared
88
+ def eql?(o)
89
+ self == o
90
+ end
91
+
92
+ # Calculates hash code according to all attributes.
93
+ # @return [Integer] Hash code
94
+ def hash
95
+ [console_url].hash
96
+ end
97
+
98
+ # Builds the object from hash
99
+ # @param [Hash] attributes Model attributes in the form of hash
100
+ # @return [Object] Returns the model itself
101
+ def self.build_from_hash(attributes)
102
+ new.build_from_hash(attributes)
103
+ end
104
+
105
+ # Builds the object from hash
106
+ # @param [Hash] attributes Model attributes in the form of hash
107
+ # @return [Object] Returns the model itself
108
+ def build_from_hash(attributes)
109
+ return nil unless attributes.is_a?(Hash)
110
+ self.class.openapi_types.each_pair do |key, type|
111
+ if type =~ /\AArray<(.*)>/i
112
+ # check to ensure the input is an array given that the attribute
113
+ # is documented as an array but the input is not
114
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
115
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
116
+ end
117
+ elsif !attributes[self.class.attribute_map[key]].nil?
118
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
119
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
120
+ self.send("#{key}=", nil)
121
+ end
122
+ end
123
+
124
+ self
125
+ end
126
+
127
+ # Deserializes the data based on type
128
+ # @param string type Data type
129
+ # @param string value Value to be deserialized
130
+ # @return [Object] Deserialized data
131
+ def _deserialize(type, value)
132
+ case type.to_sym
133
+ when :DateTime
134
+ DateTime.parse(value)
135
+ when :Date
136
+ Date.parse(value)
137
+ when :String
138
+ value.to_s
139
+ when :Integer
140
+ value.to_i
141
+ when :Float
142
+ value.to_f
143
+ when :Boolean
144
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
145
+ true
146
+ else
147
+ false
148
+ end
149
+ when :Object
150
+ # generic object (usually a Hash), return directly
151
+ value
152
+ when /\AArray<(?<inner_type>.+)>\z/
153
+ inner_type = Regexp.last_match[:inner_type]
154
+ value.map { |v| _deserialize(inner_type, v) }
155
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
156
+ k_type = Regexp.last_match[:k_type]
157
+ v_type = Regexp.last_match[:v_type]
158
+ {}.tap do |hash|
159
+ value.each do |k, v|
160
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
161
+ end
162
+ end
163
+ else # model
164
+ IbmCloudPower.const_get(type).build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+ end
214
+ end
@@ -0,0 +1,483 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module IbmCloudPower
16
+ class PVMInstanceCreate
17
+ # Name of the server to create
18
+ attr_accessor :server_name
19
+
20
+ # Number of duplicate instances to create in this request
21
+ attr_accessor :replicants
22
+
23
+ # How to name the created vms
24
+ attr_accessor :replicant_naming_scheme
25
+
26
+ # Affinity policy for replicants being created; affinity for the same host, anti-affinity for different hosts, none for no preference
27
+ attr_accessor :replicant_affinity_policy
28
+
29
+ # Image ID of the image to use for the server
30
+ attr_accessor :image_id
31
+
32
+ # Number of processors allocated
33
+ attr_accessor :processors
34
+
35
+ # Processor type (dedicated, shared, capped)
36
+ attr_accessor :proc_type
37
+
38
+ # Amount of memory allocated (in GB)
39
+ attr_accessor :memory
40
+
41
+ # (deprecated - replaced by networks) List of Network IDs
42
+ attr_accessor :network_i_ds
43
+
44
+ # The pvm instance networks information
45
+ attr_accessor :networks
46
+
47
+ # List of volume IDs
48
+ attr_accessor :volume_i_ds
49
+
50
+ # The name of the SSH key pair provided to the server for authenticating users (looked up in the tenant's list of keys)
51
+ attr_accessor :key_pair_name
52
+
53
+ # System type used to host the instance
54
+ attr_accessor :sys_type
55
+
56
+ # Indicates if the server is allowed to migrate between hosts
57
+ attr_accessor :migratable
58
+
59
+ # Cloud init user defined data
60
+ attr_accessor :user_data
61
+
62
+ # Storage type for server deployment
63
+ attr_accessor :storage_type
64
+
65
+ attr_accessor :software_licenses
66
+
67
+ attr_accessor :pin_policy
68
+
69
+ attr_accessor :virtual_cores
70
+
71
+ class EnumAttributeValidator
72
+ attr_reader :datatype
73
+ attr_reader :allowable_values
74
+
75
+ def initialize(datatype, allowable_values)
76
+ @allowable_values = allowable_values.map do |value|
77
+ case datatype.to_s
78
+ when /Integer/i
79
+ value.to_i
80
+ when /Float/i
81
+ value.to_f
82
+ else
83
+ value
84
+ end
85
+ end
86
+ end
87
+
88
+ def valid?(value)
89
+ !value || allowable_values.include?(value)
90
+ end
91
+ end
92
+
93
+ # Attribute mapping from ruby-style variable name to JSON key.
94
+ def self.attribute_map
95
+ {
96
+ :'server_name' => :'serverName',
97
+ :'replicants' => :'replicants',
98
+ :'replicant_naming_scheme' => :'replicantNamingScheme',
99
+ :'replicant_affinity_policy' => :'replicantAffinityPolicy',
100
+ :'image_id' => :'imageID',
101
+ :'processors' => :'processors',
102
+ :'proc_type' => :'procType',
103
+ :'memory' => :'memory',
104
+ :'network_i_ds' => :'networkIDs',
105
+ :'networks' => :'networks',
106
+ :'volume_i_ds' => :'volumeIDs',
107
+ :'key_pair_name' => :'keyPairName',
108
+ :'sys_type' => :'sysType',
109
+ :'migratable' => :'migratable',
110
+ :'user_data' => :'userData',
111
+ :'storage_type' => :'storageType',
112
+ :'software_licenses' => :'softwareLicenses',
113
+ :'pin_policy' => :'pinPolicy',
114
+ :'virtual_cores' => :'virtualCores'
115
+ }
116
+ end
117
+
118
+ # Attribute type mapping.
119
+ def self.openapi_types
120
+ {
121
+ :'server_name' => :'String',
122
+ :'replicants' => :'Float',
123
+ :'replicant_naming_scheme' => :'String',
124
+ :'replicant_affinity_policy' => :'String',
125
+ :'image_id' => :'String',
126
+ :'processors' => :'Float',
127
+ :'proc_type' => :'String',
128
+ :'memory' => :'Float',
129
+ :'network_i_ds' => :'Array<String>',
130
+ :'networks' => :'Array<PVMInstanceAddNetwork>',
131
+ :'volume_i_ds' => :'Array<String>',
132
+ :'key_pair_name' => :'String',
133
+ :'sys_type' => :'String',
134
+ :'migratable' => :'Boolean',
135
+ :'user_data' => :'String',
136
+ :'storage_type' => :'String',
137
+ :'software_licenses' => :'SoftwareLicenses',
138
+ :'pin_policy' => :'PinPolicy',
139
+ :'virtual_cores' => :'VirtualCores'
140
+ }
141
+ end
142
+
143
+ # List of attributes with nullable: true
144
+ def self.openapi_nullable
145
+ Set.new([
146
+ ])
147
+ end
148
+
149
+ # Initializes the object
150
+ # @param [Hash] attributes Model attributes in the form of hash
151
+ def initialize(attributes = {})
152
+ if (!attributes.is_a?(Hash))
153
+ fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudPower::PVMInstanceCreate` initialize method"
154
+ end
155
+
156
+ # check to see if the attribute exists and convert string to symbol for hash key
157
+ attributes = attributes.each_with_object({}) { |(k, v), h|
158
+ if (!self.class.attribute_map.key?(k.to_sym))
159
+ fail ArgumentError, "`#{k}` is not a valid attribute in `IbmCloudPower::PVMInstanceCreate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
160
+ end
161
+ h[k.to_sym] = v
162
+ }
163
+
164
+ if attributes.key?(:'server_name')
165
+ self.server_name = attributes[:'server_name']
166
+ end
167
+
168
+ if attributes.key?(:'replicants')
169
+ self.replicants = attributes[:'replicants']
170
+ end
171
+
172
+ if attributes.key?(:'replicant_naming_scheme')
173
+ self.replicant_naming_scheme = attributes[:'replicant_naming_scheme']
174
+ else
175
+ self.replicant_naming_scheme = 'suffix'
176
+ end
177
+
178
+ if attributes.key?(:'replicant_affinity_policy')
179
+ self.replicant_affinity_policy = attributes[:'replicant_affinity_policy']
180
+ else
181
+ self.replicant_affinity_policy = 'none'
182
+ end
183
+
184
+ if attributes.key?(:'image_id')
185
+ self.image_id = attributes[:'image_id']
186
+ end
187
+
188
+ if attributes.key?(:'processors')
189
+ self.processors = attributes[:'processors']
190
+ end
191
+
192
+ if attributes.key?(:'proc_type')
193
+ self.proc_type = attributes[:'proc_type']
194
+ else
195
+ self.proc_type = 'dedicated'
196
+ end
197
+
198
+ if attributes.key?(:'memory')
199
+ self.memory = attributes[:'memory']
200
+ end
201
+
202
+ if attributes.key?(:'network_i_ds')
203
+ if (value = attributes[:'network_i_ds']).is_a?(Array)
204
+ self.network_i_ds = value
205
+ end
206
+ end
207
+
208
+ if attributes.key?(:'networks')
209
+ if (value = attributes[:'networks']).is_a?(Array)
210
+ self.networks = value
211
+ end
212
+ end
213
+
214
+ if attributes.key?(:'volume_i_ds')
215
+ if (value = attributes[:'volume_i_ds']).is_a?(Array)
216
+ self.volume_i_ds = value
217
+ end
218
+ end
219
+
220
+ if attributes.key?(:'key_pair_name')
221
+ self.key_pair_name = attributes[:'key_pair_name']
222
+ end
223
+
224
+ if attributes.key?(:'sys_type')
225
+ self.sys_type = attributes[:'sys_type']
226
+ end
227
+
228
+ if attributes.key?(:'migratable')
229
+ self.migratable = attributes[:'migratable']
230
+ else
231
+ self.migratable = true
232
+ end
233
+
234
+ if attributes.key?(:'user_data')
235
+ self.user_data = attributes[:'user_data']
236
+ end
237
+
238
+ if attributes.key?(:'storage_type')
239
+ self.storage_type = attributes[:'storage_type']
240
+ end
241
+
242
+ if attributes.key?(:'software_licenses')
243
+ self.software_licenses = attributes[:'software_licenses']
244
+ end
245
+
246
+ if attributes.key?(:'pin_policy')
247
+ self.pin_policy = attributes[:'pin_policy']
248
+ end
249
+
250
+ if attributes.key?(:'virtual_cores')
251
+ self.virtual_cores = attributes[:'virtual_cores']
252
+ end
253
+ end
254
+
255
+ # Show invalid properties with the reasons. Usually used together with valid?
256
+ # @return Array for valid properties with the reasons
257
+ def list_invalid_properties
258
+ invalid_properties = Array.new
259
+ if @server_name.nil?
260
+ invalid_properties.push('invalid value for "server_name", server_name cannot be nil.')
261
+ end
262
+
263
+ if @image_id.nil?
264
+ invalid_properties.push('invalid value for "image_id", image_id cannot be nil.')
265
+ end
266
+
267
+ if @processors.nil?
268
+ invalid_properties.push('invalid value for "processors", processors cannot be nil.')
269
+ end
270
+
271
+ if @proc_type.nil?
272
+ invalid_properties.push('invalid value for "proc_type", proc_type cannot be nil.')
273
+ end
274
+
275
+ if @memory.nil?
276
+ invalid_properties.push('invalid value for "memory", memory cannot be nil.')
277
+ end
278
+
279
+ invalid_properties
280
+ end
281
+
282
+ # Check to see if the all the properties in the model are valid
283
+ # @return true if the model is valid
284
+ def valid?
285
+ return false if @server_name.nil?
286
+ replicant_naming_scheme_validator = EnumAttributeValidator.new('String', ["prefix", "suffix"])
287
+ return false unless replicant_naming_scheme_validator.valid?(@replicant_naming_scheme)
288
+ replicant_affinity_policy_validator = EnumAttributeValidator.new('String', ["affinity", "anti-affinity", "none"])
289
+ return false unless replicant_affinity_policy_validator.valid?(@replicant_affinity_policy)
290
+ return false if @image_id.nil?
291
+ return false if @processors.nil?
292
+ return false if @proc_type.nil?
293
+ proc_type_validator = EnumAttributeValidator.new('String', ["dedicated", "shared", "capped"])
294
+ return false unless proc_type_validator.valid?(@proc_type)
295
+ return false if @memory.nil?
296
+ true
297
+ end
298
+
299
+ # Custom attribute writer method checking allowed values (enum).
300
+ # @param [Object] replicant_naming_scheme Object to be assigned
301
+ def replicant_naming_scheme=(replicant_naming_scheme)
302
+ validator = EnumAttributeValidator.new('String', ["prefix", "suffix"])
303
+ unless validator.valid?(replicant_naming_scheme)
304
+ fail ArgumentError, "invalid value for \"replicant_naming_scheme\", must be one of #{validator.allowable_values}."
305
+ end
306
+ @replicant_naming_scheme = replicant_naming_scheme
307
+ end
308
+
309
+ # Custom attribute writer method checking allowed values (enum).
310
+ # @param [Object] replicant_affinity_policy Object to be assigned
311
+ def replicant_affinity_policy=(replicant_affinity_policy)
312
+ validator = EnumAttributeValidator.new('String', ["affinity", "anti-affinity", "none"])
313
+ unless validator.valid?(replicant_affinity_policy)
314
+ fail ArgumentError, "invalid value for \"replicant_affinity_policy\", must be one of #{validator.allowable_values}."
315
+ end
316
+ @replicant_affinity_policy = replicant_affinity_policy
317
+ end
318
+
319
+ # Custom attribute writer method checking allowed values (enum).
320
+ # @param [Object] proc_type Object to be assigned
321
+ def proc_type=(proc_type)
322
+ validator = EnumAttributeValidator.new('String', ["dedicated", "shared", "capped"])
323
+ unless validator.valid?(proc_type)
324
+ fail ArgumentError, "invalid value for \"proc_type\", must be one of #{validator.allowable_values}."
325
+ end
326
+ @proc_type = proc_type
327
+ end
328
+
329
+ # Checks equality by comparing each attribute.
330
+ # @param [Object] Object to be compared
331
+ def ==(o)
332
+ return true if self.equal?(o)
333
+ self.class == o.class &&
334
+ server_name == o.server_name &&
335
+ replicants == o.replicants &&
336
+ replicant_naming_scheme == o.replicant_naming_scheme &&
337
+ replicant_affinity_policy == o.replicant_affinity_policy &&
338
+ image_id == o.image_id &&
339
+ processors == o.processors &&
340
+ proc_type == o.proc_type &&
341
+ memory == o.memory &&
342
+ network_i_ds == o.network_i_ds &&
343
+ networks == o.networks &&
344
+ volume_i_ds == o.volume_i_ds &&
345
+ key_pair_name == o.key_pair_name &&
346
+ sys_type == o.sys_type &&
347
+ migratable == o.migratable &&
348
+ user_data == o.user_data &&
349
+ storage_type == o.storage_type &&
350
+ software_licenses == o.software_licenses &&
351
+ pin_policy == o.pin_policy &&
352
+ virtual_cores == o.virtual_cores
353
+ end
354
+
355
+ # @see the `==` method
356
+ # @param [Object] Object to be compared
357
+ def eql?(o)
358
+ self == o
359
+ end
360
+
361
+ # Calculates hash code according to all attributes.
362
+ # @return [Integer] Hash code
363
+ def hash
364
+ [server_name, replicants, replicant_naming_scheme, replicant_affinity_policy, image_id, processors, proc_type, memory, network_i_ds, networks, volume_i_ds, key_pair_name, sys_type, migratable, user_data, storage_type, software_licenses, pin_policy, virtual_cores].hash
365
+ end
366
+
367
+ # Builds the object from hash
368
+ # @param [Hash] attributes Model attributes in the form of hash
369
+ # @return [Object] Returns the model itself
370
+ def self.build_from_hash(attributes)
371
+ new.build_from_hash(attributes)
372
+ end
373
+
374
+ # Builds the object from hash
375
+ # @param [Hash] attributes Model attributes in the form of hash
376
+ # @return [Object] Returns the model itself
377
+ def build_from_hash(attributes)
378
+ return nil unless attributes.is_a?(Hash)
379
+ self.class.openapi_types.each_pair do |key, type|
380
+ if type =~ /\AArray<(.*)>/i
381
+ # check to ensure the input is an array given that the attribute
382
+ # is documented as an array but the input is not
383
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
384
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
385
+ end
386
+ elsif !attributes[self.class.attribute_map[key]].nil?
387
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
388
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
389
+ self.send("#{key}=", nil)
390
+ end
391
+ end
392
+
393
+ self
394
+ end
395
+
396
+ # Deserializes the data based on type
397
+ # @param string type Data type
398
+ # @param string value Value to be deserialized
399
+ # @return [Object] Deserialized data
400
+ def _deserialize(type, value)
401
+ case type.to_sym
402
+ when :DateTime
403
+ DateTime.parse(value)
404
+ when :Date
405
+ Date.parse(value)
406
+ when :String
407
+ value.to_s
408
+ when :Integer
409
+ value.to_i
410
+ when :Float
411
+ value.to_f
412
+ when :Boolean
413
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
414
+ true
415
+ else
416
+ false
417
+ end
418
+ when :Object
419
+ # generic object (usually a Hash), return directly
420
+ value
421
+ when /\AArray<(?<inner_type>.+)>\z/
422
+ inner_type = Regexp.last_match[:inner_type]
423
+ value.map { |v| _deserialize(inner_type, v) }
424
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
425
+ k_type = Regexp.last_match[:k_type]
426
+ v_type = Regexp.last_match[:v_type]
427
+ {}.tap do |hash|
428
+ value.each do |k, v|
429
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
430
+ end
431
+ end
432
+ else # model
433
+ IbmCloudPower.const_get(type).build_from_hash(value)
434
+ end
435
+ end
436
+
437
+ # Returns the string representation of the object
438
+ # @return [String] String presentation of the object
439
+ def to_s
440
+ to_hash.to_s
441
+ end
442
+
443
+ # to_body is an alias to to_hash (backward compatibility)
444
+ # @return [Hash] Returns the object in the form of hash
445
+ def to_body
446
+ to_hash
447
+ end
448
+
449
+ # Returns the object in the form of hash
450
+ # @return [Hash] Returns the object in the form of hash
451
+ def to_hash
452
+ hash = {}
453
+ self.class.attribute_map.each_pair do |attr, param|
454
+ value = self.send(attr)
455
+ if value.nil?
456
+ is_nullable = self.class.openapi_nullable.include?(attr)
457
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
458
+ end
459
+
460
+ hash[param] = _to_hash(value)
461
+ end
462
+ hash
463
+ end
464
+
465
+ # Outputs non-array value in the form of hash
466
+ # For object, use to_hash. Otherwise, just return the value
467
+ # @param [Object] value Any valid value
468
+ # @return [Hash] Returns the value in the form of hash
469
+ def _to_hash(value)
470
+ if value.is_a?(Array)
471
+ value.compact.map { |v| _to_hash(v) }
472
+ elsif value.is_a?(Hash)
473
+ {}.tap do |hash|
474
+ value.each { |k, v| hash[k] = _to_hash(v) }
475
+ end
476
+ elsif value.respond_to? :to_hash
477
+ value.to_hash
478
+ else
479
+ value
480
+ end
481
+ end
482
+ end
483
+ end