Method: IbmCloudPower::PCloudSPPPlacementGroupsApi#pcloud_sppplacementgroups_post_with_http_info

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

#pcloud_sppplacementgroups_post_with_http_info(cloud_instance_id, body, opts = {}) ⇒ Array<(SPPPlacementGroup, Integer, Hash)>

Create a new Shared Processor Pool Placement Group

Parameters:

  • cloud_instance_id (String)

    Cloud Instance ID of a PCloud Instance

  • body (SPPPlacementGroupCreate)

    Parameters for the creation of a Shared Processor Pool Placement Group

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

    the optional parameters

Returns:

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

    SPPPlacementGroup data, response status code and response headers



378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/ibm_cloud_power/api/p_cloud_spp_placement_groups_api.rb', line 378

def pcloud_sppplacementgroups_post_with_http_info(cloud_instance_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: PCloudSPPPlacementGroupsApi.pcloud_sppplacementgroups_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 PCloudSPPPlacementGroupsApi.pcloud_sppplacementgroups_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 PCloudSPPPlacementGroupsApi.pcloud_sppplacementgroups_post"
  end
  # resource path
  local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/spp-placement-groups'.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'])
  # 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] || 'SPPPlacementGroup'

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

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