pnap_bmc_api 1.4.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -1
  3. data/VERSION +1 -1
  4. data/docs/DeleteResult.md +1 -1
  5. data/docs/OsConfigurationCloudInit.md +1 -1
  6. data/docs/OsConfigurationNetrisController.md +1 -1
  7. data/docs/PrivateNetworkConfiguration.md +1 -1
  8. data/docs/QuotaEditLimitRequest.md +1 -1
  9. data/docs/QuotaEditLimitRequestDetails.md +1 -1
  10. data/docs/QuotasApi.md +6 -8
  11. data/docs/SSHKeysApi.md +12 -16
  12. data/docs/Server.md +14 -8
  13. data/docs/ServerCreate.md +7 -5
  14. data/docs/ServerNetworkUpdate.md +2 -2
  15. data/docs/ServerPrivateNetwork.md +3 -3
  16. data/docs/ServerProvision.md +38 -0
  17. data/docs/ServerPublicNetwork.md +2 -2
  18. data/docs/ServersApi.md +173 -111
  19. data/docs/StorageConfiguration.md +18 -0
  20. data/docs/StorageConfigurationRootPartition.md +20 -0
  21. data/lib/pnap_bmc_api/api/quotas_api.rb +11 -7
  22. data/lib/pnap_bmc_api/api/servers_api.rb +200 -75
  23. data/lib/pnap_bmc_api/api/ssh_keys_api.rb +21 -13
  24. data/lib/pnap_bmc_api/api_client.rb +24 -21
  25. data/lib/pnap_bmc_api/api_error.rb +2 -1
  26. data/lib/pnap_bmc_api/configuration.rb +28 -9
  27. data/lib/pnap_bmc_api/models/action_result.rb +16 -19
  28. data/lib/pnap_bmc_api/models/delete_result.rb +18 -19
  29. data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +18 -19
  30. data/lib/pnap_bmc_api/models/error.rb +16 -19
  31. data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +19 -20
  32. data/lib/pnap_bmc_api/models/network_configuration.rb +14 -19
  33. data/lib/pnap_bmc_api/models/os_configuration.rb +19 -20
  34. data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +15 -20
  35. data/lib/pnap_bmc_api/models/os_configuration_map.rb +14 -19
  36. data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +19 -20
  37. data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +19 -20
  38. data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +16 -21
  39. data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +66 -20
  40. data/lib/pnap_bmc_api/models/os_configuration_windows.rb +19 -20
  41. data/lib/pnap_bmc_api/models/private_network_configuration.rb +15 -20
  42. data/lib/pnap_bmc_api/models/public_network_configuration.rb +14 -19
  43. data/lib/pnap_bmc_api/models/quota.rb +30 -19
  44. data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +40 -20
  45. data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +43 -22
  46. data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +14 -19
  47. data/lib/pnap_bmc_api/models/reset_result.rb +16 -19
  48. data/lib/pnap_bmc_api/models/server.rb +94 -34
  49. data/lib/pnap_bmc_api/models/server_create.rb +43 -27
  50. data/lib/pnap_bmc_api/models/server_ip_block.rb +16 -19
  51. data/lib/pnap_bmc_api/models/server_network_update.rb +15 -20
  52. data/lib/pnap_bmc_api/models/server_patch.rb +27 -24
  53. data/lib/pnap_bmc_api/models/server_private_network.rb +27 -26
  54. data/lib/pnap_bmc_api/models/server_provision.rb +395 -0
  55. data/lib/pnap_bmc_api/models/server_public_network.rb +17 -20
  56. data/lib/pnap_bmc_api/models/server_reserve.rb +16 -19
  57. data/lib/pnap_bmc_api/models/server_reset.rb +14 -19
  58. data/lib/pnap_bmc_api/models/ssh_key.rb +28 -19
  59. data/lib/pnap_bmc_api/models/ssh_key_create.rb +52 -19
  60. data/lib/pnap_bmc_api/models/ssh_key_update.rb +29 -19
  61. data/lib/pnap_bmc_api/models/storage_configuration.rb +215 -0
  62. data/lib/pnap_bmc_api/models/{quota_edit_limit_request_details_all_of.rb → storage_configuration_root_partition.rb} +40 -36
  63. data/lib/pnap_bmc_api/models/tag_assignment.rb +20 -19
  64. data/lib/pnap_bmc_api/models/tag_assignment_request.rb +16 -19
  65. data/lib/pnap_bmc_api/version.rb +1 -1
  66. data/lib/pnap_bmc_api.rb +4 -2
  67. data/pnap_bmc_api.gemspec +2 -2
  68. data/spec/api/quotas_api_spec.rb +6 -6
  69. data/spec/api/servers_api_spec.rb +109 -36
  70. data/spec/api/ssh_keys_api_spec.rb +9 -9
  71. data/spec/models/action_result_spec.rb +6 -4
  72. data/spec/models/delete_result_spec.rb +7 -5
  73. data/spec/models/delete_ssh_key_result_spec.rb +7 -5
  74. data/spec/models/error_spec.rb +7 -5
  75. data/spec/models/ip_blocks_configuration_spec.rb +7 -5
  76. data/spec/models/network_configuration_spec.rb +19 -5
  77. data/spec/models/os_configuration_cloud_init_spec.rb +5 -3
  78. data/spec/models/os_configuration_map_esxi_spec.rb +8 -6
  79. data/spec/models/os_configuration_map_proxmox_spec.rb +8 -6
  80. data/spec/models/os_configuration_map_spec.rb +8 -6
  81. data/spec/models/os_configuration_netris_controller_spec.rb +7 -5
  82. data/spec/models/os_configuration_netris_softgate_spec.rb +8 -6
  83. data/spec/models/os_configuration_spec.rb +33 -7
  84. data/spec/models/os_configuration_windows_spec.rb +6 -4
  85. data/spec/models/private_network_configuration_spec.rb +8 -6
  86. data/spec/models/public_network_configuration_spec.rb +6 -4
  87. data/spec/models/quota_edit_limit_request_details_spec.rb +8 -6
  88. data/spec/models/quota_edit_limit_request_spec.rb +7 -5
  89. data/spec/models/quota_spec.rb +13 -15
  90. data/spec/models/relinquish_ip_block_spec.rb +6 -4
  91. data/spec/models/reset_result_spec.rb +8 -6
  92. data/spec/models/server_create_spec.rb +25 -17
  93. data/spec/models/server_ip_block_spec.rb +7 -5
  94. data/spec/models/server_network_update_spec.rb +5 -3
  95. data/spec/models/server_patch_spec.rb +7 -5
  96. data/spec/models/server_private_network_spec.rb +9 -7
  97. data/spec/models/server_provision_spec.rb +96 -0
  98. data/spec/models/server_public_network_spec.rb +8 -6
  99. data/spec/models/server_reserve_spec.rb +6 -4
  100. data/spec/models/server_reset_spec.rb +9 -7
  101. data/spec/models/server_spec.rb +47 -27
  102. data/spec/models/ssh_key_create_spec.rb +8 -6
  103. data/spec/models/ssh_key_spec.rb +12 -10
  104. data/spec/models/ssh_key_update_spec.rb +7 -5
  105. data/spec/models/storage_configuration_root_partition_spec.rb +42 -0
  106. data/spec/models/storage_configuration_spec.rb +36 -0
  107. data/spec/models/tag_assignment_request_spec.rb +7 -5
  108. data/spec/models/tag_assignment_spec.rb +10 -8
  109. data/spec/spec_helper.rb +1 -1
  110. metadata +41 -37
  111. data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
  112. data/spec/api_client_spec.rb +0 -226
  113. data/spec/configuration_spec.rb +0 -42
  114. data/spec/models/quota_edit_limit_request_details_all_of_spec.rb +0 -34
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.1.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -19,7 +19,7 @@ module BmcApi
19
19
  # The unique identifier of the server.
