ibm_cloud_power 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +68 -0
  3. data/LICENSE.txt +202 -0
  4. data/README.md +56 -10
  5. data/docs/CloudConnection.md +41 -0
  6. data/docs/CloudConnectionCreate.md +23 -0
  7. data/docs/CloudConnectionEndpointClassic.md +19 -0
  8. data/docs/CloudConnectionEndpointGRE.md +19 -0
  9. data/docs/CloudConnectionEndpointVPC.md +19 -0
  10. data/docs/CloudConnectionGRETunnel.md +21 -0
  11. data/docs/CloudConnectionSpeed.md +16 -0
  12. data/docs/CloudConnectionUpdate.md +27 -0
  13. data/docs/CloudConnectionVPC.md +19 -0
  14. data/docs/CloudConnectionVirtualPrivateClouds.md +17 -0
  15. data/docs/CloudConnectionVirtualPrivateCloudsVirtualPrivateClouds.md +23 -0
  16. data/docs/CloudConnections.md +17 -0
  17. data/docs/CreateDataVolume.md +6 -6
  18. data/docs/CreateImage.md +3 -3
  19. data/docs/Image.md +2 -0
  20. data/docs/ImageReference.md +2 -0
  21. data/docs/MaximumStorageAllocation.md +21 -0
  22. data/docs/MultiVolumesCreate.md +6 -4
  23. data/docs/Network.md +1 -1
  24. data/docs/NetworkPort.md +2 -0
  25. data/docs/NetworkReference.md +1 -1
  26. data/docs/PCloudCloudConnectionsApi.md +394 -0
  27. data/docs/PCloudEventsApi.md +2 -2
  28. data/docs/PCloudImagesApi.md +104 -6
  29. data/docs/PCloudPVMInstancesApi.md +60 -5
  30. data/docs/PCloudPlacementGroupsApi.md +298 -0
  31. data/docs/PCloudStorageCapacityApi.md +196 -0
  32. data/docs/PCloudVolumesApi.md +344 -0
  33. data/docs/PVMInstance.md +3 -1
  34. data/docs/PVMInstanceCreate.md +5 -3
  35. data/docs/PlacementGroup.md +23 -0
  36. data/docs/PlacementGroupCreate.md +19 -0
  37. data/docs/PlacementGroupServer.md +17 -0
  38. data/docs/PlacementGroups.md +17 -0
  39. data/docs/SAPCreate.md +1 -1
  40. data/docs/StoragePoolCapacity.md +23 -0
  41. data/docs/StoragePoolsCapacity.md +19 -0
  42. data/docs/StorageTypeCapacity.md +21 -0
  43. data/docs/StorageTypesCapacity.md +19 -0
  44. data/docs/Volume.md +2 -0
  45. data/docs/VolumeReference.md +2 -0
  46. data/docs/VolumesCloneAsyncRequest.md +1 -1
  47. data/docs/VolumesCloneCancel.md +1 -1
  48. data/docs/VolumesCloneDetail.md +1 -1
  49. data/docs/VolumesCloneExecute.md +1 -1
  50. data/lib/ibm_cloud_power.rb +24 -0
  51. data/lib/ibm_cloud_power/api/p_cloud_cloud_connections_api.rb +560 -0
  52. data/lib/ibm_cloud_power/api/p_cloud_events_api.rb +2 -2
  53. data/lib/ibm_cloud_power/api/p_cloud_images_api.rb +133 -4
  54. data/lib/ibm_cloud_power/api/p_cloud_placement_groups_api.rb +430 -0
  55. data/lib/ibm_cloud_power/api/p_cloud_pvm_instances_api.rb +82 -5
  56. data/lib/ibm_cloud_power/api/p_cloud_storage_capacity_api.rb +274 -0
  57. data/lib/ibm_cloud_power/api/p_cloud_volumes_api.rb +477 -0
  58. data/lib/ibm_cloud_power/models/cloud_connection.rb +379 -0
  59. data/lib/ibm_cloud_power/models/cloud_connection_create.rb +249 -0
  60. data/lib/ibm_cloud_power/models/cloud_connection_endpoint_classic.rb +218 -0
  61. data/lib/ibm_cloud_power/models/cloud_connection_endpoint_gre.rb +221 -0
  62. data/lib/ibm_cloud_power/models/cloud_connection_endpoint_vpc.rb +221 -0
  63. data/lib/ibm_cloud_power/models/cloud_connection_gre_tunnel.rb +239 -0
  64. data/lib/ibm_cloud_power/models/cloud_connection_speed.rb +42 -0
  65. data/lib/ibm_cloud_power/models/cloud_connection_update.rb +257 -0
  66. data/lib/ibm_cloud_power/models/cloud_connection_virtual_private_clouds.rb +216 -0
  67. data/lib/ibm_cloud_power/models/cloud_connection_virtual_private_clouds_virtual_private_clouds.rb +259 -0
  68. data/lib/ibm_cloud_power/models/cloud_connection_vpc.rb +224 -0
  69. data/lib/ibm_cloud_power/models/cloud_connections.rb +216 -0
  70. data/lib/ibm_cloud_power/models/create_data_volume.rb +17 -17
  71. data/lib/ibm_cloud_power/models/create_image.rb +3 -3
  72. data/lib/ibm_cloud_power/models/image.rb +16 -1
  73. data/lib/ibm_cloud_power/models/image_reference.rb +16 -1
  74. data/lib/ibm_cloud_power/models/maximum_storage_allocation.rb +245 -0
  75. data/lib/ibm_cloud_power/models/multi_volumes_create.rb +17 -7
  76. data/lib/ibm_cloud_power/models/network.rb +1 -1
  77. data/lib/ibm_cloud_power/models/network_port.rb +11 -1
  78. data/lib/ibm_cloud_power/models/network_reference.rb +1 -1
  79. data/lib/ibm_cloud_power/models/placement_group.rb +295 -0
  80. data/lib/ibm_cloud_power/models/placement_group_create.rb +263 -0
  81. data/lib/ibm_cloud_power/models/placement_group_server.rb +214 -0
  82. data/lib/ibm_cloud_power/models/placement_groups.rb +216 -0
  83. data/lib/ibm_cloud_power/models/pvm_instance.rb +17 -5
  84. data/lib/ibm_cloud_power/models/pvm_instance_create.rb +16 -6
  85. data/lib/ibm_cloud_power/models/pvm_instance_reference.rb +2 -2
  86. data/lib/ibm_cloud_power/models/sap_create.rb +1 -1
  87. data/lib/ibm_cloud_power/models/storage_pool_capacity.rb +245 -0
  88. data/lib/ibm_cloud_power/models/storage_pools_capacity.rb +220 -0
  89. data/lib/ibm_cloud_power/models/storage_type_capacity.rb +231 -0
  90. data/lib/ibm_cloud_power/models/storage_types_capacity.rb +220 -0
  91. data/lib/ibm_cloud_power/models/volume.rb +11 -1
  92. data/lib/ibm_cloud_power/models/volume_reference.rb +11 -1
  93. data/lib/ibm_cloud_power/models/volumes_clone_async_request.rb +1 -1
  94. data/lib/ibm_cloud_power/models/volumes_clone_cancel.rb +1 -1
  95. data/lib/ibm_cloud_power/models/volumes_clone_detail.rb +1 -1
  96. data/lib/ibm_cloud_power/models/volumes_clone_execute.rb +1 -1
  97. data/lib/ibm_cloud_power/version.rb +1 -1
  98. data/spec/api/p_cloud_cloud_connections_api_spec.rb +132 -0
  99. data/spec/api/p_cloud_placement_groups_api_spec.rb +108 -0
  100. data/spec/api/p_cloud_storage_capacity_api_spec.rb +81 -0
  101. data/spec/models/cloud_connection_create_spec.rb +59 -0
  102. data/spec/models/cloud_connection_endpoint_classic_spec.rb +47 -0
  103. data/spec/models/cloud_connection_endpoint_gre_spec.rb +47 -0
  104. data/spec/models/cloud_connection_endpoint_vpc_spec.rb +47 -0
  105. data/spec/models/cloud_connection_gre_tunnel_spec.rb +53 -0
  106. data/spec/models/cloud_connection_spec.rb +113 -0
  107. data/spec/models/cloud_connection_speed_spec.rb +35 -0
  108. data/spec/models/cloud_connection_update_spec.rb +71 -0
  109. data/spec/models/cloud_connection_virtual_private_clouds_spec.rb +41 -0
  110. data/spec/models/cloud_connection_virtual_private_clouds_virtual_private_clouds_spec.rb +59 -0
  111. data/spec/models/cloud_connection_vpc_spec.rb +47 -0
  112. data/spec/models/cloud_connections_spec.rb +41 -0
  113. data/spec/models/maximum_storage_allocation_spec.rb +53 -0
  114. data/spec/models/placement_group_create_spec.rb +51 -0
  115. data/spec/models/placement_group_server_spec.rb +41 -0
  116. data/spec/models/placement_group_spec.rb +63 -0
  117. data/spec/models/placement_groups_spec.rb +41 -0
  118. data/spec/models/storage_pool_capacity_spec.rb +59 -0
  119. data/spec/models/storage_pools_capacity_spec.rb +47 -0
  120. data/spec/models/storage_type_capacity_spec.rb +53 -0
  121. data/spec/models/storage_types_capacity_spec.rb +47 -0
  122. metadata +130 -32
