pnap_bmc_api 1.0.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 +7 -0
- data/Gemfile +9 -0
- data/README.md +196 -0
- data/Rakefile +10 -0
- data/VERSION +1 -0
- data/docs/ActionResult.md +18 -0
- data/docs/DeleteResult.md +20 -0
- data/docs/DeleteSshKeyResult.md +20 -0
- data/docs/Error.md +20 -0
- data/docs/IpBlocksConfiguration.md +20 -0
- data/docs/NetworkConfiguration.md +20 -0
- data/docs/OsConfiguration.md +24 -0
- data/docs/OsConfigurationMap.md +22 -0
- data/docs/OsConfigurationMapEsxi.md +22 -0
- data/docs/OsConfigurationMapProxmox.md +22 -0
- data/docs/OsConfigurationWindows.md +18 -0
- data/docs/PrivateNetworkConfiguration.md +22 -0
- data/docs/Quota.md +32 -0
- data/docs/QuotaEditLimitRequest.md +20 -0
- data/docs/QuotaEditLimitRequestDetails.md +22 -0
- data/docs/QuotaEditLimitRequestDetailsAllOf.md +18 -0
- data/docs/QuotasApi.md +217 -0
- data/docs/RelinquishIpBlock.md +18 -0
- data/docs/ResetResult.md +22 -0
- data/docs/SSHKeysApi.md +360 -0
- data/docs/Server.md +64 -0
- data/docs/ServerCreate.md +44 -0
- data/docs/ServerIpBlock.md +20 -0
- data/docs/ServerPatch.md +20 -0
- data/docs/ServerPrivateNetwork.md +24 -0
- data/docs/ServerReserve.md +18 -0
- data/docs/ServerReset.md +24 -0
- data/docs/ServersApi.md +1237 -0
- data/docs/SshKey.md +30 -0
- data/docs/SshKeyCreate.md +22 -0
- data/docs/SshKeyUpdate.md +20 -0
- data/docs/TagAssignment.md +26 -0
- data/docs/TagAssignmentRequest.md +20 -0
- data/lib/pnap_bmc_api/api/quotas_api.rb +212 -0
- data/lib/pnap_bmc_api/api/servers_api.rb +1159 -0
- data/lib/pnap_bmc_api/api/ssh_keys_api.rb +339 -0
- data/lib/pnap_bmc_api/api_client.rb +392 -0
- data/lib/pnap_bmc_api/api_error.rb +57 -0
- data/lib/pnap_bmc_api/configuration.rb +278 -0
- data/lib/pnap_bmc_api/models/action_result.rb +225 -0
- data/lib/pnap_bmc_api/models/delete_result.rb +240 -0
- data/lib/pnap_bmc_api/models/delete_ssh_key_result.rb +240 -0
- data/lib/pnap_bmc_api/models/error.rb +236 -0
- data/lib/pnap_bmc_api/models/ip_blocks_configuration.rb +283 -0
- data/lib/pnap_bmc_api/models/network_configuration.rb +228 -0
- data/lib/pnap_bmc_api/models/os_configuration.rb +266 -0
- data/lib/pnap_bmc_api/models/os_configuration_map.rb +237 -0
- data/lib/pnap_bmc_api/models/os_configuration_map_esxi.rb +257 -0
- data/lib/pnap_bmc_api/models/os_configuration_map_proxmox.rb +257 -0
- data/lib/pnap_bmc_api/models/os_configuration_windows.rb +237 -0
- data/lib/pnap_bmc_api/models/private_network_configuration.rb +244 -0
- data/lib/pnap_bmc_api/models/quota.rb +415 -0
- data/lib/pnap_bmc_api/models/quota_edit_limit_request.rb +259 -0
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details.rb +281 -0
- data/lib/pnap_bmc_api/models/quota_edit_limit_request_details_all_of.rb +225 -0
- data/lib/pnap_bmc_api/models/relinquish_ip_block.rb +222 -0
- data/lib/pnap_bmc_api/models/reset_result.rb +244 -0
- data/lib/pnap_bmc_api/models/server.rb +687 -0
- data/lib/pnap_bmc_api/models/server_create.rb +434 -0
- data/lib/pnap_bmc_api/models/server_ip_block.rb +235 -0
- data/lib/pnap_bmc_api/models/server_patch.rb +280 -0
- data/lib/pnap_bmc_api/models/server_private_network.rb +274 -0
- data/lib/pnap_bmc_api/models/server_reserve.rb +225 -0
- data/lib/pnap_bmc_api/models/server_reset.rb +255 -0
- data/lib/pnap_bmc_api/models/ssh_key.rb +315 -0
- data/lib/pnap_bmc_api/models/ssh_key_create.rb +283 -0
- data/lib/pnap_bmc_api/models/ssh_key_update.rb +268 -0
- data/lib/pnap_bmc_api/models/tag_assignment.rb +309 -0
- data/lib/pnap_bmc_api/models/tag_assignment_request.rb +235 -0
- data/lib/pnap_bmc_api/version.rb +19 -0
- data/lib/pnap_bmc_api.rb +72 -0
- data/pnap_bmc_api.gemspec +39 -0
- data/spec/api/quotas_api_spec.rb +71 -0
- data/spec/api/servers_api_spec.rb +249 -0
- data/spec/api/ssh_keys_api_spec.rb +95 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_result_spec.rb +34 -0
- data/spec/models/delete_result_spec.rb +40 -0
- data/spec/models/delete_ssh_key_result_spec.rb +40 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/ip_blocks_configuration_spec.rb +44 -0
- data/spec/models/network_configuration_spec.rb +40 -0
- data/spec/models/os_configuration_map_esxi_spec.rb +46 -0
- data/spec/models/os_configuration_map_proxmox_spec.rb +46 -0
- data/spec/models/os_configuration_map_spec.rb +46 -0
- data/spec/models/os_configuration_spec.rb +52 -0
- data/spec/models/os_configuration_windows_spec.rb +34 -0
- data/spec/models/private_network_configuration_spec.rb +46 -0
- data/spec/models/quota_edit_limit_request_details_all_of_spec.rb +34 -0
- data/spec/models/quota_edit_limit_request_details_spec.rb +46 -0
- data/spec/models/quota_edit_limit_request_spec.rb +40 -0
- data/spec/models/quota_spec.rb +84 -0
- data/spec/models/relinquish_ip_block_spec.rb +34 -0
- data/spec/models/reset_result_spec.rb +46 -0
- data/spec/models/server_create_spec.rb +112 -0
- data/spec/models/server_ip_block_spec.rb +40 -0
- data/spec/models/server_patch_spec.rb +40 -0
- data/spec/models/server_private_network_spec.rb +52 -0
- data/spec/models/server_reserve_spec.rb +34 -0
- data/spec/models/server_reset_spec.rb +52 -0
- data/spec/models/server_spec.rb +172 -0
- data/spec/models/ssh_key_create_spec.rb +46 -0
- data/spec/models/ssh_key_spec.rb +70 -0
- data/spec/models/ssh_key_update_spec.rb +40 -0
- data/spec/models/tag_assignment_request_spec.rb +40 -0
- data/spec/models/tag_assignment_spec.rb +62 -0
- data/spec/spec_helper.rb +111 -0
- metadata +232 -0
@@ -0,0 +1,1159 @@
|
|
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, 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: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module BmcApi
|
16
|
+
class ServersApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Removes the server from private network.
|
23
|
+
# Removes the server from private network. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. You are expected to perform network configuration changes in the operating system of this server. <b>This is an advanced network action that can make your server completely unavailable over any network. Make sure you are able to access this server over remote console in case of misconfiguration.</b>
|
24
|
+
# @param server_id [String] The server's ID.
|
25
|
+
# @param private_network_id [String] The private network identifier.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [String]
|
28
|
+
def delete_private_network(server_id, private_network_id, opts = {})
|
29
|
+
data, _status_code, _headers = delete_private_network_with_http_info(server_id, private_network_id, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Removes the server from private network.
|
34
|
+
# Removes the server from private network. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. You are expected to perform network configuration changes in the operating system of this server. <b>This is an advanced network action that can make your server completely unavailable over any network. Make sure you are able to access this server over remote console in case of misconfiguration.</b>
|
35
|
+
# @param server_id [String] The server's ID.
|
36
|
+
# @param private_network_id [String] The private network identifier.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
39
|
+
def delete_private_network_with_http_info(server_id, private_network_id, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.delete_private_network ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'server_id' is set
|
44
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.delete_private_network"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'private_network_id' is set
|
48
|
+
if @api_client.config.client_side_validation && private_network_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'private_network_id' when calling ServersApi.delete_private_network"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
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))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
|
62
|
+
# form parameters
|
63
|
+
form_params = opts[:form_params] || {}
|
64
|
+
|
65
|
+
# http body (model)
|
66
|
+
post_body = opts[:debug_body]
|
67
|
+
|
68
|
+
# return_type
|
69
|
+
return_type = opts[:debug_return_type] || 'String'
|
70
|
+
|
71
|
+
# auth_names
|
72
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
73
|
+
|
74
|
+
new_options = opts.merge(
|
75
|
+
:operation => :"ServersApi.delete_private_network",
|
76
|
+
:header_params => header_params,
|
77
|
+
:query_params => query_params,
|
78
|
+
:form_params => form_params,
|
79
|
+
:body => post_body,
|
80
|
+
:auth_names => auth_names,
|
81
|
+
:return_type => return_type
|
82
|
+
)
|
83
|
+
|
84
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
85
|
+
if @api_client.config.debugging
|
86
|
+
@api_client.config.logger.debug "API called: ServersApi#delete_private_network\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
+
end
|
88
|
+
return data, status_code, headers
|
89
|
+
end
|
90
|
+
|
91
|
+
# List servers.
|
92
|
+
# List all servers owned by account.
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
95
|
+
# @return [Array<Server>]
|
96
|
+
def servers_get(opts = {})
|
97
|
+
data, _status_code, _headers = servers_get_with_http_info(opts)
|
98
|
+
data
|
99
|
+
end
|
100
|
+
|
101
|
+
# List servers.
|
102
|
+
# List all servers owned by account.
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [Array<String>] :tag A list of query parameters related to tags in the form of tagName.tagValue
|
105
|
+
# @return [Array<(Array<Server>, Integer, Hash)>] Array<Server> data, response status code and response headers
|
106
|
+
def servers_get_with_http_info(opts = {})
|
107
|
+
if @api_client.config.debugging
|
108
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_get ...'
|
109
|
+
end
|
110
|
+
# resource path
|
111
|
+
local_var_path = '/servers'
|
112
|
+
|
113
|
+
# query parameters
|
114
|
+
query_params = opts[:query_params] || {}
|
115
|
+
query_params[:'tag'] = @api_client.build_collection_param(opts[:'tag'], :multi) if !opts[:'tag'].nil?
|
116
|
+
|
117
|
+
# header parameters
|
118
|
+
header_params = opts[:header_params] || {}
|
119
|
+
# HTTP header 'Accept' (if needed)
|
120
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
121
|
+
|
122
|
+
# form parameters
|
123
|
+
form_params = opts[:form_params] || {}
|
124
|
+
|
125
|
+
# http body (model)
|
126
|
+
post_body = opts[:debug_body]
|
127
|
+
|
128
|
+
# return_type
|
129
|
+
return_type = opts[:debug_return_type] || 'Array<Server>'
|
130
|
+
|
131
|
+
# auth_names
|
132
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
133
|
+
|
134
|
+
new_options = opts.merge(
|
135
|
+
:operation => :"ServersApi.servers_get",
|
136
|
+
:header_params => header_params,
|
137
|
+
:query_params => query_params,
|
138
|
+
:form_params => form_params,
|
139
|
+
:body => post_body,
|
140
|
+
:auth_names => auth_names,
|
141
|
+
:return_type => return_type
|
142
|
+
)
|
143
|
+
|
144
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
145
|
+
if @api_client.config.debugging
|
146
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
147
|
+
end
|
148
|
+
return data, status_code, headers
|
149
|
+
end
|
150
|
+
|
151
|
+
# Create new server.
|
152
|
+
# Create (request) new server for account. Server DNS will be configured to access Google's public DNS at 8.8.8.8 .
|
153
|
+
# @param [Hash] opts the optional parameters
|
154
|
+
# @option opts [ServerCreate] :server_create
|
155
|
+
# @return [Server]
|
156
|
+
def servers_post(opts = {})
|
157
|
+
data, _status_code, _headers = servers_post_with_http_info(opts)
|
158
|
+
data
|
159
|
+
end
|
160
|
+
|
161
|
+
# Create new server.
|
162
|
+
# Create (request) new server for account. Server DNS will be configured to access Google's public DNS at 8.8.8.8 .
|
163
|
+
# @param [Hash] opts the optional parameters
|
164
|
+
# @option opts [ServerCreate] :server_create
|
165
|
+
# @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
|
166
|
+
def servers_post_with_http_info(opts = {})
|
167
|
+
if @api_client.config.debugging
|
168
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_post ...'
|
169
|
+
end
|
170
|
+
# resource path
|
171
|
+
local_var_path = '/servers'
|
172
|
+
|
173
|
+
# query parameters
|
174
|
+
query_params = opts[:query_params] || {}
|
175
|
+
|
176
|
+
# header parameters
|
177
|
+
header_params = opts[:header_params] || {}
|
178
|
+
# HTTP header 'Accept' (if needed)
|
179
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
180
|
+
# HTTP header 'Content-Type'
|
181
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
182
|
+
if !content_type.nil?
|
183
|
+
header_params['Content-Type'] = content_type
|
184
|
+
end
|
185
|
+
|
186
|
+
# form parameters
|
187
|
+
form_params = opts[:form_params] || {}
|
188
|
+
|
189
|
+
# http body (model)
|
190
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_create'])
|
191
|
+
|
192
|
+
# return_type
|
193
|
+
return_type = opts[:debug_return_type] || 'Server'
|
194
|
+
|
195
|
+
# auth_names
|
196
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
197
|
+
|
198
|
+
new_options = opts.merge(
|
199
|
+
:operation => :"ServersApi.servers_post",
|
200
|
+
:header_params => header_params,
|
201
|
+
:query_params => query_params,
|
202
|
+
:form_params => form_params,
|
203
|
+
:body => post_body,
|
204
|
+
:auth_names => auth_names,
|
205
|
+
:return_type => return_type
|
206
|
+
)
|
207
|
+
|
208
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
209
|
+
if @api_client.config.debugging
|
210
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
211
|
+
end
|
212
|
+
return data, status_code, headers
|
213
|
+
end
|
214
|
+
|
215
|
+
# Deprovision a server.
|
216
|
+
# Deprovision the server. Supports advanced deprovision configuration.
|
217
|
+
# @param server_id [String] The server's ID.
|
218
|
+
# @param [Hash] opts the optional parameters
|
219
|
+
# @option opts [RelinquishIpBlock] :relinquish_ip_block
|
220
|
+
# @return [String]
|
221
|
+
def servers_server_id_actions_deprovision_post(server_id, opts = {})
|
222
|
+
data, _status_code, _headers = servers_server_id_actions_deprovision_post_with_http_info(server_id, opts)
|
223
|
+
data
|
224
|
+
end
|
225
|
+
|
226
|
+
# Deprovision a server.
|
227
|
+
# Deprovision the server. Supports advanced deprovision configuration.
|
228
|
+
# @param server_id [String] The server's ID.
|
229
|
+
# @param [Hash] opts the optional parameters
|
230
|
+
# @option opts [RelinquishIpBlock] :relinquish_ip_block
|
231
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
232
|
+
def servers_server_id_actions_deprovision_post_with_http_info(server_id, opts = {})
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_deprovision_post ...'
|
235
|
+
end
|
236
|
+
# verify the required parameter 'server_id' is set
|
237
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
238
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_deprovision_post"
|
239
|
+
end
|
240
|
+
# resource path
|
241
|
+
local_var_path = '/servers/{serverId}/actions/deprovision'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
242
|
+
|
243
|
+
# query parameters
|
244
|
+
query_params = opts[:query_params] || {}
|
245
|
+
|
246
|
+
# header parameters
|
247
|
+
header_params = opts[:header_params] || {}
|
248
|
+
# HTTP header 'Accept' (if needed)
|
249
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
250
|
+
# HTTP header 'Content-Type'
|
251
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
252
|
+
if !content_type.nil?
|
253
|
+
header_params['Content-Type'] = content_type
|
254
|
+
end
|
255
|
+
|
256
|
+
# form parameters
|
257
|
+
form_params = opts[:form_params] || {}
|
258
|
+
|
259
|
+
# http body (model)
|
260
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'relinquish_ip_block'])
|
261
|
+
|
262
|
+
# return_type
|
263
|
+
return_type = opts[:debug_return_type] || 'String'
|
264
|
+
|
265
|
+
# auth_names
|
266
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
267
|
+
|
268
|
+
new_options = opts.merge(
|
269
|
+
:operation => :"ServersApi.servers_server_id_actions_deprovision_post",
|
270
|
+
:header_params => header_params,
|
271
|
+
:query_params => query_params,
|
272
|
+
:form_params => form_params,
|
273
|
+
:body => post_body,
|
274
|
+
:auth_names => auth_names,
|
275
|
+
:return_type => return_type
|
276
|
+
)
|
277
|
+
|
278
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
279
|
+
if @api_client.config.debugging
|
280
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_deprovision_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
281
|
+
end
|
282
|
+
return data, status_code, headers
|
283
|
+
end
|
284
|
+
|
285
|
+
# Power off server.
|
286
|
+
# Power off specific server.
|
287
|
+
# @param server_id [String] The server's ID.
|
288
|
+
# @param [Hash] opts the optional parameters
|
289
|
+
# @return [ActionResult]
|
290
|
+
def servers_server_id_actions_power_off_post(server_id, opts = {})
|
291
|
+
data, _status_code, _headers = servers_server_id_actions_power_off_post_with_http_info(server_id, opts)
|
292
|
+
data
|
293
|
+
end
|
294
|
+
|
295
|
+
# Power off server.
|
296
|
+
# Power off specific server.
|
297
|
+
# @param server_id [String] The server's ID.
|
298
|
+
# @param [Hash] opts the optional parameters
|
299
|
+
# @return [Array<(ActionResult, Integer, Hash)>] ActionResult data, response status code and response headers
|
300
|
+
def servers_server_id_actions_power_off_post_with_http_info(server_id, opts = {})
|
301
|
+
if @api_client.config.debugging
|
302
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_power_off_post ...'
|
303
|
+
end
|
304
|
+
# verify the required parameter 'server_id' is set
|
305
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
306
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_power_off_post"
|
307
|
+
end
|
308
|
+
# resource path
|
309
|
+
local_var_path = '/servers/{serverId}/actions/power-off'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
310
|
+
|
311
|
+
# query parameters
|
312
|
+
query_params = opts[:query_params] || {}
|
313
|
+
|
314
|
+
# header parameters
|
315
|
+
header_params = opts[:header_params] || {}
|
316
|
+
# HTTP header 'Accept' (if needed)
|
317
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
318
|
+
|
319
|
+
# form parameters
|
320
|
+
form_params = opts[:form_params] || {}
|
321
|
+
|
322
|
+
# http body (model)
|
323
|
+
post_body = opts[:debug_body]
|
324
|
+
|
325
|
+
# return_type
|
326
|
+
return_type = opts[:debug_return_type] || 'ActionResult'
|
327
|
+
|
328
|
+
# auth_names
|
329
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
330
|
+
|
331
|
+
new_options = opts.merge(
|
332
|
+
:operation => :"ServersApi.servers_server_id_actions_power_off_post",
|
333
|
+
:header_params => header_params,
|
334
|
+
:query_params => query_params,
|
335
|
+
:form_params => form_params,
|
336
|
+
:body => post_body,
|
337
|
+
:auth_names => auth_names,
|
338
|
+
:return_type => return_type
|
339
|
+
)
|
340
|
+
|
341
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
342
|
+
if @api_client.config.debugging
|
343
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_power_off_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
344
|
+
end
|
345
|
+
return data, status_code, headers
|
346
|
+
end
|
347
|
+
|
348
|
+
# Power on server.
|
349
|
+
# Power on specific server.
|
350
|
+
# @param server_id [String] The server's ID.
|
351
|
+
# @param [Hash] opts the optional parameters
|
352
|
+
# @return [ActionResult]
|
353
|
+
def servers_server_id_actions_power_on_post(server_id, opts = {})
|
354
|
+
data, _status_code, _headers = servers_server_id_actions_power_on_post_with_http_info(server_id, opts)
|
355
|
+
data
|
356
|
+
end
|
357
|
+
|
358
|
+
# Power on server.
|
359
|
+
# Power on specific server.
|
360
|
+
# @param server_id [String] The server's ID.
|
361
|
+
# @param [Hash] opts the optional parameters
|
362
|
+
# @return [Array<(ActionResult, Integer, Hash)>] ActionResult data, response status code and response headers
|
363
|
+
def servers_server_id_actions_power_on_post_with_http_info(server_id, opts = {})
|
364
|
+
if @api_client.config.debugging
|
365
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_power_on_post ...'
|
366
|
+
end
|
367
|
+
# verify the required parameter 'server_id' is set
|
368
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
369
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_power_on_post"
|
370
|
+
end
|
371
|
+
# resource path
|
372
|
+
local_var_path = '/servers/{serverId}/actions/power-on'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
373
|
+
|
374
|
+
# query parameters
|
375
|
+
query_params = opts[:query_params] || {}
|
376
|
+
|
377
|
+
# header parameters
|
378
|
+
header_params = opts[:header_params] || {}
|
379
|
+
# HTTP header 'Accept' (if needed)
|
380
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
381
|
+
|
382
|
+
# form parameters
|
383
|
+
form_params = opts[:form_params] || {}
|
384
|
+
|
385
|
+
# http body (model)
|
386
|
+
post_body = opts[:debug_body]
|
387
|
+
|
388
|
+
# return_type
|
389
|
+
return_type = opts[:debug_return_type] || 'ActionResult'
|
390
|
+
|
391
|
+
# auth_names
|
392
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
393
|
+
|
394
|
+
new_options = opts.merge(
|
395
|
+
:operation => :"ServersApi.servers_server_id_actions_power_on_post",
|
396
|
+
:header_params => header_params,
|
397
|
+
:query_params => query_params,
|
398
|
+
:form_params => form_params,
|
399
|
+
:body => post_body,
|
400
|
+
:auth_names => auth_names,
|
401
|
+
:return_type => return_type
|
402
|
+
)
|
403
|
+
|
404
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
405
|
+
if @api_client.config.debugging
|
406
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_power_on_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
407
|
+
end
|
408
|
+
return data, status_code, headers
|
409
|
+
end
|
410
|
+
|
411
|
+
# Reboot server.
|
412
|
+
# Reboot specific server.
|
413
|
+
# @param server_id [String] The server's ID.
|
414
|
+
# @param [Hash] opts the optional parameters
|
415
|
+
# @return [ActionResult]
|
416
|
+
def servers_server_id_actions_reboot_post(server_id, opts = {})
|
417
|
+
data, _status_code, _headers = servers_server_id_actions_reboot_post_with_http_info(server_id, opts)
|
418
|
+
data
|
419
|
+
end
|
420
|
+
|
421
|
+
# Reboot server.
|
422
|
+
# Reboot specific server.
|
423
|
+
# @param server_id [String] The server's ID.
|
424
|
+
# @param [Hash] opts the optional parameters
|
425
|
+
# @return [Array<(ActionResult, Integer, Hash)>] ActionResult data, response status code and response headers
|
426
|
+
def servers_server_id_actions_reboot_post_with_http_info(server_id, opts = {})
|
427
|
+
if @api_client.config.debugging
|
428
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_reboot_post ...'
|
429
|
+
end
|
430
|
+
# verify the required parameter 'server_id' is set
|
431
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
432
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_reboot_post"
|
433
|
+
end
|
434
|
+
# resource path
|
435
|
+
local_var_path = '/servers/{serverId}/actions/reboot'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
436
|
+
|
437
|
+
# query parameters
|
438
|
+
query_params = opts[:query_params] || {}
|
439
|
+
|
440
|
+
# header parameters
|
441
|
+
header_params = opts[:header_params] || {}
|
442
|
+
# HTTP header 'Accept' (if needed)
|
443
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
444
|
+
|
445
|
+
# form parameters
|
446
|
+
form_params = opts[:form_params] || {}
|
447
|
+
|
448
|
+
# http body (model)
|
449
|
+
post_body = opts[:debug_body]
|
450
|
+
|
451
|
+
# return_type
|
452
|
+
return_type = opts[:debug_return_type] || 'ActionResult'
|
453
|
+
|
454
|
+
# auth_names
|
455
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
456
|
+
|
457
|
+
new_options = opts.merge(
|
458
|
+
:operation => :"ServersApi.servers_server_id_actions_reboot_post",
|
459
|
+
:header_params => header_params,
|
460
|
+
:query_params => query_params,
|
461
|
+
:form_params => form_params,
|
462
|
+
:body => post_body,
|
463
|
+
:auth_names => auth_names,
|
464
|
+
:return_type => return_type
|
465
|
+
)
|
466
|
+
|
467
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
468
|
+
if @api_client.config.debugging
|
469
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_reboot_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
470
|
+
end
|
471
|
+
return data, status_code, headers
|
472
|
+
end
|
473
|
+
|
474
|
+
# Reserve server.
|
475
|
+
# Reserve specific server.
|
476
|
+
# @param server_id [String] The server's ID.
|
477
|
+
# @param [Hash] opts the optional parameters
|
478
|
+
# @option opts [ServerReserve] :server_reserve
|
479
|
+
# @return [Server]
|
480
|
+
def servers_server_id_actions_reserve_post(server_id, opts = {})
|
481
|
+
data, _status_code, _headers = servers_server_id_actions_reserve_post_with_http_info(server_id, opts)
|
482
|
+
data
|
483
|
+
end
|
484
|
+
|
485
|
+
# Reserve server.
|
486
|
+
# Reserve specific server.
|
487
|
+
# @param server_id [String] The server's ID.
|
488
|
+
# @param [Hash] opts the optional parameters
|
489
|
+
# @option opts [ServerReserve] :server_reserve
|
490
|
+
# @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
|
491
|
+
def servers_server_id_actions_reserve_post_with_http_info(server_id, opts = {})
|
492
|
+
if @api_client.config.debugging
|
493
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_reserve_post ...'
|
494
|
+
end
|
495
|
+
# verify the required parameter 'server_id' is set
|
496
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
497
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_reserve_post"
|
498
|
+
end
|
499
|
+
# resource path
|
500
|
+
local_var_path = '/servers/{serverId}/actions/reserve'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
501
|
+
|
502
|
+
# query parameters
|
503
|
+
query_params = opts[:query_params] || {}
|
504
|
+
|
505
|
+
# header parameters
|
506
|
+
header_params = opts[:header_params] || {}
|
507
|
+
# HTTP header 'Accept' (if needed)
|
508
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
509
|
+
# HTTP header 'Content-Type'
|
510
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
511
|
+
if !content_type.nil?
|
512
|
+
header_params['Content-Type'] = content_type
|
513
|
+
end
|
514
|
+
|
515
|
+
# form parameters
|
516
|
+
form_params = opts[:form_params] || {}
|
517
|
+
|
518
|
+
# http body (model)
|
519
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_reserve'])
|
520
|
+
|
521
|
+
# return_type
|
522
|
+
return_type = opts[:debug_return_type] || 'Server'
|
523
|
+
|
524
|
+
# auth_names
|
525
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
526
|
+
|
527
|
+
new_options = opts.merge(
|
528
|
+
:operation => :"ServersApi.servers_server_id_actions_reserve_post",
|
529
|
+
:header_params => header_params,
|
530
|
+
:query_params => query_params,
|
531
|
+
:form_params => form_params,
|
532
|
+
:body => post_body,
|
533
|
+
:auth_names => auth_names,
|
534
|
+
:return_type => return_type
|
535
|
+
)
|
536
|
+
|
537
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
538
|
+
if @api_client.config.debugging
|
539
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_reserve_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
540
|
+
end
|
541
|
+
return data, status_code, headers
|
542
|
+
end
|
543
|
+
|
544
|
+
# Reset server.
|
545
|
+
# Reset specific server.
|
546
|
+
# @param server_id [String] The server's ID.
|
547
|
+
# @param [Hash] opts the optional parameters
|
548
|
+
# @option opts [ServerReset] :server_reset
|
549
|
+
# @return [ResetResult]
|
550
|
+
def servers_server_id_actions_reset_post(server_id, opts = {})
|
551
|
+
data, _status_code, _headers = servers_server_id_actions_reset_post_with_http_info(server_id, opts)
|
552
|
+
data
|
553
|
+
end
|
554
|
+
|
555
|
+
# Reset server.
|
556
|
+
# Reset specific server.
|
557
|
+
# @param server_id [String] The server's ID.
|
558
|
+
# @param [Hash] opts the optional parameters
|
559
|
+
# @option opts [ServerReset] :server_reset
|
560
|
+
# @return [Array<(ResetResult, Integer, Hash)>] ResetResult data, response status code and response headers
|
561
|
+
def servers_server_id_actions_reset_post_with_http_info(server_id, opts = {})
|
562
|
+
if @api_client.config.debugging
|
563
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_reset_post ...'
|
564
|
+
end
|
565
|
+
# verify the required parameter 'server_id' is set
|
566
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
567
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_reset_post"
|
568
|
+
end
|
569
|
+
# resource path
|
570
|
+
local_var_path = '/servers/{serverId}/actions/reset'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
571
|
+
|
572
|
+
# query parameters
|
573
|
+
query_params = opts[:query_params] || {}
|
574
|
+
|
575
|
+
# header parameters
|
576
|
+
header_params = opts[:header_params] || {}
|
577
|
+
# HTTP header 'Accept' (if needed)
|
578
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
579
|
+
# HTTP header 'Content-Type'
|
580
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
581
|
+
if !content_type.nil?
|
582
|
+
header_params['Content-Type'] = content_type
|
583
|
+
end
|
584
|
+
|
585
|
+
# form parameters
|
586
|
+
form_params = opts[:form_params] || {}
|
587
|
+
|
588
|
+
# http body (model)
|
589
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_reset'])
|
590
|
+
|
591
|
+
# return_type
|
592
|
+
return_type = opts[:debug_return_type] || 'ResetResult'
|
593
|
+
|
594
|
+
# auth_names
|
595
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
596
|
+
|
597
|
+
new_options = opts.merge(
|
598
|
+
:operation => :"ServersApi.servers_server_id_actions_reset_post",
|
599
|
+
:header_params => header_params,
|
600
|
+
:query_params => query_params,
|
601
|
+
:form_params => form_params,
|
602
|
+
:body => post_body,
|
603
|
+
:auth_names => auth_names,
|
604
|
+
:return_type => return_type
|
605
|
+
)
|
606
|
+
|
607
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
608
|
+
if @api_client.config.debugging
|
609
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_reset_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
610
|
+
end
|
611
|
+
return data, status_code, headers
|
612
|
+
end
|
613
|
+
|
614
|
+
# Shutdown server.
|
615
|
+
# Shut down specific server.
|
616
|
+
# @param server_id [String] The server's ID.
|
617
|
+
# @param [Hash] opts the optional parameters
|
618
|
+
# @return [ActionResult]
|
619
|
+
def servers_server_id_actions_shutdown_post(server_id, opts = {})
|
620
|
+
data, _status_code, _headers = servers_server_id_actions_shutdown_post_with_http_info(server_id, opts)
|
621
|
+
data
|
622
|
+
end
|
623
|
+
|
624
|
+
# Shutdown server.
|
625
|
+
# Shut down specific server.
|
626
|
+
# @param server_id [String] The server's ID.
|
627
|
+
# @param [Hash] opts the optional parameters
|
628
|
+
# @return [Array<(ActionResult, Integer, Hash)>] ActionResult data, response status code and response headers
|
629
|
+
def servers_server_id_actions_shutdown_post_with_http_info(server_id, opts = {})
|
630
|
+
if @api_client.config.debugging
|
631
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_actions_shutdown_post ...'
|
632
|
+
end
|
633
|
+
# verify the required parameter 'server_id' is set
|
634
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
635
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_actions_shutdown_post"
|
636
|
+
end
|
637
|
+
# resource path
|
638
|
+
local_var_path = '/servers/{serverId}/actions/shutdown'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
639
|
+
|
640
|
+
# query parameters
|
641
|
+
query_params = opts[:query_params] || {}
|
642
|
+
|
643
|
+
# header parameters
|
644
|
+
header_params = opts[:header_params] || {}
|
645
|
+
# HTTP header 'Accept' (if needed)
|
646
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
647
|
+
|
648
|
+
# form parameters
|
649
|
+
form_params = opts[:form_params] || {}
|
650
|
+
|
651
|
+
# http body (model)
|
652
|
+
post_body = opts[:debug_body]
|
653
|
+
|
654
|
+
# return_type
|
655
|
+
return_type = opts[:debug_return_type] || 'ActionResult'
|
656
|
+
|
657
|
+
# auth_names
|
658
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
659
|
+
|
660
|
+
new_options = opts.merge(
|
661
|
+
:operation => :"ServersApi.servers_server_id_actions_shutdown_post",
|
662
|
+
:header_params => header_params,
|
663
|
+
:query_params => query_params,
|
664
|
+
:form_params => form_params,
|
665
|
+
:body => post_body,
|
666
|
+
:auth_names => auth_names,
|
667
|
+
:return_type => return_type
|
668
|
+
)
|
669
|
+
|
670
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
671
|
+
if @api_client.config.debugging
|
672
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_actions_shutdown_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
673
|
+
end
|
674
|
+
return data, status_code, headers
|
675
|
+
end
|
676
|
+
|
677
|
+
# Delete server.
|
678
|
+
# Deprovision specific server. Any IP blocks assigned to this server will also be relinquished and deleted. Deprecated: see /servers/{serverId}/actions/deprovision
|
679
|
+
# @param server_id [String] The server's ID.
|
680
|
+
# @param [Hash] opts the optional parameters
|
681
|
+
# @return [DeleteResult]
|
682
|
+
def servers_server_id_delete(server_id, opts = {})
|
683
|
+
data, _status_code, _headers = servers_server_id_delete_with_http_info(server_id, opts)
|
684
|
+
data
|
685
|
+
end
|
686
|
+
|
687
|
+
# Delete server.
|
688
|
+
# Deprovision specific server. Any IP blocks assigned to this server will also be relinquished and deleted. Deprecated: see /servers/{serverId}/actions/deprovision
|
689
|
+
# @param server_id [String] The server's ID.
|
690
|
+
# @param [Hash] opts the optional parameters
|
691
|
+
# @return [Array<(DeleteResult, Integer, Hash)>] DeleteResult data, response status code and response headers
|
692
|
+
def servers_server_id_delete_with_http_info(server_id, opts = {})
|
693
|
+
if @api_client.config.debugging
|
694
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_delete ...'
|
695
|
+
end
|
696
|
+
# verify the required parameter 'server_id' is set
|
697
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
698
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_delete"
|
699
|
+
end
|
700
|
+
# resource path
|
701
|
+
local_var_path = '/servers/{serverId}'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
702
|
+
|
703
|
+
# query parameters
|
704
|
+
query_params = opts[:query_params] || {}
|
705
|
+
|
706
|
+
# header parameters
|
707
|
+
header_params = opts[:header_params] || {}
|
708
|
+
# HTTP header 'Accept' (if needed)
|
709
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
710
|
+
|
711
|
+
# form parameters
|
712
|
+
form_params = opts[:form_params] || {}
|
713
|
+
|
714
|
+
# http body (model)
|
715
|
+
post_body = opts[:debug_body]
|
716
|
+
|
717
|
+
# return_type
|
718
|
+
return_type = opts[:debug_return_type] || 'DeleteResult'
|
719
|
+
|
720
|
+
# auth_names
|
721
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
722
|
+
|
723
|
+
new_options = opts.merge(
|
724
|
+
:operation => :"ServersApi.servers_server_id_delete",
|
725
|
+
:header_params => header_params,
|
726
|
+
:query_params => query_params,
|
727
|
+
:form_params => form_params,
|
728
|
+
:body => post_body,
|
729
|
+
:auth_names => auth_names,
|
730
|
+
:return_type => return_type
|
731
|
+
)
|
732
|
+
|
733
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
734
|
+
if @api_client.config.debugging
|
735
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
736
|
+
end
|
737
|
+
return data, status_code, headers
|
738
|
+
end
|
739
|
+
|
740
|
+
# Get server.
|
741
|
+
# Get server properties.
|
742
|
+
# @param server_id [String] The server's ID.
|
743
|
+
# @param [Hash] opts the optional parameters
|
744
|
+
# @return [Server]
|
745
|
+
def servers_server_id_get(server_id, opts = {})
|
746
|
+
data, _status_code, _headers = servers_server_id_get_with_http_info(server_id, opts)
|
747
|
+
data
|
748
|
+
end
|
749
|
+
|
750
|
+
# Get server.
|
751
|
+
# Get server properties.
|
752
|
+
# @param server_id [String] The server's ID.
|
753
|
+
# @param [Hash] opts the optional parameters
|
754
|
+
# @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
|
755
|
+
def servers_server_id_get_with_http_info(server_id, opts = {})
|
756
|
+
if @api_client.config.debugging
|
757
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_get ...'
|
758
|
+
end
|
759
|
+
# verify the required parameter 'server_id' is set
|
760
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
761
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_get"
|
762
|
+
end
|
763
|
+
# resource path
|
764
|
+
local_var_path = '/servers/{serverId}'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
765
|
+
|
766
|
+
# query parameters
|
767
|
+
query_params = opts[:query_params] || {}
|
768
|
+
|
769
|
+
# header parameters
|
770
|
+
header_params = opts[:header_params] || {}
|
771
|
+
# HTTP header 'Accept' (if needed)
|
772
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
773
|
+
|
774
|
+
# form parameters
|
775
|
+
form_params = opts[:form_params] || {}
|
776
|
+
|
777
|
+
# http body (model)
|
778
|
+
post_body = opts[:debug_body]
|
779
|
+
|
780
|
+
# return_type
|
781
|
+
return_type = opts[:debug_return_type] || 'Server'
|
782
|
+
|
783
|
+
# auth_names
|
784
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
785
|
+
|
786
|
+
new_options = opts.merge(
|
787
|
+
:operation => :"ServersApi.servers_server_id_get",
|
788
|
+
:header_params => header_params,
|
789
|
+
:query_params => query_params,
|
790
|
+
:form_params => form_params,
|
791
|
+
:body => post_body,
|
792
|
+
:auth_names => auth_names,
|
793
|
+
:return_type => return_type
|
794
|
+
)
|
795
|
+
|
796
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
797
|
+
if @api_client.config.debugging
|
798
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
799
|
+
end
|
800
|
+
return data, status_code, headers
|
801
|
+
end
|
802
|
+
|
803
|
+
# Unassign IP Block from Server.
|
804
|
+
# Removes the IP block from the server. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. You are expected to perform network configuration changes in the operating system of this server. <b>This is an advanced network action that can make your server completely unavailable over any network. Make sure you are able to access this server over remote console in case of misconfiguration.</b>
|
805
|
+
# @param server_id [String] The server's ID.
|
806
|
+
# @param ip_block_id [String] The IP Block identifier.
|
807
|
+
# @param [Hash] opts the optional parameters
|
808
|
+
# @option opts [RelinquishIpBlock] :relinquish_ip_block
|
809
|
+
# @return [String]
|
810
|
+
def servers_server_id_ip_blocks_ip_block_id_delete(server_id, ip_block_id, opts = {})
|
811
|
+
data, _status_code, _headers = servers_server_id_ip_blocks_ip_block_id_delete_with_http_info(server_id, ip_block_id, opts)
|
812
|
+
data
|
813
|
+
end
|
814
|
+
|
815
|
+
# Unassign IP Block from Server.
|
816
|
+
# Removes the IP block from the server. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. You are expected to perform network configuration changes in the operating system of this server. <b>This is an advanced network action that can make your server completely unavailable over any network. Make sure you are able to access this server over remote console in case of misconfiguration.</b>
|
817
|
+
# @param server_id [String] The server's ID.
|
818
|
+
# @param ip_block_id [String] The IP Block identifier.
|
819
|
+
# @param [Hash] opts the optional parameters
|
820
|
+
# @option opts [RelinquishIpBlock] :relinquish_ip_block
|
821
|
+
# @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
|
822
|
+
def servers_server_id_ip_blocks_ip_block_id_delete_with_http_info(server_id, ip_block_id, opts = {})
|
823
|
+
if @api_client.config.debugging
|
824
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_ip_blocks_ip_block_id_delete ...'
|
825
|
+
end
|
826
|
+
# verify the required parameter 'server_id' is set
|
827
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
828
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_ip_blocks_ip_block_id_delete"
|
829
|
+
end
|
830
|
+
# verify the required parameter 'ip_block_id' is set
|
831
|
+
if @api_client.config.client_side_validation && ip_block_id.nil?
|
832
|
+
fail ArgumentError, "Missing the required parameter 'ip_block_id' when calling ServersApi.servers_server_id_ip_blocks_ip_block_id_delete"
|
833
|
+
end
|
834
|
+
# resource path
|
835
|
+
local_var_path = '/servers/{serverId}/network-configuration/ip-block-configurations/ip-blocks/{ipBlockId}'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'ipBlockId' + '}', CGI.escape(ip_block_id.to_s))
|
836
|
+
|
837
|
+
# query parameters
|
838
|
+
query_params = opts[:query_params] || {}
|
839
|
+
|
840
|
+
# header parameters
|
841
|
+
header_params = opts[:header_params] || {}
|
842
|
+
# HTTP header 'Accept' (if needed)
|
843
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
844
|
+
# HTTP header 'Content-Type'
|
845
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
846
|
+
if !content_type.nil?
|
847
|
+
header_params['Content-Type'] = content_type
|
848
|
+
end
|
849
|
+
|
850
|
+
# form parameters
|
851
|
+
form_params = opts[:form_params] || {}
|
852
|
+
|
853
|
+
# http body (model)
|
854
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'relinquish_ip_block'])
|
855
|
+
|
856
|
+
# return_type
|
857
|
+
return_type = opts[:debug_return_type] || 'String'
|
858
|
+
|
859
|
+
# auth_names
|
860
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
861
|
+
|
862
|
+
new_options = opts.merge(
|
863
|
+
:operation => :"ServersApi.servers_server_id_ip_blocks_ip_block_id_delete",
|
864
|
+
:header_params => header_params,
|
865
|
+
:query_params => query_params,
|
866
|
+
:form_params => form_params,
|
867
|
+
:body => post_body,
|
868
|
+
:auth_names => auth_names,
|
869
|
+
:return_type => return_type
|
870
|
+
)
|
871
|
+
|
872
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
873
|
+
if @api_client.config.debugging
|
874
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_ip_blocks_ip_block_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
875
|
+
end
|
876
|
+
return data, status_code, headers
|
877
|
+
end
|
878
|
+
|
879
|
+
# Assign IP Block to Server.
|
880
|
+
# Adds an IP block to this server. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. You are expected to perform network configuration changes in the operating system of this server.
|
881
|
+
# @param server_id [String] The server's ID.
|
882
|
+
# @param [Hash] opts the optional parameters
|
883
|
+
# @option opts [ServerIpBlock] :server_ip_block
|
884
|
+
# @return [ServerIpBlock]
|
885
|
+
def servers_server_id_ip_blocks_post(server_id, opts = {})
|
886
|
+
data, _status_code, _headers = servers_server_id_ip_blocks_post_with_http_info(server_id, opts)
|
887
|
+
data
|
888
|
+
end
|
889
|
+
|
890
|
+
# Assign IP Block to Server.
|
891
|
+
# Adds an IP block to this server. <b>No actual configuration is performed on the operating system.</b> BMC configures exclusively the networking devices in the datacenter infrastructure. You are expected to perform network configuration changes in the operating system of this server.
|
892
|
+
# @param server_id [String] The server's ID.
|
893
|
+
# @param [Hash] opts the optional parameters
|
894
|
+
# @option opts [ServerIpBlock] :server_ip_block
|
895
|
+
# @return [Array<(ServerIpBlock, Integer, Hash)>] ServerIpBlock data, response status code and response headers
|
896
|
+
def servers_server_id_ip_blocks_post_with_http_info(server_id, opts = {})
|
897
|
+
if @api_client.config.debugging
|
898
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_ip_blocks_post ...'
|
899
|
+
end
|
900
|
+
# verify the required parameter 'server_id' is set
|
901
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
902
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_ip_blocks_post"
|
903
|
+
end
|
904
|
+
# resource path
|
905
|
+
local_var_path = '/servers/{serverId}/network-configuration/ip-block-configurations/ip-blocks'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
906
|
+
|
907
|
+
# query parameters
|
908
|
+
query_params = opts[:query_params] || {}
|
909
|
+
|
910
|
+
# header parameters
|
911
|
+
header_params = opts[:header_params] || {}
|
912
|
+
# HTTP header 'Accept' (if needed)
|
913
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
914
|
+
# HTTP header 'Content-Type'
|
915
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
916
|
+
if !content_type.nil?
|
917
|
+
header_params['Content-Type'] = content_type
|
918
|
+
end
|
919
|
+
|
920
|
+
# form parameters
|
921
|
+
form_params = opts[:form_params] || {}
|
922
|
+
|
923
|
+
# http body (model)
|
924
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_ip_block'])
|
925
|
+
|
926
|
+
# return_type
|
927
|
+
return_type = opts[:debug_return_type] || 'ServerIpBlock'
|
928
|
+
|
929
|
+
# auth_names
|
930
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
931
|
+
|
932
|
+
new_options = opts.merge(
|
933
|
+
:operation => :"ServersApi.servers_server_id_ip_blocks_post",
|
934
|
+
:header_params => header_params,
|
935
|
+
:query_params => query_params,
|
936
|
+
:form_params => form_params,
|
937
|
+
:body => post_body,
|
938
|
+
:auth_names => auth_names,
|
939
|
+
:return_type => return_type
|
940
|
+
)
|
941
|
+
|
942
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
943
|
+
if @api_client.config.debugging
|
944
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_ip_blocks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
945
|
+
end
|
946
|
+
return data, status_code, headers
|
947
|
+
end
|
948
|
+
|
949
|
+
# Patch a Server.
|
950
|
+
# Any changes to the hostname or description using the BMC API will reflect solely in the BMC API and portal. The changes are intended to keep the BMC data up to date with your server. We do not have access to your server's settings. Local changes to the server's hostname will not be reflected in the API or portal.
|
951
|
+
# @param server_id [String] The server's ID.
|
952
|
+
# @param [Hash] opts the optional parameters
|
953
|
+
# @option opts [ServerPatch] :server_patch
|
954
|
+
# @return [Server]
|
955
|
+
def servers_server_id_patch(server_id, opts = {})
|
956
|
+
data, _status_code, _headers = servers_server_id_patch_with_http_info(server_id, opts)
|
957
|
+
data
|
958
|
+
end
|
959
|
+
|
960
|
+
# Patch a Server.
|
961
|
+
# Any changes to the hostname or description using the BMC API will reflect solely in the BMC API and portal. The changes are intended to keep the BMC data up to date with your server. We do not have access to your server's settings. Local changes to the server's hostname will not be reflected in the API or portal.
|
962
|
+
# @param server_id [String] The server's ID.
|
963
|
+
# @param [Hash] opts the optional parameters
|
964
|
+
# @option opts [ServerPatch] :server_patch
|
965
|
+
# @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
|
966
|
+
def servers_server_id_patch_with_http_info(server_id, opts = {})
|
967
|
+
if @api_client.config.debugging
|
968
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_patch ...'
|
969
|
+
end
|
970
|
+
# verify the required parameter 'server_id' is set
|
971
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
972
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_patch"
|
973
|
+
end
|
974
|
+
# resource path
|
975
|
+
local_var_path = '/servers/{serverId}'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
976
|
+
|
977
|
+
# query parameters
|
978
|
+
query_params = opts[:query_params] || {}
|
979
|
+
|
980
|
+
# header parameters
|
981
|
+
header_params = opts[:header_params] || {}
|
982
|
+
# HTTP header 'Accept' (if needed)
|
983
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
984
|
+
# HTTP header 'Content-Type'
|
985
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
986
|
+
if !content_type.nil?
|
987
|
+
header_params['Content-Type'] = content_type
|
988
|
+
end
|
989
|
+
|
990
|
+
# form parameters
|
991
|
+
form_params = opts[:form_params] || {}
|
992
|
+
|
993
|
+
# http body (model)
|
994
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_patch'])
|
995
|
+
|
996
|
+
# return_type
|
997
|
+
return_type = opts[:debug_return_type] || 'Server'
|
998
|
+
|
999
|
+
# auth_names
|
1000
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
1001
|
+
|
1002
|
+
new_options = opts.merge(
|
1003
|
+
:operation => :"ServersApi.servers_server_id_patch",
|
1004
|
+
:header_params => header_params,
|
1005
|
+
:query_params => query_params,
|
1006
|
+
:form_params => form_params,
|
1007
|
+
:body => post_body,
|
1008
|
+
:auth_names => auth_names,
|
1009
|
+
:return_type => return_type
|
1010
|
+
)
|
1011
|
+
|
1012
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
1013
|
+
if @api_client.config.debugging
|
1014
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1015
|
+
end
|
1016
|
+
return data, status_code, headers
|
1017
|
+
end
|
1018
|
+
|
1019
|
+
# Adds the server to a private network.
|
1020
|
+
# Adds the server to a private network.
|
1021
|
+
# @param server_id [String] The server's ID.
|
1022
|
+
# @param [Hash] opts the optional parameters
|
1023
|
+
# @option opts [ServerPrivateNetwork] :server_private_network
|
1024
|
+
# @return [ServerPrivateNetwork]
|
1025
|
+
def servers_server_id_private_networks_post(server_id, opts = {})
|
1026
|
+
data, _status_code, _headers = servers_server_id_private_networks_post_with_http_info(server_id, opts)
|
1027
|
+
data
|
1028
|
+
end
|
1029
|
+
|
1030
|
+
# Adds the server to a private network.
|
1031
|
+
# Adds the server to a private network.
|
1032
|
+
# @param server_id [String] The server's ID.
|
1033
|
+
# @param [Hash] opts the optional parameters
|
1034
|
+
# @option opts [ServerPrivateNetwork] :server_private_network
|
1035
|
+
# @return [Array<(ServerPrivateNetwork, Integer, Hash)>] ServerPrivateNetwork data, response status code and response headers
|
1036
|
+
def servers_server_id_private_networks_post_with_http_info(server_id, opts = {})
|
1037
|
+
if @api_client.config.debugging
|
1038
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_private_networks_post ...'
|
1039
|
+
end
|
1040
|
+
# verify the required parameter 'server_id' is set
|
1041
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
1042
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_private_networks_post"
|
1043
|
+
end
|
1044
|
+
# resource path
|
1045
|
+
local_var_path = '/servers/{serverId}/network-configuration/private-network-configuration/private-networks'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
1046
|
+
|
1047
|
+
# query parameters
|
1048
|
+
query_params = opts[:query_params] || {}
|
1049
|
+
|
1050
|
+
# header parameters
|
1051
|
+
header_params = opts[:header_params] || {}
|
1052
|
+
# HTTP header 'Accept' (if needed)
|
1053
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1054
|
+
# HTTP header 'Content-Type'
|
1055
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1056
|
+
if !content_type.nil?
|
1057
|
+
header_params['Content-Type'] = content_type
|
1058
|
+
end
|
1059
|
+
|
1060
|
+
# form parameters
|
1061
|
+
form_params = opts[:form_params] || {}
|
1062
|
+
|
1063
|
+
# http body (model)
|
1064
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'server_private_network'])
|
1065
|
+
|
1066
|
+
# return_type
|
1067
|
+
return_type = opts[:debug_return_type] || 'ServerPrivateNetwork'
|
1068
|
+
|
1069
|
+
# auth_names
|
1070
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
1071
|
+
|
1072
|
+
new_options = opts.merge(
|
1073
|
+
:operation => :"ServersApi.servers_server_id_private_networks_post",
|
1074
|
+
:header_params => header_params,
|
1075
|
+
:query_params => query_params,
|
1076
|
+
:form_params => form_params,
|
1077
|
+
:body => post_body,
|
1078
|
+
:auth_names => auth_names,
|
1079
|
+
:return_type => return_type
|
1080
|
+
)
|
1081
|
+
|
1082
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
1083
|
+
if @api_client.config.debugging
|
1084
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_private_networks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1085
|
+
end
|
1086
|
+
return data, status_code, headers
|
1087
|
+
end
|
1088
|
+
|
1089
|
+
# Set server tags.
|
1090
|
+
# Set tags for server.
|
1091
|
+
# @param server_id [String] The server's ID.
|
1092
|
+
# @param [Hash] opts the optional parameters
|
1093
|
+
# @option opts [Array<TagAssignmentRequest>] :tag_assignment_request
|
1094
|
+
# @return [Server]
|
1095
|
+
def servers_server_id_tags_put(server_id, opts = {})
|
1096
|
+
data, _status_code, _headers = servers_server_id_tags_put_with_http_info(server_id, opts)
|
1097
|
+
data
|
1098
|
+
end
|
1099
|
+
|
1100
|
+
# Set server tags.
|
1101
|
+
# Set tags for server.
|
1102
|
+
# @param server_id [String] The server's ID.
|
1103
|
+
# @param [Hash] opts the optional parameters
|
1104
|
+
# @option opts [Array<TagAssignmentRequest>] :tag_assignment_request
|
1105
|
+
# @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
|
1106
|
+
def servers_server_id_tags_put_with_http_info(server_id, opts = {})
|
1107
|
+
if @api_client.config.debugging
|
1108
|
+
@api_client.config.logger.debug 'Calling API: ServersApi.servers_server_id_tags_put ...'
|
1109
|
+
end
|
1110
|
+
# verify the required parameter 'server_id' is set
|
1111
|
+
if @api_client.config.client_side_validation && server_id.nil?
|
1112
|
+
fail ArgumentError, "Missing the required parameter 'server_id' when calling ServersApi.servers_server_id_tags_put"
|
1113
|
+
end
|
1114
|
+
# resource path
|
1115
|
+
local_var_path = '/servers/{serverId}/tags'.sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
|
1116
|
+
|
1117
|
+
# query parameters
|
1118
|
+
query_params = opts[:query_params] || {}
|
1119
|
+
|
1120
|
+
# header parameters
|
1121
|
+
header_params = opts[:header_params] || {}
|
1122
|
+
# HTTP header 'Accept' (if needed)
|
1123
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1124
|
+
# HTTP header 'Content-Type'
|
1125
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
1126
|
+
if !content_type.nil?
|
1127
|
+
header_params['Content-Type'] = content_type
|
1128
|
+
end
|
1129
|
+
|
1130
|
+
# form parameters
|
1131
|
+
form_params = opts[:form_params] || {}
|
1132
|
+
|
1133
|
+
# http body (model)
|
1134
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'tag_assignment_request'])
|
1135
|
+
|
1136
|
+
# return_type
|
1137
|
+
return_type = opts[:debug_return_type] || 'Server'
|
1138
|
+
|
1139
|
+
# auth_names
|
1140
|
+
auth_names = opts[:debug_auth_names] || ['OAuth2']
|
1141
|
+
|
1142
|
+
new_options = opts.merge(
|
1143
|
+
:operation => :"ServersApi.servers_server_id_tags_put",
|
1144
|
+
:header_params => header_params,
|
1145
|
+
:query_params => query_params,
|
1146
|
+
:form_params => form_params,
|
1147
|
+
:body => post_body,
|
1148
|
+
:auth_names => auth_names,
|
1149
|
+
:return_type => return_type
|
1150
|
+
)
|
1151
|
+
|
1152
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
1153
|
+
if @api_client.config.debugging
|
1154
|
+
@api_client.config.logger.debug "API called: ServersApi#servers_server_id_tags_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1155
|
+
end
|
1156
|
+
return data, status_code, headers
|
1157
|
+
end
|
1158
|
+
end
|
1159
|
+
end
|