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
|
|
@@ -27,13 +27,17 @@ module BmcApi
|
|
27
27
|
# List of IPs allowed to access the Management UI. Supported in single IP, CIDR and range format. When undefined, Management UI is disabled. This will only be returned in response to provisioning a server.
|
28
28
|
attr_accessor :management_access_allowed_ips
|
29
29
|
|
30
|
+
# If true, OS will be installed to and booted from the server's RAM. On restart RAM OS will be lost and the server will not be reachable unless a custom bootable OS has been deployed. Only supported for ubuntu/focal.
|
31
|
+
attr_accessor :install_os_to_ram
|
32
|
+
|
30
33
|
# Attribute mapping from ruby-style variable name to JSON key.
|
31
34
|
def self.attribute_map
|
32
35
|
{
|
33
36
|
:'windows' => :'windows',
|
34
37
|
:'root_password' => :'rootPassword',
|
35
38
|
:'management_ui_url' => :'managementUiUrl',
|
36
|
-
:'management_access_allowed_ips' => :'managementAccessAllowedIps'
|
39
|
+
:'management_access_allowed_ips' => :'managementAccessAllowedIps',
|
40
|
+
:'install_os_to_ram' => :'installOsToRam'
|
37
41
|
}
|
38
42
|
end
|
39
43
|
|
@@ -48,7 +52,8 @@ module BmcApi
|
|
48
52
|
:'windows' => :'OsConfigurationWindows',
|
49
53
|
:'root_password' => :'String',
|
50
54
|
:'management_ui_url' => :'String',
|
51
|
-
:'management_access_allowed_ips' => :'Array<String>'
|
55
|
+
:'management_access_allowed_ips' => :'Array<String>',
|
56
|
+
:'install_os_to_ram' => :'Boolean'
|
52
57
|
}
|
53
58
|
end
|
54
59
|
|
@@ -90,6 +95,12 @@ module BmcApi
|
|
90
95
|
self.management_access_allowed_ips = value
|
91
96
|
end
|
92
97
|
end
|
98
|
+
|
99
|
+
if attributes.key?(:'install_os_to_ram')
|
100
|
+
self.install_os_to_ram = attributes[:'install_os_to_ram']
|
101
|
+
else
|
102
|
+
self.install_os_to_ram = false
|
103
|
+
end
|
93
104
|
end
|
94
105
|
|
95
106
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -128,7 +139,8 @@ module BmcApi
|
|
128
139
|
windows == o.windows &&
|
129
140
|
root_password == o.root_password &&
|
130
141
|
management_ui_url == o.management_ui_url &&
|
131
|
-
management_access_allowed_ips == o.management_access_allowed_ips
|
142
|
+
management_access_allowed_ips == o.management_access_allowed_ips &&
|
143
|
+
install_os_to_ram == o.install_os_to_ram
|
132
144
|
end
|
133
145
|
|
134
146
|
# @see the `==` method
|
@@ -140,7 +152,7 @@ module BmcApi
|
|
140
152
|
# Calculates hash code according to all attributes.
|
141
153
|
# @return [Integer] Hash code
|
142
154
|
def hash
|
143
|
-
[windows, root_password, management_ui_url, management_access_allowed_ips].hash
|
155
|
+
[windows, root_password, management_ui_url, management_access_allowed_ips, install_os_to_ram].hash
|
144
156
|
end
|
145
157
|
|
146
158
|
# Builds the object from hash
|
@@ -155,6 +167,7 @@ module BmcApi
|
|
155
167
|
# @return [Object] Returns the model itself
|
156
168
|
def build_from_hash(attributes)
|
157
169
|
return nil unless attributes.is_a?(Hash)
|
170
|
+
attributes = attributes.transform_keys(&:to_sym)
|
158
171
|
self.class.openapi_types.each_pair do |key, type|
|
159
172
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
160
173
|
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
|
|
@@ -126,6 +126,7 @@ module BmcApi
|
|
126
126
|
# @return [Object] Returns the model itself
|
127
127
|
def build_from_hash(attributes)
|
128
128
|
return nil unless attributes.is_a?(Hash)
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
129
130
|
self.class.openapi_types.each_pair do |key, type|
|
130
131
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
131
132
|
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
|
|
@@ -146,6 +146,7 @@ module BmcApi
|
|
146
146
|
# @return [Object] Returns the model itself
|
147
147
|
def build_from_hash(attributes)
|
148
148
|
return nil unless attributes.is_a?(Hash)
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
149
150
|
self.class.openapi_types.each_pair do |key, type|
|
150
151
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
151
152
|
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
|
|
@@ -146,6 +146,7 @@ module BmcApi
|
|
146
146
|
# @return [Object] Returns the model itself
|
147
147
|
def build_from_hash(attributes)
|
148
148
|
return nil unless attributes.is_a?(Hash)
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
149
150
|
self.class.openapi_types.each_pair do |key, type|
|
150
151
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
151
152
|
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
|
|
@@ -126,6 +126,7 @@ module BmcApi
|
|
126
126
|
# @return [Object] Returns the model itself
|
127
127
|
def build_from_hash(attributes)
|
128
128
|
return nil unless attributes.is_a?(Hash)
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
129
130
|
self.class.openapi_types.each_pair do |key, type|
|
130
131
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
131
132
|
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
|
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module BmcApi
|
17
17
|
# Private network details of bare metal server.
|
18
18
|
class PrivateNetworkConfiguration
|
19
|
-
# The address of the gateway assigned / to assign to the server.
|
19
|
+
# The address of the gateway assigned / to assign to the server. When used as part of request body, it has to match one of the IP addresses used in the existing assigned private networks for the relevant location. Deprecated in favour of a common gateway address across all networks available under NetworkConfiguration.
|
20
20
|
attr_accessor :gateway_address
|
21
21
|
|
22
22
|
# Determines the approach for configuring private network(s) for the server being provisioned. Currently this field should be set to `USE_OR_CREATE_DEFAULT` or `USER_DEFINED`.
|
@@ -133,6 +133,7 @@ module BmcApi
|
|
133
133
|
# @return [Object] Returns the model itself
|
134
134
|
def build_from_hash(attributes)
|
135
135
|
return nil unless attributes.is_a?(Hash)
|
136
|
+
attributes = attributes.transform_keys(&:to_sym)
|
136
137
|
self.class.openapi_types.each_pair do |key, type|
|
137
138
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
138
139
|
self.send("#{key}=", nil)
|
@@ -0,0 +1,223 @@
|
|
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 PublicNetworkConfiguration
|
19
|
+
# The list of public networks this server is member of. When this field is part of request body, it'll be used to specify the public networks to assign to this server upon provisioning.
|
20
|
+
attr_accessor :public_networks
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'public_networks' => :'publicNetworks'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Returns all the JSON keys this model knows about
|
30
|
+
def self.acceptable_attributes
|
31
|
+
attribute_map.values
|
32
|
+
end
|
33
|
+
|
34
|
+
# Attribute type mapping.
|
35
|
+
def self.openapi_types
|
36
|
+
{
|
37
|
+
:'public_networks' => :'Array<ServerPublicNetwork>'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# List of attributes with nullable: true
|
42
|
+
def self.openapi_nullable
|
43
|
+
Set.new([
|
44
|
+
])
|
45
|
+
end
|
46
|
+
|
47
|
+
# Initializes the object
|
48
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
49
|
+
def initialize(attributes = {})
|
50
|
+
if (!attributes.is_a?(Hash))
|
51
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `BmcApi::PublicNetworkConfiguration` initialize method"
|
52
|
+
end
|
53
|
+
|
54
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
55
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
56
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
57
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `BmcApi::PublicNetworkConfiguration`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
58
|
+
end
|
59
|
+
h[k.to_sym] = v
|
60
|
+
}
|
61
|
+
|
62
|
+
if attributes.key?(:'public_networks')
|
63
|
+
if (value = attributes[:'public_networks']).is_a?(Array)
|
64
|
+
self.public_networks = value
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
public_networks == o.public_networks
|
88
|
+
end
|
89
|
+
|
90
|
+
# @see the `==` method
|
91
|
+
# @param [Object] Object to be compared
|
92
|
+
def eql?(o)
|
93
|
+
self == o
|
94
|
+
end
|
95
|
+
|
96
|
+
# Calculates hash code according to all attributes.
|
97
|
+
# @return [Integer] Hash code
|
98
|
+
def hash
|
99
|
+
[public_networks].hash
|
100
|
+
end
|
101
|
+
|
102
|
+
# Builds the object from hash
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
+
# @return [Object] Returns the model itself
|
105
|
+
def self.build_from_hash(attributes)
|
106
|
+
new.build_from_hash(attributes)
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def build_from_hash(attributes)
|
113
|
+
return nil unless attributes.is_a?(Hash)
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
115
|
+
self.class.openapi_types.each_pair do |key, type|
|
116
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
117
|
+
self.send("#{key}=", nil)
|
118
|
+
elsif type =~ /\AArray<(.*)>/i
|
119
|
+
# check to ensure the input is an array given that the attribute
|
120
|
+
# is documented as an array but the input is not
|
121
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
122
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
123
|
+
end
|
124
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
125
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
self
|
130
|
+
end
|
131
|
+
|
132
|
+
# Deserializes the data based on type
|
133
|
+
# @param string type Data type
|
134
|
+
# @param string value Value to be deserialized
|
135
|
+
# @return [Object] Deserialized data
|
136
|
+
def _deserialize(type, value)
|
137
|
+
case type.to_sym
|
138
|
+
when :Time
|
139
|
+
Time.parse(value)
|
140
|
+
when :Date
|
141
|
+
Date.parse(value)
|
142
|
+
when :String
|
143
|
+
value.to_s
|
144
|
+
when :Integer
|
145
|
+
value.to_i
|
146
|
+
when :Float
|
147
|
+
value.to_f
|
148
|
+
when :Boolean
|
149
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
150
|
+
true
|
151
|
+
else
|
152
|
+
false
|
153
|
+
end
|
154
|
+
when :Object
|
155
|
+
# generic object (usually a Hash), return directly
|
156
|
+
value
|
157
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
158
|
+
inner_type = Regexp.last_match[:inner_type]
|
159
|
+
value.map { |v| _deserialize(inner_type, v) }
|
160
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
161
|
+
k_type = Regexp.last_match[:k_type]
|
162
|
+
v_type = Regexp.last_match[:v_type]
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each do |k, v|
|
165
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
166
|
+
end
|
167
|
+
end
|
168
|
+
else # model
|
169
|
+
# models (e.g. Pet) or oneOf
|
170
|
+
klass = BmcApi.const_get(type)
|
171
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
# Returns the string representation of the object
|
176
|
+
# @return [String] String presentation of the object
|
177
|
+
def to_s
|
178
|
+
to_hash.to_s
|
179
|
+
end
|
180
|
+
|
181
|
+
# to_body is an alias to to_hash (backward compatibility)
|
182
|
+
# @return [Hash] Returns the object in the form of hash
|
183
|
+
def to_body
|
184
|
+
to_hash
|
185
|
+
end
|
186
|
+
|
187
|
+
# Returns the object in the form of hash
|
188
|
+
# @return [Hash] Returns the object in the form of hash
|
189
|
+
def to_hash
|
190
|
+
hash = {}
|
191
|
+
self.class.attribute_map.each_pair do |attr, param|
|
192
|
+
value = self.send(attr)
|
193
|
+
if value.nil?
|
194
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
195
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
196
|
+
end
|
197
|
+
|
198
|
+
hash[param] = _to_hash(value)
|
199
|
+
end
|
200
|
+
hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Outputs non-array value in the form of hash
|
204
|
+
# For object, use to_hash. Otherwise, just return the value
|
205
|
+
# @param [Object] value Any valid value
|
206
|
+
# @return [Hash] Returns the value in the form of hash
|
207
|
+
def _to_hash(value)
|
208
|
+
if value.is_a?(Array)
|
209
|
+
value.compact.map { |v| _to_hash(v) }
|
210
|
+
elsif value.is_a?(Hash)
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
213
|
+
end
|
214
|
+
elsif value.respond_to? :to_hash
|
215
|
+
value.to_hash
|
216
|
+
else
|
217
|
+
value
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
end
|
222
|
+
|
223
|
+
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
|
|
@@ -31,7 +31,7 @@ module BmcApi
|
|
31
31
|
# The limit set for the quota.
|
32
32
|
attr_accessor :limit
|
33
33
|
|
34
|
-
#
|
34
|
+
# Unit of the quota type. Supported values are 'COUNT' and 'GB'.
|
35
35
|
attr_accessor :unit
|
36
36
|
|
37
37
|
# The quota used expressed as a number.
|
@@ -209,8 +209,6 @@ module BmcApi
|
|
209
209
|
return false if @limit.nil?
|
210
210
|
return false if @limit < 0
|
211
211
|
return false if @unit.nil?
|
212
|
-
unit_validator = EnumAttributeValidator.new('String', ["COUNT"])
|
213
|
-
return false unless unit_validator.valid?(@unit)
|
214
212
|
return false if @used.nil?
|
215
213
|
return false if @used < 0
|
216
214
|
return false if @quota_edit_limit_request_details.nil?
|
@@ -241,16 +239,6 @@ module BmcApi
|
|
241
239
|
@limit = limit
|
242
240
|
end
|
243
241
|
|
244
|
-
# Custom attribute writer method checking allowed values (enum).
|
245
|
-
# @param [Object] unit Object to be assigned
|
246
|
-
def unit=(unit)
|
247
|
-
validator = EnumAttributeValidator.new('String', ["COUNT"])
|
248
|
-
unless validator.valid?(unit)
|
249
|
-
fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}."
|
250
|
-
end
|
251
|
-
@unit = unit
|
252
|
-
end
|
253
|
-
|
254
242
|
# Custom attribute writer method with validation
|
255
243
|
# @param [Object] used Value to be assigned
|
256
244
|
def used=(used)
|
@@ -304,6 +292,7 @@ module BmcApi
|
|
304
292
|
# @return [Object] Returns the model itself
|
305
293
|
def build_from_hash(attributes)
|
306
294
|
return nil unless attributes.is_a?(Hash)
|
295
|
+
attributes = attributes.transform_keys(&:to_sym)
|
307
296
|
self.class.openapi_types.each_pair do |key, type|
|
308
297
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
309
298
|
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
|
|
@@ -148,6 +148,7 @@ module BmcApi
|
|
148
148
|
# @return [Object] Returns the model itself
|
149
149
|
def build_from_hash(attributes)
|
150
150
|
return nil unless attributes.is_a?(Hash)
|
151
|
+
attributes = attributes.transform_keys(&:to_sym)
|
151
152
|
self.class.openapi_types.each_pair do |key, type|
|
152
153
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
153
154
|
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
|
|
@@ -170,6 +170,7 @@ module BmcApi
|
|
170
170
|
# @return [Object] Returns the model itself
|
171
171
|
def build_from_hash(attributes)
|
172
172
|
return nil unless attributes.is_a?(Hash)
|
173
|
+
attributes = attributes.transform_keys(&:to_sym)
|
173
174
|
self.class.openapi_types.each_pair do |key, type|
|
174
175
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
175
176
|
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
|
|
@@ -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
|
|
@@ -111,6 +111,7 @@ module BmcApi
|
|
111
111
|
# @return [Object] Returns the model itself
|
112
112
|
def build_from_hash(attributes)
|
113
113
|
return nil unless attributes.is_a?(Hash)
|
114
|
+
attributes = attributes.transform_keys(&:to_sym)
|
114
115
|
self.class.openapi_types.each_pair do |key, type|
|
115
116
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
116
117
|
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
|
|
@@ -133,6 +133,7 @@ module BmcApi
|
|
133
133
|
# @return [Object] Returns the model itself
|
134
134
|
def build_from_hash(attributes)
|
135
135
|
return nil unless attributes.is_a?(Hash)
|
136
|
+
attributes = attributes.transform_keys(&:to_sym)
|
136
137
|
self.class.openapi_types.each_pair do |key, type|
|
137
138
|
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
138
139
|
self.send("#{key}=", nil)
|