@@ -91,7 +91,7 @@ module IbmCloudPower
91
91
  # Get events from this cloud instance since a specific timestamp
92
92
  # You must append the '?time=' query parameter to the cURL URL to get a list of events.
93
93
  # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
94
- # @param time [String] A time in either ISO 8601 or unix epoch format
94
+ # @param time [String] (deprecated - use from_time) A time in either ISO 8601 or unix epoch format
95
95
  # @param [Hash] opts the optional parameters
96
96
  # @option opts [String] :accept_language The language requested for the return document
97
97
  # @return [Events]
@@ -103,7 +103,7 @@ module IbmCloudPower
103
103
  # Get events from this cloud instance since a specific timestamp
104
104
  # You must append the '?time=' query parameter to the cURL URL to get a list of events.
105
105
  # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
106
- # @param time [String] A time in either ISO 8601 or unix epoch format
106
+ # @param time [String] (deprecated - use from_time) A time in either ISO 8601 or unix epoch format
107
107
  # @param [Hash] opts the optional parameters
108
108
  # @option opts [String] :accept_language The language requested for the return document
109
109
  # @return [Array<(Events, Integer, Hash)>] Events data, response status code and response headers
@@ -353,7 +353,136 @@ module IbmCloudPower
353
353
  return data, status_code, headers