20
20
  attr_accessor :id
21
21
 
22
- # The status of the server.
22
+ # The status of the server. Can have one of the following values: `creating` , `powered-on` , `powered-off` , `rebooting` , `resetting` , `deleting` , `reserved` , `error` or `reinstating`.
23
23
  attr_accessor :status
24
24
 
25
25
  # Hostname of server.
@@ -28,10 +28,10 @@ module BmcApi
28
28
  # Description of server.
29
29
  attr_accessor :description
30
30
 
31
- # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `esxi/esxi70`, `debian/bullseye`, `proxmox/bullseye`, `netris/controller`, `netris/softgate_1g` or `netris/softgate_10g`.
31
+ # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
32
32
  attr_accessor :os
33
33
 
34
- # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.medium`, `d2.m1.large`, `d2.m2.medium`, `d2.m2.large`, `d2.m2.xlarge`, `d2.c4.storage.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge` or `d3.m6.xlarge`.
34
+ # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge` or `d3.m6.xxlarge`.
35
35
  attr_accessor :type
36
36
 
37
37
  # Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`.
@@ -70,7 +70,7 @@ module BmcApi
70
70
  # Auto-generated password set for user `Admin` on Windows server, user `root` on ESXi servers, user `root` on Proxmox server and user `netris` on Netris servers.<br> The password is not stored and therefore will only be returned in response to provisioning a server. Copy and save it for future reference.
