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,8 +15,8 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# Update network details of bare metal server.
|
|
18
|
-
class ServerNetworkUpdate
|
|
19
|
-
# List of IPs to be associated to the server.<br> Valid IP formats include single IP addresses or IP ranges (IPv4 or IPv6). 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>
|
|
18
|
+
class ServerNetworkUpdate < ApiModelBase
|
|
19
|
+
# List of IPs to be associated to the server.<br> 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 `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.
|
|
@@ -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::ServerNetworkUpdate`. 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::ServerNetworkUpdate`. 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
|
}
|
|
@@ -124,61 +130,6 @@ module BmcApi
|
|
|
124
130
|
new(transformed_hash)
|
|
125
131
|
end
|
|
126
132
|
|
|
127
|
-
# Deserializes the data based on type
|
|
128
|
-
# @param string type Data type
|
|
129
|
-
# @param string value Value to be deserialized
|
|
130
|
-
# @return [Object] Deserialized data
|
|
131
|
-
def self._deserialize(type, value)
|
|
132
|
-
case type.to_sym
|
|
133
|
-
when :Time
|
|
134
|
-
Time.parse(value)
|
|
135
|
-
when :Date
|
|
136
|
-
Date.parse(value)
|
|
137
|
-
when :String
|
|
138
|
-
value.to_s
|
|
139
|
-
when :Integer
|
|
140
|
-
value.to_i
|
|
141
|
-
when :Float
|
|
142
|
-
value.to_f
|
|
143
|
-
when :Boolean
|
|
144
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
145
|
-
true
|
|
146
|
-
else
|
|
147
|
-
false
|
|
148
|
-
end
|
|
149
|
-
when :Object
|
|
150
|
-
# generic object (usually a Hash), return directly
|
|
151
|
-
value
|
|
152
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
153
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
154
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
155
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
156
|
-
k_type = Regexp.last_match[:k_type]
|
|
157
|
-
v_type = Regexp.last_match[:v_type]
|
|
158
|
-
{}.tap do |hash|
|
|
159
|
-
value.each do |k, v|
|
|
160
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
161
|
-
end
|
|
162
|
-
end
|
|
163
|
-
else # model
|
|
164
|
-
# models (e.g. Pet) or oneOf
|
|
165
|
-
klass = BmcApi.const_get(type)
|
|
166
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
167
|
-
end
|
|
168
|
-
end
|
|
169
|
-
|
|
170
|
-
# Returns the string representation of the object
|
|
171
|
-
# @return [String] String presentation of the object
|
|
172
|
-
def to_s
|
|
173
|
-
to_hash.to_s
|
|
174
|
-
end
|
|
175
|
-
|
|
176
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
177
|
-
# @return [Hash] Returns the object in the form of hash
|
|
178
|
-
def to_body
|
|
179
|
-
to_hash
|
|
180
|
-
end
|
|
181
|
-
|
|
182
133
|
# Returns the object in the form of hash
|
|
183
134
|
# @return [Hash] Returns the object in the form of hash
|
|
184
135
|
def to_hash
|
|
@@ -195,24 +146,6 @@ module BmcApi
|
|
|
195
146
|
hash
|
|
196
147
|
end
|
|
197
148
|
|
|
198
|
-
# Outputs non-array value in the form of hash
|
|
199
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
200
|
-
# @param [Object] value Any valid value
|
|
201
|
-
# @return [Hash] Returns the value in the form of hash
|
|
202
|
-
def _to_hash(value)
|
|
203
|
-
if value.is_a?(Array)
|
|
204
|
-
value.compact.map { |v| _to_hash(v) }
|
|
205
|
-
elsif value.is_a?(Hash)
|
|
206
|
-
{}.tap do |hash|
|
|
207
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
208
|
-
end
|
|
209
|
-
elsif value.respond_to? :to_hash
|
|
210
|
-
value.to_hash
|
|
211
|
-
else
|
|
212
|
-
value
|
|
213
|
-
end
|
|
214
|
-
end
|
|
215
|
-
|
|
216
149
|
end
|
|
217
150
|
|
|
218
151
|
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
|
# Patch bare metal server.
|
|
18
|
-
class ServerPatch
|
|
18
|
+
class ServerPatch < ApiModelBase
|
|
19
19
|
# Description of server.
|
|
20
20
|
attr_accessor :description
|
|
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::ServerPatch`. 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::ServerPatch`. 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
|
}
|
|
@@ -87,7 +93,7 @@ module BmcApi
|
|
|
87
93
|
end
|
|
88
94
|
|
|
89
95
|
if !@hostname.nil? && @hostname.to_s.length < 1
|
|
90
|
-
invalid_properties.push('invalid value for "hostname", the character length must be
|
|
96
|
+
invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
|
|
91
97
|
end
|
|
92
98
|
|
|
93
99
|
pattern = Regexp.new(/[a-zA-Z0-9().-]+/)
|
|
@@ -135,7 +141,7 @@ module BmcApi
|
|
|
135
141
|
end
|
|
136
142
|
|
|
137
143
|
if hostname.to_s.length < 1
|
|
138
|
-
fail ArgumentError, 'invalid value for "hostname", the character length must be
|
|
144
|
+
fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
|
|
139
145
|
end
|
|
140
146
|
|
|
141
147
|
pattern = Regexp.new(/[a-zA-Z0-9().-]+/)
|
|
@@ -190,61 +196,6 @@ module BmcApi
|
|
|
190
196
|
new(transformed_hash)
|
|
191
197
|
end
|
|
192
198
|
|
|
193
|
-
# Deserializes the data based on type
|
|
194
|
-
# @param string type Data type
|
|
195
|
-
# @param string value Value to be deserialized
|
|
196
|
-
# @return [Object] Deserialized data
|
|
197
|
-
def self._deserialize(type, value)
|
|
198
|
-
case type.to_sym
|
|
199
|
-
when :Time
|
|
200
|
-
Time.parse(value)
|
|
201
|
-
when :Date
|
|
202
|
-
Date.parse(value)
|
|
203
|
-
when :String
|
|
204
|
-
value.to_s
|
|
205
|
-
when :Integer
|
|
206
|
-
value.to_i
|
|
207
|
-
when :Float
|
|
208
|
-
value.to_f
|
|
209
|
-
when :Boolean
|
|
210
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
211
|
-
true
|
|
212
|
-
else
|
|
213
|
-
false
|
|
214
|
-
end
|
|
215
|
-
when :Object
|
|
216
|
-
# generic object (usually a Hash), return directly
|
|
217
|
-
value
|
|
218
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
219
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
220
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
221
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
222
|
-
k_type = Regexp.last_match[:k_type]
|
|
223
|
-
v_type = Regexp.last_match[:v_type]
|
|
224
|
-
{}.tap do |hash|
|
|
225
|
-
value.each do |k, v|
|
|
226
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
227
|
-
end
|
|
228
|
-
end
|
|
229
|
-
else # model
|
|
230
|
-
# models (e.g. Pet) or oneOf
|
|
231
|
-
klass = BmcApi.const_get(type)
|
|
232
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
233
|
-
end
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
# Returns the string representation of the object
|
|
237
|
-
# @return [String] String presentation of the object
|
|
238
|
-
def to_s
|
|
239
|
-
to_hash.to_s
|
|
240
|
-
end
|
|
241
|
-
|
|
242
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
243
|
-
# @return [Hash] Returns the object in the form of hash
|
|
244
|
-
def to_body
|
|
245
|
-
to_hash
|
|
246
|
-
end
|
|
247
|
-
|
|
248
199
|
# Returns the object in the form of hash
|
|
249
200
|
# @return [Hash] Returns the object in the form of hash
|
|
250
201
|
def to_hash
|
|
@@ -261,24 +212,6 @@ module BmcApi
|
|
|
261
212
|
hash
|
|
262
213
|
end
|
|
263
214
|
|
|
264
|
-
# Outputs non-array value in the form of hash
|
|
265
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
266
|
-
# @param [Object] value Any valid value
|
|
267
|
-
# @return [Hash] Returns the value in the form of hash
|
|
268
|
-
def _to_hash(value)
|
|
269
|
-
if value.is_a?(Array)
|
|
270
|
-
value.compact.map { |v| _to_hash(v) }
|
|
271
|
-
elsif value.is_a?(Hash)
|
|
272
|
-
{}.tap do |hash|
|
|
273
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
274
|
-
end
|
|
275
|
-
elsif value.respond_to? :to_hash
|
|
276
|
-
value.to_hash
|
|
277
|
-
else
|
|
278
|
-
value
|
|
279
|
-
end
|
|
280
|
-
end
|
|
281
|
-
|
|
282
215
|
end
|
|
283
216
|
|
|
284
217
|
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,32 +15,41 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# Private network details of bare metal server.
|
|
18
|
-
class ServerPrivateNetwork
|
|
18
|
+
class ServerPrivateNetwork < ApiModelBase
|
|
19
19
|
# The network identifier.
|
|
20
20
|
attr_accessor :id
|
|
21
21
|
|
|
22
22
|
# IPs to configure/configured on the server.<br> Valid IP formats are single IPv4 addresses or IPv4 ranges. IPs must be within the network's range. Should be null or empty list if DHCP is true. <br> If field is undefined and DHCP is false, next available IP in network will be automatically allocated.<br> If the network contains a membership of type 'storage', the first twelve IPs are already reserved by BMC and not usable.<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. 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. <li> Assign IP addresses which are considered as reserved in network.</ul>
|
|
23
23
|
attr_accessor :ips
|
|
24
24
|
|
|
25
|
-
# Determines whether DHCP is enabled for this server.
|
|
25
|
+
# Determines whether DHCP is enabled for this server.<br> The following restrictions apply when enabling DHCP:<ul> <li> DHCP support is limited to servers configured exclusively with private networks (PRIVATE_ONLY). <li> DHCP value needs to be consistent across all server-configured private networks. <li> The server does not support manual gateway address configuration. <li> Private IP addresses for network cannot be specified.</ul> Note: Not supported on Proxmox OS.
|
|
26
26
|
attr_accessor :dhcp
|
|
27
27
|
|
|
28
28
|
# (Read-only) The status of the network.
|
|
29
29
|
attr_accessor :status_description
|
|
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
|
:'dhcp' => :'dhcp',
|
|
37
|
-
:'status_description' => :'statusDescription'
|
|
40
|
+
:'status_description' => :'statusDescription',
|
|
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
|
:'dhcp' => :'Boolean',
|
|
52
|
-
:'status_description' => :'String'
|
|
61
|
+
:'status_description' => :'String',
|
|
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::ServerPrivateNetwork`. 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::ServerPrivateNetwork`. 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
|
}
|
|
@@ -95,6 +106,10 @@ module BmcApi
|
|
|
95
106
|
if attributes.key?(:'status_description')
|
|
96
107
|
self.status_description = attributes[:'status_description']
|
|
97
108
|
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'vlan_id')
|
|
111
|
+
self.vlan_id = attributes[:'vlan_id']
|
|
112
|
+
end
|
|
98
113
|
end
|
|
99
114
|
|
|
100
115
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -122,6 +137,16 @@ module BmcApi
|
|
|
122
137
|
true
|
|
123
138
|
end
|
|
124
139
|
|
|
140
|
+
# Custom attribute writer method with validation
|
|
141
|
+
# @param [Object] id Value to be assigned
|
|
142
|
+
def id=(id)
|
|
143
|
+
if id.nil?
|
|
144
|
+
fail ArgumentError, 'id cannot be nil'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
@id = id
|
|
148
|
+
end
|
|
149
|
+
|
|
125
150
|
# Custom attribute writer method with validation
|
|
126
151
|
# @param [Object] ips Value to be assigned
|
|
127
152
|
def ips=(ips)
|
|
@@ -144,7 +169,8 @@ module BmcApi
|
|
|
144
169
|
id == o.id &&
|
|
145
170
|
ips == o.ips &&
|
|
146
171
|
dhcp == o.dhcp &&
|
|
147
|
-
status_description == o.status_description
|
|
172
|
+
status_description == o.status_description &&
|
|
173
|
+
vlan_id == o.vlan_id
|
|
148
174
|
end
|
|
149
175
|
|
|
150
176
|
# @see the `==` method
|
|
@@ -156,7 +182,7 @@ module BmcApi
|
|
|
156
182
|
# Calculates hash code according to all attributes.
|
|
157
183
|
# @return [Integer] Hash code
|
|
158
184
|
def hash
|
|
159
|
-
[id, ips, dhcp, status_description].hash
|
|
185
|
+
[id, ips, dhcp, status_description, vlan_id].hash
|
|
160
186
|
end
|
|
161
187
|
|
|
162
188
|
# Builds the object from hash
|
|
@@ -182,61 +208,6 @@ module BmcApi
|
|
|
182
208
|
new(transformed_hash)
|
|
183
209
|
end
|
|
184
210
|
|
|
185
|
-
# Deserializes the data based on type
|
|
186
|
-
# @param string type Data type
|
|
187
|
-
# @param string value Value to be deserialized
|
|
188
|
-
# @return [Object] Deserialized data
|
|
189
|
-
def self._deserialize(type, value)
|
|
190
|
-
case type.to_sym
|
|
191
|
-
when :Time
|
|
192
|
-
Time.parse(value)
|
|
193
|
-
when :Date
|
|
194
|
-
Date.parse(value)
|
|
195
|
-
when :String
|
|
196
|
-
value.to_s
|
|
197
|
-
when :Integer
|
|
198
|
-
value.to_i
|
|
199
|
-
when :Float
|
|
200
|
-
value.to_f
|
|
201
|
-
when :Boolean
|
|
202
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
203
|
-
true
|
|
204
|
-
else
|
|
205
|
-
false
|
|
206
|
-
end
|
|
207
|
-
when :Object
|
|
208
|
-
# generic object (usually a Hash), return directly
|
|
209
|
-
value
|
|
210
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
211
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
212
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
213
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
214
|
-
k_type = Regexp.last_match[:k_type]
|
|
215
|
-
v_type = Regexp.last_match[:v_type]
|
|
216
|
-
{}.tap do |hash|
|
|
217
|
-
value.each do |k, v|
|
|
218
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
219
|
-
end
|
|
220
|
-
end
|
|
221
|
-
else # model
|
|
222
|
-
# models (e.g. Pet) or oneOf
|
|
223
|
-
klass = BmcApi.const_get(type)
|
|
224
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
225
|
-
end
|
|
226
|
-
end
|
|
227
|
-
|
|
228
|
-
# Returns the string representation of the object
|
|
229
|
-
# @return [String] String presentation of the object
|
|
230
|
-
def to_s
|
|
231
|
-
to_hash.to_s
|
|
232
|
-
end
|
|
233
|
-
|
|
234
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
235
|
-
# @return [Hash] Returns the object in the form of hash
|
|
236
|
-
def to_body
|
|
237
|
-
to_hash
|
|
238
|
-
end
|
|
239
|
-
|
|
240
211
|
# Returns the object in the form of hash
|
|
241
212
|
# @return [Hash] Returns the object in the form of hash
|
|
242
213
|
def to_hash
|
|
@@ -253,24 +224,6 @@ module BmcApi
|
|
|
253
224
|
hash
|
|
254
225
|
end
|
|
255
226
|
|
|
256
|
-
# Outputs non-array value in the form of hash
|
|
257
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
258
|
-
# @param [Object] value Any valid value
|
|
259
|
-
# @return [Hash] Returns the value in the form of hash
|
|
260
|
-
def _to_hash(value)
|
|
261
|
-
if value.is_a?(Array)
|
|
262
|
-
value.compact.map { |v| _to_hash(v) }
|
|
263
|
-
elsif value.is_a?(Hash)
|
|
264
|
-
{}.tap do |hash|
|
|
265
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
266
|
-
end
|
|
267
|
-
elsif value.respond_to? :to_hash
|
|
268
|
-
value.to_hash
|
|
269
|
-
else
|
|
270
|
-
value
|
|
271
|
-
end
|
|
272
|
-
end
|
|
273
|
-
|
|
274
227
|
end
|
|
275
228
|
|
|
276
229
|
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,14 +15,14 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module BmcApi
|
|
17
17
|
# Provision bare metal server.
|
|
18
|
-
class ServerProvision
|
|
18
|
+
class ServerProvision < ApiModelBase
|
|
19
19
|
# Hostname of server.
|
|
20
20
|
attr_accessor :hostname
|
|
21
21
|
|
|
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`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `proxmox/bullseye`, `proxmox/proxmox8`, `netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
|
|
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`, `ubuntu/jammy+pytorch`, `ubuntu/noble`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `windows/srv2022std`, `windows/srv2022dc`, `windows/srv2025std`, `windows/srv2025dc`, `esxi/esxi70`, `esxi/esxi80`, `almalinux/almalinux8`, `almalinux/almalinux9`, `rockylinux/rockylinux8`, `rockylinux/rockylinux9`, `virtuozzo/virtuozzo7`, `oraclelinux/oraclelinux9`, `debian/bullseye`, `debian/bookworm`, `debian/trixie`, `proxmox/bullseye`, `proxmox/proxmox8`, `proxmox/proxmox9`,`netris/controller`, `netris/softgate_1g`, `netris/softgate_10g` or `netris/softgate_25g`.
|
|
26
26
|
attr_accessor :os
|
|
27
27
|
|
|
28
28
|
# Whether or not to install SSH keys marked as default in addition to any SSH keys specified in this request.
|
|
@@ -63,9 +63,14 @@ module BmcApi
|
|
|
63
63
|
}
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
# Returns attribute mapping this model knows about
|
|
67
|
+
def self.acceptable_attribute_map
|
|
68
|
+
attribute_map
|
|
69
|
+
end
|
|
70
|
+
|
|
66
71
|
# Returns all the JSON keys this model knows about
|
|
67
72
|
def self.acceptable_attributes
|
|
68
|
-
|
|
73
|
+
acceptable_attribute_map.values
|
|
69
74
|
end
|
|
70
75
|
|
|
71
76
|
# Attribute type mapping.
|
|
@@ -99,9 +104,10 @@ module BmcApi
|
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
107
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
102
108
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
103
|
-
if (!
|
|
104
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerProvision`. Please check the name to make sure it's valid. List of attributes: " +
|
|
109
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
110
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerProvision`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
105
111
|
end
|
|
106
112
|
h[k.to_sym] = v
|
|
107
113
|
}
|
|
@@ -179,7 +185,7 @@ module BmcApi
|
|
|
179
185
|
end
|
|
180
186
|
|
|
181
187
|
if @hostname.to_s.length < 1
|
|
182
|
-
invalid_properties.push('invalid value for "hostname", the character length must be
|
|
188
|
+
invalid_properties.push('invalid value for "hostname", the character length must be greater than or equal to 1.')
|
|
183
189
|
end
|
|
184
190
|
|
|
185
191
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
|
|
@@ -223,7 +229,7 @@ module BmcApi
|
|
|
223
229
|
end
|
|
224
230
|
|
|
225
231
|
if hostname.to_s.length < 1
|
|
226
|
-
fail ArgumentError, 'invalid value for "hostname", the character length must be
|
|
232
|
+
fail ArgumentError, 'invalid value for "hostname", the character length must be greater than or equal to 1.'
|
|
227
233
|
end
|
|
228
234
|
|
|
229
235
|
pattern = Regexp.new(/^(?=.*[a-zA-Z])([a-zA-Z0-9().-])+$/)
|
|
@@ -248,6 +254,16 @@ module BmcApi
|
|
|
248
254
|
@description = description
|
|
249
255
|
end
|
|
250
256
|
|
|
257
|
+
# Custom attribute writer method with validation
|
|
258
|
+
# @param [Object] os Value to be assigned
|
|
259
|
+
def os=(os)
|
|
260
|
+
if os.nil?
|
|
261
|
+
fail ArgumentError, 'os cannot be nil'
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
@os = os
|
|
265
|
+
end
|
|
266
|
+
|
|
251
267
|
# Checks equality by comparing each attribute.
|
|
252
268
|
# @param [Object] Object to be compared
|
|
253
269
|
def ==(o)
|
|
@@ -301,61 +317,6 @@ module BmcApi
|
|
|
301
317
|
new(transformed_hash)
|
|
302
318
|
end
|
|
303
319
|
|
|
304
|
-
# Deserializes the data based on type
|
|
305
|
-
# @param string type Data type
|
|
306
|
-
# @param string value Value to be deserialized
|
|
307
|
-
# @return [Object] Deserialized data
|
|
308
|
-
def self._deserialize(type, value)
|
|
309
|
-
case type.to_sym
|
|
310
|
-
when :Time
|
|
311
|
-
Time.parse(value)
|
|
312
|
-
when :Date
|
|
313
|
-
Date.parse(value)
|
|
314
|
-
when :String
|
|
315
|
-
value.to_s
|
|
316
|
-
when :Integer
|
|
317
|
-
value.to_i
|
|
318
|
-
when :Float
|
|
319
|
-
value.to_f
|
|
320
|
-
when :Boolean
|
|
321
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
322
|
-
true
|
|
323
|
-
else
|
|
324
|
-
false
|
|
325
|
-
end
|
|
326
|
-
when :Object
|
|
327
|
-
# generic object (usually a Hash), return directly
|
|
328
|
-
value
|
|
329
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
330
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
331
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
332
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
333
|
-
k_type = Regexp.last_match[:k_type]
|
|
334
|
-
v_type = Regexp.last_match[:v_type]
|
|
335
|
-
{}.tap do |hash|
|
|
336
|
-
value.each do |k, v|
|
|
337
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
338
|
-
end
|
|
339
|
-
end
|
|
340
|
-
else # model
|
|
341
|
-
# models (e.g. Pet) or oneOf
|
|
342
|
-
klass = BmcApi.const_get(type)
|
|
343
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
344
|
-
end
|
|
345
|
-
end
|
|
346
|
-
|
|
347
|
-
# Returns the string representation of the object
|
|
348
|
-
# @return [String] String presentation of the object
|
|
349
|
-
def to_s
|
|
350
|
-
to_hash.to_s
|
|
351
|
-
end
|
|
352
|
-
|
|
353
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
354
|
-
# @return [Hash] Returns the object in the form of hash
|
|
355
|
-
def to_body
|
|
356
|
-
to_hash
|
|
357
|
-
end
|
|
358
|
-
|
|
359
320
|
# Returns the object in the form of hash
|
|
360
321
|
# @return [Hash] Returns the object in the form of hash
|
|
361
322
|
def to_hash
|
|
@@ -372,24 +333,6 @@ module BmcApi
|
|
|
372
333
|
hash
|
|
373
334
|
end
|
|
374
335
|
|
|
375
|
-
# Outputs non-array value in the form of hash
|
|
376
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
377
|
-
# @param [Object] value Any valid value
|
|
378
|
-
# @return [Hash] Returns the value in the form of hash
|
|
379
|
-
def _to_hash(value)
|
|
380
|
-
if value.is_a?(Array)
|
|
381
|
-
value.compact.map { |v| _to_hash(v) }
|
|
382
|
-
elsif value.is_a?(Hash)
|
|
383
|
-
{}.tap do |hash|
|
|
384
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
385
|
-
end
|
|
386
|
-
elsif value.respond_to? :to_hash
|
|
387
|
-
value.to_hash
|
|
388
|
-
else
|
|
389
|
-
value
|
|
390
|
-
end
|
|
391
|
-
end
|
|
392
|
-
|
|
393
336
|
end
|
|
394
337
|
|
|
395
338
|
end
|