pnap_bmc_api 2.2.2 → 2.4.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 +6 -0
- data/VERSION +1 -1
- data/docs/IpBlocksConfiguration.md +1 -1
- data/docs/OsConfiguration.md +3 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/OsConfigurationIPXE.md +20 -0
- data/docs/OsConfigurationIPXENativeVlanConfiguration.md +22 -0
- data/docs/OsConfigurationWindows.md +3 -1
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/PublicNetworkConfiguration.md +1 -1
- data/docs/RebootRequest.md +20 -0
- data/docs/ReservationTransferDetails.md +18 -0
- data/docs/Server.md +4 -4
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerNetworkUpdate.md +1 -1
- data/docs/ServerPrivateNetwork.md +3 -1
- data/docs/ServerProvision.md +1 -1
- data/docs/ServerPublicNetwork.md +5 -3
- data/docs/ServersApi.md +157 -7
- data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
- data/lib/pnap_bmc_api/api/servers_api.rb +182 -24
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +6 -6
- data/lib/pnap_bmc_api/api_client.rb +17 -14
- data/lib/pnap_bmc_api/api_error.rb +1 -1
- data/lib/pnap_bmc_api/api_model_base.rb +88 -0
- data/lib/pnap_bmc_api/configuration.rb +11 -1
- data/lib/pnap_bmc_api/models/action_result.rb +21 -78
- data/lib/pnap_bmc_api/models/delete_result.rb +31 -78
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +31 -78
- data/lib/pnap_bmc_api/models/error.rb +21 -78
- data/lib/pnap_bmc_api/models/esxi_datastore_configuration.rb +13 -80
- data/lib/pnap_bmc_api/models/esxi_os_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/gpu_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/network_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration.rb +24 -82
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_ipxe.rb +186 -0
- data/lib/pnap_bmc_api/models/os_configuration_ipxe_native_vlan_configuration.rb +224 -0
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +27 -82
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +12 -79
- data/lib/pnap_bmc_api/models/quota.rb +61 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +14 -81
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +25 -86
- data/lib/pnap_bmc_api/models/reboot_request.rb +212 -0
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +11 -78
- data/lib/pnap_bmc_api/models/reservation_transfer_details.rb +166 -0
- data/lib/pnap_bmc_api/models/reset_result.rb +21 -78
- data/lib/pnap_bmc_api/models/server.rb +117 -84
- data/lib/pnap_bmc_api/models/server_create.rb +46 -83
- data/lib/pnap_bmc_api/models/server_ip_block.rb +21 -78
- data/lib/pnap_bmc_api/models/server_network_update.rb +12 -79
- data/lib/pnap_bmc_api/models/server_patch.rb +13 -80
- data/lib/pnap_bmc_api/models/server_private_network.rb +35 -82
- data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
- data/lib/pnap_bmc_api/models/server_public_network.rb +53 -83
- data/lib/pnap_bmc_api/models/server_reserve.rb +21 -78
- data/lib/pnap_bmc_api/models/server_reset.rb +11 -78
- data/lib/pnap_bmc_api/models/ssh_key.rb +81 -78
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +23 -80
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +23 -80
- data/lib/pnap_bmc_api/models/storage_configuration.rb +11 -78
- data/lib/pnap_bmc_api/models/storage_configuration_root_partition.rb +11 -78
- data/lib/pnap_bmc_api/models/tag_assignment.rb +41 -78
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +21 -78
- data/lib/pnap_bmc_api/version.rb +1 -2
- data/lib/pnap_bmc_api.rb +6 -1
- data/pnap_bmc_api.gemspec +6 -6
- data/spec/api/quotas_api_spec.rb +1 -1
- data/spec/api/servers_api_spec.rb +29 -1
- data/spec/api/ssh_keys_api_spec.rb +1 -1
- data/spec/models/action_result_spec.rb +2 -2
- data/spec/models/delete_result_spec.rb +2 -2
- data/spec/models/delete_ssh_key_result_spec.rb +2 -2
- data/spec/models/error_spec.rb +2 -2
- data/spec/models/esxi_datastore_configuration_spec.rb +2 -2
- data/spec/models/esxi_os_configuration_spec.rb +2 -2
- data/spec/models/gpu_configuration_spec.rb +2 -2
- data/spec/models/ip_blocks_configuration_spec.rb +2 -2
- data/spec/models/network_configuration_spec.rb +2 -2
- data/spec/models/os_configuration_cloud_init_spec.rb +2 -2
- data/spec/models/os_configuration_ipxe_native_vlan_configuration_spec.rb +52 -0
- data/spec/models/os_configuration_ipxe_spec.rb +42 -0
- data/spec/models/os_configuration_map_esxi_spec.rb +2 -2
- data/spec/models/os_configuration_map_proxmox_spec.rb +2 -2
- data/spec/models/os_configuration_map_spec.rb +2 -2
- data/spec/models/os_configuration_netris_controller_spec.rb +2 -2
- data/spec/models/os_configuration_netris_softgate_spec.rb +2 -2
- data/spec/models/os_configuration_spec.rb +8 -2
- data/spec/models/os_configuration_windows_spec.rb +8 -2
- data/spec/models/private_network_configuration_spec.rb +2 -2
- data/spec/models/public_network_configuration_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_details_spec.rb +2 -2
- data/spec/models/quota_edit_limit_request_spec.rb +2 -2
- data/spec/models/quota_spec.rb +2 -2
- data/spec/models/reboot_request_spec.rb +46 -0
- data/spec/models/relinquish_ip_block_spec.rb +2 -2
- data/spec/models/reservation_transfer_details_spec.rb +36 -0
- data/spec/models/reset_result_spec.rb +2 -2
- data/spec/models/server_create_spec.rb +2 -2
- data/spec/models/server_ip_block_spec.rb +2 -2
- data/spec/models/server_network_update_spec.rb +2 -2
- data/spec/models/server_patch_spec.rb +2 -2
- data/spec/models/server_private_network_spec.rb +8 -2
- data/spec/models/server_provision_spec.rb +2 -2
- data/spec/models/server_public_network_spec.rb +8 -2
- data/spec/models/server_reserve_spec.rb +2 -2
- data/spec/models/server_reset_spec.rb +2 -2
- data/spec/models/server_spec.rb +2 -2
- data/spec/models/ssh_key_create_spec.rb +2 -2
- data/spec/models/ssh_key_spec.rb +2 -2
- data/spec/models/ssh_key_update_spec.rb +2 -2
- data/spec/models/storage_configuration_root_partition_spec.rb +2 -2
- data/spec/models/storage_configuration_spec.rb +2 -2
- data/spec/models/tag_assignment_request_spec.rb +2 -2
- data/spec/models/tag_assignment_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- metadata +60 -39
|
@@ -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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# SSH Key.
|
|
18
|
-
class SshKey
|
|
18
|
+
class SshKey < ApiModelBase
|
|
19
19
|
# The unique identifier of the SSH Key.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
@@ -50,9 +50,14 @@ module BmcApi
|
|
|
50
50
|
}
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
+
# Returns attribute mapping this model knows about
|
|
54
|
+
def self.acceptable_attribute_map
|
|
55
|
+
attribute_map
|
|
56
|
+
end
|
|
57
|
+
|
|
53
58
|
# Returns all the JSON keys this model knows about
|
|
54
59
|
def self.acceptable_attributes
|
|
55
|
-
|
|
60
|
+
acceptable_attribute_map.values
|
|
56
61
|
end
|
|
57
62
|
|
|
58
63
|
# Attribute type mapping.
|
|
@@ -82,9 +87,10 @@ module BmcApi
|
|
|
82
87
|
end
|
|
83
88
|
|
|
84
89
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
90
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
85
91
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
86
|
-
if (!
|
|
87
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKey`. Please check the name to make sure it's valid. List of attributes: " +
|
|
92
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
93
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
88
94
|
end
|
|
89
95
|
h[k.to_sym] = v
|
|
90
96
|
}
|
|
@@ -182,6 +188,76 @@ module BmcApi
|
|
|
182
188
|
true
|
|
183
189
|
end
|
|
184
190
|
|
|
191
|
+
# Custom attribute writer method with validation
|
|
192
|
+
# @param [Object] id Value to be assigned
|
|
193
|
+
def id=(id)
|
|
194
|
+
if id.nil?
|
|
195
|
+
fail ArgumentError, 'id cannot be nil'
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
@id = id
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Custom attribute writer method with validation
|
|
202
|
+
# @param [Object] default Value to be assigned
|
|
203
|
+
def default=(default)
|
|
204
|
+
if default.nil?
|
|
205
|
+
fail ArgumentError, 'default cannot be nil'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@default = default
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Custom attribute writer method with validation
|
|
212
|
+
# @param [Object] name Value to be assigned
|
|
213
|
+
def name=(name)
|
|
214
|
+
if name.nil?
|
|
215
|
+
fail ArgumentError, 'name cannot be nil'
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@name = name
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] key Value to be assigned
|
|
223
|
+
def key=(key)
|
|
224
|
+
if key.nil?
|
|
225
|
+
fail ArgumentError, 'key cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
@key = key
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
# Custom attribute writer method with validation
|
|
232
|
+
# @param [Object] fingerprint Value to be assigned
|
|
233
|
+
def fingerprint=(fingerprint)
|
|
234
|
+
if fingerprint.nil?
|
|
235
|
+
fail ArgumentError, 'fingerprint cannot be nil'
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
@fingerprint = fingerprint
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Custom attribute writer method with validation
|
|
242
|
+
# @param [Object] created_on Value to be assigned
|
|
243
|
+
def created_on=(created_on)
|
|
244
|
+
if created_on.nil?
|
|
245
|
+
fail ArgumentError, 'created_on cannot be nil'
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
@created_on = created_on
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
# Custom attribute writer method with validation
|
|
252
|
+
# @param [Object] last_updated_on Value to be assigned
|
|
253
|
+
def last_updated_on=(last_updated_on)
|
|
254
|
+
if last_updated_on.nil?
|
|
255
|
+
fail ArgumentError, 'last_updated_on cannot be nil'
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
@last_updated_on = last_updated_on
|
|
259
|
+
end
|
|
260
|
+
|
|
185
261
|
# Checks equality by comparing each attribute.
|
|
186
262
|
# @param [Object] Object to be compared
|
|
187
263
|
def ==(o)
|
|
@@ -231,61 +307,6 @@ module BmcApi
|
|
|
231
307
|
new(transformed_hash)
|
|
232
308
|
end
|
|
233
309
|
|
|
234
|
-
# Deserializes the data based on type
|
|
235
|
-
# @param string type Data type
|
|
236
|
-
# @param string value Value to be deserialized
|
|
237
|
-
# @return [Object] Deserialized data
|
|
238
|
-
def self._deserialize(type, value)
|
|
239
|
-
case type.to_sym
|
|
240
|
-
when :Time
|
|
241
|
-
Time.parse(value)
|
|
242
|
-
when :Date
|
|
243
|
-
Date.parse(value)
|
|
244
|
-
when :String
|
|
245
|
-
value.to_s
|
|
246
|
-
when :Integer
|
|
247
|
-
value.to_i
|
|
248
|
-
when :Float
|
|
249
|
-
value.to_f
|
|
250
|
-
when :Boolean
|
|
251
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
252
|
-
true
|
|
253
|
-
else
|
|
254
|
-
false
|
|
255
|
-
end
|
|
256
|
-
when :Object
|
|
257
|
-
# generic object (usually a Hash), return directly
|
|
258
|
-
value
|
|
259
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
260
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
261
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
262
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
263
|
-
k_type = Regexp.last_match[:k_type]
|
|
264
|
-
v_type = Regexp.last_match[:v_type]
|
|
265
|
-
{}.tap do |hash|
|
|
266
|
-
value.each do |k, v|
|
|
267
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
268
|
-
end
|
|
269
|
-
end
|
|
270
|
-
else # model
|
|
271
|
-
# models (e.g. Pet) or oneOf
|
|
272
|
-
klass = BmcApi.const_get(type)
|
|
273
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
# Returns the string representation of the object
|
|
278
|
-
# @return [String] String presentation of the object
|
|
279
|
-
def to_s
|
|
280
|
-
to_hash.to_s
|
|
281
|
-
end
|
|
282
|
-
|
|
283
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
284
|
-
# @return [Hash] Returns the object in the form of hash
|
|
285
|
-
def to_body
|
|
286
|
-
to_hash
|
|
287
|
-
end
|
|
288
|
-
|
|
289
310
|
# Returns the object in the form of hash
|
|
290
311
|
# @return [Hash] Returns the object in the form of hash
|
|
291
312
|
def to_hash
|
|
@@ -302,24 +323,6 @@ module BmcApi
|
|
|
302
323
|
hash
|
|
303
324
|
end
|
|
304
325
|
|
|
305
|
-
# Outputs non-array value in the form of hash
|
|
306
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
307
|
-
# @param [Object] value Any valid value
|
|
308
|
-
# @return [Hash] Returns the value in the form of hash
|
|
309
|
-
def _to_hash(value)
|
|
310
|
-
if value.is_a?(Array)
|
|
311
|
-
value.compact.map { |v| _to_hash(v) }
|
|
312
|
-
elsif value.is_a?(Hash)
|
|
313
|
-
{}.tap do |hash|
|
|
314
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
315
|
-
end
|
|
316
|
-
elsif value.respond_to? :to_hash
|
|
317
|
-
value.to_hash
|
|
318
|
-
else
|
|
319
|
-
value
|
|
320
|
-
end
|
|
321
|
-
end
|
|
322
|
-
|
|
323
326
|
end
|
|
324
327
|
|
|
325
328
|
end
|
|
@@ -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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# SSH key creation model.
|
|
18
|
-
class SshKeyCreate
|
|
18
|
+
class SshKeyCreate < ApiModelBase
|
|
19
19
|
# Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request.
|
|
20
20
|
attr_accessor :default
|
|
21
21
|
|
|
@@ -34,9 +34,14 @@ module BmcApi
|
|
|
34
34
|
}
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
37
42
|
# Returns all the JSON keys this model knows about
|
|
38
43
|
def self.acceptable_attributes
|
|
39
|
-
|
|
44
|
+
acceptable_attribute_map.values
|
|
40
45
|
end
|
|
41
46
|
|
|
42
47
|
# Attribute type mapping.
|
|
@@ -62,9 +67,10 @@ module BmcApi
|
|
|
62
67
|
end
|
|
63
68
|
|
|
64
69
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
71
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
-
if (!
|
|
67
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyCreate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyCreate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
74
|
end
|
|
69
75
|
h[k.to_sym] = v
|
|
70
76
|
}
|
|
@@ -106,7 +112,7 @@ module BmcApi
|
|
|
106
112
|
end
|
|
107
113
|
|
|
108
114
|
if @name.to_s.length < 1
|
|
109
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
115
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
110
116
|
end
|
|
111
117
|
|
|
112
118
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -140,6 +146,16 @@ module BmcApi
|
|
|
140
146
|
true
|
|
141
147
|
end
|
|
142
148
|
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] default Value to be assigned
|
|
151
|
+
def default=(default)
|
|
152
|
+
if default.nil?
|
|
153
|
+
fail ArgumentError, 'default cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@default = default
|
|
157
|
+
end
|
|
158
|
+
|
|
143
159
|
# Custom attribute writer method with validation
|
|
144
160
|
# @param [Object] name Value to be assigned
|
|
145
161
|
def name=(name)
|
|
@@ -152,7 +168,7 @@ module BmcApi
|
|
|
152
168
|
end
|
|
153
169
|
|
|
154
170
|
if name.to_s.length < 1
|
|
155
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
171
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
156
172
|
end
|
|
157
173
|
|
|
158
174
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -223,61 +239,6 @@ module BmcApi
|
|
|
223
239
|
new(transformed_hash)
|
|
224
240
|
end
|
|
225
241
|
|
|
226
|
-
# Deserializes the data based on type
|
|
227
|
-
# @param string type Data type
|
|
228
|
-
# @param string value Value to be deserialized
|
|
229
|
-
# @return [Object] Deserialized data
|
|
230
|
-
def self._deserialize(type, value)
|
|
231
|
-
case type.to_sym
|
|
232
|
-
when :Time
|
|
233
|
-
Time.parse(value)
|
|
234
|
-
when :Date
|
|
235
|
-
Date.parse(value)
|
|
236
|
-
when :String
|
|
237
|
-
value.to_s
|
|
238
|
-
when :Integer
|
|
239
|
-
value.to_i
|
|
240
|
-
when :Float
|
|
241
|
-
value.to_f
|
|
242
|
-
when :Boolean
|
|
243
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
244
|
-
true
|
|
245
|
-
else
|
|
246
|
-
false
|
|
247
|
-
end
|
|
248
|
-
when :Object
|
|
249
|
-
# generic object (usually a Hash), return directly
|
|
250
|
-
value
|
|
251
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
252
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
253
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
254
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
255
|
-
k_type = Regexp.last_match[:k_type]
|
|
256
|
-
v_type = Regexp.last_match[:v_type]
|
|
257
|
-
{}.tap do |hash|
|
|
258
|
-
value.each do |k, v|
|
|
259
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
260
|
-
end
|
|
261
|
-
end
|
|
262
|
-
else # model
|
|
263
|
-
# models (e.g. Pet) or oneOf
|
|
264
|
-
klass = BmcApi.const_get(type)
|
|
265
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
266
|
-
end
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
# Returns the string representation of the object
|
|
270
|
-
# @return [String] String presentation of the object
|
|
271
|
-
def to_s
|
|
272
|
-
to_hash.to_s
|
|
273
|
-
end
|
|
274
|
-
|
|
275
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
276
|
-
# @return [Hash] Returns the object in the form of hash
|
|
277
|
-
def to_body
|
|
278
|
-
to_hash
|
|
279
|
-
end
|
|
280
|
-
|
|
281
242
|
# Returns the object in the form of hash
|
|
282
243
|
# @return [Hash] Returns the object in the form of hash
|
|
283
244
|
def to_hash
|
|
@@ -294,24 +255,6 @@ module BmcApi
|
|
|
294
255
|
hash
|
|
295
256
|
end
|
|
296
257
|
|
|
297
|
-
# Outputs non-array value in the form of hash
|
|
298
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
299
|
-
# @param [Object] value Any valid value
|
|
300
|
-
# @return [Hash] Returns the value in the form of hash
|
|
301
|
-
def _to_hash(value)
|
|
302
|
-
if value.is_a?(Array)
|
|
303
|
-
value.compact.map { |v| _to_hash(v) }
|
|
304
|
-
elsif value.is_a?(Hash)
|
|
305
|
-
{}.tap do |hash|
|
|
306
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
307
|
-
end
|
|
308
|
-
elsif value.respond_to? :to_hash
|
|
309
|
-
value.to_hash
|
|
310
|
-
else
|
|
311
|
-
value
|
|
312
|
-
end
|
|
313
|
-
end
|
|
314
|
-
|
|
315
258
|
end
|
|
316
259
|
|
|
317
260
|
end
|
|
@@ -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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# SSH key modification model.
|
|
18
|
-
class SshKeyUpdate
|
|
18
|
+
class SshKeyUpdate < ApiModelBase
|
|
19
19
|
# Keys marked as default are always included on server creation and reset unless toggled off in creation/reset request.
|
|
20
20
|
attr_accessor :default
|
|
21
21
|
|
|
@@ -30,9 +30,14 @@ module BmcApi
|
|
|
30
30
|
}
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
33
38
|
# Returns all the JSON keys this model knows about
|
|
34
39
|
def self.acceptable_attributes
|
|
35
|
-
|
|
40
|
+
acceptable_attribute_map.values
|
|
36
41
|
end
|
|
37
42
|
|
|
38
43
|
# Attribute type mapping.
|
|
@@ -57,9 +62,10 @@ module BmcApi
|
|
|
57
62
|
end
|
|
58
63
|
|
|
59
64
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
66
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
|
-
if (!
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyUpdate`. Please check the name to make sure it's valid. List of attributes: " +
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::SshKeyUpdate`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
69
|
end
|
|
64
70
|
h[k.to_sym] = v
|
|
65
71
|
}
|
|
@@ -95,7 +101,7 @@ module BmcApi
|
|
|
95
101
|
end
|
|
96
102
|
|
|
97
103
|
if @name.to_s.length < 1
|
|
98
|
-
invalid_properties.push('invalid value for "name", the character length must be
|
|
104
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
99
105
|
end
|
|
100
106
|
|
|
101
107
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -118,6 +124,16 @@ module BmcApi
|
|
|
118
124
|
true
|
|
119
125
|
end
|
|
120
126
|
|
|
127
|
+
# Custom attribute writer method with validation
|
|
128
|
+
# @param [Object] default Value to be assigned
|
|
129
|
+
def default=(default)
|
|
130
|
+
if default.nil?
|
|
131
|
+
fail ArgumentError, 'default cannot be nil'
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
@default = default
|
|
135
|
+
end
|
|
136
|
+
|
|
121
137
|
# Custom attribute writer method with validation
|
|
122
138
|
# @param [Object] name Value to be assigned
|
|
123
139
|
def name=(name)
|
|
@@ -130,7 +146,7 @@ module BmcApi
|
|
|
130
146
|
end
|
|
131
147
|
|
|
132
148
|
if name.to_s.length < 1
|
|
133
|
-
fail ArgumentError, 'invalid value for "name", the character length must be
|
|
149
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
134
150
|
end
|
|
135
151
|
|
|
136
152
|
pattern = Regexp.new(/^(?!\s*$).+/)
|
|
@@ -185,61 +201,6 @@ module BmcApi
|
|
|
185
201
|
new(transformed_hash)
|
|
186
202
|
end
|
|
187
203
|
|
|
188
|
-
# Deserializes the data based on type
|
|
189
|
-
# @param string type Data type
|
|
190
|
-
# @param string value Value to be deserialized
|
|
191
|
-
# @return [Object] Deserialized data
|
|
192
|
-
def self._deserialize(type, value)
|
|
193
|
-
case type.to_sym
|
|
194
|
-
when :Time
|
|
195
|
-
Time.parse(value)
|
|
196
|
-
when :Date
|
|
197
|
-
Date.parse(value)
|
|
198
|
-
when :String
|
|
199
|
-
value.to_s
|
|
200
|
-
when :Integer
|
|
201
|
-
value.to_i
|
|
202
|
-
when :Float
|
|
203
|
-
value.to_f
|
|
204
|
-
when :Boolean
|
|
205
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
206
|
-
true
|
|
207
|
-
else
|
|
208
|
-
false
|
|
209
|
-
end
|
|
210
|
-
when :Object
|
|
211
|
-
# generic object (usually a Hash), return directly
|
|
212
|
-
value
|
|
213
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
214
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
215
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
216
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
217
|
-
k_type = Regexp.last_match[:k_type]
|
|
218
|
-
v_type = Regexp.last_match[:v_type]
|
|
219
|
-
{}.tap do |hash|
|
|
220
|
-
value.each do |k, v|
|
|
221
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
222
|
-
end
|
|
223
|
-
end
|
|
224
|
-
else # model
|
|
225
|
-
# models (e.g. Pet) or oneOf
|
|
226
|
-
klass = BmcApi.const_get(type)
|
|
227
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
228
|
-
end
|
|
229
|
-
end
|
|
230
|
-
|
|
231
|
-
# Returns the string representation of the object
|
|
232
|
-
# @return [String] String presentation of the object
|
|
233
|
-
def to_s
|
|
234
|
-
to_hash.to_s
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
238
|
-
# @return [Hash] Returns the object in the form of hash
|
|
239
|
-
def to_body
|
|
240
|
-
to_hash
|
|
241
|
-
end
|
|
242
|
-
|
|
243
204
|
# Returns the object in the form of hash
|
|
244
205
|
# @return [Hash] Returns the object in the form of hash
|
|
245
206
|
def to_hash
|
|
@@ -256,24 +217,6 @@ module BmcApi
|
|
|
256
217
|
hash
|
|
257
218
|
end
|
|
258
219
|
|
|
259
|
-
# Outputs non-array value in the form of hash
|
|
260
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
261
|
-
# @param [Object] value Any valid value
|
|
262
|
-
# @return [Hash] Returns the value in the form of hash
|
|
263
|
-
def _to_hash(value)
|
|
264
|
-
if value.is_a?(Array)
|
|
265
|
-
value.compact.map { |v| _to_hash(v) }
|
|
266
|
-
elsif value.is_a?(Hash)
|
|
267
|
-
{}.tap do |hash|
|
|
268
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
269
|
-
end
|
|
270
|
-
elsif value.respond_to? :to_hash
|
|
271
|
-
value.to_hash
|
|
272
|
-
else
|
|
273
|
-
value
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
|
|
277
220
|
end
|
|
278
221
|
|
|
279
222
|
end
|
|
@@ -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
|
-
|
|
9
|
+
Generator version: 7.20.0
|
|
10
10
|
|
|
11
11
|
=end
|
|
12
12
|
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# Storage configuration.
|
|
18
|
-
class StorageConfiguration
|
|
18
|
+
class StorageConfiguration < ApiModelBase
|
|
19
19
|
attr_accessor :root_partition
|
|
20
20
|
|
|
21
21
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -25,9 +25,14 @@ module BmcApi
|
|
|
25
25
|
}
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
# Returns attribute mapping this model knows about
|
|
29
|
+
def self.acceptable_attribute_map
|
|
30
|
+
attribute_map
|
|
31
|
+
end
|
|
32
|
+
|
|
28
33
|
# Returns all the JSON keys this model knows about
|
|
29
34
|
def self.acceptable_attributes
|
|
30
|
-
|
|
35
|
+
acceptable_attribute_map.values
|
|
31
36
|
end
|
|
32
37
|
|
|
33
38
|
# Attribute type mapping.
|
|
@@ -51,9 +56,10 @@ module BmcApi
|
|
|
51
56
|
end
|
|
52
57
|
|
|
53
58
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
54
60
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
55
|
-
if (!
|
|
56
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::StorageConfiguration`. Please check the name to make sure it's valid. List of attributes: " +
|
|
61
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::StorageConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
57
63
|
end
|
|
58
64
|
h[k.to_sym] = v
|
|
59
65
|
}
|
|
@@ -121,61 +127,6 @@ module BmcApi
|
|
|
121
127
|
new(transformed_hash)
|
|
122
128
|
end
|
|
123
129
|
|
|
124
|
-
# Deserializes the data based on type
|
|
125
|
-
# @param string type Data type
|
|
126
|
-
# @param string value Value to be deserialized
|
|
127
|
-
# @return [Object] Deserialized data
|
|
128
|
-
def self._deserialize(type, value)
|
|
129
|
-
case type.to_sym
|
|
130
|
-
when :Time
|
|
131
|
-
Time.parse(value)
|
|
132
|
-
when :Date
|
|
133
|
-
Date.parse(value)
|
|
134
|
-
when :String
|
|
135
|
-
value.to_s
|
|
136
|
-
when :Integer
|
|
137
|
-
value.to_i
|
|
138
|
-
when :Float
|
|
139
|
-
value.to_f
|
|
140
|
-
when :Boolean
|
|
141
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
142
|
-
true
|
|
143
|
-
else
|
|
144
|
-
false
|
|
145
|
-
end
|
|
146
|
-
when :Object
|
|
147
|
-
# generic object (usually a Hash), return directly
|
|
148
|
-
value
|
|
149
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
150
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
151
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
152
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
153
|
-
k_type = Regexp.last_match[:k_type]
|
|
154
|
-
v_type = Regexp.last_match[:v_type]
|
|
155
|
-
{}.tap do |hash|
|
|
156
|
-
value.each do |k, v|
|
|
157
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
else # model
|
|
161
|
-
# models (e.g. Pet) or oneOf
|
|
162
|
-
klass = BmcApi.const_get(type)
|
|
163
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
164
|
-
end
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
# Returns the string representation of the object
|
|
168
|
-
# @return [String] String presentation of the object
|
|
169
|
-
def to_s
|
|
170
|
-
to_hash.to_s
|
|
171
|
-
end
|
|
172
|
-
|
|
173
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
174
|
-
# @return [Hash] Returns the object in the form of hash
|
|
175
|
-
def to_body
|
|
176
|
-
to_hash
|
|
177
|
-
end
|
|
178
|
-
|
|
179
130
|
# Returns the object in the form of hash
|
|
180
131
|
# @return [Hash] Returns the object in the form of hash
|
|
181
132
|
def to_hash
|
|
@@ -192,24 +143,6 @@ module BmcApi
|
|
|
192
143
|
hash
|
|
193
144
|
end
|
|
194
145
|
|
|
195
|
-
# Outputs non-array value in the form of hash
|
|
196
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
197
|
-
# @param [Object] value Any valid value
|
|
198
|
-
# @return [Hash] Returns the value in the form of hash
|
|
199
|
-
def _to_hash(value)
|
|
200
|
-
if value.is_a?(Array)
|
|
201
|
-
value.compact.map { |v| _to_hash(v) }
|
|
202
|
-
elsif value.is_a?(Hash)
|
|
203
|
-
{}.tap do |hash|
|
|
204
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
205
|
-
end
|
|
206
|
-
elsif value.respond_to? :to_hash
|
|
207
|
-
value.to_hash
|
|
208
|
-
else
|
|
209
|
-
value
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
|
-
|
|
213
146
|
end
|
|
214
147
|
|
|
215
148
|
end
|