71
71
  attr_accessor :password
72
72
 
73
- # The type of network configuration for this server. Currently this field should be set to `PUBLIC_AND_PRIVATE` or `PRIVATE_ONLY`.
73
+ # The type of network configuration for this server. Currently this field should be set to `PUBLIC_AND_PRIVATE`, `PRIVATE_ONLY`, `PUBLIC_ONLY` or `NONE`.
74
74
  attr_accessor :network_type
75
75
 
76
76
  # The cluster reference id if any.
@@ -86,6 +86,14 @@ module BmcApi
86
86
 
87
87
  attr_accessor :network_configuration
88
88
 
89
+ attr_accessor :storage_configuration
90
+
91
+ # Unique identifier of the server to which the reservation has been transferred.
92
+ attr_accessor :superseded_by
93
+
94
+ # Unique identifier of the server from which the reservation has been transferred.
95
+ attr_accessor :supersedes
96
+
89
97
  # Attribute mapping from ruby-style variable name to JSON key.
90
98
  def self.attribute_map
91
99
  {
@@ -112,7 +120,10 @@ module BmcApi
112
120
  :'tags' => :'tags',
113
121
  :'provisioned_on' => :'provisionedOn',
114
122
  :'os_configuration' => :'osConfiguration',
115
- :'network_configuration' => :'networkConfiguration'
123
+ :'network_configuration' => :'networkConfiguration',
124
+ :'storage_configuration' => :'storageConfiguration',
125
+ :'superseded_by' => :'supersededBy',
126
+ :'supersedes' => :'supersedes'
116
127
  }
117
128
  end
118
129
 
@@ -147,7 +158,10 @@ module BmcApi
147
158
  :'tags' => :'Array<TagAssignment>',
148
159
  :'provisioned_on' => :'Time',
149
160
  :'os_configuration' => :'OsConfiguration',
150
- :'network_configuration' => :'NetworkConfiguration'
161
+ :'network_configuration' => :'NetworkConfiguration',
162
+ :'storage_configuration' => :'StorageConfiguration',
163
+ :'superseded_by' => :'String',
164
+ :'supersedes' => :'String'
151
165
  }
152
166
  end
153
167
 
@@ -174,14 +188,20 @@ module BmcApi
174
188
 
175
189
  if attributes.key?(:'id')
176
190
  self.id = attributes[:'id']
191
+ else
192
+ self.id = nil
177
193
  end
178
194
 
179
195
  if attributes.key?(:'status')
180
196
  self.status = attributes[:'status']
197
+ else
198
+ self.status = nil
181
199
  end
182
200
 
183
201
  if attributes.key?(:'hostname')
184
202
  self.hostname = attributes[:'hostname']
203
+ else
204
+ self.hostname = nil
185
205
  end
186
206
 
187
207
  if attributes.key?(:'description')
@@ -194,40 +214,58 @@ module BmcApi
194
214
 
195
215
  if attributes.key?(:'type')
196
216
  self.type = attributes[:'type']
217
+ else
218
+ self.type = nil
197
219
  end
198
220
 
199
221
  if attributes.key?(:'location')
200
222
  self.location = attributes[:'location']
223
+ else
224
+ self.location = nil
201
225
  end
202
226
 
203
227
  if attributes.key?(:'cpu')
