pnap_bmc_api 1.5.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.
- checksums.yaml +4 -4
- data/README.md +5 -1
- data/VERSION +1 -1
- data/docs/DeleteResult.md +1 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/QuotasApi.md +6 -8
- data/docs/SSHKeysApi.md +12 -16
- data/docs/Server.md +11 -7
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerNetworkUpdate.md +2 -2
- data/docs/ServerPrivateNetwork.md +3 -3
- data/docs/ServerProvision.md +38 -0
- data/docs/ServerPublicNetwork.md +2 -2
- data/docs/ServersApi.md +173 -111
- data/docs/StorageConfigurationRootPartition.md +2 -2
- data/lib/pnap_bmc_api/api/quotas_api.rb +11 -7
- data/lib/pnap_bmc_api/api/servers_api.rb +200 -75
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +21 -13
- data/lib/pnap_bmc_api/api_client.rb +24 -21
- data/lib/pnap_bmc_api/api_error.rb +2 -1
- data/lib/pnap_bmc_api/configuration.rb +28 -9
- data/lib/pnap_bmc_api/models/action_result.rb +16 -19
- data/lib/pnap_bmc_api/models/delete_result.rb +18 -19
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +18 -19
- data/lib/pnap_bmc_api/models/error.rb +16 -19
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +19 -20
- data/lib/pnap_bmc_api/models/network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +15 -20
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +19 -20
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +14 -19
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +25 -22
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +19 -20
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/quota.rb +30 -19
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +39 -19
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +42 -21
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +14 -19
- data/lib/pnap_bmc_api/models/reset_result.rb +16 -19
- data/lib/pnap_bmc_api/models/server.rb +79 -33
- data/lib/pnap_bmc_api/models/server_create.rb +29 -22
- data/lib/pnap_bmc_api/models/server_ip_block.rb +16 -19
- data/lib/pnap_bmc_api/models/server_network_update.rb +15 -20
- data/lib/pnap_bmc_api/models/server_patch.rb +27 -24
- data/lib/pnap_bmc_api/models/server_private_network.rb +23 -22
- data/lib/pnap_bmc_api/models/server_provision.rb +395 -0
- data/lib/pnap_bmc_api/models/server_public_network.rb +17 -20
- data/lib/pnap_bmc_api/models/server_reserve.rb +16 -19
- data/lib/pnap_bmc_api/models/server_reset.rb +14 -19
- data/lib/pnap_bmc_api/models/ssh_key.rb +28 -19
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +52 -19
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +29 -19
- data/lib/pnap_bmc_api/models/storage_configuration.rb +14 -19
- data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +14 -19
- data/lib/pnap_bmc_api/models/tag_assignment.rb +20 -19
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +16 -19
- data/lib/pnap_bmc_api/version.rb +1 -1
- data/lib/pnap_bmc_api.rb +2 -2
- data/pnap_bmc_api.gemspec +2 -2
- data/spec/api/quotas_api_spec.rb +6 -6
- data/spec/api/servers_api_spec.rb +109 -36
- data/spec/api/ssh_keys_api_spec.rb +9 -9
- data/spec/models/action_result_spec.rb +6 -4
- data/spec/models/delete_result_spec.rb +7 -5
- data/spec/models/delete_ssh_key_result_spec.rb +7 -5
- data/spec/models/error_spec.rb +7 -5
- data/spec/models/ip_blocks_configuration_spec.rb +7 -5
- data/spec/models/network_configuration_spec.rb +19 -5
- data/spec/models/os_configuration_cloud_init_spec.rb +5 -3
- data/spec/models/os_configuration_map_esxi_spec.rb +8 -6
- data/spec/models/os_configuration_map_proxmox_spec.rb +8 -6
- data/spec/models/os_configuration_map_spec.rb +8 -6
- data/spec/models/os_configuration_netris_controller_spec.rb +7 -5
- data/spec/models/os_configuration_netris_softgate_spec.rb +8 -6
- data/spec/models/os_configuration_spec.rb +33 -7
- data/spec/models/os_configuration_windows_spec.rb +6 -4
- data/spec/models/private_network_configuration_spec.rb +8 -6
- data/spec/models/public_network_configuration_spec.rb +6 -4
- data/spec/models/quota_edit_limit_request_details_spec.rb +8 -6
- data/spec/models/quota_edit_limit_request_spec.rb +7 -5
- data/spec/models/quota_spec.rb +13 -15
- data/spec/models/relinquish_ip_block_spec.rb +6 -4
- data/spec/models/reset_result_spec.rb +8 -6
- data/spec/models/server_create_spec.rb +25 -17
- data/spec/models/server_ip_block_spec.rb +7 -5
- data/spec/models/server_network_update_spec.rb +5 -3
- data/spec/models/server_patch_spec.rb +7 -5
- data/spec/models/server_private_network_spec.rb +9 -7
- data/spec/models/server_provision_spec.rb +96 -0
- data/spec/models/server_public_network_spec.rb +8 -6
- data/spec/models/server_reserve_spec.rb +6 -4
- data/spec/models/server_reset_spec.rb +9 -7
- data/spec/models/server_spec.rb +47 -27
- data/spec/models/ssh_key_create_spec.rb +8 -6
- data/spec/models/ssh_key_spec.rb +12 -10
- data/spec/models/ssh_key_update_spec.rb +7 -5
- data/spec/models/storage_configuration_root_partition_spec.rb +6 -4
- data/spec/models/storage_configuration_spec.rb +5 -3
- data/spec/models/tag_assignment_request_spec.rb +7 -5
- data/spec/models/tag_assignment_spec.rb +10 -8
- data/spec/spec_helper.rb +1 -1
- metadata +38 -42
- data/docs/QuotaEditLimitRequestDetailsAllOf.md +0 -18
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details_all_of.rb +0 -226
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- 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:
|
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`, `esxi/esxi80`, `debian/bullseye`, `proxmox/bullseye`, `netris/controller`, `netris/softgate_1g` or `netris/
|
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.
|
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`.
|
@@ -88,6 +88,12 @@ module BmcApi
|
|
88
88
|
|
89
89
|
attr_accessor :storage_configuration
|
90
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
|
+
|
91
97
|
# Attribute mapping from ruby-style variable name to JSON key.
|
92
98
|
def self.attribute_map
|
93
99
|
{
|
@@ -115,7 +121,9 @@ module BmcApi
|
|
115
121
|
:'provisioned_on' => :'provisionedOn',
|
116
122
|
:'os_configuration' => :'osConfiguration',
|
117
123
|
:'network_configuration' => :'networkConfiguration',
|
118
|
-
:'storage_configuration' => :'storageConfiguration'
|
124
|
+
:'storage_configuration' => :'storageConfiguration',
|
125
|
+
:'superseded_by' => :'supersededBy',
|
126
|
+
:'supersedes' => :'supersedes'
|
119
127
|
}
|
120
128
|
end
|
121
129
|
|
@@ -151,7 +159,9 @@ module BmcApi
|
|
151
159
|
:'provisioned_on' => :'Time',
|
152
160
|
:'os_configuration' => :'OsConfiguration',
|
153
161
|
:'network_configuration' => :'NetworkConfiguration',
|
154
|
-
:'storage_configuration' => :'StorageConfiguration'
|
162
|
+
:'storage_configuration' => :'StorageConfiguration',
|
163
|
+
:'superseded_by' => :'String',
|
164
|
+
:'supersedes' => :'String'
|
155
165
|
}
|
156
166
|
end
|
157
167
|
|
@@ -178,14 +188,20 @@ module BmcApi
|
|
178
188
|
|
179
189
|
if attributes.key?(:'id')
|
180
190
|
self.id = attributes[:'id']
|
191
|
+
else
|
192
|
+
self.id = nil
|
181
193
|
end
|
182
194
|
|
183
195
|
if attributes.key?(:'status')
|
184
196
|
self.status = attributes[:'status']
|
197
|
+
else
|
198
|
+
self.status = nil
|
185
199
|
end
|
186
200
|
|
187
201
|
if attributes.key?(:'hostname')
|
188
202
|
self.hostname = attributes[:'hostname']
|
203
|
+
else
|
204
|
+
self.hostname = nil
|
189
205
|
end
|
190
206
|
|
191
207
|
if attributes.key?(:'description')
|
@@ -198,40 +214,58 @@ module BmcApi
|
|
198
214
|
|
199
215
|
if attributes.key?(:'type')
|
200
216
|
self.type = attributes[:'type']
|
217
|
+
else
|
218
|
+
self.type = nil
|
201
219
|
end
|
202
220
|
|
203
221
|
if attributes.key?(:'location')
|
204
222
|
self.location = attributes[:'location']
|
223
|
+
else
|
224
|
+
self.location = nil
|
205
225
|
end
|
206
226
|
|
207
227
|
if attributes.key?(:'cpu')
|
208
228
|
self.cpu = attributes[:'cpu']
|
229
|
+
else
|
230
|
+
self.cpu = nil
|
209
231
|
end
|
210
232
|
|
211
233
|
if attributes.key?(:'cpu_count')
|
212
234
|
self.cpu_count = attributes[:'cpu_count']
|
235
|
+
else
|
236
|
+
self.cpu_count = nil
|
213
237
|
end
|
214
238
|
|
215
239
|
if attributes.key?(:'cores_per_cpu')
|
216
240
|
self.cores_per_cpu = attributes[:'cores_per_cpu']
|
241
|
+
else
|
242
|
+
self.cores_per_cpu = nil
|
217
243
|
end
|
218
244
|
|
219
245
|
if attributes.key?(:'cpu_frequency')
|
220
246
|
self.cpu_frequency = attributes[:'cpu_frequency']
|
247
|
+
else
|
248
|
+
self.cpu_frequency = nil
|
221
249
|
end
|
222
250
|
|
223
251
|
if attributes.key?(:'ram')
|
224
252
|
self.ram = attributes[:'ram']
|
253
|
+
else
|
254
|
+
self.ram = nil
|
225
255
|
end
|
226
256
|
|
227
257
|
if attributes.key?(:'storage')
|
228
258
|
self.storage = attributes[:'storage']
|
259
|
+
else
|
260
|
+
self.storage = nil
|
229
261
|
end
|
230
262
|
|
231
263
|
if attributes.key?(:'private_ip_addresses')
|
232
264
|
if (value = attributes[:'private_ip_addresses']).is_a?(Array)
|
233
265
|
self.private_ip_addresses = value
|
234
266
|
end
|
267
|
+
else
|
268
|
+
self.private_ip_addresses = nil
|
235
269
|
end
|
236
270
|
|
237
271
|
if attributes.key?(:'public_ip_addresses')
|
@@ -280,16 +314,29 @@ module BmcApi
|
|
280
314
|
|
281
315
|
if attributes.key?(:'network_configuration')
|
282
316
|
self.network_configuration = attributes[:'network_configuration']
|
317
|
+
else
|
318
|
+
self.network_configuration = nil
|
283
319
|
end
|
284
320
|
|
285
321
|
if attributes.key?(:'storage_configuration')
|
286
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']
|
287
333
|
end
|
288
334
|
end
|
289
335
|
|
290
336
|
# Show invalid properties with the reasons. Usually used together with valid?
|
291
337
|
# @return Array for valid properties with the reasons
|
292
338
|
def list_invalid_properties
|
339
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
293
340
|
invalid_properties = Array.new
|
294
341
|
if @id.nil?
|
295
342
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
@@ -320,10 +367,6 @@ module BmcApi
|
|
320
367
|
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
|
321
368
|
end
|
322
369
|
|
323
|
-
if @os.nil?
|
324
|
-
invalid_properties.push('invalid value for "os", os cannot be nil.')
|
325
|
-
end
|
326
|
-
|
327
370
|
if @type.nil?
|
328
371
|
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
329
372
|
end
|
@@ -398,6 +441,7 @@ module BmcApi
|
|
398
441
|
# Check to see if the all the properties in the model are valid
|
399
442
|
# @return true if the model is valid
|
400
443
|
def valid?
|
444
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
401
445
|
return false if @id.nil?
|
402
446
|
return false if @status.nil?
|
403
447
|
return false if @hostname.nil?
|
@@ -405,7 +449,6 @@ module BmcApi
|
|
405
449
|
return false if @hostname.to_s.length < 1
|
406
450
|
return false if @hostname !~ Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
|
407
451
|
return false if !@description.nil? && @description.to_s.length > 250
|
408
|
-
return false if @os.nil?
|
409
452
|
return false if @type.nil?
|
410
453
|
return false if @location.nil?
|
411
454
|
return false if @cpu.nil?
|
@@ -452,7 +495,11 @@ module BmcApi
|
|
452
495
|
# Custom attribute writer method with validation
|
453
496
|
# @param [Object] description Value to be assigned
|
454
497
|
def description=(description)
|
455
|
-
if
|
498
|
+
if description.nil?
|
499
|
+
fail ArgumentError, 'description cannot be nil'
|
500
|
+
end
|
501
|
+
|
502
|
+
if description.to_s.length > 250
|
456
503
|
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
457
504
|
end
|
458
505
|
|
@@ -518,7 +565,11 @@ module BmcApi
|
|
518
565
|
# Custom attribute writer method with validation
|
519
566
|
# @param [Object] public_ip_addresses Value to be assigned
|
520
567
|
def public_ip_addresses=(public_ip_addresses)
|
521
|
-
if
|
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
|
522
573
|
fail ArgumentError, 'invalid value for "public_ip_addresses", number of items must be greater than or equal to 0.'
|
523
574
|
end
|
524
575
|
|
@@ -554,7 +605,9 @@ module BmcApi
|
|
554
605
|
provisioned_on == o.provisioned_on &&
|
555
606
|
os_configuration == o.os_configuration &&
|
556
607
|
network_configuration == o.network_configuration &&
|
557
|
-
storage_configuration == o.storage_configuration
|
608
|
+
storage_configuration == o.storage_configuration &&
|
609
|
+
superseded_by == o.superseded_by &&
|
610
|
+
supersedes == o.supersedes
|
558
611
|
end
|
559
612
|
|
560
613
|
# @see the `==` method
|
@@ -566,44 +619,37 @@ module BmcApi
|
|
566
619
|
# Calculates hash code according to all attributes.
|
567
620
|
# @return [Integer] Hash code
|
568
621
|
def hash
|
569
|
-
[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].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
|
570
623
|
end
|
571
624
|
|
572
625
|
# Builds the object from hash
|
573
626
|
# @param [Hash] attributes Model attributes in the form of hash
|
574
627
|
# @return [Object] Returns the model itself
|
575
628
|
def self.build_from_hash(attributes)
|
576
|
-
new.build_from_hash(attributes)
|
577
|
-
end
|
578
|
-
|
579
|
-
# Builds the object from hash
|
580
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
581
|
-
# @return [Object] Returns the model itself
|
582
|
-
def build_from_hash(attributes)
|
583
629
|
return nil unless attributes.is_a?(Hash)
|
584
630
|
attributes = attributes.transform_keys(&:to_sym)
|
585
|
-
|
586
|
-
|
587
|
-
|
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
|
588
635
|
elsif type =~ /\AArray<(.*)>/i
|
589
636
|
# check to ensure the input is an array given that the attribute
|
590
637
|
# is documented as an array but the input is not
|
591
|
-
if attributes[
|
592
|
-
|
638
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
639
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
593
640
|
end
|
594
|
-
elsif !attributes[
|
595
|
-
|
641
|
+
elsif !attributes[attribute_map[key]].nil?
|
642
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
596
643
|
end
|
597
644
|
end
|
598
|
-
|
599
|
-
self
|
645
|
+
new(transformed_hash)
|
600
646
|
end
|
601
647
|
|
602
648
|
# Deserializes the data based on type
|
603
649
|
# @param string type Data type
|
604
650
|
# @param string value Value to be deserialized
|
605
651
|
# @return [Object] Deserialized data
|
606
|
-
def _deserialize(type, value)
|
652
|
+
def self._deserialize(type, value)
|
607
653
|
case type.to_sym
|
608
654
|
when :Time
|
609
655
|
Time.parse(value)
|
@@ -638,7 +684,7 @@ module BmcApi
|
|
638
684
|
else # model
|
639
685
|
# models (e.g. Pet) or oneOf
|
640
686
|
klass = BmcApi.const_get(type)
|
641
|
-
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)
|
642
688
|
end
|
643
689
|
end
|
644
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:
|
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`, `esxi/esxi80`, `debian/bullseye`, `proxmox/bullseye`, `netris/controller`, `netris/softgate_1g` or `netris/
|
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.
|
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`.
|
@@ -128,6 +128,8 @@ module BmcApi
|
|
128
128
|
|
129
129
|
if attributes.key?(:'hostname')
|
130
130
|
self.hostname = attributes[:'hostname']
|
131
|
+
else
|
132
|
+
self.hostname = nil
|
131
133
|
end
|
132
134
|
|
133
135
|
if attributes.key?(:'description')
|
@@ -136,14 +138,20 @@ module BmcApi
|
|
136
138
|
|
137
139
|
if attributes.key?(:'os')
|
138
140
|
self.os = attributes[:'os']
|
141
|
+
else
|
142
|
+
self.os = nil
|
139
143
|
end
|
140
144
|
|
141
145
|
if attributes.key?(:'type')
|
142
146
|
self.type = attributes[:'type']
|
147
|
+
else
|
148
|
+
self.type = nil
|
143
149
|
end
|
144
150
|
|
145
151
|
if attributes.key?(:'location')
|
146
152
|
self.location = attributes[:'location']
|
153
|
+
else
|
154
|
+
self.location = nil
|
147
155
|
end
|
148
156
|
|
149
157
|
if attributes.key?(:'install_default_ssh_keys')
|
@@ -202,6 +210,7 @@ module BmcApi
|
|
202
210
|
# Show invalid properties with the reasons. Usually used together with valid?
|
203
211
|
# @return Array for valid properties with the reasons
|
204
212
|
def list_invalid_properties
|
213
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
205
214
|
invalid_properties = Array.new
|
206
215
|
if @hostname.nil?
|
207
216
|
invalid_properties.push('invalid value for "hostname", hostname cannot be nil.')
|
@@ -242,6 +251,7 @@ module BmcApi
|
|
242
251
|
# Check to see if the all the properties in the model are valid
|
243
252
|
# @return true if the model is valid
|
244
253
|
def valid?
|
254
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
245
255
|
return false if @hostname.nil?
|
246
256
|
return false if @hostname.to_s.length > 100
|
247
257
|
return false if @hostname.to_s.length < 1
|
@@ -279,7 +289,11 @@ module BmcApi
|
|
279
289
|
# Custom attribute writer method with validation
|
280
290
|
# @param [Object] description Value to be assigned
|
281
291
|
def description=(description)
|
282
|
-
if
|
292
|
+
if description.nil?
|
293
|
+
fail ArgumentError, 'description cannot be nil'
|
294
|
+
end
|
295
|
+
|
296
|
+
if description.to_s.length > 250
|
283
297
|
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
284
298
|
end
|
285
299
|
|
@@ -324,37 +338,30 @@ module BmcApi
|
|
324
338
|
# @param [Hash] attributes Model attributes in the form of hash
|
325
339
|
# @return [Object] Returns the model itself
|
326
340
|
def self.build_from_hash(attributes)
|
327
|
-
new.build_from_hash(attributes)
|
328
|
-
end
|
329
|
-
|
330
|
-
# Builds the object from hash
|
331
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
332
|
-
# @return [Object] Returns the model itself
|
333
|
-
def build_from_hash(attributes)
|
334
341
|
return nil unless attributes.is_a?(Hash)
|
335
342
|
attributes = attributes.transform_keys(&:to_sym)
|
336
|
-
|
337
|
-
|
338
|
-
|
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
|
339
347
|
elsif type =~ /\AArray<(.*)>/i
|
340
348
|
# check to ensure the input is an array given that the attribute
|
341
349
|
# is documented as an array but the input is not
|
342
|
-
if attributes[
|
343
|
-
|
350
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
351
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
344
352
|
end
|
345
|
-
elsif !attributes[
|
346
|
-
|
353
|
+
elsif !attributes[attribute_map[key]].nil?
|
354
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
347
355
|
end
|
348
356
|
end
|
349
|
-
|
350
|
-
self
|
357
|
+
new(transformed_hash)
|
351
358
|
end
|
352
359
|
|
353
360
|
# Deserializes the data based on type
|
354
361
|
# @param string type Data type
|
355
362
|
# @param string value Value to be deserialized
|
356
363
|
# @return [Object] Deserialized data
|
357
|
-
def _deserialize(type, value)
|
364
|
+
def self._deserialize(type, value)
|
358
365
|
case type.to_sym
|
359
366
|
when :Time
|
360
367
|
Time.parse(value)
|
@@ -389,7 +396,7 @@ module BmcApi
|
|
389
396
|
else # model
|
390
397
|
# models (e.g. Pet) or oneOf
|
391
398
|
klass = BmcApi.const_get(type)
|
392
|
-
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)
|
393
400
|
end
|
394
401
|
end
|
395
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:
|
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
|
-
|
129
|
-
|
130
|
-
|
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[
|
135
|
-
|
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[
|
138
|
-
|
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
|
|
@@ -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:
|
9
|
+
OpenAPI Generator version: 7.2.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module BmcApi
|
17
17
|
# Update network details of bare metal server.
|
18
18
|
class ServerNetworkUpdate
|
19
|
-
# List of IPs to be associated to the server.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul>
|
19
|
+
# List of IPs to be associated to the server.<br> Valid IP formats are single IPv4 addresses or IPv4 ranges. IPs must be within the network's range.<br> Setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. <li> Assign one or more IP addresses which are already configured on other resource(s) in network. <li> Assign IP addresses which are considered as reserved in network.</ul>
|
20
20
|
attr_accessor :ips
|
21
21
|
|
22
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -69,6 +69,7 @@ module BmcApi
|
|
69
69
|
# Show invalid properties with the reasons. Usually used together with valid?
|
70
70
|
# @return Array for valid properties with the reasons
|
71
71
|
def list_invalid_properties
|
72
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
72
73
|
invalid_properties = Array.new
|
73
74
|
invalid_properties
|
74
75
|
end
|
@@ -76,6 +77,7 @@ module BmcApi
|
|
76
77
|
# Check to see if the all the properties in the model are valid
|
77
78
|
# @return true if the model is valid
|
78
79
|
def valid?
|
80
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
79
81
|
true
|
80
82
|
end
|
81
83
|
|
@@ -103,37 +105,30 @@ module BmcApi
|
|
103
105
|
# @param [Hash] attributes Model attributes in the form of hash
|
104
106
|
# @return [Object] Returns the model itself
|
105
107
|
def self.build_from_hash(attributes)
|
106
|
-
new.build_from_hash(attributes)
|
107
|
-
end
|
108
|
-
|
109
|
-
# Builds the object from hash
|
110
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
-
# @return [Object] Returns the model itself
|
112
|
-
def build_from_hash(attributes)
|
113
108
|
return nil unless attributes.is_a?(Hash)
|
114
109
|
attributes = attributes.transform_keys(&:to_sym)
|
115
|
-
|
116
|
-
|
117
|
-
|
110
|
+
transformed_hash = {}
|
111
|
+
openapi_types.each_pair do |key, type|
|
112
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
113
|
+
transformed_hash["#{key}"] = nil
|
118
114
|
elsif type =~ /\AArray<(.*)>/i
|
119
115
|
# check to ensure the input is an array given that the attribute
|
120
116
|
# is documented as an array but the input is not
|
121
|
-
if attributes[
|
122
|
-
|
117
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
118
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
123
119
|
end
|
124
|
-
elsif !attributes[
|
125
|
-
|
120
|
+
elsif !attributes[attribute_map[key]].nil?
|
121
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
126
122
|
end
|
127
123
|
end
|
128
|
-
|
129
|
-
self
|
124
|
+
new(transformed_hash)
|
130
125
|
end
|
131
126
|
|
132
127
|
# Deserializes the data based on type
|
133
128
|
# @param string type Data type
|
134
129
|
# @param string value Value to be deserialized
|
135
130
|
# @return [Object] Deserialized data
|
136
|
-
def _deserialize(type, value)
|
131
|
+
def self._deserialize(type, value)
|
137
132
|
case type.to_sym
|
138
133
|
when :Time
|
139
134
|
Time.parse(value)
|
@@ -168,7 +163,7 @@ module BmcApi
|
|
168
163
|
else # model
|
169
164
|
# models (e.g. Pet) or oneOf
|
170
165
|
klass = BmcApi.const_get(type)
|
171
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
166
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
167
|
end
|
173
168
|
end
|
174
169
|
|