pnap_bmc_api 1.3.0 → 1.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 +5 -0
- data/VERSION +1 -1
- data/docs/IpBlocksConfiguration.md +1 -1
- data/docs/OsConfiguration.md +8 -4
- data/docs/OsConfigurationMapEsxi.md +2 -2
- data/docs/OsConfigurationMapProxmox.md +2 -2
- data/docs/OsConfigurationNetrisController.md +22 -0
- data/docs/OsConfigurationNetrisSoftgate.md +24 -0
- data/docs/PrivateNetworkConfiguration.md +1 -1
- data/docs/Server.md +3 -3
- data/docs/ServerCreate.md +2 -2
- data/docs/ServerIpBlock.md +1 -1
- data/docs/ServerNetworkUpdate.md +18 -0
- data/docs/ServerPrivateNetwork.md +1 -1
- data/docs/ServerPublicNetwork.md +1 -1
- data/docs/ServersApi.md +156 -0
- data/lib/pnap_bmc_api/api/servers_api.rb +158 -0
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +1 -1
- data/lib/pnap_bmc_api/models/os_configuration.rb +22 -4
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +2 -2
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +2 -2
- data/lib/pnap_bmc_api/models/os_configuration_netris_controller.rb +241 -0
- data/lib/pnap_bmc_api/models/os_configuration_netris_softgate.rb +251 -0
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +1 -1
- data/lib/pnap_bmc_api/models/server.rb +3 -3
- data/lib/pnap_bmc_api/models/server_create.rb +2 -2
- data/lib/pnap_bmc_api/models/server_ip_block.rb +1 -1
- data/lib/pnap_bmc_api/models/server_network_update.rb +223 -0
- data/lib/pnap_bmc_api/models/server_private_network.rb +1 -1
- data/lib/pnap_bmc_api/models/server_public_network.rb +1 -1
- data/lib/pnap_bmc_api.rb +3 -0
- data/spec/models/os_configuration_netris_controller_spec.rb +46 -0
- data/spec/models/os_configuration_netris_softgate_spec.rb +52 -0
- data/spec/models/server_network_update_spec.rb +34 -0
- metadata +42 -30
@@ -1019,6 +1019,85 @@ module BmcApi
|
|
1019
1019
|
return data, status_code, headers
|
1020
1020
|
end
|
1021
1021
|
|
1022
|
+
# Updates the server's private network's IP addresses
|
1023
|
+
# IP address changes intended to keep the BMC data up to date with server's operating system. We do not have access to the server's operating system and therefore manual configuration is required to apply the changes on the host. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-6' target='_blank'>here</a>
|
1024
|
+
# @param server_id [String] The server's ID.
|
1025
|
+
# @param private_network_id [String] The private network identifier.
|
1026
|
+
# @param [Hash] opts the optional parameters
|
1027
|
+
# @option opts [Boolean] :force Query parameter controlling advanced features availability. Currently applicable for networking. It is advised to use with caution since it might lead to unhealthy setups. (default to false)
|
1028
|
+
# @option opts [ServerNetworkUpdate] :server_network_update
|
1029
|
+
# @return [ServerPrivateNetwork]
|
1030
|
+
def servers_server_id_private_networks_patch(server_id, private_network_id, opts = {})
|
1031
|
+
data, _status_code, _headers = servers_server_id_private_networks_patch_with_http_info(server_id, private_network_id, opts)
|
1032
|
+
data
|
1033
|
+
end
|
1034
|
+
|
1035
|
+
# Updates the server's private network's IP addresses
|
1036
|
+
# IP address changes intended to keep the BMC data up to date with server's operating system. We do not have access to the server's operating system and therefore manual configuration is required to apply the changes on the host. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-6' target='_blank'>here</a>
|
1037
|
+
# @param server_id [String] The server's ID.
|
1038
|
+
# @param private_network_id [String] The private network identifier.
|
1039
|
+
# @param [Hash] opts the optional parameters
|
1040
|
+
# @option opts [Boolean] :force Query parameter controlling advanced features availability. Currently applicable for networking. It is advised to use with caution since it might lead to unhealthy setups. (default to false)
|
1041
|
+
# @option opts [ServerNetworkUpdate] :server_network_update
|
1042
|
+
# @return [Array<(ServerPrivateNetwork, Integer, Hash)>] ServerPrivateNetwork data, response status code and response headers
|
1043
|
+
def servers_server_id_private_networks_patch_with_http_info(server_id, private_network_id, opts = {})
|
1044
|
+
if @api_client.config.debugging
|
1045
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_private_networks_patch ...'
|
1046
|
+
end
|
1047
|
+
# verify the required parameter 'server_id' is set
|
1048
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
1049
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_private_networks_patch"
|
1050
|
+
end
|
1051
|
+
# verify the required parameter 'private_network_id' is set
|
1052
|
+
if @api_client.config.client_side_validation && private_network_id.nil?
|
1053
|
+
fail ArgumentError, "Missing the required parameter 'private_network_id' when calling ServersApi.servers_server_id_private_networks_patch"
|
1054
|
+
end
|
1055
|
+
# resource path
|
1056
|
+
local_var_path = '/servers/{serverId}/network-configuration/private-network-configuration/private-networks/{privateNetworkId}'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'privateNetworkId' + '}', CGI.escape(private_network_id.to_s))
|
1057
|
+
|
1058
|
+
# query parameters
|
1059
|
+
query_params = opts[:query_params] || {}
|
1060
|
+
query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
|
1061
|
+
|
1062
|
+
# header parameters
|
1063
|
+
header_params = opts[:header_params] || {}
|
1064
|
+
# HTTP header 'Accept' (if needed)
|
1065
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1066
|
+
# HTTP header 'Content-Type'
|
1067
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1068
|
+
if !content_type.nil?
|
1069
|
+
header_params['Content-Type'] = content_type
|
1070
|
+
end
|
1071
|
+
|
1072
|
+
# form parameters
|
1073
|
+
form_params = opts[:form_params] || {}
|
1074
|
+
|
1075
|
+
# http body (model)
|
1076
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_network_update'])
|
1077
|
+
|
1078
|
+
# return_type
|
1079
|
+
return_type = opts[:debug_return_type] || 'ServerPrivateNetwork'
|
1080
|
+
|
1081
|
+
# auth_names
|
1082
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
1083
|
+
|
1084
|
+
new_options = opts.merge(
|
1085
|
+
:operation => :"ServersApi.servers_server_id_private_networks_patch",
|
1086
|
+
:header_params => header_params,
|
1087
|
+
:query_params => query_params,
|
1088
|
+
:form_params => form_params,
|
1089
|
+
:body => post_body,
|
1090
|
+
:auth_names => auth_names,
|
1091
|
+
:return_type => return_type
|
1092
|
+
)
|
1093
|
+
|
1094
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1095
|
+
if @api_client.config.debugging
|
1096
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_private_networks_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1097
|
+
end
|
1098
|
+
return data, status_code, headers
|
1099
|
+
end
|
1100
|
+
|
1022
1101
|
# Adds the server to a private network.
|
1023
1102
|
# Adds the server to a private network. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. Manual network configuration changes in the operating system of this server are required. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/configure-bmc-server-after-adding-to-network#ftoc-heading-3' target='_blank'>here</a>.
|
1024
1103
|
# @param server_id [String] The server's ID.
|
@@ -1161,6 +1240,85 @@ module BmcApi
|
|
1161
1240
|
return data, status_code, headers
|
1162
1241
|
end
|
1163
1242
|
|
1243
|
+
# Updates the server's public network's IP addresses.
|
1244
|
+
# IP address changes intended to keep the BMC data up to date with server's operating system. We do not have access to the server's operating system and therefore manual configuration is required to apply the changes on the host. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-6' target='_blank'>here</a>
|
1245
|
+
# @param server_id [String] The server's ID.
|
1246
|
+
# @param public_network_id [String] The Public Network identifier.
|
1247
|
+
# @param [Hash] opts the optional parameters
|
1248
|
+
# @option opts [Boolean] :force Query parameter controlling advanced features availability. Currently applicable for networking. It is advised to use with caution since it might lead to unhealthy setups. (default to false)
|
1249
|
+
# @option opts [ServerNetworkUpdate] :server_network_update
|
1250
|
+
# @return [ServerPublicNetwork]
|
1251
|
+
def servers_server_id_public_networks_patch(server_id, public_network_id, opts = {})
|
1252
|
+
data, _status_code, _headers = servers_server_id_public_networks_patch_with_http_info(server_id, public_network_id, opts)
|
1253
|
+
data
|
1254
|
+
end
|
1255
|
+
|
1256
|
+
# Updates the server's public network's IP addresses.
|
1257
|
+
# IP address changes intended to keep the BMC data up to date with server's operating system. We do not have access to the server's operating system and therefore manual configuration is required to apply the changes on the host. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/bmc-server-management-via-api#ftoc-heading-6' target='_blank'>here</a>
|
1258
|
+
# @param server_id [String] The server's ID.
|
1259
|
+
# @param public_network_id [String] The Public Network identifier.
|
1260
|
+
# @param [Hash] opts the optional parameters
|
1261
|
+
# @option opts [Boolean] :force Query parameter controlling advanced features availability. Currently applicable for networking. It is advised to use with caution since it might lead to unhealthy setups. (default to false)
|
1262
|
+
# @option opts [ServerNetworkUpdate] :server_network_update
|
1263
|
+
# @return [Array<(ServerPublicNetwork, Integer, Hash)>] ServerPublicNetwork data, response status code and response headers
|
1264
|
+
def servers_server_id_public_networks_patch_with_http_info(server_id, public_network_id, opts = {})
|
1265
|
+
if @api_client.config.debugging
|
1266
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_public_networks_patch ...'
|
1267
|
+
end
|
1268
|
+
# verify the required parameter 'server_id' is set
|
1269
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
1270
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_public_networks_patch"
|
1271
|
+
end
|
1272
|
+
# verify the required parameter 'public_network_id' is set
|
1273
|
+
if @api_client.config.client_side_validation && public_network_id.nil?
|
1274
|
+
fail ArgumentError, "Missing the required parameter 'public_network_id' when calling ServersApi.servers_server_id_public_networks_patch"
|
1275
|
+
end
|
1276
|
+
# resource path
|
1277
|
+
local_var_path = '/servers/{serverId}/network-configuration/public-network-configuration/public-networks/{publicNetworkId}'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'publicNetworkId' + '}', CGI.escape(public_network_id.to_s))
|
1278
|
+
|
1279
|
+
# query parameters
|
1280
|
+
query_params = opts[:query_params] || {}
|
1281
|
+
query_params[:'force'] = opts[:'force'] if !opts[:'force'].nil?
|
1282
|
+
|
1283
|
+
# header parameters
|
1284
|
+
header_params = opts[:header_params] || {}
|
1285
|
+
# HTTP header 'Accept' (if needed)
|
1286
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1287
|
+
# HTTP header 'Content-Type'
|
1288
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1289
|
+
if !content_type.nil?
|
1290
|
+
header_params['Content-Type'] = content_type
|
1291
|
+
end
|
1292
|
+
|
1293
|
+
# form parameters
|
1294
|
+
form_params = opts[:form_params] || {}
|
1295
|
+
|
1296
|
+
# http body (model)
|
1297
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_network_update'])
|
1298
|
+
|
1299
|
+
# return_type
|
1300
|
+
return_type = opts[:debug_return_type] || 'ServerPublicNetwork'
|
1301
|
+
|
1302
|
+
# auth_names
|
1303
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
1304
|
+
|
1305
|
+
new_options = opts.merge(
|
1306
|
+
:operation => :"ServersApi.servers_server_id_public_networks_patch",
|
1307
|
+
:header_params => header_params,
|
1308
|
+
:query_params => query_params,
|
1309
|
+
:form_params => form_params,
|
1310
|
+
:body => post_body,
|
1311
|
+
:auth_names => auth_names,
|
1312
|
+
:return_type => return_type
|
1313
|
+
)
|
1314
|
+
|
1315
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1316
|
+
if @api_client.config.debugging
|
1317
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_public_networks_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1318
|
+
end
|
1319
|
+
return data, status_code, headers
|
1320
|
+
end
|
1321
|
+
|
1164
1322
|
# Adds the server to a Public Network.
|
1165
1323
|
# Adds the server to a Public Network. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. Manual network configuration changes in the operating system of this server are required. Knowledge base article to help you can be found <a href='https://phoenixnap.com/kb/configure-bmc-server-after-adding-to-network#ftoc-heading-3' target='_blank'>here</a>.
|
1166
1324
|
# @param server_id [String] The server's ID.
|
@@ -16,7 +16,7 @@ require 'time'
|
|
16
16
|
module BmcApi
|
17
17
|
# The IP blocks to assign to this server. <b>This is an exclusive allocation</b>, i.e. the IP blocks cannot be shared with other servers. If IpBlocksConfiguration is not defined, the purchase of a new IP block is determined by the networkType field.
|
18
18
|
class IpBlocksConfiguration
|
19
|
-
# Determines the approach for configuring IP blocks for the server being provisioned. If PURCHASE_NEW is selected, the smallest supported range, depending on the operating system, is allocated to the server.
|
19
|
+
# (Write-only) Determines the approach for configuring IP blocks for the server being provisioned. If PURCHASE_NEW is selected, the smallest supported range, depending on the operating system, is allocated to the server.
|
20
20
|
attr_accessor :configuration_type
|
21
21
|
|
22
22
|
# Used to specify the previously purchased IP blocks to assign to this server upon provisioning. Used alongside the USER_DEFINED configurationType.
|
@@ -16,18 +16,22 @@ require 'time'
|
|
16
16
|
module BmcApi
|
17
17
|
# OS specific configuration properties.
|
18
18
|
class OsConfiguration
|
19
|
+
attr_accessor :netris_controller
|
20
|
+
|
21
|
+
attr_accessor :netris_softgate
|
22
|
+
|
19
23
|
attr_accessor :windows
|
20
24
|
|
21
|
-
#
|
25
|
+
# (Read-only) Auto-generated password set for user 'root' on an ESXi or Proxmox server.<br> The password is not stored and therefore will only be returned in response to provisioning a server. Copy and save it for future reference.
|
22
26
|
attr_accessor :root_password
|
23
27
|
|
24
|
-
# The URL of the management UI which will only be returned in response to provisioning a server.
|
28
|
+
# (Read-only) The URL of the management UI which will only be returned in response to provisioning a server.
|
25
29
|
attr_accessor :management_ui_url
|
26
30
|
|
27
31
|
# 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
32
|
attr_accessor :management_access_allowed_ips
|
29
33
|
|
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 and ubuntu/jammy.
|
34
|
+
# 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. Follow the <a href='https://phoenixnap.com/kb/bmc-custom-os' target='_blank'>instructions</a> on how to install custom OS on BMC. Only supported for ubuntu/focal and ubuntu/jammy.
|
31
35
|
attr_accessor :install_os_to_ram
|
32
36
|
|
33
37
|
attr_accessor :cloud_init
|
@@ -35,6 +39,8 @@ module BmcApi
|
|
35
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
36
40
|
def self.attribute_map
|
37
41
|
{
|
42
|
+
:'netris_controller' => :'netrisController',
|
43
|
+
:'netris_softgate' => :'netrisSoftgate',
|
38
44
|
:'windows' => :'windows',
|
39
45
|
:'root_password' => :'rootPassword',
|
40
46
|
:'management_ui_url' => :'managementUiUrl',
|
@@ -52,6 +58,8 @@ module BmcApi
|
|
52
58
|
# Attribute type mapping.
|
53
59
|
def self.openapi_types
|
54
60
|
{
|
61
|
+
:'netris_controller' => :'OsConfigurationNetrisController',
|
62
|
+
:'netris_softgate' => :'OsConfigurationNetrisSoftgate',
|
55
63
|
:'windows' => :'OsConfigurationWindows',
|
56
64
|
:'root_password' => :'String',
|
57
65
|
:'management_ui_url' => :'String',
|
@@ -82,6 +90,14 @@ module BmcApi
|
|
82
90
|
h[k.to_sym] = v
|
83
91
|
}
|
84
92
|
|
93
|
+
if attributes.key?(:'netris_controller')
|
94
|
+
self.netris_controller = attributes[:'netris_controller']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'netris_softgate')
|
98
|
+
self.netris_softgate = attributes[:'netris_softgate']
|
99
|
+
end
|
100
|
+
|
85
101
|
if attributes.key?(:'windows')
|
86
102
|
self.windows = attributes[:'windows']
|
87
103
|
end
|
@@ -144,6 +160,8 @@ module BmcApi
|
|
144
160
|
def ==(o)
|
145
161
|
return true if self.equal?(o)
|
146
162
|
self.class == o.class &&
|
163
|
+
netris_controller == o.netris_controller &&
|
164
|
+
netris_softgate == o.netris_softgate &&
|
147
165
|
windows == o.windows &&
|
148
166
|
root_password == o.root_password &&
|
149
167
|
management_ui_url == o.management_ui_url &&
|
@@ -161,7 +179,7 @@ module BmcApi
|
|
161
179
|
# Calculates hash code according to all attributes.
|
162
180
|
# @return [Integer] Hash code
|
163
181
|
def hash
|
164
|
-
[windows, root_password, management_ui_url, management_access_allowed_ips, install_os_to_ram, cloud_init].hash
|
182
|
+
[netris_controller, netris_softgate, windows, root_password, management_ui_url, management_access_allowed_ips, install_os_to_ram, cloud_init].hash
|
165
183
|
end
|
166
184
|
|
167
185
|
# Builds the object from hash
|
@@ -16,10 +16,10 @@ require 'time'
|
|
16
16
|
module BmcApi
|
17
17
|
# VMWare ESXi configuration properties.
|
18
18
|
class OsConfigurationMapEsxi
|
19
|
-
# Password set for user root on an ESXi server which will only be returned in response to provisioning a server.
|
19
|
+
# (Read-only) Password set for user root on an ESXi server which will only be returned in response to provisioning a server.
|
20
20
|
attr_accessor :root_password
|
21
21
|
|
22
|
-
# The URL of the management UI which will only be returned in response to provisioning a server.
|
22
|
+
# (Read-only) The URL of the management UI which will only be returned in response to provisioning a server.
|
23
23
|
attr_accessor :management_ui_url
|
24
24
|
|
25
25
|
# 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.
|
@@ -16,10 +16,10 @@ require 'time'
|
|
16
16
|
module BmcApi
|
17
17
|
# Proxmox VE configuration properties.
|
18
18
|
class OsConfigurationMapProxmox
|
19
|
-
# Password set for user root on a Proxmox server which will only be returned in response to provisioning a server.
|
19
|
+
# (Read-only) Password set for user root on a Proxmox server which will only be returned in response to provisioning a server.
|
20
20
|
attr_accessor :root_password
|
21
21
|
|
22
|
-
# The URL of the management UI which will only be returned in response to provisioning a server.
|
22
|
+
# (Read-only) The URL of the management UI which will only be returned in response to provisioning a server.
|
23
23
|
attr_accessor :management_ui_url
|
24
24
|
|
25
25
|
# 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.
|
@@ -0,0 +1,241 @@
|
|
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
|
+
# Netris Controller configuration properties.
|
18
|
+
class OsConfigurationNetrisController
|
19
|
+
# (Read-only) Host OS on which the Netris Controller is installed.
|
20
|
+
attr_accessor :host_os
|
21
|
+
|
22
|
+
# (Read-only) The URL for the Netris Controller web console. Will only be returned in response to provisioning a server.
|
23
|
+
attr_accessor :netris_web_console_url
|
24
|
+
|
25
|
+
# (Read-only) Auto-generated password set for user 'netris' in the web console.<br> The password is not stored and therefore will only be returned in response to provisioning a server. Copy and save it for future reference.
|
26
|
+
attr_accessor :netris_user_password
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'host_os' => :'hostOs',
|
32
|
+
:'netris_web_console_url' => :'netrisWebConsoleUrl',
|
33
|
+
:'netris_user_password' => :'netrisUserPassword'
|
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
|
+
:'host_os' => :'String',
|
46
|
+
:'netris_web_console_url' => :'String',
|
47
|
+
:'netris_user_password' => :'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::OsConfigurationNetrisController` 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::OsConfigurationNetrisController`. 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?(:'host_os')
|
73
|
+
self.host_os = attributes[:'host_os']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes.key?(:'netris_web_console_url')
|
77
|
+
self.netris_web_console_url = attributes[:'netris_web_console_url']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes.key?(:'netris_user_password')
|
81
|
+
self.netris_user_password = attributes[:'netris_user_password']
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
86
|
+
# @return Array for valid properties with the reasons
|
87
|
+
def list_invalid_properties
|
88
|
+
invalid_properties = Array.new
|
89
|
+
invalid_properties
|
90
|
+
end
|
91
|
+
|
92
|
+
# Check to see if the all the properties in the model are valid
|
93
|
+
# @return true if the model is valid
|
94
|
+
def valid?
|
95
|
+
true
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] Object to be compared
|
100
|
+
def ==(o)
|
101
|
+
return true if self.equal?(o)
|
102
|
+
self.class == o.class &&
|
103
|
+
host_os == o.host_os &&
|
104
|
+
netris_web_console_url == o.netris_web_console_url &&
|
105
|
+
netris_user_password == o.netris_user_password
|
106
|
+
end
|
107
|
+
|
108
|
+
# @see the `==` method
|
109
|
+
# @param [Object] Object to be compared
|
110
|
+
def eql?(o)
|
111
|
+
self == o
|
112
|
+
end
|
113
|
+
|
114
|
+
# Calculates hash code according to all attributes.
|
115
|
+
# @return [Integer] Hash code
|
116
|
+
def hash
|
117
|
+
[host_os, netris_web_console_url, netris_user_password].hash
|
118
|
+
end
|
119
|
+
|
120
|
+
# Builds the object from hash
|
121
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
122
|
+
# @return [Object] Returns the model itself
|
123
|
+
def self.build_from_hash(attributes)
|
124
|
+
new.build_from_hash(attributes)
|
125
|
+
end
|
126
|
+
|
127
|
+
# Builds the object from hash
|
128
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
129
|
+
# @return [Object] Returns the model itself
|
130
|
+
def build_from_hash(attributes)
|
131
|
+
return nil unless attributes.is_a?(Hash)
|
132
|
+
attributes = attributes.transform_keys(&:to_sym)
|
133
|
+
self.class.openapi_types.each_pair do |key, type|
|
134
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
135
|
+
self.send("#{key}=", nil)
|
136
|
+
elsif type =~ /\AArray<(.*)>/i
|
137
|
+
# check to ensure the input is an array given that the attribute
|
138
|
+
# is documented as an array but the input is not
|
139
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
140
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
141
|
+
end
|
142
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
143
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
self
|
148
|
+
end
|
149
|
+
|
150
|
+
# Deserializes the data based on type
|
151
|
+
# @param string type Data type
|
152
|
+
# @param string value Value to be deserialized
|
153
|
+
# @return [Object] Deserialized data
|
154
|
+
def _deserialize(type, value)
|
155
|
+
case type.to_sym
|
156
|
+
when :Time
|
157
|
+
Time.parse(value)
|
158
|
+
when :Date
|
159
|
+
Date.parse(value)
|
160
|
+
when :String
|
161
|
+
value.to_s
|
162
|
+
when :Integer
|
163
|
+
value.to_i
|
164
|
+
when :Float
|
165
|
+
value.to_f
|
166
|
+
when :Boolean
|
167
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
168
|
+
true
|
169
|
+
else
|
170
|
+
false
|
171
|
+
end
|
172
|
+
when :Object
|
173
|
+
# generic object (usually a Hash), return directly
|
174
|
+
value
|
175
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
176
|
+
inner_type = Regexp.last_match[:inner_type]
|
177
|
+
value.map { |v| _deserialize(inner_type, v) }
|
178
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
179
|
+
k_type = Regexp.last_match[:k_type]
|
180
|
+
v_type = Regexp.last_match[:v_type]
|
181
|
+
{}.tap do |hash|
|
182
|
+
value.each do |k, v|
|
183
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
else # model
|
187
|
+
# models (e.g. Pet) or oneOf
|
188
|
+
klass = BmcApi.const_get(type)
|
189
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
# Returns the string representation of the object
|
194
|
+
# @return [String] String presentation of the object
|
195
|
+
def to_s
|
196
|
+
to_hash.to_s
|
197
|
+
end
|
198
|
+
|
199
|
+
# to_body is an alias to to_hash (backward compatibility)
|
200
|
+
# @return [Hash] Returns the object in the form of hash
|
201
|
+
def to_body
|
202
|
+
to_hash
|
203
|
+
end
|
204
|
+
|
205
|
+
# Returns the object in the form of hash
|
206
|
+
# @return [Hash] Returns the object in the form of hash
|
207
|
+
def to_hash
|
208
|
+
hash = {}
|
209
|
+
self.class.attribute_map.each_pair do |attr, param|
|
210
|
+
value = self.send(attr)
|
211
|
+
if value.nil?
|
212
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
213
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
214
|
+
end
|
215
|
+
|
216
|
+
hash[param] = _to_hash(value)
|
217
|
+
end
|
218
|
+
hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Outputs non-array value in the form of hash
|
222
|
+
# For object, use to_hash. Otherwise, just return the value
|
223
|
+
# @param [Object] value Any valid value
|
224
|
+
# @return [Hash] Returns the value in the form of hash
|
225
|
+
def _to_hash(value)
|
226
|
+
if value.is_a?(Array)
|
227
|
+
value.compact.map { |v| _to_hash(v) }
|
228
|
+
elsif value.is_a?(Hash)
|
229
|
+
{}.tap do |hash|
|
230
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
231
|
+
end
|
232
|
+
elsif value.respond_to? :to_hash
|
233
|
+
value.to_hash
|
234
|
+
else
|
235
|
+
value
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
240
|
+
|
241
|
+
end
|