pnap_bmc_api 1.0.0 → 1.1.1
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 +8 -4
- data/VERSION +1 -1
- data/docs/NetworkConfiguration.md +5 -1
- data/docs/OsConfiguration.md +3 -1
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/PublicNetworkConfiguration.md +18 -0
- data/docs/Quota.md +2 -2
- data/docs/Server.md +3 -3
- data/docs/ServerCreate.md +3 -3
- data/docs/ServerPrivateNetwork.md +1 -1
- data/docs/ServerPublicNetwork.md +22 -0
- data/docs/ServersApi.md +156 -10
- data/lib/pnap_bmc_api/api/quotas_api.rb +2 -2
- data/lib/pnap_bmc_api/api/servers_api.rb +155 -16
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +2 -2
- data/lib/pnap_bmc_api/api_client.rb +5 -3
- data/lib/pnap_bmc_api/api_error.rb +2 -2
- data/lib/pnap_bmc_api/configuration.rb +4 -3
- data/lib/pnap_bmc_api/models/action_result.rb +3 -2
- data/lib/pnap_bmc_api/models/delete_result.rb +3 -2
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +3 -2
- data/lib/pnap_bmc_api/models/error.rb +3 -2
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +3 -2
- data/lib/pnap_bmc_api/models/network_configuration.rb +26 -6
- data/lib/pnap_bmc_api/models/os_configuration.rb +19 -6
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +3 -2
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +3 -2
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +3 -2
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +3 -2
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +4 -3
- data/lib/pnap_bmc_api/models/public_network_configuration.rb +223 -0
- data/lib/pnap_bmc_api/models/quota.rb +4 -15
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +3 -2
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +3 -2
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details_all_of.rb +3 -2
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +3 -2
- data/lib/pnap_bmc_api/models/reset_result.rb +3 -2
- data/lib/pnap_bmc_api/models/server.rb +10 -18
- data/lib/pnap_bmc_api/models/server_create.rb +6 -5
- data/lib/pnap_bmc_api/models/server_ip_block.rb +4 -3
- data/lib/pnap_bmc_api/models/server_patch.rb +3 -2
- data/lib/pnap_bmc_api/models/server_private_network.rb +4 -3
- data/lib/pnap_bmc_api/models/server_public_network.rb +272 -0
- data/lib/pnap_bmc_api/models/server_reserve.rb +3 -2
- data/lib/pnap_bmc_api/models/server_reset.rb +3 -2
- data/lib/pnap_bmc_api/models/ssh_key.rb +3 -2
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +3 -2
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +3 -2
- data/lib/pnap_bmc_api/models/tag_assignment.rb +3 -2
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +3 -2
- data/lib/pnap_bmc_api/version.rb +2 -2
- data/lib/pnap_bmc_api.rb +4 -2
- data/pnap_bmc_api.gemspec +3 -3
- data/spec/api_client_spec.rb +2 -2
- data/spec/configuration_spec.rb +2 -2
- data/spec/models/public_network_configuration_spec.rb +34 -0
- data/spec/models/server_public_network_spec.rb +46 -0
- data/spec/spec_helper.rb +2 -2
- metadata +32 -24
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -28,10 +28,10 @@ module BmcApi
|
|
28
28
|
# Description of server.
|
29
29
|
attr_accessor :description
|
30
30
|
|
31
|
-
# The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `centos/centos7`, `windows/srv2019std`, `windows/srv2019dc`, `esxi/esxi70u2`, `debian/bullseye` or `proxmox/bullseye`.
|
31
|
+
# The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `centos/centos7`, `centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `esxi/esxi70u2`, `debian/bullseye` or `proxmox/bullseye`.
|
32
32
|
attr_accessor :os
|
33
33
|
|
34
|
-
# Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m2.medium`, `d2.m2.large` or `d2.
|
34
|
+
# Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.medium`, `d2.m1.large`, `d2.m2.medium`, `d2.m2.large`, `d2.m2.xlarge` or `d2.c4.storage.pliops1`.
|
35
35
|
attr_accessor :type
|
36
36
|
|
37
37
|
# Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`.
|
@@ -368,12 +368,8 @@ module BmcApi
|
|
368
368
|
invalid_properties.push('invalid value for "private_ip_addresses", number of items must be greater than or equal to 1.')
|
369
369
|
end
|
370
370
|
|
371
|
-
if
|
372
|
-
invalid_properties.push('invalid value for "public_ip_addresses",
|
373
|
-
end
|
374
|
-
|
375
|
-
if @public_ip_addresses.length < 1
|
376
|
-
invalid_properties.push('invalid value for "public_ip_addresses", number of items must be greater than or equal to 1.')
|
371
|
+
if !@public_ip_addresses.nil? && @public_ip_addresses.length < 0
|
372
|
+
invalid_properties.push('invalid value for "public_ip_addresses", number of items must be greater than or equal to 0.')
|
377
373
|
end
|
378
374
|
|
379
375
|
if @pricing_model.nil?
|
@@ -411,8 +407,7 @@ module BmcApi
|
|
411
407
|
return false if @storage.nil?
|
412
408
|
return false if @private_ip_addresses.nil?
|
413
409
|
return false if @private_ip_addresses.length < 1
|
414
|
-
return false if
|
415
|
-
return false if @public_ip_addresses.length < 1
|
410
|
+
return false if !@public_ip_addresses.nil? && @public_ip_addresses.length < 0
|
416
411
|
return false if @pricing_model.nil?
|
417
412
|
return false if @network_configuration.nil?
|
418
413
|
true
|
@@ -510,12 +505,8 @@ module BmcApi
|
|
510
505
|
# Custom attribute writer method with validation
|
511
506
|
# @param [Object] public_ip_addresses Value to be assigned
|
512
507
|
def public_ip_addresses=(public_ip_addresses)
|
513
|
-
if public_ip_addresses.nil?
|
514
|
-
fail ArgumentError, 'public_ip_addresses
|
515
|
-
end
|
516
|
-
|
517
|
-
if public_ip_addresses.length < 1
|
518
|
-
fail ArgumentError, 'invalid value for "public_ip_addresses", number of items must be greater than or equal to 1.'
|
508
|
+
if !public_ip_addresses.nil? && public_ip_addresses.length < 0
|
509
|
+
fail ArgumentError, 'invalid value for "public_ip_addresses", number of items must be greater than or equal to 0.'
|
519
510
|
end
|
520
511
|
|
521
512
|
@public_ip_addresses = public_ip_addresses
|
@@ -576,6 +567,7 @@ module BmcApi
|
|
576
567
|
# @return [Object] Returns the model itself
|
577
568
|
def build_from_hash(attributes)
|
578
569
|
return nil unless attributes.is_a?(Hash)
|
570
|
+
attributes = attributes.transform_keys(&:to_sym)
|
579
571
|
self.class.openapi_types.each_pair do |key, type|
|
580
572
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
581
573
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -22,10 +22,10 @@ module BmcApi
|
|
22
22
|
# Description of server.
|
23
23
|
attr_accessor :description
|
24
24
|
|
25
|
-
# The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `centos/centos7`, `windows/srv2019std`, `windows/srv2019dc`, `esxi/esxi70u2`, `debian/bullseye` or `proxmox/bullseye`.
|
25
|
+
# The server’s OS ID used when the server was created. Currently this field should be set to either `ubuntu/bionic`, `ubuntu/focal`, `centos/centos7`,`centos/centos8`, `windows/srv2019std`, `windows/srv2019dc`, `esxi/esxi70u2`, `debian/bullseye` or `proxmox/bullseye`.
|
26
26
|
attr_accessor :os
|
27
27
|
|
28
|
-
# Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m2.medium`, `d2.m2.large` or `d2.
|
28
|
+
# Server type ID. Cannot be changed once a server is created. Currently this field should be set to either `s0.d1.small`, `s0.d1.medium`, `s1.c1.small`, `s1.c1.medium`, `s1.c2.medium`, `s1.c2.large`, `s1.e1.small`, `s1.e1.medium`, `s1.e1.large`, `s2.c1.small`, `s2.c1.medium`, `s2.c1.large`, `s2.c2.small`, `s2.c2.medium`, `s2.c2.large`, `d1.c1.small`, `d1.c2.small`, `d1.c3.small`, `d1.c4.small`, `d1.c1.medium`, `d1.c2.medium`, `d1.c3.medium`, `d1.c4.medium`, `d1.c1.large`, `d1.c2.large`, `d1.c3.large`, `d1.c4.large`, `d1.m1.medium`, `d1.m2.medium`, `d1.m3.medium`, `d1.m4.medium`, `d2.c1.medium`, `d2.c2.medium`, `d2.c3.medium`, `d2.c4.medium`, `d2.c5.medium`, `d2.c1.large`, `d2.c2.large`, `d2.c3.large`, `d2.c4.large`, `d2.c5.large`, `d2.m1.medium`, `d2.m1.large`, `d2.m2.medium`, `d2.m2.large`, `d2.m2.xlarge` or `d2.c4.storage.pliops1`.
|
29
29
|
attr_accessor :type
|
30
30
|
|
31
31
|
# Server location ID. Cannot be changed once a server is created. Currently this field should be set to `PHX`, `ASH`, `SGP`, `NLD`, `CHI`, `SEA` or `AUS`.
|
@@ -51,7 +51,7 @@ module BmcApi
|
|
51
51
|
|
52
52
|
attr_accessor :os_configuration
|
53
53
|
|
54
|
-
# Tags to set to server,
|
54
|
+
# Tags to set to the server. To create a new tag or list all the existing tags that you can use, refer to [Tags API](https://developers.phoenixnap.com/docs/tags/1/overview).
|
55
55
|
attr_accessor :tags
|
56
56
|
|
57
57
|
attr_accessor :network_configuration
|
@@ -323,6 +323,7 @@ module BmcApi
|
|
323
323
|
# @return [Object] Returns the model itself
|
324
324
|
def build_from_hash(attributes)
|
325
325
|
return nil unless attributes.is_a?(Hash)
|
326
|
+
attributes = attributes.transform_keys(&:to_sym)
|
326
327
|
self.class.openapi_types.each_pair do |key, type|
|
327
328
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
328
329
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module BmcApi
|
17
|
-
# IP block
|
17
|
+
# IP block assigned to server
|
18
18
|
class ServerIpBlock
|
19
19
|
# The IP block's ID.
|
20
20
|
attr_accessor :id
|
@@ -124,6 +124,7 @@ module BmcApi
|
|
124
124
|
# @return [Object] Returns the model itself
|
125
125
|
def build_from_hash(attributes)
|
126
126
|
return nil unless attributes.is_a?(Hash)
|
127
|
+
attributes = attributes.transform_keys(&:to_sym)
|
127
128
|
self.class.openapi_types.each_pair do |key, type|
|
128
129
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
129
130
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -169,6 +169,7 @@ module BmcApi
|
|
169
169
|
# @return [Object] Returns the model itself
|
170
170
|
def build_from_hash(attributes)
|
171
171
|
return nil unless attributes.is_a?(Hash)
|
172
|
+
attributes = attributes.transform_keys(&:to_sym)
|
172
173
|
self.class.openapi_types.each_pair do |key, type|
|
173
174
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
174
175
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -19,7 +19,7 @@ module BmcApi
|
|
19
19
|
# The network identifier.
|
20
20
|
attr_accessor :id
|
21
21
|
|
22
|
-
# IPs to configure/configured on the server. Should be null or empty list if DHCP is true.
|
22
|
+
# IPs to configure/configured on the server. Should be null or empty list if DHCP is true. If the network contains a membership of type 'storage', the first twelve IPs are already reserved by BMC and not usable. These will return a Bad Request (400) if selected.
|
23
23
|
attr_accessor :ips
|
24
24
|
|
25
25
|
# Determines whether DHCP is enabled for this server. Should be false if ips is not an empty list. Not supported for proxmox OS.
|
@@ -163,6 +163,7 @@ module BmcApi
|
|
163
163
|
# @return [Object] Returns the model itself
|
164
164
|
def build_from_hash(attributes)
|
165
165
|
return nil unless attributes.is_a?(Hash)
|
166
|
+
attributes = attributes.transform_keys(&:to_sym)
|
166
167
|
self.class.openapi_types.each_pair do |key, type|
|
167
168
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
168
169
|
self.send("#{key}=", nil)
|
@@ -0,0 +1,272 @@
|
|
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
|
+
OpenAPI Generator version: 6.1.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module BmcApi
|
17
|
+
# Public network details of bare metal server.
|
18
|
+
class ServerPublicNetwork
|
19
|
+
# The network identifier.
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# IPs to configure/configured on the server. IPs must be within the network's range.
|
23
|
+
attr_accessor :ips
|
24
|
+
|
25
|
+
# The status of the assignment to the network.
|
26
|
+
attr_accessor :status_description
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'id' => :'id',
|
32
|
+
:'ips' => :'ips',
|
33
|
+
:'status_description' => :'statusDescription'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns all the JSON keys this model knows about
|
38
|
+
def self.acceptable_attributes
|
39
|
+
attribute_map.values
|
40
|
+
end
|
41
|
+
|
42
|
+
# Attribute type mapping.
|
43
|
+
def self.openapi_types
|
44
|
+
{
|
45
|
+
:'id' => :'String',
|
46
|
+
:'ips' => :'Array<String>',
|
47
|
+
:'status_description' => :'String'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# List of attributes with nullable: true
|
52
|
+
def self.openapi_nullable
|
53
|
+
Set.new([
|
54
|
+
])
|
55
|
+
end
|
56
|
+
|
57
|
+
# Initializes the object
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
59
|
+
def initialize(attributes = {})
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BmcApi::ServerPublicNetwork` initialize method"
|
62
|
+
end
|
63
|
+
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
66
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::ServerPublicNetwork`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
68
|
+
end
|
69
|
+
h[k.to_sym] = v
|
70
|
+
}
|
71
|
+
|
72
|
+
if attributes.key?(:'id')
|
73
|
+
self.id = attributes[:'id']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'ips')
|
77
|
+
if (value = attributes[:'ips']).is_a?(Array)
|
78
|
+
self.ips = value
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'status_description')
|
83
|
+
self.status_description = attributes[:'status_description']
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
88
|
+
# @return Array for valid properties with the reasons
|
89
|
+
def list_invalid_properties
|
90
|
+
invalid_properties = Array.new
|
91
|
+
if @id.nil?
|
92
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
93
|
+
end
|
94
|
+
|
95
|
+
if @ips.nil?
|
96
|
+
invalid_properties.push('invalid value for "ips", ips cannot be nil.')
|
97
|
+
end
|
98
|
+
|
99
|
+
if @ips.length < 1
|
100
|
+
invalid_properties.push('invalid value for "ips", number of items must be greater than or equal to 1.')
|
101
|
+
end
|
102
|
+
|
103
|
+
invalid_properties
|
104
|
+
end
|
105
|
+
|
106
|
+
# Check to see if the all the properties in the model are valid
|
107
|
+
# @return true if the model is valid
|
108
|
+
def valid?
|
109
|
+
return false if @id.nil?
|
110
|
+
return false if @ips.nil?
|
111
|
+
return false if @ips.length < 1
|
112
|
+
true
|
113
|
+
end
|
114
|
+
|
115
|
+
# Custom attribute writer method with validation
|
116
|
+
# @param [Object] ips Value to be assigned
|
117
|
+
def ips=(ips)
|
118
|
+
if ips.nil?
|
119
|
+
fail ArgumentError, 'ips cannot be nil'
|
120
|
+
end
|
121
|
+
|
122
|
+
if ips.length < 1
|
123
|
+
fail ArgumentError, 'invalid value for "ips", number of items must be greater than or equal to 1.'
|
124
|
+
end
|
125
|
+
|
126
|
+
@ips = ips
|
127
|
+
end
|
128
|
+
|
129
|
+
# Checks equality by comparing each attribute.
|
130
|
+
# @param [Object] Object to be compared
|
131
|
+
def ==(o)
|
132
|
+
return true if self.equal?(o)
|
133
|
+
self.class == o.class &&
|
134
|
+
id == o.id &&
|
135
|
+
ips == o.ips &&
|
136
|
+
status_description == o.status_description
|
137
|
+
end
|
138
|
+
|
139
|
+
# @see the `==` method
|
140
|
+
# @param [Object] Object to be compared
|
141
|
+
def eql?(o)
|
142
|
+
self == o
|
143
|
+
end
|
144
|
+
|
145
|
+
# Calculates hash code according to all attributes.
|
146
|
+
# @return [Integer] Hash code
|
147
|
+
def hash
|
148
|
+
[id, ips, status_description].hash
|
149
|
+
end
|
150
|
+
|
151
|
+
# Builds the object from hash
|
152
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
153
|
+
# @return [Object] Returns the model itself
|
154
|
+
def self.build_from_hash(attributes)
|
155
|
+
new.build_from_hash(attributes)
|
156
|
+
end
|
157
|
+
|
158
|
+
# Builds the object from hash
|
159
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
160
|
+
# @return [Object] Returns the model itself
|
161
|
+
def build_from_hash(attributes)
|
162
|
+
return nil unless attributes.is_a?(Hash)
|
163
|
+
attributes = attributes.transform_keys(&:to_sym)
|
164
|
+
self.class.openapi_types.each_pair do |key, type|
|
165
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
166
|
+
self.send("#{key}=", nil)
|
167
|
+
elsif type =~ /\AArray<(.*)>/i
|
168
|
+
# check to ensure the input is an array given that the attribute
|
169
|
+
# is documented as an array but the input is not
|
170
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
171
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
172
|
+
end
|
173
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
174
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
self
|
179
|
+
end
|
180
|
+
|
181
|
+
# Deserializes the data based on type
|
182
|
+
# @param string type Data type
|
183
|
+
# @param string value Value to be deserialized
|
184
|
+
# @return [Object] Deserialized data
|
185
|
+
def _deserialize(type, value)
|
186
|
+
case type.to_sym
|
187
|
+
when :Time
|
188
|
+
Time.parse(value)
|
189
|
+
when :Date
|
190
|
+
Date.parse(value)
|
191
|
+
when :String
|
192
|
+
value.to_s
|
193
|
+
when :Integer
|
194
|
+
value.to_i
|
195
|
+
when :Float
|
196
|
+
value.to_f
|
197
|
+
when :Boolean
|
198
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
199
|
+
true
|
200
|
+
else
|
201
|
+
false
|
202
|
+
end
|
203
|
+
when :Object
|
204
|
+
# generic object (usually a Hash), return directly
|
205
|
+
value
|
206
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
207
|
+
inner_type = Regexp.last_match[:inner_type]
|
208
|
+
value.map { |v| _deserialize(inner_type, v) }
|
209
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
210
|
+
k_type = Regexp.last_match[:k_type]
|
211
|
+
v_type = Regexp.last_match[:v_type]
|
212
|
+
{}.tap do |hash|
|
213
|
+
value.each do |k, v|
|
214
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
215
|
+
end
|
216
|
+
end
|
217
|
+
else # model
|
218
|
+
# models (e.g. Pet) or oneOf
|
219
|
+
klass = BmcApi.const_get(type)
|
220
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the string representation of the object
|
225
|
+
# @return [String] String presentation of the object
|
226
|
+
def to_s
|
227
|
+
to_hash.to_s
|
228
|
+
end
|
229
|
+
|
230
|
+
# to_body is an alias to to_hash (backward compatibility)
|
231
|
+
# @return [Hash] Returns the object in the form of hash
|
232
|
+
def to_body
|
233
|
+
to_hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Returns the object in the form of hash
|
237
|
+
# @return [Hash] Returns the object in the form of hash
|
238
|
+
def to_hash
|
239
|
+
hash = {}
|
240
|
+
self.class.attribute_map.each_pair do |attr, param|
|
241
|
+
value = self.send(attr)
|
242
|
+
if value.nil?
|
243
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
244
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
245
|
+
end
|
246
|
+
|
247
|
+
hash[param] = _to_hash(value)
|
248
|
+
end
|
249
|
+
hash
|
250
|
+
end
|
251
|
+
|
252
|
+
# Outputs non-array value in the form of hash
|
253
|
+
# For object, use to_hash. Otherwise, just return the value
|
254
|
+
# @param [Object] value Any valid value
|
255
|
+
# @return [Hash] Returns the value in the form of hash
|
256
|
+
def _to_hash(value)
|
257
|
+
if value.is_a?(Array)
|
258
|
+
value.compact.map { |v| _to_hash(v) }
|
259
|
+
elsif value.is_a?(Hash)
|
260
|
+
{}.tap do |hash|
|
261
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
262
|
+
end
|
263
|
+
elsif value.respond_to? :to_hash
|
264
|
+
value.to_hash
|
265
|
+
else
|
266
|
+
value
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
270
|
+
end
|
271
|
+
|
272
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -114,6 +114,7 @@ module BmcApi
|
|
114
114
|
# @return [Object] Returns the model itself
|
115
115
|
def build_from_hash(attributes)
|
116
116
|
return nil unless attributes.is_a?(Hash)
|
117
|
+
attributes = attributes.transform_keys(&:to_sym)
|
117
118
|
self.class.openapi_types.each_pair do |key, type|
|
118
119
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
119
120
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -144,6 +144,7 @@ module BmcApi
|
|
144
144
|
# @return [Object] Returns the model itself
|
145
145
|
def build_from_hash(attributes)
|
146
146
|
return nil unless attributes.is_a?(Hash)
|
147
|
+
attributes = attributes.transform_keys(&:to_sym)
|
147
148
|
self.class.openapi_types.each_pair do |key, type|
|
148
149
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
149
150
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -204,6 +204,7 @@ module BmcApi
|
|
204
204
|
# @return [Object] Returns the model itself
|
205
205
|
def build_from_hash(attributes)
|
206
206
|
return nil unless attributes.is_a?(Hash)
|
207
|
+
attributes = attributes.transform_keys(&:to_sym)
|
207
208
|
self.class.openapi_types.each_pair do |key, type|
|
208
209
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
209
210
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -172,6 +172,7 @@ module BmcApi
|
|
172
172
|
# @return [Object] Returns the model itself
|
173
173
|
def build_from_hash(attributes)
|
174
174
|
return nil unless attributes.is_a?(Hash)
|
175
|
+
attributes = attributes.transform_keys(&:to_sym)
|
175
176
|
self.class.openapi_types.each_pair do |key, type|
|
176
177
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
177
178
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -157,6 +157,7 @@ module BmcApi
|
|
157
157
|
# @return [Object] Returns the model itself
|
158
158
|
def build_from_hash(attributes)
|
159
159
|
return nil unless attributes.is_a?(Hash)
|
160
|
+
attributes = attributes.transform_keys(&:to_sym)
|
160
161
|
self.class.openapi_types.each_pair do |key, type|
|
161
162
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
162
163
|
self.send("#{key}=", nil)
|
@@ -1,12 +1,12 @@
|
|
1
1
|
=begin
|
2
2
|
#Bare Metal Cloud API
|
3
3
|
|
4
|
-
#Create, power off, power on, reset, reboot, or shut down your server with the Bare Metal Cloud API.
|
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
5
|
|
6
6
|
The version of the OpenAPI document: 0.1
|
7
7
|
Contact: support@phoenixnap.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version:
|
9
|
+
OpenAPI Generator version: 6.1.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -198,6 +198,7 @@ module BmcApi
|
|
198
198
|
# @return [Object] Returns the model itself
|
199
199
|
def build_from_hash(attributes)
|
200
200
|
return nil unless attributes.is_a?(Hash)
|
201
|
+
attributes = attributes.transform_keys(&:to_sym)
|
201
202
|
self.class.openapi_types.each_pair do |key, type|
|
202
203
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
203
204
|
self.send("#{key}=", nil)
|