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
|
# Entire network details of bare metal server.
|
|
18
|
-
class NetworkConfiguration
|
|
18
|
+
class NetworkConfiguration < ApiModelBase
|
|
19
19
|
# The address of the gateway assigned / to assign to the server.<br> When used as part of request body, IP address has to be part of a private/public network or an IP block assigned to this server.<br> Gateway address also has to be assigned on an already deployed resource unless the address matches the BMC gateway address in a public network/IP block or the `force` query parameter is true.
|
|
20
20
|
attr_accessor :gateway_address
|
|
21
21
|
|
|
@@ -35,9 +35,14 @@ module BmcApi
|
|
|
35
35
|
}
|
|
36
36
|
end
|
|
37
37
|
|
|
38
|
+
# Returns attribute mapping this model knows about
|
|
39
|
+
def self.acceptable_attribute_map
|
|
40
|
+
attribute_map
|
|
41
|
+
end
|
|
42
|
+
|
|
38
43
|
# Returns all the JSON keys this model knows about
|
|
39
44
|
def self.acceptable_attributes
|
|
40
|
-
|
|
45
|
+
acceptable_attribute_map.values
|
|
41
46
|
end
|
|
42
47
|
|
|
43
48
|
# Attribute type mapping.
|
|
@@ -64,9 +69,10 @@ module BmcApi
|
|
|
64
69
|
end
|
|
65
70
|
|
|
66
71
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
72
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
67
73
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
68
|
-
if (!
|
|
69
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::NetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " +
|
|
74
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
75
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::NetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
70
76
|
end
|
|
71
77
|
h[k.to_sym] = v
|
|
72
78
|
}
|
|
@@ -149,61 +155,6 @@ module BmcApi
|
|
|
149
155
|
new(transformed_hash)
|
|
150
156
|
end
|
|
151
157
|
|
|
152
|
-
# Deserializes the data based on type
|
|
153
|
-
# @param string type Data type
|
|
154
|
-
# @param string value Value to be deserialized
|
|
155
|
-
# @return [Object] Deserialized data
|
|
156
|
-
def self._deserialize(type, value)
|
|
157
|
-
case type.to_sym
|
|
158
|
-
when :Time
|
|
159
|
-
Time.parse(value)
|
|
160
|
-
when :Date
|
|
161
|
-
Date.parse(value)
|
|
162
|
-
when :String
|
|
163
|
-
value.to_s
|
|
164
|
-
when :Integer
|
|
165
|
-
value.to_i
|
|
166
|
-
when :Float
|
|
167
|
-
value.to_f
|
|
168
|
-
when :Boolean
|
|
169
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
170
|
-
true
|
|
171
|
-
else
|
|
172
|
-
false
|
|
173
|
-
end
|
|
174
|
-
when :Object
|
|
175
|
-
# generic object (usually a Hash), return directly
|
|
176
|
-
value
|
|
177
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
178
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
179
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
180
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
181
|
-
k_type = Regexp.last_match[:k_type]
|
|
182
|
-
v_type = Regexp.last_match[:v_type]
|
|
183
|
-
{}.tap do |hash|
|
|
184
|
-
value.each do |k, v|
|
|
185
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
186
|
-
end
|
|
187
|
-
end
|
|
188
|
-
else # model
|
|
189
|
-
# models (e.g. Pet) or oneOf
|
|
190
|
-
klass = BmcApi.const_get(type)
|
|
191
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
192
|
-
end
|
|
193
|
-
end
|
|
194
|
-
|
|
195
|
-
# Returns the string representation of the object
|
|
196
|
-
# @return [String] String presentation of the object
|
|
197
|
-
def to_s
|
|
198
|
-
to_hash.to_s
|
|
199
|
-
end
|
|
200
|
-
|
|
201
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
202
|
-
# @return [Hash] Returns the object in the form of hash
|
|
203
|
-
def to_body
|
|
204
|
-
to_hash
|
|
205
|
-
end
|
|
206
|
-
|
|
207
158
|
# Returns the object in the form of hash
|
|
208
159
|
# @return [Hash] Returns the object in the form of hash
|
|
209
160
|
def to_hash
|
|
@@ -220,24 +171,6 @@ module BmcApi
|
|
|
220
171
|
hash
|
|
221
172
|
end
|
|
222
173
|
|
|
223
|
-
# Outputs non-array value in the form of hash
|
|
224
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
225
|
-
# @param [Object] value Any valid value
|
|
226
|
-
# @return [Hash] Returns the value in the form of hash
|
|
227
|
-
def _to_hash(value)
|
|
228
|
-
if value.is_a?(Array)
|
|
229
|
-
value.compact.map { |v| _to_hash(v) }
|
|
230
|
-
elsif value.is_a?(Hash)
|
|
231
|
-
{}.tap do |hash|
|
|
232
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
233
|
-
end
|
|
234
|
-
elsif value.respond_to? :to_hash
|
|
235
|
-
value.to_hash
|
|
236
|
-
else
|
|
237
|
-
value
|
|
238
|
-
end
|
|
239
|
-
end
|
|
240
|
-
|
|
241
174
|
end
|
|
242
175
|
|
|
243
176
|
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
|
# OS specific configuration properties.
|
|
18
|
-
class OsConfiguration
|
|
18
|
+
class OsConfiguration < ApiModelBase
|
|
19
19
|
attr_accessor :netris_controller
|
|
20
20
|
|
|
21
21
|
attr_accessor :netris_softgate
|
|
@@ -38,6 +38,8 @@ module BmcApi
|
|
|
38
38
|
|
|
39
39
|
attr_accessor :cloud_init
|
|
40
40
|
|
|
41
|
+
attr_accessor :i_pxe
|
|
42
|
+
|
|
41
43
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
42
44
|
def self.attribute_map
|
|
43
45
|
{
|
|
@@ -49,13 +51,19 @@ module BmcApi
|
|
|
49
51
|
:'management_access_allowed_ips' => :'managementAccessAllowedIps',
|
|
50
52
|
:'install_os_to_ram' => :'installOsToRam',
|
|
51
53
|
:'esxi' => :'esxi',
|
|
52
|
-
:'cloud_init' => :'cloudInit'
|
|
54
|
+
:'cloud_init' => :'cloudInit',
|
|
55
|
+
:'i_pxe' => :'iPXE'
|
|
53
56
|
}
|
|
54
57
|
end
|
|
55
58
|
|
|
59
|
+
# Returns attribute mapping this model knows about
|
|
60
|
+
def self.acceptable_attribute_map
|
|
61
|
+
attribute_map
|
|
62
|
+
end
|
|
63
|
+
|
|
56
64
|
# Returns all the JSON keys this model knows about
|
|
57
65
|
def self.acceptable_attributes
|
|
58
|
-
|
|
66
|
+
acceptable_attribute_map.values
|
|
59
67
|
end
|
|
60
68
|
|
|
61
69
|
# Attribute type mapping.
|
|
@@ -69,7 +77,8 @@ module BmcApi
|
|
|
69
77
|
:'management_access_allowed_ips' => :'Array<String>',
|
|
70
78
|
:'install_os_to_ram' => :'Boolean',
|
|
71
79
|
:'esxi' => :'EsxiOsConfiguration',
|
|
72
|
-
:'cloud_init' => :'OsConfigurationCloudInit'
|
|
80
|
+
:'cloud_init' => :'OsConfigurationCloudInit',
|
|
81
|
+
:'i_pxe' => :'OsConfigurationIPXE'
|
|
73
82
|
}
|
|
74
83
|
end
|
|
75
84
|
|
|
@@ -87,9 +96,10 @@ module BmcApi
|
|
|
87
96
|
end
|
|
88
97
|
|
|
89
98
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
99
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
100
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
-
if (!
|
|
92
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfiguration`. Please check the name to make sure it's valid. List of attributes: " +
|
|
101
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
102
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
103
|
end
|
|
94
104
|
h[k.to_sym] = v
|
|
95
105
|
}
|
|
@@ -133,6 +143,10 @@ module BmcApi
|
|
|
133
143
|
if attributes.key?(:'cloud_init')
|
|
134
144
|
self.cloud_init = attributes[:'cloud_init']
|
|
135
145
|
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'i_pxe')
|
|
148
|
+
self.i_pxe = attributes[:'i_pxe']
|
|
149
|
+
end
|
|
136
150
|
end
|
|
137
151
|
|
|
138
152
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -182,7 +196,8 @@ module BmcApi
|
|
|
182
196
|
management_access_allowed_ips == o.management_access_allowed_ips &&
|
|
183
197
|
install_os_to_ram == o.install_os_to_ram &&
|
|
184
198
|
esxi == o.esxi &&
|
|
185
|
-
cloud_init == o.cloud_init
|
|
199
|
+
cloud_init == o.cloud_init &&
|
|
200
|
+
i_pxe == o.i_pxe
|
|
186
201
|
end
|
|
187
202
|
|
|
188
203
|
# @see the `==` method
|
|
@@ -194,7 +209,7 @@ module BmcApi
|
|
|
194
209
|
# Calculates hash code according to all attributes.
|
|
195
210
|
# @return [Integer] Hash code
|
|
196
211
|
def hash
|
|
197
|
-
[netris_controller, netris_softgate, windows, root_password, management_ui_url, management_access_allowed_ips, install_os_to_ram, esxi, cloud_init].hash
|
|
212
|
+
[netris_controller, netris_softgate, windows, root_password, management_ui_url, management_access_allowed_ips, install_os_to_ram, esxi, cloud_init, i_pxe].hash
|
|
198
213
|
end
|
|
199
214
|
|
|
200
215
|
# Builds the object from hash
|
|
@@ -220,61 +235,6 @@ module BmcApi
|
|
|
220
235
|
new(transformed_hash)
|
|
221
236
|
end
|
|
222
237
|
|
|
223
|
-
# Deserializes the data based on type
|
|
224
|
-
# @param string type Data type
|
|
225
|
-
# @param string value Value to be deserialized
|
|
226
|
-
# @return [Object] Deserialized data
|
|
227
|
-
def self._deserialize(type, value)
|
|
228
|
-
case type.to_sym
|
|
229
|
-
when :Time
|
|
230
|
-
Time.parse(value)
|
|
231
|
-
when :Date
|
|
232
|
-
Date.parse(value)
|
|
233
|
-
when :String
|
|
234
|
-
value.to_s
|
|
235
|
-
when :Integer
|
|
236
|
-
value.to_i
|
|
237
|
-
when :Float
|
|
238
|
-
value.to_f
|
|
239
|
-
when :Boolean
|
|
240
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
241
|
-
true
|
|
242
|
-
else
|
|
243
|
-
false
|
|
244
|
-
end
|
|
245
|
-
when :Object
|
|
246
|
-
# generic object (usually a Hash), return directly
|
|
247
|
-
value
|
|
248
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
249
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
250
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
251
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
252
|
-
k_type = Regexp.last_match[:k_type]
|
|
253
|
-
v_type = Regexp.last_match[:v_type]
|
|
254
|
-
{}.tap do |hash|
|
|
255
|
-
value.each do |k, v|
|
|
256
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
257
|
-
end
|
|
258
|
-
end
|
|
259
|
-
else # model
|
|
260
|
-
# models (e.g. Pet) or oneOf
|
|
261
|
-
klass = BmcApi.const_get(type)
|
|
262
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
263
|
-
end
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
# Returns the string representation of the object
|
|
267
|
-
# @return [String] String presentation of the object
|
|
268
|
-
def to_s
|
|
269
|
-
to_hash.to_s
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
273
|
-
# @return [Hash] Returns the object in the form of hash
|
|
274
|
-
def to_body
|
|
275
|
-
to_hash
|
|
276
|
-
end
|
|
277
|
-
|
|
278
238
|
# Returns the object in the form of hash
|
|
279
239
|
# @return [Hash] Returns the object in the form of hash
|
|
280
240
|
def to_hash
|
|
@@ -291,24 +251,6 @@ module BmcApi
|
|
|
291
251
|
hash
|
|
292
252
|
end
|
|
293
253
|
|
|
294
|
-
# Outputs non-array value in the form of hash
|
|
295
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
296
|
-
# @param [Object] value Any valid value
|
|
297
|
-
# @return [Hash] Returns the value in the form of hash
|
|
298
|
-
def _to_hash(value)
|
|
299
|
-
if value.is_a?(Array)
|
|
300
|
-
value.compact.map { |v| _to_hash(v) }
|
|
301
|
-
elsif value.is_a?(Hash)
|
|
302
|
-
{}.tap do |hash|
|
|
303
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
304
|
-
end
|
|
305
|
-
elsif value.respond_to? :to_hash
|
|
306
|
-
value.to_hash
|
|
307
|
-
else
|
|
308
|
-
value
|
|
309
|
-
end
|
|
310
|
-
end
|
|
311
|
-
|
|
312
254
|
end
|
|
313
255
|
|
|
314
256
|
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
|
# Cloud-init configuration details.
|
|
18
|
-
class OsConfigurationCloudInit
|
|
18
|
+
class OsConfigurationCloudInit < ApiModelBase
|
|
19
19
|
# (Write-only) User data for the <a href='https://cloudinit.readthedocs.io/en/latest/' target='_blank'>cloud-init</a> configuration in base64 encoding. NoCloud format is supported. Follow the <a href='https://phoenixnap.com/kb/bmc-cloud-init' target='_blank'>instructions</a> on how to provision a server using cloud-init. Only ubuntu/bionic, ubuntu/focal, ubuntu/jammy, debian/bullseye, debian/bookworm, centos/centos7, centos/centos8, almalinux/almalinux8, almalinux/almalinux9, rockylinux/rockylinux8, rockylinux/rockylinux9 and virtuozzo/virtuozzo7 are supported. User data will not be stored and cannot be retrieved once you deploy the server. Copy and save it for future reference.
|
|
20
20
|
attr_accessor :user_data
|
|
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::OsConfigurationCloudInit`. 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::OsConfigurationCloudInit`. 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
|
}
|
|
@@ -122,61 +128,6 @@ module BmcApi
|
|
|
122
128
|
new(transformed_hash)
|
|
123
129
|
end
|
|
124
130
|
|
|
125
|
-
# Deserializes the data based on type
|
|
126
|
-
# @param string type Data type
|
|
127
|
-
# @param string value Value to be deserialized
|
|
128
|
-
# @return [Object] Deserialized data
|
|
129
|
-
def self._deserialize(type, value)
|
|
130
|
-
case type.to_sym
|
|
131
|
-
when :Time
|
|
132
|
-
Time.parse(value)
|
|
133
|
-
when :Date
|
|
134
|
-
Date.parse(value)
|
|
135
|
-
when :String
|
|
136
|
-
value.to_s
|
|
137
|
-
when :Integer
|
|
138
|
-
value.to_i
|
|
139
|
-
when :Float
|
|
140
|
-
value.to_f
|
|
141
|
-
when :Boolean
|
|
142
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
143
|
-
true
|
|
144
|
-
else
|
|
145
|
-
false
|
|
146
|
-
end
|
|
147
|
-
when :Object
|
|
148
|
-
# generic object (usually a Hash), return directly
|
|
149
|
-
value
|
|
150
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
|
151
|
-
inner_type = Regexp.last_match[:inner_type]
|
|
152
|
-
value.map { |v| _deserialize(inner_type, v) }
|
|
153
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
154
|
-
k_type = Regexp.last_match[:k_type]
|
|
155
|
-
v_type = Regexp.last_match[:v_type]
|
|
156
|
-
{}.tap do |hash|
|
|
157
|
-
value.each do |k, v|
|
|
158
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
159
|
-
end
|
|
160
|
-
end
|
|
161
|
-
else # model
|
|
162
|
-
# models (e.g. Pet) or oneOf
|
|
163
|
-
klass = BmcApi.const_get(type)
|
|
164
|
-
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
165
|
-
end
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
# Returns the string representation of the object
|
|
169
|
-
# @return [String] String presentation of the object
|
|
170
|
-
def to_s
|
|
171
|
-
to_hash.to_s
|
|
172
|
-
end
|
|
173
|
-
|
|
174
|
-
# to_body is an alias to to_hash (backward compatibility)
|
|
175
|
-
# @return [Hash] Returns the object in the form of hash
|
|
176
|
-
def to_body
|
|
177
|
-
to_hash
|
|
178
|
-
end
|
|
179
|
-
|
|
180
131
|
# Returns the object in the form of hash
|
|
181
132
|
# @return [Hash] Returns the object in the form of hash
|
|
182
133
|
def to_hash
|
|
@@ -193,24 +144,6 @@ module BmcApi
|
|
|
193
144
|
hash
|
|
194
145
|
end
|
|
195
146
|
|
|
196
|
-
# Outputs non-array value in the form of hash
|
|
197
|
-
# For object, use to_hash. Otherwise, just return the value
|
|
198
|
-
# @param [Object] value Any valid value
|
|
199
|
-
# @return [Hash] Returns the value in the form of hash
|
|
200
|
-
def _to_hash(value)
|
|
201
|
-
if value.is_a?(Array)
|
|
202
|
-
value.compact.map { |v| _to_hash(v) }
|
|
203
|
-
elsif value.is_a?(Hash)
|
|
204
|
-
{}.tap do |hash|
|
|
205
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
206
|
-
end
|
|
207
|
-
elsif value.respond_to? :to_hash
|
|
208
|
-
value.to_hash
|
|
209
|
-
else
|
|
210
|
-
value
|
|
211
|
-
end
|
|
212
|
-
end
|
|
213
|
-
|
|
214
147
|
end
|
|
215
148
|
|
|
216
149
|
end
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Bare Metal Cloud API
|
|
3
|
+
|
|
4
|
+
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API. Deprovision servers, get or edit SSH key details, assign public IPs, assign servers to networks and a lot more. Manage your infrastructure more efficiently using just a few simple API calls.<br> <br> <span class='pnap-api-knowledge-base-link'> Knowledge base articles to help you can be found <a href='https://phoenixnap.com/kb/how-to-deploy-bare-metal-cloud-server' target='_blank'>here</a> </span><br> <br> <b>All URLs are relative to (https://api.phoenixnap.com/bmc/v1/)</b>
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 0.1
|
|
7
|
+
Contact: support@phoenixnap.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.20.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module BmcApi
|
|
17
|
+
# iPXE configuration details. Configures the server to boot using the iPXE network boot firmware with a custom boot script. Only applicable when osName is 'ipxe' and must not be provided for any other OS.
|
|
18
|
+
class OsConfigurationIPXE < ApiModelBase
|
|
19
|
+
# The URL of the iPXE boot script used to start the server.
|
|
20
|
+
attr_accessor :url
|
|
21
|
+
|
|
22
|
+
attr_accessor :native_vlan_configuration
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'url' => :'url',
|
|
28
|
+
:'native_vlan_configuration' => :'nativeVlanConfiguration'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'url' => :'String',
|
|
46
|
+
:'native_vlan_configuration' => :'OsConfigurationIPXENativeVlanConfiguration'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BmcApi::OsConfigurationIPXE` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::OsConfigurationIPXE`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'url')
|
|
73
|
+
self.url = attributes[:'url']
|
|
74
|
+
else
|
|
75
|
+
self.url = nil
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'native_vlan_configuration')
|
|
79
|
+
self.native_vlan_configuration = attributes[:'native_vlan_configuration']
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if @url.nil?
|
|
89
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
pattern = Regexp.new(/^https?:\/\/.+$/)
|
|
93
|
+
if @url !~ pattern
|
|
94
|
+
invalid_properties.push("invalid value for \"url\", must conform to the pattern #{pattern}.")
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
invalid_properties
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
# Check to see if the all the properties in the model are valid
|
|
101
|
+
# @return true if the model is valid
|
|
102
|
+
def valid?
|
|
103
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
104
|
+
return false if @url.nil?
|
|
105
|
+
return false if @url !~ Regexp.new(/^https?:\/\/.+$/)
|
|
106
|
+
true
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Custom attribute writer method with validation
|
|
110
|
+
# @param [Object] url Value to be assigned
|
|
111
|
+
def url=(url)
|
|
112
|
+
if url.nil?
|
|
113
|
+
fail ArgumentError, 'url cannot be nil'
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
pattern = Regexp.new(/^https?:\/\/.+$/)
|
|
117
|
+
if url !~ pattern
|
|
118
|
+
fail ArgumentError, "invalid value for \"url\", must conform to the pattern #{pattern}."
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
@url = url
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Checks equality by comparing each attribute.
|
|
125
|
+
# @param [Object] Object to be compared
|
|
126
|
+
def ==(o)
|
|
127
|
+
return true if self.equal?(o)
|
|
128
|
+
self.class == o.class &&
|
|
129
|
+
url == o.url &&
|
|
130
|
+
native_vlan_configuration == o.native_vlan_configuration
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# @see the `==` method
|
|
134
|
+
# @param [Object] Object to be compared
|
|
135
|
+
def eql?(o)
|
|
136
|
+
self == o
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Calculates hash code according to all attributes.
|
|
140
|
+
# @return [Integer] Hash code
|
|
141
|
+
def hash
|
|
142
|
+
[url, native_vlan_configuration].hash
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
# Builds the object from hash
|
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
147
|
+
# @return [Object] Returns the model itself
|
|
148
|
+
def self.build_from_hash(attributes)
|
|
149
|
+
return nil unless attributes.is_a?(Hash)
|
|
150
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
151
|
+
transformed_hash = {}
|
|
152
|
+
openapi_types.each_pair do |key, type|
|
|
153
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
154
|
+
transformed_hash["#{key}"] = nil
|
|
155
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
156
|
+
# check to ensure the input is an array given that the attribute
|
|
157
|
+
# is documented as an array but the input is not
|
|
158
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
159
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
160
|
+
end
|
|
161
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
162
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
new(transformed_hash)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Returns the object in the form of hash
|
|
169
|
+
# @return [Hash] Returns the object in the form of hash
|
|
170
|
+
def to_hash
|
|
171
|
+
hash = {}
|
|
172
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
173
|
+
value = self.send(attr)
|
|
174
|
+
if value.nil?
|
|
175
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
176
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
hash[param] = _to_hash(value)
|
|
180
|
+
end
|
|
181
|
+
hash
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
end
|