354
354
  end
355
355
 
356
- # Detailed information of an available image
356
+ # Detailed info of an available stock image
357
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
358
+ # @param image_id [String] Image ID of a image
359
+ # @param [Hash] opts the optional parameters
360
+ # @return [Image]
361
+ def pcloud_cloudinstances_stockimages_get(cloud_instance_id, image_id, opts = {})
362
+ data, _status_code, _headers = pcloud_cloudinstances_stockimages_get_with_http_info(cloud_instance_id, image_id, opts)
363
+ data
364
+ end
365
+
366
+ # Detailed info of an available stock image
367
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
368
+ # @param image_id [String] Image ID of a image
369
+ # @param [Hash] opts the optional parameters
370
+ # @return [Array<(Image, Integer, Hash)>] Image data, response status code and response headers
371
+ def pcloud_cloudinstances_stockimages_get_with_http_info(cloud_instance_id, image_id, opts = {})
372
+ if @api_client.config.debugging
373
+ @api_client.config.logger.debug 'Calling API: PCloudImagesApi.pcloud_cloudinstances_stockimages_get ...'
374
+ end
375
+ # verify the required parameter 'cloud_instance_id' is set
376
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
377
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudImagesApi.pcloud_cloudinstances_stockimages_get"
378
+ end
379
+ # verify the required parameter 'image_id' is set
380
+ if @api_client.config.client_side_validation && image_id.nil?
381
+ fail ArgumentError, "Missing the required parameter 'image_id' when calling PCloudImagesApi.pcloud_cloudinstances_stockimages_get"
382
+ end
383
+ # resource path
384
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images/{image_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'image_id' + '}', CGI.escape(image_id.to_s))
385
+
386
+ # query parameters
387
+ query_params = opts[:query_params] || {}
388
+
389
+ # header parameters
390
+ header_params = opts[:header_params] || {}
391
+ # HTTP header 'Accept' (if needed)
392
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
393
+
394
+ # form parameters
395
+ form_params = opts[:form_params] || {}
396
+
397
+ # http body (model)
398
+ post_body = opts[:body]
399
+
400
+ # return_type
401
+ return_type = opts[:return_type] || 'Image'
402
+
403
+ # auth_names
404
+ auth_names = opts[:auth_names] || []
405
+
406
+ new_options = opts.merge(
407
+ :header_params => header_params,
408
+ :query_params => query_params,
409
+ :form_params => form_params,
410
+ :body => post_body,
411
+ :auth_names => auth_names,
412
+ :return_type => return_type
413
+ )
414
+
415
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
416
+ if @api_client.config.debugging
417
+ @api_client.config.logger.debug "API called: PCloudImagesApi#pcloud_cloudinstances_stockimages_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
418
+ end
419
+ return data, status_code, headers
420
+ end
421
+
422
+ # List all available stock images
423
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
424
+ # @param [Hash] opts the optional parameters
425
+ # @option opts [Boolean] :sap Include SAP images with get available stock images
426
+ # @return [Images]
427
+ def pcloud_cloudinstances_stockimages_getall(cloud_instance_id, opts = {})
428
+ data, _status_code, _headers = pcloud_cloudinstances_stockimages_getall_with_http_info(cloud_instance_id, opts)
429
+ data
430
+ end
431
+
432
+ # List all available stock images
433
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
434
+ # @param [Hash] opts the optional parameters
435
+ # @option opts [Boolean] :sap Include SAP images with get available stock images
436
+ # @return [Array<(Images, Integer, Hash)>] Images data, response status code and response headers
437
+ def pcloud_cloudinstances_stockimages_getall_with_http_info(cloud_instance_id, opts = {})
438
+ if @api_client.config.debugging
439
+ @api_client.config.logger.debug 'Calling API: PCloudImagesApi.pcloud_cloudinstances_stockimages_getall ...'
440
+ end
441
+ # verify the required parameter 'cloud_instance_id' is set
442
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
443
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudImagesApi.pcloud_cloudinstances_stockimages_getall"
444
+ end
445
+ # resource path
446
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/stock-images'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s))
447
+
448
+ # query parameters
449
+ query_params = opts[:query_params] || {}
450
+ query_params[:'sap'] = opts[:'sap'] if !opts[:'sap'].nil?
451
+
452
+ # header parameters
453
+ header_params = opts[:header_params] || {}
454
+ # HTTP header 'Accept' (if needed)
455
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
456
+
457
+ # form parameters
458
+ form_params = opts[:form_params] || {}
459
+
460
+ # http body (model)
461
+ post_body = opts[:body]
462
+
463
+ # return_type
464
+ return_type = opts[:return_type] || 'Images'
465
+
466
+ # auth_names
467
+ auth_names = opts[:auth_names] || []
468
+
469
+ new_options = opts.merge(
470
+ :header_params => header_params,
471
+ :query_params => query_params,
472
+ :form_params => form_params,
473
+ :body => post_body,
474
+ :auth_names => auth_names,
475
+ :return_type => return_type
476
+ )
477
+
478
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
479
+ if @api_client.config.debugging
480
+ @api_client.config.logger.debug "API called: PCloudImagesApi#pcloud_cloudinstances_stockimages_getall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
481
+ end
482
+ return data, status_code, headers
483
+ end
484
+
485
+ # Deprecated for /pcloud/v1/cloud-instances/${CLOUD_INSTANCE_ID}/stock-images/{image_id} - Detailed info of an available stock image
357
486
  # @param image_id [String] Image ID of a image
