Method: IbmCloudPower::PCloudCloudConnectionsApi#pcloud_cloudconnections_put_with_http_info

Defined in:
lib/ibm_cloud_power/api/p_cloud_cloud_connections_api.rb

#pcloud_cloudconnections_put_with_http_info(cloud_instance_id, cloud_connection_id, body, opts = {}) ⇒ Array<(CloudConnection, Integer, Hash)>

Update a Cloud Connection

Parameters:

  • cloud_instance_id (String)

    Cloud Instance ID of a PCloud Instance

  • cloud_connection_id (String)

    Cloud Connection ID

  • body (CloudConnectionUpdate)

    Parameters to update a Cloud Connection

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(CloudConnection, Integer, Hash)>)

    CloudConnection data, response status code and response headers



452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/ibm_cloud_power/api/p_cloud_cloud_connections_api.rb', line 452

def pcloud_cloudconnections_put_with_http_info(cloud_instance_id, cloud_connection_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PCloudCloudConnectionsApi.pcloud_cloudconnections_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 PCloudCloudConnectionsApi.pcloud_cloudconnections_put"
  end
  # verify the required parameter 'cloud_connection_id' is set
  if @api_client.config.client_side_validation && cloud_connection_id.nil?
    fail ArgumentError, "Missing the required parameter 'cloud_connection_id' when calling PCloudCloudConnectionsApi.pcloud_cloudconnections_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 PCloudCloudConnectionsApi.pcloud_cloudconnections_put"
  end
  # resource path
  local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/cloud-connections/{cloud_connection_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'cloud_connection_id' + '}', CGI.escape(cloud_connection_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'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type] || 'CloudConnection'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"PCloudCloudConnectionsApi.pcloud_cloudconnections_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: PCloudCloudConnectionsApi#pcloud_cloudconnections_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end