class Ionoscloud::ServerApi
Attributes
Public Class Methods
# File lib/ionoscloud/api/server_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Detach a CD-ROM This will detach a CD-ROM from the server @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param cdrom_id [String] The unique ID of the CD-ROM @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Object]
# File lib/ionoscloud/api/server_api.rb, line 32 def datacenters_servers_cdroms_delete(datacenter_id, server_id, cdrom_id, opts = {}) data, _status_code, _headers = datacenters_servers_cdroms_delete_with_http_info(datacenter_id, server_id, cdrom_id, opts) data end
Detach a CD-ROM This will detach a CD-ROM from the server @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param cdrom_id [String] The unique ID of the CD-ROM @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Object
, Integer, Hash)>] Object
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 47 def datacenters_servers_cdroms_delete_with_http_info(datacenter_id, server_id, cdrom_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_delete ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_delete" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_delete" end # verify the required parameter 'cdrom_id' is set if @api_client.config.client_side_validation && cdrom_id.nil? fail ArgumentError, "Missing the required parameter 'cdrom_id' when calling ServerApi.datacenters_servers_cdroms_delete" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_delete, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_delete, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'cdromId' + '}', CGI.escape(cdrom_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_cdroms_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retrieve an attached CD-ROM You can retrieve a specific CD-ROM attached to the server @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param cdrom_id [String] The unique ID of the CD-ROM @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Image]
# File lib/ionoscloud/api/server_api.rb, line 124 def datacenters_servers_cdroms_find_by_id(datacenter_id, server_id, cdrom_id, opts = {}) data, _status_code, _headers = datacenters_servers_cdroms_find_by_id_with_http_info(datacenter_id, server_id, cdrom_id, opts) data end
Retrieve an attached CD-ROM You can retrieve a specific CD-ROM attached to the server @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param cdrom_id [String] The unique ID of the CD-ROM @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Image
, Integer, Hash)>] Image
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 139 def datacenters_servers_cdroms_find_by_id_with_http_info(datacenter_id, server_id, cdrom_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_find_by_id ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_find_by_id" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_find_by_id" end # verify the required parameter 'cdrom_id' is set if @api_client.config.client_side_validation && cdrom_id.nil? fail ArgumentError, "Missing the required parameter 'cdrom_id' when calling ServerApi.datacenters_servers_cdroms_find_by_id" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_find_by_id, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_find_by_id, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'cdromId' + '}', CGI.escape(cdrom_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Image' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_cdroms_find_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List attached CD-ROMs You can retrieve a list of CD-ROMs attached to the server. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (default to 0) @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) (default to 1000) @return [Cdroms]
# File lib/ionoscloud/api/server_api.rb, line 217 def datacenters_servers_cdroms_get(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_cdroms_get_with_http_info(datacenter_id, server_id, opts) data end
List attached CD-ROMs You can retrieve a list of CD-ROMs attached to the server. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) @return [Array<(Cdroms
, Integer, Hash)>] Cdroms
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 233 def datacenters_servers_cdroms_get_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_get ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_get" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_get" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_get, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ServerApi.datacenters_servers_cdroms_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_cdroms_get, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_cdroms_get, must be greater than or equal to 1.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Cdroms' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_cdroms_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Attach a CD-ROM You can attach a CD-ROM to an existing server. You can attach up to 2 CD-ROMs to one server. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param cdrom [Image] CD-ROM to be attached @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Image]
# File lib/ionoscloud/api/server_api.rb, line 320 def datacenters_servers_cdroms_post(datacenter_id, server_id, cdrom, opts = {}) data, _status_code, _headers = datacenters_servers_cdroms_post_with_http_info(datacenter_id, server_id, cdrom, opts) data end
Attach a CD-ROM You can attach a CD-ROM to an existing server. You can attach up to 2 CD-ROMs to one server. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param cdrom [Image] CD-ROM to be attached @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Image
, Integer, Hash)>] Image
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 335 def datacenters_servers_cdroms_post_with_http_info(datacenter_id, server_id, cdrom, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_post ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_post" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_post" end # verify the required parameter 'cdrom' is set if @api_client.config.client_side_validation && cdrom.nil? fail ArgumentError, "Missing the required parameter 'cdrom' when calling ServerApi.datacenters_servers_cdroms_post" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_post, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_post, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(cdrom) # return_type return_type = opts[:debug_return_type] || 'Image' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_cdroms_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a Server
This will remove a server from your datacenter; however, it will not remove the storage volumes attached to the server. You will need to make a separate API call to perform that action @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Object]
# File lib/ionoscloud/api/server_api.rb, line 413 def datacenters_servers_delete(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_delete_with_http_info(datacenter_id, server_id, opts) data end
Delete a Server
This will remove a server from your datacenter; however, it will not remove the storage volumes attached to the server. You will need to make a separate API call to perform that action @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Object
, Integer, Hash)>] Object
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 427 def datacenters_servers_delete_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_delete ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_delete" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_delete" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_delete, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_delete, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retrieve a Server
Returns information about a server such as its configuration, provisioning status, etc. @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Server]
# File lib/ionoscloud/api/server_api.rb, line 499 def datacenters_servers_find_by_id(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_find_by_id_with_http_info(datacenter_id, server_id, opts) data end
Retrieve a Server
Returns information about a server such as its configuration, provisioning status, etc. @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Server
, Integer, Hash)>] Server
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 513 def datacenters_servers_find_by_id_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_find_by_id ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_find_by_id" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_find_by_id" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_find_by_id, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_find_by_id, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Server' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_find_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Servers
You can retrieve a list of servers within a datacenter @param datacenter_id [String] The unique ID of the datacenter @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Boolean] :upgrade_needed It can be used to filter which servers can be upgraded which can not be upgraded. @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (default to 0) @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) (default to 1000) @return [Servers]
# File lib/ionoscloud/api/server_api.rb, line 587 def datacenters_servers_get(datacenter_id, opts = {}) data, _status_code, _headers = datacenters_servers_get_with_http_info(datacenter_id, opts) data end
List Servers
You can retrieve a list of servers within a datacenter @param datacenter_id [String] The unique ID of the datacenter @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Boolean] :upgrade_needed It can be used to filter which servers can be upgraded which can not be upgraded. @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) @return [Array<(Servers
, Integer, Hash)>] Servers
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 603 def datacenters_servers_get_with_http_info(datacenter_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_get ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_get" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_get, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ServerApi.datacenters_servers_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_get, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_get, must be greater than or equal to 1.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? query_params[:'upgradeNeeded'] = opts[:'upgrade_needed'] if !opts[:'upgrade_needed'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Servers' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Partially modify a Server
You can use update attributes of a server @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the server @param server [ServerProperties] Modified properties of Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Server]
# File lib/ionoscloud/api/server_api.rb, line 687 def datacenters_servers_patch(datacenter_id, server_id, server, opts = {}) data, _status_code, _headers = datacenters_servers_patch_with_http_info(datacenter_id, server_id, server, opts) data end
Partially modify a Server
You can use update attributes of a server @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the server @param server [ServerProperties] Modified properties of Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Server
, Integer, Hash)>] Server
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 702 def datacenters_servers_patch_with_http_info(datacenter_id, server_id, server, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_patch ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_patch" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_patch" end # verify the required parameter 'server' is set if @api_client.config.client_side_validation && server.nil? fail ArgumentError, "Missing the required parameter 'server' when calling ServerApi.datacenters_servers_patch" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_patch, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_patch, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(server) # return_type return_type = opts[:debug_return_type] || 'Server' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_patch", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create a Server
Creates a server within an existing datacenter. You can configure the boot volume and connect the server to an existing LAN. @param datacenter_id [String] The unique ID of the datacenter @param server [Server] Server
to be created @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Server]
# File lib/ionoscloud/api/server_api.rb, line 780 def datacenters_servers_post(datacenter_id, server, opts = {}) data, _status_code, _headers = datacenters_servers_post_with_http_info(datacenter_id, server, opts) data end
Create a Server
Creates a server within an existing datacenter. You can configure the boot volume and connect the server to an existing LAN. @param datacenter_id [String] The unique ID of the datacenter @param server [Server] Server
to be created @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Server
, Integer, Hash)>] Server
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 794 def datacenters_servers_post_with_http_info(datacenter_id, server, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_post ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_post" end # verify the required parameter 'server' is set if @api_client.config.client_side_validation && server.nil? fail ArgumentError, "Missing the required parameter 'server' when calling ServerApi.datacenters_servers_post" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_post, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_post, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(server) # return_type return_type = opts[:debug_return_type] || 'Server' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Modify a Server
Allows to modify the attributes of a Server
. From v5 onwards 'allowReboot' attribute will no longer be available. For certain server property change it was earlier forced to be provided. Now this behaviour is implicit and backend will do this automatically e.g. in earlier versions, when CPU family changes, the 'allowReboot' property was required to be set to true which will no longer be the case and the server will be rebooted automatically @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the server @param server [Server] Modified Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Server]
# File lib/ionoscloud/api/server_api.rb, line 869 def datacenters_servers_put(datacenter_id, server_id, server, opts = {}) data, _status_code, _headers = datacenters_servers_put_with_http_info(datacenter_id, server_id, server, opts) data end
Modify a Server
Allows to modify the attributes of a Server
. From v5 onwards 'allowReboot' attribute will no longer be available. For certain server property change it was earlier forced to be provided. Now this behaviour is implicit and backend will do this automatically e.g. in earlier versions, when CPU family changes, the 'allowReboot' property was required to be set to true which will no longer be the case and the server will be rebooted automatically @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the server @param server [Server] Modified Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Server
, Integer, Hash)>] Server
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 884 def datacenters_servers_put_with_http_info(datacenter_id, server_id, server, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_put ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_put" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_put" end # verify the required parameter 'server' is set if @api_client.config.client_side_validation && server.nil? fail ArgumentError, "Missing the required parameter 'server' when calling ServerApi.datacenters_servers_put" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_put, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_put, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(server) # return_type return_type = opts[:debug_return_type] || 'Server' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_put", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Reboot a Server
This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on. @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Object]
# File lib/ionoscloud/api/server_api.rb, line 962 def datacenters_servers_reboot_post(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_reboot_post_with_http_info(datacenter_id, server_id, opts) data end
Reboot a Server
This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on. @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Object
, Integer, Hash)>] Object
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 976 def datacenters_servers_reboot_post_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_reboot_post ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_reboot_post" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_reboot_post" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_reboot_post, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_reboot_post, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/reboot'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_reboot_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_reboot_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Start a Server
This will start a server. If the server's public IP was deallocated then a new IP will be assigned @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Object]
# File lib/ionoscloud/api/server_api.rb, line 1048 def datacenters_servers_start_post(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_start_post_with_http_info(datacenter_id, server_id, opts) data end
Start a Server
This will start a server. If the server's public IP was deallocated then a new IP will be assigned @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Object
, Integer, Hash)>] Object
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 1062 def datacenters_servers_start_post_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_start_post ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_start_post" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_start_post" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_start_post, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_start_post, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/start'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_start_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_start_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Stop a Server
This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated. The operation is not supported for Cube servers. @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Object]
# File lib/ionoscloud/api/server_api.rb, line 1134 def datacenters_servers_stop_post(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_stop_post_with_http_info(datacenter_id, server_id, opts) data end
Stop a Server
This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated. The operation is not supported for Cube servers. @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Object
, Integer, Hash)>] Object
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 1148 def datacenters_servers_stop_post_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_stop_post ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_stop_post" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_stop_post" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_stop_post, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_stop_post, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/stop'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_stop_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_stop_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Upgrade a Server
This will upgrade the version of the server, if needed. To verify if there is an upgrade available for a server, call '/datacenters/{datacenterId}/servers?upgradeNeeded=true' @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Object]
# File lib/ionoscloud/api/server_api.rb, line 1220 def datacenters_servers_upgrade_post(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_upgrade_post_with_http_info(datacenter_id, server_id, opts) data end
Upgrade a Server
This will upgrade the version of the server, if needed. To verify if there is an upgrade available for a server, call '/datacenters/{datacenterId}/servers?upgradeNeeded=true' @param datacenter_id [String] The unique ID of the datacenter @param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Object
, Integer, Hash)>] Object
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 1234 def datacenters_servers_upgrade_post_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_upgrade_post ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_upgrade_post" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_upgrade_post" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_upgrade_post, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_upgrade_post, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/upgrade'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_upgrade_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_upgrade_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Detach a volume This will detach the volume from the server. This will not delete the volume from your datacenter. You will need to make a separate request to perform a deletion @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param volume_id [String] The unique ID of the Volume
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Object]
# File lib/ionoscloud/api/server_api.rb, line 1307 def datacenters_servers_volumes_delete(datacenter_id, server_id, volume_id, opts = {}) data, _status_code, _headers = datacenters_servers_volumes_delete_with_http_info(datacenter_id, server_id, volume_id, opts) data end
Detach a volume This will detach the volume from the server. This will not delete the volume from your datacenter. You will need to make a separate request to perform a deletion @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param volume_id [String] The unique ID of the Volume
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Object
, Integer, Hash)>] Object
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 1322 def datacenters_servers_volumes_delete_with_http_info(datacenter_id, server_id, volume_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_delete ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_delete" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_delete" end # verify the required parameter 'volume_id' is set if @api_client.config.client_side_validation && volume_id.nil? fail ArgumentError, "Missing the required parameter 'volume_id' when calling ServerApi.datacenters_servers_volumes_delete" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_delete, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_delete, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Object' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_volumes_delete", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Retrieve an attached volume This will retrieve the properties of an attached volume. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param volume_id [String] The unique ID of the Volume
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Volume]
# File lib/ionoscloud/api/server_api.rb, line 1399 def datacenters_servers_volumes_find_by_id(datacenter_id, server_id, volume_id, opts = {}) data, _status_code, _headers = datacenters_servers_volumes_find_by_id_with_http_info(datacenter_id, server_id, volume_id, opts) data end
Retrieve an attached volume This will retrieve the properties of an attached volume. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param volume_id [String] The unique ID of the Volume
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Volume
, Integer, Hash)>] Volume
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 1414 def datacenters_servers_volumes_find_by_id_with_http_info(datacenter_id, server_id, volume_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_find_by_id ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_find_by_id" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_find_by_id" end # verify the required parameter 'volume_id' is set if @api_client.config.client_side_validation && volume_id.nil? fail ArgumentError, "Missing the required parameter 'volume_id' when calling ServerApi.datacenters_servers_volumes_find_by_id" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_find_by_id, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_find_by_id, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Volume' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_volumes_find_by_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
List Attached Volumes
You can retrieve a list of volumes attached to the server @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (default to 0) @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) (default to 1000) @return [AttachedVolumes]
# File lib/ionoscloud/api/server_api.rb, line 1492 def datacenters_servers_volumes_get(datacenter_id, server_id, opts = {}) data, _status_code, _headers = datacenters_servers_volumes_get_with_http_info(datacenter_id, server_id, opts) data end
List Attached Volumes
You can retrieve a list of volumes attached to the server @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) @return [Array<(AttachedVolumes
, Integer, Hash)>] AttachedVolumes
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 1508 def datacenters_servers_volumes_get_with_http_info(datacenter_id, server_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_get ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_get" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_get" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_get, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ServerApi.datacenters_servers_volumes_get, must be greater than or equal to 0.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_volumes_get, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_volumes_get, must be greater than or equal to 1.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'AttachedVolumes' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_volumes_get", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Attach a volume This will attach a pre-existing storage volume to the server. It is also possible to create and attach a volume in one step just by providing a new volume description as payload. Combine count of Nics
and volumes attached to the server should not exceed size 24. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param volume [Volume] Volume
to be attached (created and attached) @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on (default to 0) @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Volume]
# File lib/ionoscloud/api/server_api.rb, line 1595 def datacenters_servers_volumes_post(datacenter_id, server_id, volume, opts = {}) data, _status_code, _headers = datacenters_servers_volumes_post_with_http_info(datacenter_id, server_id, volume, opts) data end
Attach a volume This will attach a pre-existing storage volume to the server. It is also possible to create and attach a volume in one step just by providing a new volume description as payload. Combine count of Nics
and volumes attached to the server should not exceed size 24. @param datacenter_id [String] The unique ID of the Datacenter
@param server_id [String] The unique ID of the Server
@param volume [Volume] Volume
to be attached (created and attached) @param [Hash] opts the optional parameters @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/ - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=… and so on @option opts [Integer] :x_contract_number Users
having more than 1 contract need to provide contract number, against which all API requests should be executed @return [Array<(Volume
, Integer, Hash)>] Volume
data, response status code and response headers
# File lib/ionoscloud/api/server_api.rb, line 1610 def datacenters_servers_volumes_post_with_http_info(datacenter_id, server_id, volume, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_post ...' end # verify the required parameter 'datacenter_id' is set if @api_client.config.client_side_validation && datacenter_id.nil? fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_post" end # verify the required parameter 'server_id' is set if @api_client.config.client_side_validation && server_id.nil? fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_post" end # verify the required parameter 'volume' is set if @api_client.config.client_side_validation && volume.nil? fail ArgumentError, "Missing the required parameter 'volume' when calling ServerApi.datacenters_servers_volumes_post" end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_post, must be smaller than or equal to 10.' end if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0 fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_post, must be greater than or equal to 0.' end # resource path local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil? query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(volume) # return_type return_type = opts[:debug_return_type] || 'Volume' # auth_names auth_names = opts[:debug_auth_names] || ['Basic Authentication'] new_options = opts.merge( :operation => :"ServerApi.datacenters_servers_volumes_post", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end