358
487
  # @param [Hash] opts the optional parameters
359
488
  # @return [Images]
@@ -362,7 +491,7 @@ module IbmCloudPower
362
491
  data
363
492
  end
364
493
 
365
- # Detailed information of an available image
494
+ # Deprecated for /pcloud/v1/cloud-instances/${CLOUD_INSTANCE_ID}/stock-images/{image_id} - Detailed info of an available stock image
366
495
  # @param image_id [String] Image ID of a image
367
496
  # @param [Hash] opts the optional parameters
368
497
  # @return [Array<(Images, Integer, Hash)>] Images data, response status code and response headers
@@ -413,7 +542,7 @@ module IbmCloudPower
413
542
  return data, status_code, headers
414
543
  end
415
544
 
416
- # List all images available for copying into cloud instances
545
+ # Deprecated for /pcloud/v1/cloud-instances/${CLOUD_INSTANCE_ID}/stock-images - List all available stock images
417
546
  # @param [Hash] opts the optional parameters
418
547
  # @option opts [Boolean] :sap Include SAP images with get available stock images
419
548
  # @return [Images]
@@ -422,7 +551,7 @@ module IbmCloudPower
422
551
  data
423
552
  end
424
553
 
425
- # List all images available for copying into cloud instances
554
+ # Deprecated for /pcloud/v1/cloud-instances/${CLOUD_INSTANCE_ID}/stock-images - List all available stock images
426
555
  # @param [Hash] opts the optional parameters