204
228
  self.cpu = attributes[:'cpu']
229
+ else
230
+ self.cpu = nil
205
231
  end
206
232
 
207
233
  if attributes.key?(:'cpu_count')
208
234
  self.cpu_count = attributes[:'cpu_count']
235
+ else
236
+ self.cpu_count = nil
209
237
  end
210
238
 
211
239
  if attributes.key?(:'cores_per_cpu')
212
240
  self.cores_per_cpu = attributes[:'cores_per_cpu']
241
+ else
242
+ self.cores_per_cpu = nil
213
243
  end
214
244
 
215
245
  if attributes.key?(:'cpu_frequency')
216
246
  self.cpu_frequency = attributes[:'cpu_frequency']
247
+ else
248
+ self.cpu_frequency = nil
217
249
  end
218
250
 
219
251
  if attributes.key?(:'ram')
220
252
  self.ram = attributes[:'ram']
253
+ else
254
+ self.ram = nil
221
255
  end
222
256
 
223
257
  if attributes.key?(:'storage')
224
258
  self.storage = attributes[:'storage']
259
+ else
260
+ self.storage = nil
225
261
  end
226
262
 
227
263
  if attributes.key?(:'private_ip_addresses')
228
264
  if (value = attributes[:'private_ip_addresses']).is_a?(Array)
229
265
  self.private_ip_addresses = value
230
266
  end
267
+ else
268
+ self.private_ip_addresses = nil
231
269
  end
232
270
 
233
271
  if attributes.key?(:'public_ip_addresses')
@@ -276,12 +314,29 @@ module BmcApi
276
314
 
277
315
  if attributes.key?(:'network_configuration')
278
316
  self.network_configuration = attributes[:'network_configuration']
317
+ else
318
+ self.network_configuration = nil
319
+ end
320
+
321
+ if attributes.key?(:'storage_configuration')
322
+ self.storage_configuration = attributes[:'storage_configuration']
323
+ else
324
+ self.storage_configuration = nil
325
+ end
326
+
327
+ if attributes.key?(:'superseded_by')
328
+ self.superseded_by = attributes[:'superseded_by']
329
+ end
330
+
331
+ if attributes.key?(:'supersedes')
332
+ self.supersedes = attributes[:'supersedes']
279
333
  end
280
334
  end
281
335
 
282
336
  # Show invalid properties with the reasons. Usually used together with valid?
283
337
  # @return Array for valid properties with the reasons
284
338
  def list_invalid_properties
339
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
285
340
  invalid_properties = Array.new
286
341
  if @id.nil?
287
342
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -312,10 +367,6 @@ module BmcApi
312
367
  invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
313
368
  end
314
369
 
315
- if @os.nil?
316
- invalid_properties.push('invalid value for "os", os cannot be nil.')
317
- end
318
-
319
370
  if @type.nil?
320
371
  invalid_properties.push('invalid value for "type", type cannot be nil.')
321
372
  end
@@ -380,12 +431,17 @@ module BmcApi
380
431
  invalid_properties.push('invalid value for "network_configuration", network_configuration cannot be nil.')
381
432
  end
382
433
 
434
+ if @storage_configuration.nil?
435
+ invalid_properties.push('invalid value for "storage_configuration", storage_configuration cannot be nil.')
436
+ end
437
+
383
438
  invalid_properties
384
439
  end
385
440
 
386
441
  # Check to see if the all the properties in the model are valid
387
442
  # @return true if the model is valid
388
443
  def valid?
444
+ warn '[DEPRECATED] the `valid?` method is obsolete'
389
445
  return false if @id.nil?
390
446
  return false if @status.nil?
391
447
  return false if @hostname.nil?
@@ -393,7 +449,6 @@ module BmcApi
393
449
  return false if @hostname.to_s.length < 1
394
450
  return false if @hostname !~ Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
395
451
  return false if !@description.nil? && @description.to_s.length > 250
396
- return false if @os.nil?
397
452
  return false if @type.nil?
398
453
  return false if @location.nil?
399
454
  return false if @cpu.nil?
@@ -410,6 +465,7 @@ module BmcApi
410
465
  return false if !@public_ip_addresses.nil? && @public_ip_addresses.length < 0
411
466
  return false if @pricing_model.nil?
