pnap_bmc_api 2.2.1 → 2.3.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 +2 -0
- data/VERSION +1 -1
- data/docs/IpBlocksConfiguration.md +1 -1
- data/docs/OsConfigurationCloudInit.md +1 -1
- data/docs/OsConfigurationWindows.md +3 -1
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/PublicNetworkConfiguration.md +1 -1
- data/docs/ReservationTransferDetails.md +18 -0
- data/docs/Server.md +3 -3
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerNetworkUpdate.md +1 -1
- data/docs/ServerPrivateNetwork.md +4 -2
- data/docs/ServerProvision.md +1 -1
- data/docs/ServerPublicNetwork.md +5 -3
- data/docs/ServersApi.md +72 -0
- data/lib/pnap_bmc_api/api/quotas_api.rb +4 -4
- data/lib/pnap_bmc_api/api/servers_api.rb +97 -23
- 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 +11 -78
- data/lib/pnap_bmc_api/models/os_configuration_cloud_init.rb +11 -78
- 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 +11 -78
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +22 -79
- 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 +116 -83
- 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 +36 -83
- data/lib/pnap_bmc_api/models/server_provision.rb +24 -81
- data/lib/pnap_bmc_api/models/server_public_network.rb +36 -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 +3 -1
- data/pnap_bmc_api.gemspec +6 -6
- data/spec/api/quotas_api_spec.rb +1 -1
- data/spec/api/servers_api_spec.rb +14 -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_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 +2 -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/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 +48 -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,11 +15,11 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# Public network details of bare metal server.
|
|
18
|
-
class ServerPublicNetwork
|
|
18
|
+
class ServerPublicNetwork < ApiModelBase
|
|
19
19
|
# The network identifier.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
22
|
-
# Configurable/configured IPs on the server.<br> At least 1 IP address is required. Valid IP
|
|
22
|
+
# Configurable/configured IPs on the server.<br> At least 1 IP address is required. Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). All IPs must be within the network's range.<br> Setting the `computeSlaacIp` field to `true` allows you to provide an empty array of IPs.<br> Additionally, setting the `force` query parameter to `true` allows you to:<ul> <li> Assign no specific IP addresses by designating an empty array of IPs. Note that at least one IP is required for the gateway address to be selected from this network. <li> Assign one or more IP addresses which are already configured on other resource(s) in network.</ul>
|
|
23
23
|
attr_accessor :ips
|
|
24
24
|
|
|
25
25
|
# (Read-only) The status of the assignment to the network.
|
|
@@ -28,19 +28,28 @@ module BmcApi
|
|
|
28
28
|
# (Write-only) Requests Stateless Address Autoconfiguration (SLAAC). Applicable for Network which contains IPv6 block(s).
|
|
29
29
|
attr_accessor :compute_slaac_ip
|
|
30
30
|
|
|
31
|
+
# (Read-only) The VLAN on which this network has been configured within the network switch.
|
|
32
|
+
attr_accessor :vlan_id
|
|
33
|
+
|
|
31
34
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
35
|
def self.attribute_map
|
|
33
36
|
{
|
|
34
37
|
:'id' => :'id',
|
|
35
38
|
:'ips' => :'ips',
|
|
36
39
|
:'status_description' => :'statusDescription',
|
|
37
|
-
:'compute_slaac_ip' => :'computeSlaacIp'
|
|
40
|
+
:'compute_slaac_ip' => :'computeSlaacIp',
|
|
41
|
+
:'vlan_id' => :'vlanId'
|
|
38
42
|
}
|
|
39
43
|
end
|
|
40
44
|
|
|
45
|
+
# Returns attribute mapping this model knows about
|
|
46
|
+
def self.acceptable_attribute_map
|
|
47
|
+
attribute_map
|
|
48
|
+
end
|
|
49
|
+
|
|
41
50
|
# Returns all the JSON keys this model knows about
|
|
42
51
|
def self.acceptable_attributes
|
|
43
|
-
|
|
52
|
+
acceptable_attribute_map.values
|
|
44
53
|
end
|
|
45
54
|
|
|
46
55
|
# Attribute type mapping.
|
|
@@ -49,7 +58,8 @@ module BmcApi
|
|
|
49
58
|
:'id' => :'String',
|
|
50
59
|
:'ips' => :'Array<String>',
|
|
51
60
|
:'status_description' => :'String',
|
|
52
|
-
:'compute_slaac_ip' => :'Boolean'
|
|
61
|
+
:'compute_slaac_ip' => :'Boolean',
|
|
62
|
+
:'vlan_id' => :'Integer'
|
|
53
63
|
}
|
|
54
64
|
end
|
|
55
65
|
|
|
@@ -67,9 +77,10 @@ module BmcApi
|
|
|
67
77
|
end
|
|
68
78
|
|
|
69
79
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
70
81
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
71
|
-
if (!
|
|
72
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPublicNetwork`. Please check the name to make sure it's valid. List of attributes: " +
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPublicNetwork`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
73
84
|
end
|
|
74
85
|
h[k.to_sym] = v
|
|
75
86
|
}
|
|
@@ -93,6 +104,10 @@ module BmcApi
|
|
|
93
104
|
if attributes.key?(:'compute_slaac_ip')
|
|
94
105
|
self.compute_slaac_ip = attributes[:'compute_slaac_ip']
|
|
95
106
|
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'vlan_id')
|
|
109
|
+
self.vlan_id = attributes[:'vlan_id']
|
|
110
|
+
end
|
|
96
111
|
end
|
|
97
112
|
|
|
98
113
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -115,6 +130,16 @@ module BmcApi
|
|
|
115
130
|
true
|
|
116
131
|
end
|
|
117
132
|
|
|
133
|
+
# Custom attribute writer method with validation
|
|
134
|
+
# @param [Object] id Value to be assigned
|
|
135
|
+
def id=(id)
|
|
136
|
+
if id.nil?
|
|
137
|
+
fail ArgumentError, 'id cannot be nil'
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
@id = id
|
|
141
|
+
end
|
|
142
|
+
|
|
118
143
|
# Checks equality by comparing each attribute.
|
|
119
144
|
# @param [Object] Object to be compared
|
|
120
145
|
def ==(o)
|
|
@@ -123,7 +148,8 @@ module BmcApi
|
|
|
123
148
|
id == o.id &&
|
|
124
149
|
ips == o.ips &&
|
|
125
150
|
status_description == o.status_description &&
|
|
126
|
-
compute_slaac_ip == o.compute_slaac_ip
|
|
151
|
+
compute_slaac_ip == o.compute_slaac_ip &&
|
|
152
|
+
vlan_id == o.vlan_id
|
|
127
153
|
end
|
|
128
154
|
|
|
129
155
|
# @see the `==` method
|
|
@@ -135,7 +161,7 @@ module BmcApi
|
|
|
135
161
|
# Calculates hash code according to all attributes.
|
|
136
162
|
# @return [Integer] Hash code
|
|
137
163
|
def hash
|
|
138
|
-
[id, ips, status_description, compute_slaac_ip].hash
|
|
164
|
+
[id, ips, status_description, compute_slaac_ip, vlan_id].hash
|
|
139
165
|
end
|
|
140
166
|
|
|
141
167
|
# Builds the object from hash
|
|
@@ -161,61 +187,6 @@ module BmcApi
|
|
|
161
187
|
new(transformed_hash)
|
|
162
188
|
end
|
|
163
189
|
|
|
164
|
-
# Deserializes the data based on type
|
|
165
|
-
# @param string type Data type
|
|
166
|
-
# @param string value Value to be deserialized
|
|
167
|
-
# @return [Object] Deserialized data
|
|
168
|
-
def self._deserialize(type, value)
|
|
169
|
-
case type.to_sym
|
|
170
|
-
when :Time
|
|
171
|
-
Time.parse(value)
|
|
172
|
-
when :Date
|
|
173
|
-
Date.parse(value)
|
|
174
|
-
when :String
|
|
175
|
-
value.to_s
|
|
176
|
-
when :Integer
|
|
177
|
-
value.to_i
|
|
178
|
-
when :Float
|
|
179
|
-
value.to_f
|
|
180
|
-
when :Boolean
|
|
181
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
182
|
-
true
|
|
183
|
-
else
|
|
184
|
-
false
|
|
185
|
-
end
|
|
186
|
-
when :Object
|
|
187
|
-
# generic object (usually a Hash), return directly
|
|
188
|
-
value
|
|
189
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
190
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
191
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
192
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
193
|
-
k_type = Regexp.last_match[:k_type]
|
|
194
|
-
v_type = Regexp.last_match[:v_type]
|
|
195
|
-
{}.tap do |hash|
|
|
196
|
-
value.each do |k, v|
|
|
197
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
198
|
-
end
|
|
199
|
-
end
|
|
200
|
-
else # model
|
|
201
|
-
# models (e.g. Pet) or oneOf
|
|
202
|
-
klass = BmcApi.const_get(type)
|
|
203
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
204
|
-
end
|
|
205
|
-
end
|
|
206
|
-
|
|
207
|
-
# Returns the string representation of the object
|
|
208
|
-
# @return [String] String presentation of the object
|
|
209
|
-
def to_s
|
|
210
|
-
to_hash.to_s
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
214
|
-
# @return [Hash] Returns the object in the form of hash
|
|
215
|
-
def to_body
|
|
216
|
-
to_hash
|
|
217
|
-
end
|
|
218
|
-
|
|
219
190
|
# Returns the object in the form of hash
|
|
220
191
|
# @return [Hash] Returns the object in the form of hash
|
|
221
192
|
def to_hash
|
|
@@ -232,24 +203,6 @@ module BmcApi
|
|
|
232
203
|
hash
|
|
233
204
|
end
|
|
234
205
|
|
|
235
|
-
# Outputs non-array value in the form of hash
|
|
236
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
237
|
-
# @param [Object] value Any valid value
|
|
238
|
-
# @return [Hash] Returns the value in the form of hash
|
|
239
|
-
def _to_hash(value)
|
|
240
|
-
if value.is_a?(Array)
|
|
241
|
-
value.compact.map { |v| _to_hash(v) }
|
|
242
|
-
elsif value.is_a?(Hash)
|
|
243
|
-
{}.tap do |hash|
|
|
244
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
245
|
-
end
|
|
246
|
-
elsif value.respond_to? :to_hash
|
|
247
|
-
value.to_hash
|
|
248
|
-
else
|
|
249
|
-
value
|
|
250
|
-
end
|
|
251
|
-
end
|
|
252
|
-
|
|
253
206
|
end
|
|
254
207
|
|
|
255
208
|
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
|
# Bare metal server reservation.
|
|
18
|
-
class ServerReserve
|
|
18
|
+
class ServerReserve < ApiModelBase
|
|
19
19
|
# Server pricing model. Currently this field should be set to `ONE_MONTH_RESERVATION`, `TWELVE_MONTHS_RESERVATION`, `TWENTY_FOUR_MONTHS_RESERVATION` or `THIRTY_SIX_MONTHS_RESERVATION`.
|
|
20
20
|
attr_accessor :pricing_model
|
|
21
21
|
|
|
@@ -26,9 +26,14 @@ module BmcApi
|
|
|
26
26
|
}
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
# Returns attribute mapping this model knows about
|
|
30
|
+
def self.acceptable_attribute_map
|
|
31
|
+
attribute_map
|
|
32
|
+
end
|
|
33
|
+
|
|
29
34
|
# Returns all the JSON keys this model knows about
|
|
30
35
|
def self.acceptable_attributes
|
|
31
|
-
|
|
36
|
+
acceptable_attribute_map.values
|
|
32
37
|
end
|
|
33
38
|
|
|
34
39
|
# Attribute type mapping.
|
|
@@ -52,9 +57,10 @@ module BmcApi
|
|
|
52
57
|
end
|
|
53
58
|
|
|
54
59
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
60
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
55
61
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
56
|
-
if (!
|
|
57
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReserve`. Please check the name to make sure it's valid. List of attributes: " +
|
|
62
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReserve`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
58
64
|
end
|
|
59
65
|
h[k.to_sym] = v
|
|
60
66
|
}
|
|
@@ -86,6 +92,16 @@ module BmcApi
|
|
|
86
92
|
true
|
|
87
93
|
end
|
|
88
94
|
|
|
95
|
+
# Custom attribute writer method with validation
|
|
96
|
+
# @param [Object] pricing_model Value to be assigned
|
|
97
|
+
def pricing_model=(pricing_model)
|
|
98
|
+
if pricing_model.nil?
|
|
99
|
+
fail ArgumentError, 'pricing_model cannot be nil'
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
@pricing_model = pricing_model
|
|
103
|
+
end
|
|
104
|
+
|
|
89
105
|
# Checks equality by comparing each attribute.
|
|
90
106
|
# @param [Object] Object to be compared
|
|
91
107
|
def ==(o)
|
|
@@ -129,61 +145,6 @@ module BmcApi
|
|
|
129
145
|
new(transformed_hash)
|
|
130
146
|
end
|
|
131
147
|
|
|
132
|
-
# Deserializes the data based on type
|
|
133
|
-
# @param string type Data type
|
|
134
|
-
# @param string value Value to be deserialized
|
|
135
|
-
# @return [Object] Deserialized data
|
|
136
|
-
def self._deserialize(type, value)
|
|
137
|
-
case type.to_sym
|
|
138
|
-
when :Time
|
|
139
|
-
Time.parse(value)
|
|
140
|
-
when :Date
|
|
141
|
-
Date.parse(value)
|
|
142
|
-
when :String
|
|
143
|
-
value.to_s
|
|
144
|
-
when :Integer
|
|
145
|
-
value.to_i
|
|
146
|
-
when :Float
|
|
147
|
-
value.to_f
|
|
148
|
-
when :Boolean
|
|
149
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
150
|
-
true
|
|
151
|
-
else
|
|
152
|
-
false
|
|
153
|
-
end
|
|
154
|
-
when :Object
|
|
155
|
-
# generic object (usually a Hash), return directly
|
|
156
|
-
value
|
|
157
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
158
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
159
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
160
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
161
|
-
k_type = Regexp.last_match[:k_type]
|
|
162
|
-
v_type = Regexp.last_match[:v_type]
|
|
163
|
-
{}.tap do |hash|
|
|
164
|
-
value.each do |k, v|
|
|
165
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
166
|
-
end
|
|
167
|
-
end
|
|
168
|
-
else # model
|
|
169
|
-
# models (e.g. Pet) or oneOf
|
|
170
|
-
klass = BmcApi.const_get(type)
|
|
171
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
172
|
-
end
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
# Returns the string representation of the object
|
|
176
|
-
# @return [String] String presentation of the object
|
|
177
|
-
def to_s
|
|
178
|
-
to_hash.to_s
|
|
179
|
-
end
|
|
180
|
-
|
|
181
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
182
|
-
# @return [Hash] Returns the object in the form of hash
|
|
183
|
-
def to_body
|
|
184
|
-
to_hash
|
|
185
|
-
end
|
|
186
|
-
|
|
187
148
|
# Returns the object in the form of hash
|
|
188
149
|
# @return [Hash] Returns the object in the form of hash
|
|
189
150
|
def to_hash
|
|
@@ -200,24 +161,6 @@ module BmcApi
|
|
|
200
161
|
hash
|
|
201
162
|
end
|
|
202
163
|
|
|
203
|
-
# Outputs non-array value in the form of hash
|
|
204
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
205
|
-
# @param [Object] value Any valid value
|
|
206
|
-
# @return [Hash] Returns the value in the form of hash
|
|
207
|
-
def _to_hash(value)
|
|
208
|
-
if value.is_a?(Array)
|
|
209
|
-
value.compact.map { |v| _to_hash(v) }
|
|
210
|
-
elsif value.is_a?(Hash)
|
|
211
|
-
{}.tap do |hash|
|
|
212
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
213
|
-
end
|
|
214
|
-
elsif value.respond_to? :to_hash
|
|
215
|
-
value.to_hash
|
|
216
|
-
else
|
|
217
|
-
value
|
|
218
|
-
end
|
|
219
|
-
end
|
|
220
|
-
|
|
221
164
|
end
|
|
222
165
|
|
|
223
166
|
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
|
# Reset bare metal server.
|
|
18
|
-
class ServerReset
|
|
18
|
+
class ServerReset < ApiModelBase
|
|
19
19
|
# Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request.
|
|
20
20
|
attr_accessor :install_default_ssh_keys
|
|
21
21
|
|
|
@@ -37,9 +37,14 @@ module BmcApi
|
|
|
37
37
|
}
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
# Returns attribute mapping this model knows about
|
|
41
|
+
def self.acceptable_attribute_map
|
|
42
|
+
attribute_map
|
|
43
|
+
end
|
|
44
|
+
|
|
40
45
|
# Returns all the JSON keys this model knows about
|
|
41
46
|
def self.acceptable_attributes
|
|
42
|
-
|
|
47
|
+
acceptable_attribute_map.values
|
|
43
48
|
end
|
|
44
49
|
|
|
45
50
|
# Attribute type mapping.
|
|
@@ -66,9 +71,10 @@ module BmcApi
|
|
|
66
71
|
end
|
|
67
72
|
|
|
68
73
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
69
75
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
-
if (!
|
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReset`. Please check the name to make sure it's valid. List of attributes: " +
|
|
76
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
77
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerReset`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
72
78
|
end
|
|
73
79
|
h[k.to_sym] = v
|
|
74
80
|
}
|
|
@@ -157,61 +163,6 @@ module BmcApi
|
|
|
157
163
|
new(transformed_hash)
|
|
158
164
|
end
|
|
159
165
|
|
|
160
|
-
# Deserializes the data based on type
|
|
161
|
-
# @param string type Data type
|
|
162
|
-
# @param string value Value to be deserialized
|
|
163
|
-
# @return [Object] Deserialized data
|
|
164
|
-
def self._deserialize(type, value)
|
|
165
|
-
case type.to_sym
|
|
166
|
-
when :Time
|
|
167
|
-
Time.parse(value)
|
|
168
|
-
when :Date
|
|
169
|
-
Date.parse(value)
|
|
170
|
-
when :String
|
|
171
|
-
value.to_s
|
|
172
|
-
when :Integer
|
|
173
|
-
value.to_i
|
|
174
|
-
when :Float
|
|
175
|
-
value.to_f
|
|
176
|
-
when :Boolean
|
|
177
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
178
|
-
true
|
|
179
|
-
else
|
|
180
|
-
false
|
|
181
|
-
end
|
|
182
|
-
when :Object
|
|
183
|
-
# generic object (usually a Hash), return directly
|
|
184
|
-
value
|
|
185
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
186
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
187
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
188
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
189
|
-
k_type = Regexp.last_match[:k_type]
|
|
190
|
-
v_type = Regexp.last_match[:v_type]
|
|
191
|
-
{}.tap do |hash|
|
|
192
|
-
value.each do |k, v|
|
|
193
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
194
|
-
end
|
|
195
|
-
end
|
|
196
|
-
else # model
|
|
197
|
-
# models (e.g. Pet) or oneOf
|
|
198
|
-
klass = BmcApi.const_get(type)
|
|
199
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
200
|
-
end
|
|
201
|
-
end
|
|
202
|
-
|
|
203
|
-
# Returns the string representation of the object
|
|
204
|
-
# @return [String] String presentation of the object
|
|
205
|
-
def to_s
|
|
206
|
-
to_hash.to_s
|
|
207
|
-
end
|
|
208
|
-
|
|
209
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
210
|
-
# @return [Hash] Returns the object in the form of hash
|
|
211
|
-
def to_body
|
|
212
|
-
to_hash
|
|
213
|
-
end
|
|
214
|
-
|
|
215
166
|
# Returns the object in the form of hash
|
|
216
167
|
# @return [Hash] Returns the object in the form of hash
|
|
217
168
|
def to_hash
|
|
@@ -228,24 +179,6 @@ module BmcApi
|
|
|
228
179
|
hash
|
|
229
180
|
end
|
|
230
181
|
|
|
231
|
-
# Outputs non-array value in the form of hash
|
|
232
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
233
|
-
# @param [Object] value Any valid value
|
|
234
|
-
# @return [Hash] Returns the value in the form of hash
|
|
235
|
-
def _to_hash(value)
|
|
236
|
-
if value.is_a?(Array)
|
|
237
|
-
value.compact.map { |v| _to_hash(v) }
|
|
238
|
-
elsif value.is_a?(Hash)
|
|
239
|
-
{}.tap do |hash|
|
|
240
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
241
|
-
end
|
|
242
|
-
elsif value.respond_to? :to_hash
|
|
243
|
-
value.to_hash
|
|
244
|
-
else
|
|
245
|
-
value
|
|
246
|
-
end
|
|
247
|
-
end
|
|
248
|
-
|
|
249
182
|
end
|
|
250
183
|
|
|
251
184
|
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.
|
|
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
|