427
556
  # @option opts [Boolean] :sap Include SAP images with get available stock images
428
557
  # @return [Array<(Images, Integer, Hash)>] Images data, response status code and response headers
@@ -0,0 +1,430 @@
1
+ =begin
2
+ #Power Cloud API
3
+
4
+ #IBM Power Cloud API for Power Hardware / Infrastructure
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+ Contact: kylej@us.ibm.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IbmCloudPower
16
+ class PCloudPlacementGroupsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete server placement group
23
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
24
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Object]
27
+ def pcloud_placementgroups_delete(cloud_instance_id, placement_group_id, opts = {})
28
+ data, _status_code, _headers = pcloud_placementgroups_delete_with_http_info(cloud_instance_id, placement_group_id, opts)
29
+ data
30
+ end
31
+
32
+ # Delete server placement group
33
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
34
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
37
+ def pcloud_placementgroups_delete_with_http_info(cloud_instance_id, placement_group_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: PCloudPlacementGroupsApi.pcloud_placementgroups_delete ...'
40
+ end
41
+ # verify the required parameter 'cloud_instance_id' is set
42
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_delete"
44
+ end
45
+ # verify the required parameter 'placement_group_id' is set
46
+ if @api_client.config.client_side_validation && placement_group_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'placement_group_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_delete"
48
+ end
49
+ # resource path
50
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'placement_group_id' + '}', CGI.escape(placement_group_id.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['*/*'])
59
+
60
+ # form parameters
61
+ form_params = opts[:form_params] || {}
62
+
63
+ # http body (model)
64
+ post_body = opts[:body]
65
+
66
+ # return_type
67
+ return_type = opts[:return_type] || 'Object'
68
+
69
+ # auth_names
70
+ auth_names = opts[:auth_names] || []
71
+
72
+ new_options = opts.merge(
73
+ :header_params => header_params,
74
+ :query_params => query_params,
75
+ :form_params => form_params,
76
+ :body => post_body,
77
+ :auth_names => auth_names,
78
+ :return_type => return_type
79
+ )
80
+
81
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: PCloudPlacementGroupsApi#pcloud_placementgroups_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+
88
+ # Get server placement group details
89
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
90
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [PlacementGroup]
93
+ def pcloud_placementgroups_get(cloud_instance_id, placement_group_id, opts = {})
94
+ data, _status_code, _headers = pcloud_placementgroups_get_with_http_info(cloud_instance_id, placement_group_id, opts)
95
+ data
96
+ end
97
+
98
+ # Get server placement group details
99
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
100
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(PlacementGroup, Integer, Hash)>] PlacementGroup data, response status code and response headers
103
+ def pcloud_placementgroups_get_with_http_info(cloud_instance_id, placement_group_id, opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: PCloudPlacementGroupsApi.pcloud_placementgroups_get ...'
106
+ end
107
+ # verify the required parameter 'cloud_instance_id' is set
108
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
109
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_get"
110
+ end
111
+ # verify the required parameter 'placement_group_id' is set
112
+ if @api_client.config.client_side_validation && placement_group_id.nil?
113
+ fail ArgumentError, "Missing the required parameter 'placement_group_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_get"
114
+ end
115
+ # resource path
116
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'placement_group_id' + '}', CGI.escape(placement_group_id.to_s))
117
+
118
+ # query parameters
119
+ query_params = opts[:query_params] || {}
120
+
121
+ # header parameters
122
+ header_params = opts[:header_params] || {}
123
+ # HTTP header 'Accept' (if needed)
124
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
125
+
126
+ # form parameters
127
+ form_params = opts[:form_params] || {}
128
+
129
+ # http body (model)
130
+ post_body = opts[:body]
131
+
132
+ # return_type
133
+ return_type = opts[:return_type] || 'PlacementGroup'
134
+
135
+ # auth_names
136
+ auth_names = opts[:auth_names] || []
137
+
138
+ new_options = opts.merge(
139
+ :header_params => header_params,
140
+ :query_params => query_params,
141
+ :form_params => form_params,
142
+ :body => post_body,
143
+ :auth_names => auth_names,
144
+ :return_type => return_type
145
+ )
146
+
147
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
148
+ if @api_client.config.debugging
149
+ @api_client.config.logger.debug "API called: PCloudPlacementGroupsApi#pcloud_placementgroups_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
150
+ end
151
+ return data, status_code, headers
152
+ end
153
+
154
+ # Get all server placement groups
155
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
156
+ # @param [Hash] opts the optional parameters
157
+ # @return [PlacementGroups]
158
+ def pcloud_placementgroups_getall(cloud_instance_id, opts = {})
159
+ data, _status_code, _headers = pcloud_placementgroups_getall_with_http_info(cloud_instance_id, opts)
160
+ data
161
+ end
162
+
163
+ # Get all server placement groups
164
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
165
+ # @param [Hash] opts the optional parameters
166
+ # @return [Array<(PlacementGroups, Integer, Hash)>] PlacementGroups data, response status code and response headers
167
+ def pcloud_placementgroups_getall_with_http_info(cloud_instance_id, opts = {})
168
+ if @api_client.config.debugging
169
+ @api_client.config.logger.debug 'Calling API: PCloudPlacementGroupsApi.pcloud_placementgroups_getall ...'
170
+ end
171
+ # verify the required parameter 'cloud_instance_id' is set
172
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
173
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_getall"
174
+ end
175
+ # resource path
176
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s))
177
+
178
+ # query parameters
179
+ query_params = opts[:query_params] || {}
180
+
181
+ # header parameters
182
+ header_params = opts[:header_params] || {}
183
+ # HTTP header 'Accept' (if needed)
184
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
185
+
186
+ # form parameters
187
+ form_params = opts[:form_params] || {}
188
+
189
+ # http body (model)
190
+ post_body = opts[:body]
191
+
192
+ # return_type
193
+ return_type = opts[:return_type] || 'PlacementGroups'
194
+
195
+ # auth_names
196
+ auth_names = opts[:auth_names] || []
197
+
198
+ new_options = opts.merge(
199
+ :header_params => header_params,
200
+ :query_params => query_params,
201
+ :form_params => form_params,
202
+ :body => post_body,
203
+ :auth_names => auth_names,
204
+ :return_type => return_type
205
+ )
206
+
207
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
208
+ if @api_client.config.debugging
209
+ @api_client.config.logger.debug "API called: PCloudPlacementGroupsApi#pcloud_placementgroups_getall\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
210
+ end
211
+ return data, status_code, headers
212
+ end
213
+
214
+ # Remove server from placement group
215
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
216
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
217
+ # @param body [PlacementGroupServer] Parameters for removing a Server in a Placement Group
218
+ # @param [Hash] opts the optional parameters
219
+ # @return [PlacementGroup]
220
+ def pcloud_placementgroups_members_delete(cloud_instance_id, placement_group_id, body, opts = {})
221
+ data, _status_code, _headers = pcloud_placementgroups_members_delete_with_http_info(cloud_instance_id, placement_group_id, body, opts)
222
+ data
223
+ end
224
+
225
+ # Remove server from placement group
226
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
227
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
228
+ # @param body [PlacementGroupServer] Parameters for removing a Server in a Placement Group
229
+ # @param [Hash] opts the optional parameters
230
+ # @return [Array<(PlacementGroup, Integer, Hash)>] PlacementGroup data, response status code and response headers
231
+ def pcloud_placementgroups_members_delete_with_http_info(cloud_instance_id, placement_group_id, body, opts = {})
232
+ if @api_client.config.debugging
233
+ @api_client.config.logger.debug 'Calling API: PCloudPlacementGroupsApi.pcloud_placementgroups_members_delete ...'
234
+ end
235
+ # verify the required parameter 'cloud_instance_id' is set
236
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
237
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_members_delete"
238
+ end
239
+ # verify the required parameter 'placement_group_id' is set
240
+ if @api_client.config.client_side_validation && placement_group_id.nil?
241
+ fail ArgumentError, "Missing the required parameter 'placement_group_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_members_delete"
242
+ end
243
+ # verify the required parameter 'body' is set
244
+ if @api_client.config.client_side_validation && body.nil?
245
+ fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_members_delete"
246
+ end
247
+ # resource path
248
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'placement_group_id' + '}', CGI.escape(placement_group_id.to_s))
249
+
250
+ # query parameters
251
+ query_params = opts[:query_params] || {}
252
+
253
+ # header parameters
254
+ header_params = opts[:header_params] || {}
255
+ # HTTP header 'Accept' (if needed)
256
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
257
+ # HTTP header 'Content-Type'
258
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
259
+
260
+ # form parameters
261
+ form_params = opts[:form_params] || {}
262
+
263
+ # http body (model)
264
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
265
+
266
+ # return_type
267
+ return_type = opts[:return_type] || 'PlacementGroup'
268
+
269
+ # auth_names
270
+ auth_names = opts[:auth_names] || []
271
+
272
+ new_options = opts.merge(
273
+ :header_params => header_params,
274
+ :query_params => query_params,
275
+ :form_params => form_params,
276
+ :body => post_body,
277
+ :auth_names => auth_names,
278
+ :return_type => return_type
279
+ )
280
+
281
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
282
+ if @api_client.config.debugging
283
+ @api_client.config.logger.debug "API called: PCloudPlacementGroupsApi#pcloud_placementgroups_members_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
284
+ end
285
+ return data, status_code, headers
286
+ end
287
+
288
+ # Add server to placement group
289
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
290
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
291
+ # @param body [PlacementGroupServer] Parameters for adding a server to a Placement Group
292
+ # @param [Hash] opts the optional parameters
293
+ # @return [PlacementGroup]
294
+ def pcloud_placementgroups_members_post(cloud_instance_id, placement_group_id, body, opts = {})
295
+ data, _status_code, _headers = pcloud_placementgroups_members_post_with_http_info(cloud_instance_id, placement_group_id, body, opts)
296
+ data
297
+ end
298
+
299
+ # Add server to placement group
300
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
301
+ # @param placement_group_id [String] Placement Group ID or Placement Group Name
302
+ # @param body [PlacementGroupServer] Parameters for adding a server to a Placement Group
303
+ # @param [Hash] opts the optional parameters
304
+ # @return [Array<(PlacementGroup, Integer, Hash)>] PlacementGroup data, response status code and response headers
305
+ def pcloud_placementgroups_members_post_with_http_info(cloud_instance_id, placement_group_id, body, opts = {})
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug 'Calling API: PCloudPlacementGroupsApi.pcloud_placementgroups_members_post ...'
308
+ end
309
+ # verify the required parameter 'cloud_instance_id' is set
310
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
311
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_members_post"
312
+ end
313
+ # verify the required parameter 'placement_group_id' is set
314
+ if @api_client.config.client_side_validation && placement_group_id.nil?
315
+ fail ArgumentError, "Missing the required parameter 'placement_group_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_members_post"
316
+ end
317
+ # verify the required parameter 'body' is set
318
+ if @api_client.config.client_side_validation && body.nil?
319
+ fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_members_post"
320
+ end
321
+ # resource path
322
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups/{placement_group_id}/members'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s)).sub('{' + 'placement_group_id' + '}', CGI.escape(placement_group_id.to_s))
323
+
324
+ # query parameters
325
+ query_params = opts[:query_params] || {}
326
+
327
+ # header parameters
328
+ header_params = opts[:header_params] || {}
329
+ # HTTP header 'Accept' (if needed)
330
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
331
+ # HTTP header 'Content-Type'
332
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
333
+
334
+ # form parameters
335
+ form_params = opts[:form_params] || {}
336
+
337
+ # http body (model)
338
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
339
+
340
+ # return_type
341
+ return_type = opts[:return_type] || 'PlacementGroup'
342
+
343
+ # auth_names
344
+ auth_names = opts[:auth_names] || []
345
+
346
+ new_options = opts.merge(
347
+ :header_params => header_params,
348
+ :query_params => query_params,
349
+ :form_params => form_params,
350
+ :body => post_body,
351
+ :auth_names => auth_names,
352
+ :return_type => return_type
353
+ )
354
+
355
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
356
+ if @api_client.config.debugging
357
+ @api_client.config.logger.debug "API called: PCloudPlacementGroupsApi#pcloud_placementgroups_members_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
358
+ end
359
+ return data, status_code, headers
360
+ end
361
+
362
+ # Create a server placement group
363
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
364
+ # @param body [PlacementGroupCreate] Parameters for the creating a server placement group
365
+ # @param [Hash] opts the optional parameters
366
+ # @return [PlacementGroup]
367
+ def pcloud_placementgroups_post(cloud_instance_id, body, opts = {})
368
+ data, _status_code, _headers = pcloud_placementgroups_post_with_http_info(cloud_instance_id, body, opts)
369
+ data
370
+ end
371
+
372
+ # Create a server placement group
373
+ # @param cloud_instance_id [String] Cloud Instance ID of a PCloud Instance
374
+ # @param body [PlacementGroupCreate] Parameters for the creating a server placement group
375
+ # @param [Hash] opts the optional parameters
376
+ # @return [Array<(PlacementGroup, Integer, Hash)>] PlacementGroup data, response status code and response headers
377
+ def pcloud_placementgroups_post_with_http_info(cloud_instance_id, body, opts = {})
378
+ if @api_client.config.debugging
379
+ @api_client.config.logger.debug 'Calling API: PCloudPlacementGroupsApi.pcloud_placementgroups_post ...'
380
+ end
381
+ # verify the required parameter 'cloud_instance_id' is set
382
+ if @api_client.config.client_side_validation && cloud_instance_id.nil?
383
+ fail ArgumentError, "Missing the required parameter 'cloud_instance_id' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_post"
384
+ end
385
+ # verify the required parameter 'body' is set
386
+ if @api_client.config.client_side_validation && body.nil?
387
+ fail ArgumentError, "Missing the required parameter 'body' when calling PCloudPlacementGroupsApi.pcloud_placementgroups_post"
388
+ end
389
+ # resource path
390
+ local_var_path = '/pcloud/v1/cloud-instances/{cloud_instance_id}/placement-groups'.sub('{' + 'cloud_instance_id' + '}', CGI.escape(cloud_instance_id.to_s))
391
+
392
+ # query parameters
393
+ query_params = opts[:query_params] || {}
394
+
395
+ # header parameters
396
+ header_params = opts[:header_params] || {}
397
+ # HTTP header 'Accept' (if needed)
398
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
399
+ # HTTP header 'Content-Type'
400
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
401
+
402
+ # form parameters
403
+ form_params = opts[:form_params] || {}
404
+
405
+ # http body (model)
406
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
407
+
408
+ # return_type
409
+ return_type = opts[:return_type] || 'PlacementGroup'
410
+
411
+ # auth_names
412
+ auth_names = opts[:auth_names] || []
413
+
414
+ new_options = opts.merge(
415
+ :header_params => header_params,
416
+ :query_params => query_params,
417
+ :form_params => form_params,
418
+ :body => post_body,
419
+ :auth_names => auth_names,
420
+ :return_type => return_type
421
+ )
422
+
423
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
424
+ if @api_client.config.debugging
425
+ @api_client.config.logger.debug "API called: PCloudPlacementGroupsApi#pcloud_placementgroups_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
426
+ end
427
+ return data, status_code, headers
428
+ end
429
+ end
430
+ end