412
467
  return false if @network_configuration.nil?
468
+ return false if @storage_configuration.nil?
413
469
  true
414
470
  end
415
471
 
@@ -439,7 +495,11 @@ module BmcApi
439
495
  # Custom attribute writer method with validation
440
496
  # @param [Object] description Value to be assigned
441
497
  def description=(description)
442
- if !description.nil? && description.to_s.length > 250
498
+ if description.nil?
499
+ fail ArgumentError, 'description cannot be nil'
500
+ end
501
+
502
+ if description.to_s.length > 250
443
503
  fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
444
504
  end
445
505
 
@@ -505,7 +565,11 @@ module BmcApi
505
565
  # Custom attribute writer method with validation
506
566
  # @param [Object] public_ip_addresses Value to be assigned
507
567
  def public_ip_addresses=(public_ip_addresses)
508
- if !public_ip_addresses.nil? && public_ip_addresses.length < 0
568
+ if public_ip_addresses.nil?
569
+ fail ArgumentError, 'public_ip_addresses cannot be nil'
570
+ end
571
+
572
+ if public_ip_addresses.length < 0
509
573
  fail ArgumentError, 'invalid value for "public_ip_addresses", number of items must be greater than or equal to 0.'
510
574
  end
511
575
 
@@ -540,7 +604,10 @@ module BmcApi
540
604
  tags == o.tags &&
541
605
  provisioned_on == o.provisioned_on &&
542
606
  os_configuration == o.os_configuration &&
543
- network_configuration == o.network_configuration
607
+ network_configuration == o.network_configuration &&
608
+ storage_configuration == o.storage_configuration &&
609
+ superseded_by == o.superseded_by &&
610
+ supersedes == o.supersedes
544
611
  end
545
612
 
546
613
  # @see the `==` method
@@ -552,44 +619,37 @@ module BmcApi
552
619
  # Calculates hash code according to all attributes.
553
620
  # @return [Integer] Hash code
554
621
  def hash
555
- [id, status, hostname, description, os, type, location, cpu, cpu_count, cores_per_cpu, cpu_frequency, ram, storage, private_ip_addresses, public_ip_addresses, reservation_id, pricing_model, password, network_type, cluster_id, tags, provisioned_on, os_configuration, network_configuration].hash
622
+ [id, status, hostname, description, os, type, location, cpu, cpu_count, cores_per_cpu, cpu_frequency, ram, storage, private_ip_addresses, public_ip_addresses, reservation_id, pricing_model, password, network_type, cluster_id, tags, provisioned_on, os_configuration, network_configuration, storage_configuration, superseded_by, supersedes].hash
556
623
  end
557
624
 
558
625
  # Builds the object from hash
559
626
  # @param [Hash] attributes Model attributes in the form of hash
560
627
  # @return [Object] Returns the model itself
561
628
  def self.build_from_hash(attributes)
562
- new.build_from_hash(attributes)
563
- end
564
-
565
- # Builds the object from hash
566
- # @param [Hash] attributes Model attributes in the form of hash
567
- # @return [Object] Returns the model itself
568
- def build_from_hash(attributes)
569
629
  return nil unless attributes.is_a?(Hash)
570
630
  attributes = attributes.transform_keys(&:to_sym)
571
- self.class.openapi_types.each_pair do |key, type|
572
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
573
- self.send("#{key}=", nil)
631
+ transformed_hash = {}
632
+ openapi_types.each_pair do |key, type|
633
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
634
+ transformed_hash["#{key}"] = nil
574
635
  elsif type =~ /\AArray<(.*)>/i
575
636
  # check to ensure the input is an array given that the attribute
576
637
  # is documented as an array but the input is not
577
- if attributes[self.class.attribute_map[key]].is_a?(Array)
578
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
638
+ if attributes[attribute_map[key]].is_a?(Array)
639
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
579
640
  end
580
- elsif !attributes[self.class.attribute_map[key]].nil?
581
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
641
+ elsif !attributes[attribute_map[key]].nil?
642
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
582
643
  end
583
644
  end
584
-
585
- self
645
+ new(transformed_hash)
586
646
  end
587
647
 
588
648
  # Deserializes the data based on type
589
649
  # @param string type Data type
