class IbmCloudPower::PCloudPVMInstancesApi
Attributes
Public Class Methods
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Perform an action (start stop reboot immediate-shutdown reset) on a PVMInstance
@param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceAction] Parameters for the desired action @param [Hash] opts the optional parameters @return [Object]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 28 def pcloud_pvminstances_action_post(cloud_instance_id, pvm_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_action_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts) data end
Perform an action (start stop reboot immediate-shutdown reset) on a PVMInstance
@param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceAction] Parameters for the desired action @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 39 def pcloud_pvminstances_action_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_action_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_action_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_action_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_action_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/action'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_action_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Capture a PVM instance and create a deployable image @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceCapture] Parameters for the capture PVMInstance
@param [Hash] opts the optional parameters @return [Object]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 102 def pcloud_pvminstances_capture_post(cloud_instance_id, pvm_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_capture_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts) data end
Capture a PVM instance and create a deployable image @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceCapture] Parameters for the capture PVMInstance
@param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 113 def pcloud_pvminstances_capture_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_capture_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_capture_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_capture_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_capture_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/capture'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_capture_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Clone a PVMInstance
@param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceClone] Clone PVM Instance parameters @param [Hash] opts the optional parameters @return [PVMInstance]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 176 def pcloud_pvminstances_clone_post(cloud_instance_id, pvm_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_clone_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts) data end
Clone a PVMInstance
@param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceClone] Clone PVM Instance parameters @param [Hash] opts the optional parameters @return [Array<(PVMInstance
, Integer, Hash)>] PVMInstance
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 187 def pcloud_pvminstances_clone_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_clone_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_clone_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_clone_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_clone_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/clone'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'PVMInstance' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_clone_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Generate the noVNC console URL @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [PVMInstanceConsole]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 249 def pcloud_pvminstances_console_post(cloud_instance_id, pvm_instance_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_console_post_with_http_info(cloud_instance_id, pvm_instance_id, opts) data end
Generate the noVNC console URL @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [Array<(PVMInstanceConsole
, Integer, Hash)>] PVMInstanceConsole
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 259 def pcloud_pvminstances_console_post_with_http_info(cloud_instance_id, pvm_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_console_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_console_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_console_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/console'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PVMInstanceConsole' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_console_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Delete a PCloud PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @option opts [Boolean] :delete_data_volumes Indicates whether all data volumes attached to the PVMInstance
must be deleted when deleting the PVMInstance
. Shared data volumes will be deleted if no other PVMInstances
are attached. @return [Object]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 316 def pcloud_pvminstances_delete(cloud_instance_id, pvm_instance_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_delete_with_http_info(cloud_instance_id, pvm_instance_id, opts) data end
Delete a PCloud PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @option opts [Boolean] :delete_data_volumes Indicates whether all data volumes attached to the PVMInstance
must be deleted when deleting the PVMInstance
. Shared data volumes will be deleted if no other PVMInstances
are attached. @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 327 def pcloud_pvminstances_delete_with_http_info(cloud_instance_id, pvm_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_delete ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_delete" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_delete" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'delete_data_volumes'] = opts[:'delete_data_volumes'] if !opts[:'delete_data_volumes'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a PVM instance's current state or information @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [PVMInstance]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 384 def pcloud_pvminstances_get(cloud_instance_id, pvm_instance_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_get_with_http_info(cloud_instance_id, pvm_instance_id, opts) data end
Get a PVM instance's current state or information @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [Array<(PVMInstance
, Integer, Hash)>] PVMInstance
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 394 def pcloud_pvminstances_get_with_http_info(cloud_instance_id, pvm_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_get ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_get" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_get" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PVMInstance' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all the PVM instances for this cloud instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param [Hash] opts the optional parameters @return [PVMInstances]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 449 def pcloud_pvminstances_getall(cloud_instance_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_getall_with_http_info(cloud_instance_id, opts) data end
Get all the PVM instances for this cloud instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param [Hash] opts the optional parameters @return [Array<(PVMInstances
, Integer, Hash)>] PVMInstances
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 458 def pcloud_pvminstances_getall_with_http_info(cloud_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_getall ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_getall" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PVMInstances' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_getall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Remove all addresses of network from a PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param network_id [String] Network
ID @param [Hash] opts the optional parameters @option opts [PVMInstanceRemoveNetwork] :body Remove a network from PVM Instance parameters @return [Object]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 512 def pcloud_pvminstances_networks_delete(cloud_instance_id, pvm_instance_id, network_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_networks_delete_with_http_info(cloud_instance_id, pvm_instance_id, network_id, opts) data end
Remove all addresses of network from a PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param network_id [String] Network
ID @param [Hash] opts the optional parameters @option opts [PVMInstanceRemoveNetwork] :body Remove a network from PVM Instance parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 524 def pcloud_pvminstances_networks_delete_with_http_info(cloud_instance_id, pvm_instance_id, network_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_networks_delete ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_delete" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_delete" end # verify the required parameter 'network_id' is set if @api_client.config.client_side_validation && network_id.nil? fail ArgumentError, "Missing the required parameter 'network_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_delete" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)).sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(opts[:'body']) # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_networks_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a PVM instance's network information @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param network_id [String] Network
ID @param [Hash] opts the optional parameters @return [PVMInstanceNetworks]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 587 def pcloud_pvminstances_networks_get(cloud_instance_id, pvm_instance_id, network_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_networks_get_with_http_info(cloud_instance_id, pvm_instance_id, network_id, opts) data end
Get a PVM instance's network information @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param network_id [String] Network
ID @param [Hash] opts the optional parameters @return [Array<(PVMInstanceNetworks
, Integer, Hash)>] PVMInstanceNetworks
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 598 def pcloud_pvminstances_networks_get_with_http_info(cloud_instance_id, pvm_instance_id, network_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_networks_get ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_get" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_get" end # verify the required parameter 'network_id' is set if @api_client.config.client_side_validation && network_id.nil? fail ArgumentError, "Missing the required parameter 'network_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_get" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks/{network_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)).sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PVMInstanceNetworks' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_networks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all networks for this PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [PVMInstanceNetworks]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 658 def pcloud_pvminstances_networks_getall(cloud_instance_id, pvm_instance_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_networks_getall_with_http_info(cloud_instance_id, pvm_instance_id, opts) data end
Get all networks for this PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [Array<(PVMInstanceNetworks
, Integer, Hash)>] PVMInstanceNetworks
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 668 def pcloud_pvminstances_networks_getall_with_http_info(cloud_instance_id, pvm_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_networks_getall ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_getall" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_getall" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'PVMInstanceNetworks' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_networks_getall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Perform network addition, deletion, and listing @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceAddNetwork] Add network to PVM Instance parameters @param [Hash] opts the optional parameters @return [PVMInstanceNetwork]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 725 def pcloud_pvminstances_networks_post(cloud_instance_id, pvm_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_networks_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts) data end
Perform network addition, deletion, and listing @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceAddNetwork] Add network to PVM Instance parameters @param [Hash] opts the optional parameters @return [Array<(PVMInstanceNetwork
, Integer, Hash)>] PVMInstanceNetwork
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 736 def pcloud_pvminstances_networks_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_networks_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_networks_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/networks'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'PVMInstanceNetwork' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_networks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Perform an operation on a PVMInstance
@param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceOperation] Parameters for the desired operations @param [Hash] opts the optional parameters @return [Object]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 799 def pcloud_pvminstances_operations_post(cloud_instance_id, pvm_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_operations_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts) data end
Perform an operation on a PVMInstance
@param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceOperation] Parameters for the desired operations @param [Hash] opts the optional parameters @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 810 def pcloud_pvminstances_operations_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_operations_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_operations_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_operations_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_operations_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/operations'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Object' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_operations_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create a new PVM instance The order of network IDs passed in will be the order of interfaces defined to the VM. @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param body [PVMInstanceCreate] Parameters for the creation of a new tenant @param [Hash] opts the optional parameters @option opts [Boolean] :skip_host_validation Option to skip host validation on PVMInstance
Create API @return [Array<PVMInstance>]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 874 def pcloud_pvminstances_post(cloud_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_post_with_http_info(cloud_instance_id, body, opts) data end
Create a new PVM instance The order of network IDs passed in will be the order of interfaces defined to the VM. @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param body [PVMInstanceCreate] Parameters for the creation of a new tenant @param [Hash] opts the optional parameters @option opts [Boolean] :skip_host_validation Option to skip host validation on PVMInstance
Create API @return [Array<(Array<PVMInstance>, Integer, Hash)>] Array<PVMInstance> data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 886 def pcloud_pvminstances_post_with_http_info(cloud_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'skipHostValidation'] = opts[:'skip_host_validation'] if !opts[:'skip_host_validation'].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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Array<PVMInstance>' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update a PCloud PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceUpdate] Parameters to update a PCloud PVM instance @param [Hash] opts the optional parameters @return [PVMInstanceUpdateResponse]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 946 def pcloud_pvminstances_put(cloud_instance_id, pvm_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_put_with_http_info(cloud_instance_id, pvm_instance_id, body, opts) data end
Update a PCloud PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [PVMInstanceUpdate] Parameters to update a PCloud PVM instance @param [Hash] opts the optional parameters @return [Array<(PVMInstanceUpdateResponse
, Integer, Hash)>] PVMInstanceUpdateResponse
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 957 def pcloud_pvminstances_put_with_http_info(cloud_instance_id, pvm_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_put ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_put" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_put" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_put" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'PVMInstanceUpdateResponse' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get all snapshots for this PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [Snapshots]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 1019 def pcloud_pvminstances_snapshots_getall(cloud_instance_id, pvm_instance_id, opts = {}) data, _status_code, _headers = pcloud_pvminstances_snapshots_getall_with_http_info(cloud_instance_id, pvm_instance_id, opts) data end
Get all snapshots for this PVM instance @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param [Hash] opts the optional parameters @return [Array<(Snapshots
, Integer, Hash)>] Snapshots
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 1029 def pcloud_pvminstances_snapshots_getall_with_http_info(cloud_instance_id, pvm_instance_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_getall ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_getall" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_getall" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] # return_type return_type = opts[:return_type] || 'Snapshots' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_snapshots_getall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create a PVM instance snapshot @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [SnapshotCreate] PVM Instance snapshot create parameters @param [Hash] opts the optional parameters @return [SnapshotCreateResponse]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 1086 def pcloud_pvminstances_snapshots_post(cloud_instance_id, pvm_instance_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_snapshots_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts) data end
Create a PVM instance snapshot @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param body [SnapshotCreate] PVM Instance snapshot create parameters @param [Hash] opts the optional parameters @return [Array<(SnapshotCreateResponse
, Integer, Hash)>] SnapshotCreateResponse
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 1097 def pcloud_pvminstances_snapshots_post_with_http_info(cloud_instance_id, pvm_instance_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_post" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)) # query parameters query_params = opts[:query_params] || {} # 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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'SnapshotCreateResponse' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_snapshots_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Restore a PVM Instance snapshot To roll back the clone operation, append '?restore_fail_action=rollback' to the cURL URL. If you'd like to try the clone operation again, append '?restore_fail_action=retry' to the cURL URL. @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param snapshot_id [String] PVM Instance snapshot id @param body [SnapshotRestore] PVM Instance snapshot restore parameters @param [Hash] opts the optional parameters @option opts [String] :restore_fail_action Action to take on a failed snapshot restore @return [Snapshot]
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 1163 def pcloud_pvminstances_snapshots_restore_post(cloud_instance_id, pvm_instance_id, snapshot_id, body, opts = {}) data, _status_code, _headers = pcloud_pvminstances_snapshots_restore_post_with_http_info(cloud_instance_id, pvm_instance_id, snapshot_id, body, opts) data end
Restore a PVM Instance snapshot To roll back the clone operation, append '?restore_fail_action=rollback' to the cURL URL. If you'd like to try the clone operation again, append '?restore_fail_action=retry' to the cURL URL. @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance @param pvm_instance_id [String] PCloud PVM Instance ID @param snapshot_id [String] PVM Instance snapshot id @param body [SnapshotRestore] PVM Instance snapshot restore parameters @param [Hash] opts the optional parameters @option opts [String] :restore_fail_action Action to take on a failed snapshot restore @return [Array<(Snapshot
, Integer, Hash)>] Snapshot
data, response status code and response headers
# File lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb, line 1177 def pcloud_pvminstances_snapshots_restore_post_with_http_info(cloud_instance_id, pvm_instance_id, snapshot_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_restore_post ...' end # verify the required parameter 'cloud_instance_id' is set if @api_client.config.client_side_validation && cloud_instance_id.nil? fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_restore_post" end # verify the required parameter 'pvm_instance_id' is set if @api_client.config.client_side_validation && pvm_instance_id.nil? fail ArgumentError, "Missing the required parameter 'pvm_instance_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_restore_post" end # verify the required parameter 'snapshot_id' is set if @api_client.config.client_side_validation && snapshot_id.nil? fail ArgumentError, "Missing the required parameter 'snapshot_id' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_restore_post" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPVMInstancesApi.pcloud_pvminstances_snapshots_restore_post" end allowable_values = ["retry", "rollback"] if @api_client.config.client_side_validation && opts[:'restore_fail_action'] && !allowable_values.include?(opts[:'restore_fail_action']) fail ArgumentError, "invalid value for \"restore_fail_action\", must be one of #{allowable_values}" end # resource path local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/pvm-instances/{pvm_instance_id}/snapshots/{snapshot_id}/restore'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'pvm_instance_id' + '}', CGI.escape(pvm_instance_id.to_s)).sub('{' + 'snapshot_id' + '}', CGI.escape(snapshot_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'restore_fail_action'] = opts[:'restore_fail_action'] if !opts[:'restore_fail_action'].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']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:body] || @api_client.object_to_http_body(body) # return_type return_type = opts[:return_type] || 'Snapshot' # auth_names auth_names = opts[:auth_names] || [] new_options = opts.merge( :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: PCloudPVMInstancesApi#pcloud_pvminstances_snapshots_restore_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end