590
650
  # @param string value Value to be deserialized
591
651
  # @return [Object] Deserialized data
592
- def _deserialize(type, value)
652
+ def self._deserialize(type, value)
593
653
  case type.to_sym
594
654
  when :Time
595
655
  Time.parse(value)
@@ -624,7 +684,7 @@ module BmcApi
624
684
  else # model
625
685
  # models (e.g. Pet) or oneOf
626
686
  klass = BmcApi.const_get(type)
627
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
687
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
628
688
  end
629
689
  end
630
690
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.1.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -22,10 +22,10 @@ module BmcApi
22
22
  # Description of server.
23
23
  attr_accessor :description
24
24
 
25
- # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `esxi/esxi70`, `debian/bullseye`, `proxmox/bullseye`, `netris/controller`, `netris/softgate_1g` or `netris/softgate_10g`.
25
+ # The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `ubuntu/jammy`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `rockylinux/rockylinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
26
26
  attr_accessor :os
27
27
 
28
- # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.medium`, `d2.m1.large`, `d2.m2.medium`, `d2.m2.large`, `d2.m2.xlarge`, `d2.c4.storage.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge` or `d3.m6.xlarge`.
28
+ # Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.xlarge`, `d2.m2.xxlarge`, `d2.m3.xlarge`, `d2.m4.xlarge`, `d2.m5.xlarge`, `d2.c4.db1.pliops1`, `d3.m4.xlarge`, `d3.m5.xlarge`, `d3.m6.xlarge`, `a1.c5.large`, `d3.s5.xlarge`, `d3.m4.xxlarge`, `d3.m5.xxlarge` or `d3.m6.xxlarge`.
29
29
  attr_accessor :type
30
30
 
31
31
  # Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`.
@@ -46,7 +46,7 @@ module BmcApi
46
46
  # Server pricing model. Currently this field should be set to `HOURLY`, `ONE_MONTH_RESERVATION`, `TWELVE_MONTHS_RESERVATION`, `TWENTY_FOUR_MONTHS_RESERVATION` or `THIRTY_SIX_MONTHS_RESERVATION`.
47
47
  attr_accessor :pricing_model
48
48
 
49
- # The type of network configuration for this server. Currently this field should be set to `PUBLIC_AND_PRIVATE` or `PRIVATE_ONLY`.
49
+ # The type of network configuration for this server.<br> Currently this field should be set to `PUBLIC_AND_PRIVATE`, `PRIVATE_ONLY`, `PUBLIC_ONLY` or `USER_DEFINED`.<br> Setting the `force` query parameter to `true` allows you to configure network configuration type as `NONE`.
50
50
  attr_accessor :network_type
51
51
 
52
52
  attr_accessor :os_configuration
@@ -56,6 +56,8 @@ module BmcApi
56
56
 
57
57
  attr_accessor :network_configuration
58
58
 
59
+ attr_accessor :storage_configuration
60
+
59
61
  # Attribute mapping from ruby-style variable name to JSON key.
60
62
  def self.attribute_map
61
63
  {
@@ -72,7 +74,8 @@ module BmcApi
72
74
  :'network_type' => :'networkType',
73
75
  :'os_configuration' => :'osConfiguration',
74
76
  :'tags' => :'tags',
75
- :'network_configuration' => :'networkConfiguration'
77
+ :'network_configuration' => :'networkConfiguration',
78
+ :'storage_configuration' => :'storageConfiguration'
76
79
  }
77
80
  end
78
81
 
@@ -97,7 +100,8 @@ module BmcApi
97
100
  :'network_type' => :'String',
98
101
  :'os_configuration' => :'OsConfiguration',
99
102
  :'tags' => :'Array<TagAssignmentRequest>',
100
- :'network_configuration' => :'NetworkConfiguration'
103
+ :'network_configuration' => :'NetworkConfiguration',
104
+ :'storage_configuration' => :'StorageConfiguration'
101
105
  }
102
106
  end
103
107
 
@@ -124,6 +128,8 @@ module BmcApi
124
128
 
125
129
  if attributes.key?(:'hostname')
126
130
  self.hostname = attributes[:'hostname']
131
+ else
132
+ self.hostname = nil
127
133
  end
128
134
 
129
135
  if attributes.key?(:'description')
@@ -132,14 +138,20 @@ module BmcApi
132
138
 
133
139
  if attributes.key?(:'os')
134
140
  self.os = attributes[:'os']
141
+ else
142
+ self.os = nil
135
143
  end
136
144
 
137
145
  if attributes.key?(:'type')
138
146
  self.type = attributes[:'type']
147
+ else
148
+ self.type = nil
139
149
  end
140
150
 
141
151
  if attributes.key?(:'location')
142
152
  self.location = attributes[:'location']
153
+ else
154
+ self.location = nil
143
155
  end
144
156
 
145
157
  if attributes.key?(:'install_default_ssh_keys')
@@ -189,11 +201,16 @@ module BmcApi
189
201
  if attributes.key?(:'network_configuration')
190
202
  self.network_configuration = attributes[:'network_configuration']
191
203
  end
204
+
205
+ if attributes.key?(:'storage_configuration')
206
+ self.storage_configuration = attributes[:'storage_configuration']
207
+ end
192
208
  end
193
209
 
194
210
  # Show invalid properties with the reasons. Usually used together with valid?
195
211
  # @return Array for valid properties with the reasons
196
212
  def list_invalid_properties
213
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
197
214
  invalid_properties = Array.new
198
215
  if @hostname.nil?
199
216
  invalid_properties.push('invalid value for "hostname", hostname cannot be nil.')
@@ -234,6 +251,7 @@ module BmcApi
234
251
  # Check to see if the all the properties in the model are valid
235
252
  # @return true if the model is valid
236
253
  def valid?
254
+ warn '[DEPRECATED] the `valid?` method is obsolete'
237
255
  return false if @hostname.nil?
238
256
  return false if @hostname.to_s.length > 100
239
257
  return false if @hostname.to_s.length < 1
@@ -271,7 +289,11 @@ module BmcApi
271
289
  # Custom attribute writer method with validation
272
290
  # @param [Object] description Value to be assigned
273
291
  def description=(description)
274
- if !description.nil? && description.to_s.length > 250
292
+ if description.nil?
293
+ fail ArgumentError, 'description cannot be nil'
294
+ end
295
+
296
+ if description.to_s.length > 250
275
297
  fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
276
298
  end
277
299
 
@@ -296,7 +318,8 @@ module BmcApi
296
318
  network_type == o.network_type &&
297
319
  os_configuration == o.os_configuration &&
298
320
  tags == o.tags &&
299
- network_configuration == o.network_configuration
321
+ network_configuration == o.network_configuration &&
322
+ storage_configuration == o.storage_configuration
300
323
  end
301
324
 
302
325
  # @see the `==` method
@@ -308,44 +331,37 @@ module BmcApi
308
331
  # Calculates hash code according to all attributes.
309
332
  # @return [Integer] Hash code
310
333
  def hash
311
- [hostname, description, os, type, location, install_default_ssh_keys, ssh_keys, ssh_key_ids, reservation_id, pricing_model, network_type, os_configuration, tags, network_configuration].hash
334
+ [hostname, description, os, type, location, install_default_ssh_keys, ssh_keys, ssh_key_ids, reservation_id, pricing_model, network_type, os_configuration, tags, network_configuration, storage_configuration].hash
312
335
  end
313
336
 
314
337
  # Builds the object from hash
315
338
  # @param [Hash] attributes Model attributes in the form of hash
316
339
  # @return [Object] Returns the model itself
317
340
  def self.build_from_hash(attributes)
318
- new.build_from_hash(attributes)
319
- end
320
-
321
- # Builds the object from hash
322
- # @param [Hash] attributes Model attributes in the form of hash
323
- # @return [Object] Returns the model itself
324
- def build_from_hash(attributes)
325
341
  return nil unless attributes.is_a?(Hash)
326
342
  attributes = attributes.transform_keys(&:to_sym)
327
- self.class.openapi_types.each_pair do |key, type|
328
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
329
- self.send("#{key}=", nil)
343
+ transformed_hash = {}
344
+ openapi_types.each_pair do |key, type|
345
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
346
+ transformed_hash["#{key}"] = nil
330
347
  elsif type =~ /\AArray<(.*)>/i
331
348
  # check to ensure the input is an array given that the attribute
332
349
  # is documented as an array but the input is not
333
- if attributes[self.class.attribute_map[key]].is_a?(Array)
334
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
350
+ if attributes[attribute_map[key]].is_a?(Array)
351
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
335
352
  end
336
- elsif !attributes[self.class.attribute_map[key]].nil?
337
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
353
+ elsif !attributes[attribute_map[key]].nil?
354
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
338
355
  end
339
356
  end
340
-
341
- self
357
+ new(transformed_hash)
342
358
  end
343
359
 
344
360
  # Deserializes the data based on type
345
361
  # @param string type Data type
346
362
  # @param string value Value to be deserialized
347
363
  # @return [Object] Deserialized data
348
- def _deserialize(type, value)
364
+ def self._deserialize(type, value)
349
365
  case type.to_sym
350
366
  when :Time
351
367
  Time.parse(value)
@@ -380,7 +396,7 @@ module BmcApi
380
396
  else # model
381
397
  # models (e.g. Pet) or oneOf
382
398
  klass = BmcApi.const_get(type)
383
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
399
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
384
400
  end
385
401
  end
386
402
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.1
7
7
  Contact: support@phoenixnap.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.1.0
9
+ OpenAPI Generator version: 7.2.0
10
10
 
11
11
  =end
12
12
 
@@ -66,6 +66,8 @@ module BmcApi
66
66
 
67
67
  if attributes.key?(:'id')
68
68
  self.id = attributes[:'id']
69
+ else
70
+ self.id = nil
69
71
  end
70
72
 
71
73
  if attributes.key?(:'vlan_id')
@@ -76,6 +78,7 @@ module BmcApi
76
78
  # Show invalid properties with the reasons. Usually used together with valid?
77
79
  # @return Array for valid properties with the reasons
78
80
  def list_invalid_properties
81
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
82
  invalid_properties = Array.new
80
83
  if @id.nil?
81
84
  invalid_properties.push('invalid value for "id", id cannot be nil.')
@@ -87,6 +90,7 @@ module BmcApi
87
90
  # Check to see if the all the properties in the model are valid
88
91
  # @return true if the model is valid
89
92
  def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
90
94
  return false if @id.nil?
91
95
  true
92
96
  end
@@ -116,37 +120,30 @@ module BmcApi
116
120
  # @param [Hash] attributes Model attributes in the form of hash
117
121
  # @return [Object] Returns the model itself
118
122
  def self.build_from_hash(attributes)
119
- new.build_from_hash(attributes)
120
- end
121
-
122
- # Builds the object from hash
123
- # @param [Hash] attributes Model attributes in the form of hash
124
- # @return [Object] Returns the model itself
125
- def build_from_hash(attributes)
126
123
  return nil unless attributes.is_a?(Hash)
127
124
  attributes = attributes.transform_keys(&:to_sym)
128
- self.class.openapi_types.each_pair do |key, type|
129
- if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
130
- self.send("#{key}=", nil)
125
+ transformed_hash = {}
126
+ openapi_types.each_pair do |key, type|
127
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
128
+ transformed_hash["#{key}"] = nil
131
129
  elsif type =~ /\AArray<(.*)>/i
132
130
  # check to ensure the input is an array given that the attribute
133
131
  # is documented as an array but the input is not
134
- if attributes[self.class.attribute_map[key]].is_a?(Array)
135
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
136
134
  end
137
- elsif !attributes[self.class.attribute_map[key]].nil?
138
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
139
137
  end
140
138
  end
141
-
142
- self
139
+ new(transformed_hash)
143
140
  end
144
141
 
145
142
  # Deserializes the data based on type
146
143
  # @param string type Data type
147
144
  # @param string value Value to be deserialized
148
145
  # @return [Object] Deserialized data
149
- def _deserialize(type, value)
146
+ def self._deserialize(type, value)
150
147
  case type.to_sym
151
148
  when :Time
152
149
  Time.parse(value)
@@ -181,7 +178,7 @@ module BmcApi
181
178
  else # model
182
179
  # models (e.g. Pet) or oneOf
183
180
  klass = BmcApi.const_get(type)
184
- klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
185
182
  end
186
183
  end
187
184