ionoscloud 5.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (300) hide show
  1. checksums.yaml +7 -0
  2. data/DOCS.md +14618 -0
  3. data/Gemfile +9 -0
  4. data/README.md +55 -0
  5. data/Rakefile +10 -0
  6. data/git_push.sh +58 -0
  7. data/ionoscloud.gemspec +38 -0
  8. data/lib/ionoscloud.rb +181 -0
  9. data/lib/ionoscloud/api/_api.rb +96 -0
  10. data/lib/ionoscloud/api/backup_unit_api.rb +583 -0
  11. data/lib/ionoscloud/api/contract_api.rb +96 -0
  12. data/lib/ionoscloud/api/data_center_api.rb +532 -0
  13. data/lib/ionoscloud/api/image_api.rb +432 -0
  14. data/lib/ionoscloud/api/ip_blocks_api.rb +514 -0
  15. data/lib/ionoscloud/api/kubernetes_api.rb +1479 -0
  16. data/lib/ionoscloud/api/label_api.rb +2460 -0
  17. data/lib/ionoscloud/api/lan_api.rb +858 -0
  18. data/lib/ionoscloud/api/load_balancer_api.rb +950 -0
  19. data/lib/ionoscloud/api/location_api.rb +262 -0
  20. data/lib/ionoscloud/api/nic_api.rb +1222 -0
  21. data/lib/ionoscloud/api/private_cross_connect_api.rb +426 -0
  22. data/lib/ionoscloud/api/request_api.rb +283 -0
  23. data/lib/ionoscloud/api/server_api.rb +1679 -0
  24. data/lib/ionoscloud/api/snapshot_api.rb +432 -0
  25. data/lib/ionoscloud/api/user_management_api.rb +2495 -0
  26. data/lib/ionoscloud/api/volume_api.rb +763 -0
  27. data/lib/ionoscloud/api_client.rb +521 -0
  28. data/lib/ionoscloud/api_error.rb +57 -0
  29. data/lib/ionoscloud/configuration.rb +291 -0
  30. data/lib/ionoscloud/models/attached_volumes.rb +278 -0
  31. data/lib/ionoscloud/models/backup_unit.rb +294 -0
  32. data/lib/ionoscloud/models/backup_unit_properties.rb +242 -0
  33. data/lib/ionoscloud/models/backup_unit_sso.rb +217 -0
  34. data/lib/ionoscloud/models/backup_units.rb +283 -0
  35. data/lib/ionoscloud/models/balanced_nics.rb +278 -0
  36. data/lib/ionoscloud/models/cdroms.rb +278 -0
  37. data/lib/ionoscloud/models/connectable_datacenter.rb +234 -0
  38. data/lib/ionoscloud/models/contract.rb +231 -0
  39. data/lib/ionoscloud/models/contract_properties.rb +256 -0
  40. data/lib/ionoscloud/models/data_center_entities.rb +243 -0
  41. data/lib/ionoscloud/models/datacenter.rb +269 -0
  42. data/lib/ionoscloud/models/datacenter_element_metadata.rb +321 -0
  43. data/lib/ionoscloud/models/datacenter_properties.rb +296 -0
  44. data/lib/ionoscloud/models/datacenters.rb +278 -0
  45. data/lib/ionoscloud/models/error.rb +228 -0
  46. data/lib/ionoscloud/models/error_message.rb +227 -0
  47. data/lib/ionoscloud/models/firewall_rule.rb +260 -0
  48. data/lib/ionoscloud/models/firewall_rules.rb +278 -0
  49. data/lib/ionoscloud/models/firewallrule_properties.rb +468 -0
  50. data/lib/ionoscloud/models/group.rb +260 -0
  51. data/lib/ionoscloud/models/group_entities.rb +225 -0
  52. data/lib/ionoscloud/models/group_members.rb +249 -0
  53. data/lib/ionoscloud/models/group_properties.rb +307 -0
  54. data/lib/ionoscloud/models/group_share.rb +251 -0
  55. data/lib/ionoscloud/models/group_share_properties.rb +227 -0
  56. data/lib/ionoscloud/models/group_shares.rb +249 -0
  57. data/lib/ionoscloud/models/group_users.rb +250 -0
  58. data/lib/ionoscloud/models/groups.rb +249 -0
  59. data/lib/ionoscloud/models/image.rb +260 -0
  60. data/lib/ionoscloud/models/image_properties.rb +428 -0
  61. data/lib/ionoscloud/models/images.rb +249 -0
  62. data/lib/ionoscloud/models/info.rb +237 -0
  63. data/lib/ionoscloud/models/ip_block.rb +260 -0
  64. data/lib/ionoscloud/models/ip_block_properties.rb +271 -0
  65. data/lib/ionoscloud/models/ip_blocks.rb +249 -0
  66. data/lib/ionoscloud/models/ip_consumer.rb +270 -0
  67. data/lib/ionoscloud/models/ip_failover.rb +225 -0
  68. data/lib/ionoscloud/models/kubernetes_auto_scaling.rb +227 -0
  69. data/lib/ionoscloud/models/kubernetes_cluster.rb +303 -0
  70. data/lib/ionoscloud/models/kubernetes_cluster_entities.rb +216 -0
  71. data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +265 -0
  72. data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post_and_put.rb +241 -0
  73. data/lib/ionoscloud/models/kubernetes_clusters.rb +283 -0
  74. data/lib/ionoscloud/models/kubernetes_config.rb +285 -0
  75. data/lib/ionoscloud/models/kubernetes_config_properties.rb +217 -0
  76. data/lib/ionoscloud/models/kubernetes_maintenance_window.rb +261 -0
  77. data/lib/ionoscloud/models/kubernetes_node.rb +294 -0
  78. data/lib/ionoscloud/models/kubernetes_node_metadata.rb +291 -0
  79. data/lib/ionoscloud/models/kubernetes_node_pool.rb +294 -0
  80. data/lib/ionoscloud/models/kubernetes_node_pool_for_put.rb +294 -0
  81. data/lib/ionoscloud/models/kubernetes_node_pool_lan.rb +217 -0
  82. data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +476 -0
  83. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +464 -0
  84. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_put.rb +464 -0
  85. data/lib/ionoscloud/models/kubernetes_node_pools.rb +283 -0
  86. data/lib/ionoscloud/models/kubernetes_node_properties.rb +252 -0
  87. data/lib/ionoscloud/models/kubernetes_nodes.rb +283 -0
  88. data/lib/ionoscloud/models/label.rb +294 -0
  89. data/lib/ionoscloud/models/label_properties.rb +257 -0
  90. data/lib/ionoscloud/models/label_resource.rb +294 -0
  91. data/lib/ionoscloud/models/label_resource_properties.rb +227 -0
  92. data/lib/ionoscloud/models/label_resources.rb +312 -0
  93. data/lib/ionoscloud/models/labels.rb +283 -0
  94. data/lib/ionoscloud/models/lan.rb +269 -0
  95. data/lib/ionoscloud/models/lan_entities.rb +216 -0
  96. data/lib/ionoscloud/models/lan_nics.rb +278 -0
  97. data/lib/ionoscloud/models/lan_post.rb +269 -0
  98. data/lib/ionoscloud/models/lan_properties.rb +249 -0
  99. data/lib/ionoscloud/models/lan_properties_post.rb +249 -0
  100. data/lib/ionoscloud/models/lans.rb +278 -0
  101. data/lib/ionoscloud/models/loadbalancer.rb +269 -0
  102. data/lib/ionoscloud/models/loadbalancer_entities.rb +216 -0
  103. data/lib/ionoscloud/models/loadbalancer_properties.rb +271 -0
  104. data/lib/ionoscloud/models/loadbalancers.rb +278 -0
  105. data/lib/ionoscloud/models/location.rb +260 -0
  106. data/lib/ionoscloud/models/location_properties.rb +263 -0
  107. data/lib/ionoscloud/models/locations.rb +249 -0
  108. data/lib/ionoscloud/models/nic.rb +269 -0
  109. data/lib/ionoscloud/models/nic_entities.rb +216 -0
  110. data/lib/ionoscloud/models/nic_properties.rb +284 -0
  111. data/lib/ionoscloud/models/nics.rb +278 -0
  112. data/lib/ionoscloud/models/no_state_meta_data.rb +277 -0
  113. data/lib/ionoscloud/models/pagination_links.rb +237 -0
  114. data/lib/ionoscloud/models/peer.rb +252 -0
  115. data/lib/ionoscloud/models/private_cross_connect.rb +260 -0
  116. data/lib/ionoscloud/models/private_cross_connect_properties.rb +251 -0
  117. data/lib/ionoscloud/models/private_cross_connects.rb +249 -0
  118. data/lib/ionoscloud/models/request.rb +260 -0
  119. data/lib/ionoscloud/models/request_metadata.rb +246 -0
  120. data/lib/ionoscloud/models/request_properties.rb +245 -0
  121. data/lib/ionoscloud/models/request_status.rb +246 -0
  122. data/lib/ionoscloud/models/request_status_metadata.rb +280 -0
  123. data/lib/ionoscloud/models/request_target.rb +259 -0
  124. data/lib/ionoscloud/models/requests.rb +293 -0
  125. data/lib/ionoscloud/models/resource.rb +265 -0
  126. data/lib/ionoscloud/models/resource_entities.rb +216 -0
  127. data/lib/ionoscloud/models/resource_groups.rb +250 -0
  128. data/lib/ionoscloud/models/resource_limits.rb +462 -0
  129. data/lib/ionoscloud/models/resource_properties.rb +227 -0
  130. data/lib/ionoscloud/models/resource_reference.rb +242 -0
  131. data/lib/ionoscloud/models/resources.rb +250 -0
  132. data/lib/ionoscloud/models/resources_users.rb +250 -0
  133. data/lib/ionoscloud/models/s3_key.rb +260 -0
  134. data/lib/ionoscloud/models/s3_key_metadata.rb +227 -0
  135. data/lib/ionoscloud/models/s3_key_properties.rb +227 -0
  136. data/lib/ionoscloud/models/s3_keys.rb +249 -0
  137. data/lib/ionoscloud/models/s3_object_storage_sso.rb +217 -0
  138. data/lib/ionoscloud/models/server.rb +269 -0
  139. data/lib/ionoscloud/models/server_entities.rb +234 -0
  140. data/lib/ionoscloud/models/server_properties.rb +341 -0
  141. data/lib/ionoscloud/models/servers.rb +278 -0
  142. data/lib/ionoscloud/models/snapshot.rb +260 -0
  143. data/lib/ionoscloud/models/snapshot_properties.rb +401 -0
  144. data/lib/ionoscloud/models/snapshots.rb +249 -0
  145. data/lib/ionoscloud/models/type.rb +59 -0
  146. data/lib/ionoscloud/models/user.rb +269 -0
  147. data/lib/ionoscloud/models/user_metadata.rb +237 -0
  148. data/lib/ionoscloud/models/user_properties.rb +297 -0
  149. data/lib/ionoscloud/models/users.rb +249 -0
  150. data/lib/ionoscloud/models/users_entities.rb +225 -0
  151. data/lib/ionoscloud/models/volume.rb +260 -0
  152. data/lib/ionoscloud/models/volume_properties.rb +463 -0
  153. data/lib/ionoscloud/models/volumes.rb +278 -0
  154. data/lib/ionoscloud/version.rb +15 -0
  155. data/spec/api/_api_spec.rb +49 -0
  156. data/spec/api/backup_unit_api_spec.rb +140 -0
  157. data/spec/api/contract_api_spec.rb +49 -0
  158. data/spec/api/data_center_api_spec.rb +128 -0
  159. data/spec/api/image_api_spec.rb +111 -0
  160. data/spec/api/ip_blocks_api_spec.rb +126 -0
  161. data/spec/api/kubernetes_api_spec.rb +306 -0
  162. data/spec/api/label_api_spec.rb +480 -0
  163. data/spec/api/lan_api_spec.rb +186 -0
  164. data/spec/api/load_balancer_api_spec.rb +203 -0
  165. data/spec/api/location_api_spec.rb +80 -0
  166. data/spec/api/nic_api_spec.rb +251 -0
  167. data/spec/api/private_cross_connect_api_spec.rb +110 -0
  168. data/spec/api/request_api_spec.rb +84 -0
  169. data/spec/api/server_api_spec.rb +337 -0
  170. data/spec/api/snapshot_api_spec.rb +111 -0
  171. data/spec/api/user_management_api_spec.rb +495 -0
  172. data/spec/api/volume_api_spec.rb +171 -0
  173. data/spec/api_client_spec.rb +226 -0
  174. data/spec/configuration_spec.rb +42 -0
  175. data/spec/models/attached_volumes_spec.rb +70 -0
  176. data/spec/models/backup_unit_properties_spec.rb +46 -0
  177. data/spec/models/backup_unit_spec.rb +62 -0
  178. data/spec/models/backup_unit_sso_spec.rb +34 -0
  179. data/spec/models/backup_units_spec.rb +56 -0
  180. data/spec/models/balanced_nics_spec.rb +70 -0
  181. data/spec/models/cdroms_spec.rb +70 -0
  182. data/spec/models/connectable_datacenter_spec.rb +46 -0
  183. data/spec/models/contract_properties_spec.rb +58 -0
  184. data/spec/models/contract_spec.rb +40 -0
  185. data/spec/models/data_center_entities_spec.rb +52 -0
  186. data/spec/models/datacenter_element_metadata_spec.rb +80 -0
  187. data/spec/models/datacenter_properties_spec.rb +68 -0
  188. data/spec/models/datacenter_spec.rb +64 -0
  189. data/spec/models/datacenters_spec.rb +70 -0
  190. data/spec/models/error_message_spec.rb +40 -0
  191. data/spec/models/error_spec.rb +40 -0
  192. data/spec/models/firewall_rule_spec.rb +58 -0
  193. data/spec/models/firewall_rules_spec.rb +70 -0
  194. data/spec/models/firewallrule_properties_spec.rb +98 -0
  195. data/spec/models/group_entities_spec.rb +40 -0
  196. data/spec/models/group_members_spec.rb +52 -0
  197. data/spec/models/group_properties_spec.rb +88 -0
  198. data/spec/models/group_share_properties_spec.rb +40 -0
  199. data/spec/models/group_share_spec.rb +52 -0
  200. data/spec/models/group_shares_spec.rb +52 -0
  201. data/spec/models/group_spec.rb +58 -0
  202. data/spec/models/group_users_spec.rb +52 -0
  203. data/spec/models/groups_spec.rb +52 -0
  204. data/spec/models/image_properties_spec.rb +138 -0
  205. data/spec/models/image_spec.rb +58 -0
  206. data/spec/models/images_spec.rb +52 -0
  207. data/spec/models/info_spec.rb +46 -0
  208. data/spec/models/ip_block_properties_spec.rb +58 -0
  209. data/spec/models/ip_block_spec.rb +58 -0
  210. data/spec/models/ip_blocks_spec.rb +52 -0
  211. data/spec/models/ip_consumer_spec.rb +70 -0
  212. data/spec/models/ip_failover_spec.rb +40 -0
  213. data/spec/models/kubernetes_auto_scaling_spec.rb +40 -0
  214. data/spec/models/kubernetes_cluster_entities_spec.rb +34 -0
  215. data/spec/models/kubernetes_cluster_properties_for_post_and_put_spec.rb +46 -0
  216. data/spec/models/kubernetes_cluster_properties_spec.rb +58 -0
  217. data/spec/models/kubernetes_cluster_spec.rb +68 -0
  218. data/spec/models/kubernetes_clusters_spec.rb +56 -0
  219. data/spec/models/kubernetes_config_properties_spec.rb +34 -0
  220. data/spec/models/kubernetes_config_spec.rb +56 -0
  221. data/spec/models/kubernetes_maintenance_window_spec.rb +44 -0
  222. data/spec/models/kubernetes_node_metadata_spec.rb +62 -0
  223. data/spec/models/kubernetes_node_pool_for_put_spec.rb +62 -0
  224. data/spec/models/kubernetes_node_pool_lan_spec.rb +34 -0
  225. data/spec/models/kubernetes_node_pool_properties_for_post_spec.rb +132 -0
  226. data/spec/models/kubernetes_node_pool_properties_for_put_spec.rb +132 -0
  227. data/spec/models/kubernetes_node_pool_properties_spec.rb +138 -0
  228. data/spec/models/kubernetes_node_pool_spec.rb +62 -0
  229. data/spec/models/kubernetes_node_pools_spec.rb +56 -0
  230. data/spec/models/kubernetes_node_properties_spec.rb +46 -0
  231. data/spec/models/kubernetes_node_spec.rb +62 -0
  232. data/spec/models/kubernetes_nodes_spec.rb +56 -0
  233. data/spec/models/label_properties_spec.rb +58 -0
  234. data/spec/models/label_resource_properties_spec.rb +40 -0
  235. data/spec/models/label_resource_spec.rb +62 -0
  236. data/spec/models/label_resources_spec.rb +74 -0
  237. data/spec/models/label_spec.rb +62 -0
  238. data/spec/models/labels_spec.rb +56 -0
  239. data/spec/models/lan_entities_spec.rb +34 -0
  240. data/spec/models/lan_nics_spec.rb +70 -0
  241. data/spec/models/lan_post_spec.rb +64 -0
  242. data/spec/models/lan_properties_post_spec.rb +52 -0
  243. data/spec/models/lan_properties_spec.rb +52 -0
  244. data/spec/models/lan_spec.rb +64 -0
  245. data/spec/models/lans_spec.rb +70 -0
  246. data/spec/models/loadbalancer_entities_spec.rb +34 -0
  247. data/spec/models/loadbalancer_properties_spec.rb +50 -0
  248. data/spec/models/loadbalancer_spec.rb +64 -0
  249. data/spec/models/loadbalancers_spec.rb +70 -0
  250. data/spec/models/location_properties_spec.rb +50 -0
  251. data/spec/models/location_spec.rb +58 -0
  252. data/spec/models/locations_spec.rb +52 -0
  253. data/spec/models/nic_entities_spec.rb +34 -0
  254. data/spec/models/nic_properties_spec.rb +70 -0
  255. data/spec/models/nic_spec.rb +64 -0
  256. data/spec/models/nics_spec.rb +70 -0
  257. data/spec/models/no_state_meta_data_spec.rb +70 -0
  258. data/spec/models/pagination_links_spec.rb +46 -0
  259. data/spec/models/peer_spec.rb +58 -0
  260. data/spec/models/private_cross_connect_properties_spec.rb +52 -0
  261. data/spec/models/private_cross_connect_spec.rb +58 -0
  262. data/spec/models/private_cross_connects_spec.rb +52 -0
  263. data/spec/models/request_metadata_spec.rb +52 -0
  264. data/spec/models/request_properties_spec.rb +52 -0
  265. data/spec/models/request_spec.rb +58 -0
  266. data/spec/models/request_status_metadata_spec.rb +56 -0
  267. data/spec/models/request_status_spec.rb +52 -0
  268. data/spec/models/request_target_spec.rb +44 -0
  269. data/spec/models/requests_spec.rb +70 -0
  270. data/spec/models/resource_entities_spec.rb +34 -0
  271. data/spec/models/resource_groups_spec.rb +52 -0
  272. data/spec/models/resource_limits_spec.rb +130 -0
  273. data/spec/models/resource_properties_spec.rb +40 -0
  274. data/spec/models/resource_reference_spec.rb +46 -0
  275. data/spec/models/resource_spec.rb +64 -0
  276. data/spec/models/resources_spec.rb +52 -0
  277. data/spec/models/resources_users_spec.rb +52 -0
  278. data/spec/models/s3_key_metadata_spec.rb +40 -0
  279. data/spec/models/s3_key_properties_spec.rb +40 -0
  280. data/spec/models/s3_key_spec.rb +58 -0
  281. data/spec/models/s3_keys_spec.rb +52 -0
  282. data/spec/models/s3_object_storage_sso_spec.rb +34 -0
  283. data/spec/models/server_entities_spec.rb +46 -0
  284. data/spec/models/server_properties_spec.rb +84 -0
  285. data/spec/models/server_spec.rb +64 -0
  286. data/spec/models/servers_spec.rb +70 -0
  287. data/spec/models/snapshot_properties_spec.rb +128 -0
  288. data/spec/models/snapshot_spec.rb +58 -0
  289. data/spec/models/snapshots_spec.rb +52 -0
  290. data/spec/models/type_spec.rb +28 -0
  291. data/spec/models/user_metadata_spec.rb +46 -0
  292. data/spec/models/user_properties_spec.rb +82 -0
  293. data/spec/models/user_spec.rb +64 -0
  294. data/spec/models/users_entities_spec.rb +40 -0
  295. data/spec/models/users_spec.rb +52 -0
  296. data/spec/models/volume_properties_spec.rb +152 -0
  297. data/spec/models/volume_spec.rb +58 -0
  298. data/spec/models/volumes_spec.rb +70 -0
  299. data/spec/spec_helper.rb +111 -0
  300. metadata +532 -0
@@ -0,0 +1,1679 @@
1
+ =begin
2
+ #CLOUD API
3
+
4
+ #An enterprise-grade Infrastructure is provided as a Service (IaaS) solution that can be managed through a browser-based \"Data Center Designer\" (DCD) tool or via an easy to use API. The API allows you to perform a variety of management tasks such as spinning up additional servers, adding volumes, adjusting networking, and so forth. It is designed to allow users to leverage the same power and flexibility found within the DCD visual tool. Both tools are consistent with their concepts and lend well to making the experience smooth and intuitive.
5
+
6
+ The version of the OpenAPI document: 5.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Ionoscloud
16
+ class ServerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Detach a CD-ROM
23
+ # This will detach a CD-ROM from the server
24
+ # @param datacenter_id [String] The unique ID of the Datacenter
25
+ # @param server_id [String] The unique ID of the Server
26
+ # @param cdrom_id [String] The unique ID of the CD-ROM
27
+ # @param [Hash] opts the optional parameters
28
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
29
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on (default to 0)
30
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
31
+ # @return [Object]
32
+ def datacenters_servers_cdroms_delete(datacenter_id, server_id, cdrom_id, opts = {})
33
+ data, _status_code, _headers = datacenters_servers_cdroms_delete_with_http_info(datacenter_id, server_id, cdrom_id, opts)
34
+ data
35
+ end
36
+
37
+ # Detach a CD-ROM
38
+ # This will detach a CD-ROM from the server
39
+ # @param datacenter_id [String] The unique ID of the Datacenter
40
+ # @param server_id [String] The unique ID of the Server
41
+ # @param cdrom_id [String] The unique ID of the CD-ROM
42
+ # @param [Hash] opts the optional parameters
43
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
44
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth=0: only direct properties are included. Children (servers etc.) are not included - depth=1: direct properties and children references are included - depth=2: direct properties and children properties are included - depth=3: direct properties and children properties and children's children are included - depth=... and so on
45
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
46
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
47
+ def datacenters_servers_cdroms_delete_with_http_info(datacenter_id, server_id, cdrom_id, opts = {})
48
+ if @api_client.config.debugging
49
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_delete ...'
50
+ end
51
+ # verify the required parameter 'datacenter_id' is set
52
+ if @api_client.config.client_side_validation && datacenter_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_delete"
54
+ end
55
+ # verify the required parameter 'server_id' is set
56
+ if @api_client.config.client_side_validation && server_id.nil?
57
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_delete"
58
+ end
59
+ # verify the required parameter 'cdrom_id' is set
60
+ if @api_client.config.client_side_validation && cdrom_id.nil?
61
+ fail ArgumentError, "Missing the required parameter 'cdrom_id' when calling ServerApi.datacenters_servers_cdroms_delete"
62
+ end
63
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
64
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_delete, must be smaller than or equal to 10.'
65
+ end
66
+
67
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
68
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_delete, must be greater than or equal to 0.'
69
+ end
70
+
71
+ # resource path
72
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'cdromId' + '}', CGI.escape(cdrom_id.to_s))
73
+
74
+ # query parameters
75
+ query_params = opts[:query_params] || {}
76
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
77
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
78
+
79
+ # header parameters
80
+ header_params = opts[:header_params] || {}
81
+ # HTTP header 'Accept' (if needed)
82
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
83
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
84
+
85
+ # form parameters
86
+ form_params = opts[:form_params] || {}
87
+
88
+ # http body (model)
89
+ post_body = opts[:debug_body]
90
+
91
+ # return_type
92
+ return_type = opts[:debug_return_type] || 'Object'
93
+
94
+ # auth_names
95
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
96
+
97
+ new_options = opts.merge(
98
+ :operation => :"ServerApi.datacenters_servers_cdroms_delete",
99
+ :header_params => header_params,
100
+ :query_params => query_params,
101
+ :form_params => form_params,
102
+ :body => post_body,
103
+ :auth_names => auth_names,
104
+ :return_type => return_type
105
+ )
106
+
107
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
110
+ end
111
+ return data, status_code, headers
112
+ end
113
+
114
+ # Retrieve an attached CD-ROM
115
+ # You can retrieve a specific CD-ROM attached to the server
116
+ # @param datacenter_id [String] The unique ID of the Datacenter
117
+ # @param server_id [String] The unique ID of the Server
118
+ # @param cdrom_id [String] The unique ID of the CD-ROM
119
+ # @param [Hash] opts the optional parameters
120
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
121
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
122
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
123
+ # @return [Image]
124
+ def datacenters_servers_cdroms_find_by_id(datacenter_id, server_id, cdrom_id, opts = {})
125
+ data, _status_code, _headers = datacenters_servers_cdroms_find_by_id_with_http_info(datacenter_id, server_id, cdrom_id, opts)
126
+ data
127
+ end
128
+
129
+ # Retrieve an attached CD-ROM
130
+ # You can retrieve a specific CD-ROM attached to the server
131
+ # @param datacenter_id [String] The unique ID of the Datacenter
132
+ # @param server_id [String] The unique ID of the Server
133
+ # @param cdrom_id [String] The unique ID of the CD-ROM
134
+ # @param [Hash] opts the optional parameters
135
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
136
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
137
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
138
+ # @return [Array<(Image, Integer, Hash)>] Image data, response status code and response headers
139
+ def datacenters_servers_cdroms_find_by_id_with_http_info(datacenter_id, server_id, cdrom_id, opts = {})
140
+ if @api_client.config.debugging
141
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_find_by_id ...'
142
+ end
143
+ # verify the required parameter 'datacenter_id' is set
144
+ if @api_client.config.client_side_validation && datacenter_id.nil?
145
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_find_by_id"
146
+ end
147
+ # verify the required parameter 'server_id' is set
148
+ if @api_client.config.client_side_validation && server_id.nil?
149
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_find_by_id"
150
+ end
151
+ # verify the required parameter 'cdrom_id' is set
152
+ if @api_client.config.client_side_validation && cdrom_id.nil?
153
+ fail ArgumentError, "Missing the required parameter 'cdrom_id' when calling ServerApi.datacenters_servers_cdroms_find_by_id"
154
+ end
155
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
156
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_find_by_id, must be smaller than or equal to 10.'
157
+ end
158
+
159
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
160
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_find_by_id, must be greater than or equal to 0.'
161
+ end
162
+
163
+ # resource path
164
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'cdromId' + '}', CGI.escape(cdrom_id.to_s))
165
+
166
+ # query parameters
167
+ query_params = opts[:query_params] || {}
168
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
169
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
170
+
171
+ # header parameters
172
+ header_params = opts[:header_params] || {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
175
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
176
+
177
+ # form parameters
178
+ form_params = opts[:form_params] || {}
179
+
180
+ # http body (model)
181
+ post_body = opts[:debug_body]
182
+
183
+ # return_type
184
+ return_type = opts[:debug_return_type] || 'Image'
185
+
186
+ # auth_names
187
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
188
+
189
+ new_options = opts.merge(
190
+ :operation => :"ServerApi.datacenters_servers_cdroms_find_by_id",
191
+ :header_params => header_params,
192
+ :query_params => query_params,
193
+ :form_params => form_params,
194
+ :body => post_body,
195
+ :auth_names => auth_names,
196
+ :return_type => return_type
197
+ )
198
+
199
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
200
+ if @api_client.config.debugging
201
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
202
+ end
203
+ return data, status_code, headers
204
+ end
205
+
206
+ # List attached CD-ROMs
207
+ # You can retrieve a list of CD-ROMs attached to the server.
208
+ # @param datacenter_id [String] The unique ID of the Datacenter
209
+ # @param server_id [String] The unique ID of the Server
210
+ # @param [Hash] opts the optional parameters
211
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
212
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
213
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
214
+ # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with &lt;code&gt;limit&lt;/code&gt; for pagination) (default to 0)
215
+ # @option opts [Integer] :limit the maximum number of elements to return (use together with &lt;code&gt;offset&lt;/code&gt; for pagination) (default to 1000)
216
+ # @return [Cdroms]
217
+ def datacenters_servers_cdroms_get(datacenter_id, server_id, opts = {})
218
+ data, _status_code, _headers = datacenters_servers_cdroms_get_with_http_info(datacenter_id, server_id, opts)
219
+ data
220
+ end
221
+
222
+ # List attached CD-ROMs
223
+ # You can retrieve a list of CD-ROMs attached to the server.
224
+ # @param datacenter_id [String] The unique ID of the Datacenter
225
+ # @param server_id [String] The unique ID of the Server
226
+ # @param [Hash] opts the optional parameters
227
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
228
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
229
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
230
+ # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with &lt;code&gt;limit&lt;/code&gt; for pagination)
231
+ # @option opts [Integer] :limit the maximum number of elements to return (use together with &lt;code&gt;offset&lt;/code&gt; for pagination)
232
+ # @return [Array<(Cdroms, Integer, Hash)>] Cdroms data, response status code and response headers
233
+ def datacenters_servers_cdroms_get_with_http_info(datacenter_id, server_id, opts = {})
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_get ...'
236
+ end
237
+ # verify the required parameter 'datacenter_id' is set
238
+ if @api_client.config.client_side_validation && datacenter_id.nil?
239
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_get"
240
+ end
241
+ # verify the required parameter 'server_id' is set
242
+ if @api_client.config.client_side_validation && server_id.nil?
243
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_get"
244
+ end
245
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
246
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_get, must be smaller than or equal to 10.'
247
+ end
248
+
249
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
250
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_get, must be greater than or equal to 0.'
251
+ end
252
+
253
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
254
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ServerApi.datacenters_servers_cdroms_get, must be greater than or equal to 0.'
255
+ end
256
+
257
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000
258
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_cdroms_get, must be smaller than or equal to 10000.'
259
+ end
260
+
261
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
262
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_cdroms_get, must be greater than or equal to 1.'
263
+ end
264
+
265
+ # resource path
266
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
267
+
268
+ # query parameters
269
+ query_params = opts[:query_params] || {}
270
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
271
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
272
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
273
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
274
+
275
+ # header parameters
276
+ header_params = opts[:header_params] || {}
277
+ # HTTP header 'Accept' (if needed)
278
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
279
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
280
+
281
+ # form parameters
282
+ form_params = opts[:form_params] || {}
283
+
284
+ # http body (model)
285
+ post_body = opts[:debug_body]
286
+
287
+ # return_type
288
+ return_type = opts[:debug_return_type] || 'Cdroms'
289
+
290
+ # auth_names
291
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
292
+
293
+ new_options = opts.merge(
294
+ :operation => :"ServerApi.datacenters_servers_cdroms_get",
295
+ :header_params => header_params,
296
+ :query_params => query_params,
297
+ :form_params => form_params,
298
+ :body => post_body,
299
+ :auth_names => auth_names,
300
+ :return_type => return_type
301
+ )
302
+
303
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
304
+ if @api_client.config.debugging
305
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
306
+ end
307
+ return data, status_code, headers
308
+ end
309
+
310
+ # Attach a CD-ROM
311
+ # You can attach a CD-ROM to an existing server. You can attach up to 2 CD-ROMs to one server.
312
+ # @param datacenter_id [String] The unique ID of the Datacenter
313
+ # @param server_id [String] The unique ID of the Server
314
+ # @param cdrom [Image] CD-ROM to be attached
315
+ # @param [Hash] opts the optional parameters
316
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
317
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
318
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
319
+ # @return [Image]
320
+ def datacenters_servers_cdroms_post(datacenter_id, server_id, cdrom, opts = {})
321
+ data, _status_code, _headers = datacenters_servers_cdroms_post_with_http_info(datacenter_id, server_id, cdrom, opts)
322
+ data
323
+ end
324
+
325
+ # Attach a CD-ROM
326
+ # You can attach a CD-ROM to an existing server. You can attach up to 2 CD-ROMs to one server.
327
+ # @param datacenter_id [String] The unique ID of the Datacenter
328
+ # @param server_id [String] The unique ID of the Server
329
+ # @param cdrom [Image] CD-ROM to be attached
330
+ # @param [Hash] opts the optional parameters
331
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
332
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
333
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
334
+ # @return [Array<(Image, Integer, Hash)>] Image data, response status code and response headers
335
+ def datacenters_servers_cdroms_post_with_http_info(datacenter_id, server_id, cdrom, opts = {})
336
+ if @api_client.config.debugging
337
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_cdroms_post ...'
338
+ end
339
+ # verify the required parameter 'datacenter_id' is set
340
+ if @api_client.config.client_side_validation && datacenter_id.nil?
341
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_cdroms_post"
342
+ end
343
+ # verify the required parameter 'server_id' is set
344
+ if @api_client.config.client_side_validation && server_id.nil?
345
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_cdroms_post"
346
+ end
347
+ # verify the required parameter 'cdrom' is set
348
+ if @api_client.config.client_side_validation && cdrom.nil?
349
+ fail ArgumentError, "Missing the required parameter 'cdrom' when calling ServerApi.datacenters_servers_cdroms_post"
350
+ end
351
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
352
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_post, must be smaller than or equal to 10.'
353
+ end
354
+
355
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
356
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_cdroms_post, must be greater than or equal to 0.'
357
+ end
358
+
359
+ # resource path
360
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/cdroms'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
361
+
362
+ # query parameters
363
+ query_params = opts[:query_params] || {}
364
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
365
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
366
+
367
+ # header parameters
368
+ header_params = opts[:header_params] || {}
369
+ # HTTP header 'Accept' (if needed)
370
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
371
+ # HTTP header 'Content-Type'
372
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
373
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
374
+
375
+ # form parameters
376
+ form_params = opts[:form_params] || {}
377
+
378
+ # http body (model)
379
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(cdrom)
380
+
381
+ # return_type
382
+ return_type = opts[:debug_return_type] || 'Image'
383
+
384
+ # auth_names
385
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
386
+
387
+ new_options = opts.merge(
388
+ :operation => :"ServerApi.datacenters_servers_cdroms_post",
389
+ :header_params => header_params,
390
+ :query_params => query_params,
391
+ :form_params => form_params,
392
+ :body => post_body,
393
+ :auth_names => auth_names,
394
+ :return_type => return_type
395
+ )
396
+
397
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
398
+ if @api_client.config.debugging
399
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_cdroms_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
400
+ end
401
+ return data, status_code, headers
402
+ end
403
+
404
+ # Delete a Server
405
+ # This will remove a server from your datacenter; however, it will not remove the storage volumes attached to the server. You will need to make a separate API call to perform that action
406
+ # @param datacenter_id [String] The unique ID of the datacenter
407
+ # @param server_id [String] The unique ID of the Server
408
+ # @param [Hash] opts the optional parameters
409
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
410
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
411
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
412
+ # @return [Object]
413
+ def datacenters_servers_delete(datacenter_id, server_id, opts = {})
414
+ data, _status_code, _headers = datacenters_servers_delete_with_http_info(datacenter_id, server_id, opts)
415
+ data
416
+ end
417
+
418
+ # Delete a Server
419
+ # This will remove a server from your datacenter; however, it will not remove the storage volumes attached to the server. You will need to make a separate API call to perform that action
420
+ # @param datacenter_id [String] The unique ID of the datacenter
421
+ # @param server_id [String] The unique ID of the Server
422
+ # @param [Hash] opts the optional parameters
423
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
424
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
425
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
426
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
427
+ def datacenters_servers_delete_with_http_info(datacenter_id, server_id, opts = {})
428
+ if @api_client.config.debugging
429
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_delete ...'
430
+ end
431
+ # verify the required parameter 'datacenter_id' is set
432
+ if @api_client.config.client_side_validation && datacenter_id.nil?
433
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_delete"
434
+ end
435
+ # verify the required parameter 'server_id' is set
436
+ if @api_client.config.client_side_validation && server_id.nil?
437
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_delete"
438
+ end
439
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
440
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_delete, must be smaller than or equal to 10.'
441
+ end
442
+
443
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
444
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_delete, must be greater than or equal to 0.'
445
+ end
446
+
447
+ # resource path
448
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
449
+
450
+ # query parameters
451
+ query_params = opts[:query_params] || {}
452
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
453
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
454
+
455
+ # header parameters
456
+ header_params = opts[:header_params] || {}
457
+ # HTTP header 'Accept' (if needed)
458
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
459
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
460
+
461
+ # form parameters
462
+ form_params = opts[:form_params] || {}
463
+
464
+ # http body (model)
465
+ post_body = opts[:debug_body]
466
+
467
+ # return_type
468
+ return_type = opts[:debug_return_type] || 'Object'
469
+
470
+ # auth_names
471
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
472
+
473
+ new_options = opts.merge(
474
+ :operation => :"ServerApi.datacenters_servers_delete",
475
+ :header_params => header_params,
476
+ :query_params => query_params,
477
+ :form_params => form_params,
478
+ :body => post_body,
479
+ :auth_names => auth_names,
480
+ :return_type => return_type
481
+ )
482
+
483
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
484
+ if @api_client.config.debugging
485
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
486
+ end
487
+ return data, status_code, headers
488
+ end
489
+
490
+ # Retrieve a Server
491
+ # Returns information about a server such as its configuration, provisioning status, etc.
492
+ # @param datacenter_id [String] The unique ID of the datacenter
493
+ # @param server_id [String] The unique ID of the Server
494
+ # @param [Hash] opts the optional parameters
495
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
496
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
497
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
498
+ # @return [Server]
499
+ def datacenters_servers_find_by_id(datacenter_id, server_id, opts = {})
500
+ data, _status_code, _headers = datacenters_servers_find_by_id_with_http_info(datacenter_id, server_id, opts)
501
+ data
502
+ end
503
+
504
+ # Retrieve a Server
505
+ # Returns information about a server such as its configuration, provisioning status, etc.
506
+ # @param datacenter_id [String] The unique ID of the datacenter
507
+ # @param server_id [String] The unique ID of the Server
508
+ # @param [Hash] opts the optional parameters
509
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
510
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
511
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
512
+ # @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
513
+ def datacenters_servers_find_by_id_with_http_info(datacenter_id, server_id, opts = {})
514
+ if @api_client.config.debugging
515
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_find_by_id ...'
516
+ end
517
+ # verify the required parameter 'datacenter_id' is set
518
+ if @api_client.config.client_side_validation && datacenter_id.nil?
519
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_find_by_id"
520
+ end
521
+ # verify the required parameter 'server_id' is set
522
+ if @api_client.config.client_side_validation && server_id.nil?
523
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_find_by_id"
524
+ end
525
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
526
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_find_by_id, must be smaller than or equal to 10.'
527
+ end
528
+
529
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
530
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_find_by_id, must be greater than or equal to 0.'
531
+ end
532
+
533
+ # resource path
534
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
535
+
536
+ # query parameters
537
+ query_params = opts[:query_params] || {}
538
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
539
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
540
+
541
+ # header parameters
542
+ header_params = opts[:header_params] || {}
543
+ # HTTP header 'Accept' (if needed)
544
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
545
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
546
+
547
+ # form parameters
548
+ form_params = opts[:form_params] || {}
549
+
550
+ # http body (model)
551
+ post_body = opts[:debug_body]
552
+
553
+ # return_type
554
+ return_type = opts[:debug_return_type] || 'Server'
555
+
556
+ # auth_names
557
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
558
+
559
+ new_options = opts.merge(
560
+ :operation => :"ServerApi.datacenters_servers_find_by_id",
561
+ :header_params => header_params,
562
+ :query_params => query_params,
563
+ :form_params => form_params,
564
+ :body => post_body,
565
+ :auth_names => auth_names,
566
+ :return_type => return_type
567
+ )
568
+
569
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
570
+ if @api_client.config.debugging
571
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
572
+ end
573
+ return data, status_code, headers
574
+ end
575
+
576
+ # List Servers
577
+ # You can retrieve a list of servers within a datacenter
578
+ # @param datacenter_id [String] The unique ID of the datacenter
579
+ # @param [Hash] opts the optional parameters
580
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
581
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
582
+ # @option opts [Boolean] :upgrade_needed It can be used to filter which servers can be upgraded which can not be upgraded.
583
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
584
+ # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with &lt;code&gt;limit&lt;/code&gt; for pagination) (default to 0)
585
+ # @option opts [Integer] :limit the maximum number of elements to return (use together with &lt;code&gt;offset&lt;/code&gt; for pagination) (default to 1000)
586
+ # @return [Servers]
587
+ def datacenters_servers_get(datacenter_id, opts = {})
588
+ data, _status_code, _headers = datacenters_servers_get_with_http_info(datacenter_id, opts)
589
+ data
590
+ end
591
+
592
+ # List Servers
593
+ # You can retrieve a list of servers within a datacenter
594
+ # @param datacenter_id [String] The unique ID of the datacenter
595
+ # @param [Hash] opts the optional parameters
596
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
597
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
598
+ # @option opts [Boolean] :upgrade_needed It can be used to filter which servers can be upgraded which can not be upgraded.
599
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
600
+ # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with &lt;code&gt;limit&lt;/code&gt; for pagination)
601
+ # @option opts [Integer] :limit the maximum number of elements to return (use together with &lt;code&gt;offset&lt;/code&gt; for pagination)
602
+ # @return [Array<(Servers, Integer, Hash)>] Servers data, response status code and response headers
603
+ def datacenters_servers_get_with_http_info(datacenter_id, opts = {})
604
+ if @api_client.config.debugging
605
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_get ...'
606
+ end
607
+ # verify the required parameter 'datacenter_id' is set
608
+ if @api_client.config.client_side_validation && datacenter_id.nil?
609
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_get"
610
+ end
611
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
612
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_get, must be smaller than or equal to 10.'
613
+ end
614
+
615
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
616
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_get, must be greater than or equal to 0.'
617
+ end
618
+
619
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
620
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ServerApi.datacenters_servers_get, must be greater than or equal to 0.'
621
+ end
622
+
623
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000
624
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_get, must be smaller than or equal to 10000.'
625
+ end
626
+
627
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
628
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_get, must be greater than or equal to 1.'
629
+ end
630
+
631
+ # resource path
632
+ local_var_path = '/datacenters/{datacenterId}/servers'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s))
633
+
634
+ # query parameters
635
+ query_params = opts[:query_params] || {}
636
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
637
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
638
+ query_params[:'upgradeNeeded'] = opts[:'upgrade_needed'] if !opts[:'upgrade_needed'].nil?
639
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
640
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
641
+
642
+ # header parameters
643
+ header_params = opts[:header_params] || {}
644
+ # HTTP header 'Accept' (if needed)
645
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
646
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
647
+
648
+ # form parameters
649
+ form_params = opts[:form_params] || {}
650
+
651
+ # http body (model)
652
+ post_body = opts[:debug_body]
653
+
654
+ # return_type
655
+ return_type = opts[:debug_return_type] || 'Servers'
656
+
657
+ # auth_names
658
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
659
+
660
+ new_options = opts.merge(
661
+ :operation => :"ServerApi.datacenters_servers_get",
662
+ :header_params => header_params,
663
+ :query_params => query_params,
664
+ :form_params => form_params,
665
+ :body => post_body,
666
+ :auth_names => auth_names,
667
+ :return_type => return_type
668
+ )
669
+
670
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
671
+ if @api_client.config.debugging
672
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
673
+ end
674
+ return data, status_code, headers
675
+ end
676
+
677
+ # Partially modify a Server
678
+ # You can use update attributes of a server
679
+ # @param datacenter_id [String] The unique ID of the datacenter
680
+ # @param server_id [String] The unique ID of the server
681
+ # @param server [ServerProperties] Modified properties of Server
682
+ # @param [Hash] opts the optional parameters
683
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
684
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
685
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
686
+ # @return [Server]
687
+ def datacenters_servers_patch(datacenter_id, server_id, server, opts = {})
688
+ data, _status_code, _headers = datacenters_servers_patch_with_http_info(datacenter_id, server_id, server, opts)
689
+ data
690
+ end
691
+
692
+ # Partially modify a Server
693
+ # You can use update attributes of a server
694
+ # @param datacenter_id [String] The unique ID of the datacenter
695
+ # @param server_id [String] The unique ID of the server
696
+ # @param server [ServerProperties] Modified properties of Server
697
+ # @param [Hash] opts the optional parameters
698
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
699
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
700
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
701
+ # @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
702
+ def datacenters_servers_patch_with_http_info(datacenter_id, server_id, server, opts = {})
703
+ if @api_client.config.debugging
704
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_patch ...'
705
+ end
706
+ # verify the required parameter 'datacenter_id' is set
707
+ if @api_client.config.client_side_validation && datacenter_id.nil?
708
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_patch"
709
+ end
710
+ # verify the required parameter 'server_id' is set
711
+ if @api_client.config.client_side_validation && server_id.nil?
712
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_patch"
713
+ end
714
+ # verify the required parameter 'server' is set
715
+ if @api_client.config.client_side_validation && server.nil?
716
+ fail ArgumentError, "Missing the required parameter 'server' when calling ServerApi.datacenters_servers_patch"
717
+ end
718
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
719
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_patch, must be smaller than or equal to 10.'
720
+ end
721
+
722
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
723
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_patch, must be greater than or equal to 0.'
724
+ end
725
+
726
+ # resource path
727
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
728
+
729
+ # query parameters
730
+ query_params = opts[:query_params] || {}
731
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
732
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
733
+
734
+ # header parameters
735
+ header_params = opts[:header_params] || {}
736
+ # HTTP header 'Accept' (if needed)
737
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
738
+ # HTTP header 'Content-Type'
739
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
740
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
741
+
742
+ # form parameters
743
+ form_params = opts[:form_params] || {}
744
+
745
+ # http body (model)
746
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(server)
747
+
748
+ # return_type
749
+ return_type = opts[:debug_return_type] || 'Server'
750
+
751
+ # auth_names
752
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
753
+
754
+ new_options = opts.merge(
755
+ :operation => :"ServerApi.datacenters_servers_patch",
756
+ :header_params => header_params,
757
+ :query_params => query_params,
758
+ :form_params => form_params,
759
+ :body => post_body,
760
+ :auth_names => auth_names,
761
+ :return_type => return_type
762
+ )
763
+
764
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
765
+ if @api_client.config.debugging
766
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
767
+ end
768
+ return data, status_code, headers
769
+ end
770
+
771
+ # Create a Server
772
+ # Creates a server within an existing datacenter. You can configure the boot volume and connect the server to an existing LAN.
773
+ # @param datacenter_id [String] The unique ID of the datacenter
774
+ # @param server [Server] Server to be created
775
+ # @param [Hash] opts the optional parameters
776
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
777
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
778
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
779
+ # @return [Server]
780
+ def datacenters_servers_post(datacenter_id, server, opts = {})
781
+ data, _status_code, _headers = datacenters_servers_post_with_http_info(datacenter_id, server, opts)
782
+ data
783
+ end
784
+
785
+ # Create a Server
786
+ # Creates a server within an existing datacenter. You can configure the boot volume and connect the server to an existing LAN.
787
+ # @param datacenter_id [String] The unique ID of the datacenter
788
+ # @param server [Server] Server to be created
789
+ # @param [Hash] opts the optional parameters
790
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
791
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
792
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
793
+ # @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
794
+ def datacenters_servers_post_with_http_info(datacenter_id, server, opts = {})
795
+ if @api_client.config.debugging
796
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_post ...'
797
+ end
798
+ # verify the required parameter 'datacenter_id' is set
799
+ if @api_client.config.client_side_validation && datacenter_id.nil?
800
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_post"
801
+ end
802
+ # verify the required parameter 'server' is set
803
+ if @api_client.config.client_side_validation && server.nil?
804
+ fail ArgumentError, "Missing the required parameter 'server' when calling ServerApi.datacenters_servers_post"
805
+ end
806
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
807
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_post, must be smaller than or equal to 10.'
808
+ end
809
+
810
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
811
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_post, must be greater than or equal to 0.'
812
+ end
813
+
814
+ # resource path
815
+ local_var_path = '/datacenters/{datacenterId}/servers'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s))
816
+
817
+ # query parameters
818
+ query_params = opts[:query_params] || {}
819
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
820
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
821
+
822
+ # header parameters
823
+ header_params = opts[:header_params] || {}
824
+ # HTTP header 'Accept' (if needed)
825
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
826
+ # HTTP header 'Content-Type'
827
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
828
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
829
+
830
+ # form parameters
831
+ form_params = opts[:form_params] || {}
832
+
833
+ # http body (model)
834
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(server)
835
+
836
+ # return_type
837
+ return_type = opts[:debug_return_type] || 'Server'
838
+
839
+ # auth_names
840
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
841
+
842
+ new_options = opts.merge(
843
+ :operation => :"ServerApi.datacenters_servers_post",
844
+ :header_params => header_params,
845
+ :query_params => query_params,
846
+ :form_params => form_params,
847
+ :body => post_body,
848
+ :auth_names => auth_names,
849
+ :return_type => return_type
850
+ )
851
+
852
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
853
+ if @api_client.config.debugging
854
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
855
+ end
856
+ return data, status_code, headers
857
+ end
858
+
859
+ # Modify a Server
860
+ # Allows to modify the attributes of a Server. From v5 onwards 'allowReboot' attribute will no longer be available. For certain server property change it was earlier forced to be provided. Now this behaviour is implicit and backend will do this automatically e.g. in earlier versions, when CPU family changes, the 'allowReboot' property was required to be set to true which will no longer be the case and the server will be rebooted automatically
861
+ # @param datacenter_id [String] The unique ID of the datacenter
862
+ # @param server_id [String] The unique ID of the server
863
+ # @param server [Server] Modified Server
864
+ # @param [Hash] opts the optional parameters
865
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
866
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
867
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
868
+ # @return [Server]
869
+ def datacenters_servers_put(datacenter_id, server_id, server, opts = {})
870
+ data, _status_code, _headers = datacenters_servers_put_with_http_info(datacenter_id, server_id, server, opts)
871
+ data
872
+ end
873
+
874
+ # Modify a Server
875
+ # Allows to modify the attributes of a Server. From v5 onwards &#39;allowReboot&#39; attribute will no longer be available. For certain server property change it was earlier forced to be provided. Now this behaviour is implicit and backend will do this automatically e.g. in earlier versions, when CPU family changes, the &#39;allowReboot&#39; property was required to be set to true which will no longer be the case and the server will be rebooted automatically
876
+ # @param datacenter_id [String] The unique ID of the datacenter
877
+ # @param server_id [String] The unique ID of the server
878
+ # @param server [Server] Modified Server
879
+ # @param [Hash] opts the optional parameters
880
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
881
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
882
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
883
+ # @return [Array<(Server, Integer, Hash)>] Server data, response status code and response headers
884
+ def datacenters_servers_put_with_http_info(datacenter_id, server_id, server, opts = {})
885
+ if @api_client.config.debugging
886
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_put ...'
887
+ end
888
+ # verify the required parameter 'datacenter_id' is set
889
+ if @api_client.config.client_side_validation && datacenter_id.nil?
890
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_put"
891
+ end
892
+ # verify the required parameter 'server_id' is set
893
+ if @api_client.config.client_side_validation && server_id.nil?
894
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_put"
895
+ end
896
+ # verify the required parameter 'server' is set
897
+ if @api_client.config.client_side_validation && server.nil?
898
+ fail ArgumentError, "Missing the required parameter 'server' when calling ServerApi.datacenters_servers_put"
899
+ end
900
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
901
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_put, must be smaller than or equal to 10.'
902
+ end
903
+
904
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
905
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_put, must be greater than or equal to 0.'
906
+ end
907
+
908
+ # resource path
909
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
910
+
911
+ # query parameters
912
+ query_params = opts[:query_params] || {}
913
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
914
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
915
+
916
+ # header parameters
917
+ header_params = opts[:header_params] || {}
918
+ # HTTP header 'Accept' (if needed)
919
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
920
+ # HTTP header 'Content-Type'
921
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
922
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
923
+
924
+ # form parameters
925
+ form_params = opts[:form_params] || {}
926
+
927
+ # http body (model)
928
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(server)
929
+
930
+ # return_type
931
+ return_type = opts[:debug_return_type] || 'Server'
932
+
933
+ # auth_names
934
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
935
+
936
+ new_options = opts.merge(
937
+ :operation => :"ServerApi.datacenters_servers_put",
938
+ :header_params => header_params,
939
+ :query_params => query_params,
940
+ :form_params => form_params,
941
+ :body => post_body,
942
+ :auth_names => auth_names,
943
+ :return_type => return_type
944
+ )
945
+
946
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
947
+ if @api_client.config.debugging
948
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
949
+ end
950
+ return data, status_code, headers
951
+ end
952
+
953
+ # Reboot a Server
954
+ # This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on.
955
+ # @param datacenter_id [String] The unique ID of the datacenter
956
+ # @param server_id [String] The unique ID of the Server
957
+ # @param [Hash] opts the optional parameters
958
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
959
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
960
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
961
+ # @return [Object]
962
+ def datacenters_servers_reboot_post(datacenter_id, server_id, opts = {})
963
+ data, _status_code, _headers = datacenters_servers_reboot_post_with_http_info(datacenter_id, server_id, opts)
964
+ data
965
+ end
966
+
967
+ # Reboot a Server
968
+ # This will force a hard reboot of the server. Do not use this method if you want to gracefully reboot the machine. This is the equivalent of powering off the machine and turning it back on.
969
+ # @param datacenter_id [String] The unique ID of the datacenter
970
+ # @param server_id [String] The unique ID of the Server
971
+ # @param [Hash] opts the optional parameters
972
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
973
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
974
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
975
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
976
+ def datacenters_servers_reboot_post_with_http_info(datacenter_id, server_id, opts = {})
977
+ if @api_client.config.debugging
978
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_reboot_post ...'
979
+ end
980
+ # verify the required parameter 'datacenter_id' is set
981
+ if @api_client.config.client_side_validation && datacenter_id.nil?
982
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_reboot_post"
983
+ end
984
+ # verify the required parameter 'server_id' is set
985
+ if @api_client.config.client_side_validation && server_id.nil?
986
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_reboot_post"
987
+ end
988
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
989
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_reboot_post, must be smaller than or equal to 10.'
990
+ end
991
+
992
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
993
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_reboot_post, must be greater than or equal to 0.'
994
+ end
995
+
996
+ # resource path
997
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/reboot'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
998
+
999
+ # query parameters
1000
+ query_params = opts[:query_params] || {}
1001
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1002
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1003
+
1004
+ # header parameters
1005
+ header_params = opts[:header_params] || {}
1006
+ # HTTP header 'Accept' (if needed)
1007
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1008
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1009
+
1010
+ # form parameters
1011
+ form_params = opts[:form_params] || {}
1012
+
1013
+ # http body (model)
1014
+ post_body = opts[:debug_body]
1015
+
1016
+ # return_type
1017
+ return_type = opts[:debug_return_type] || 'Object'
1018
+
1019
+ # auth_names
1020
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
1021
+
1022
+ new_options = opts.merge(
1023
+ :operation => :"ServerApi.datacenters_servers_reboot_post",
1024
+ :header_params => header_params,
1025
+ :query_params => query_params,
1026
+ :form_params => form_params,
1027
+ :body => post_body,
1028
+ :auth_names => auth_names,
1029
+ :return_type => return_type
1030
+ )
1031
+
1032
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1033
+ if @api_client.config.debugging
1034
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_reboot_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1035
+ end
1036
+ return data, status_code, headers
1037
+ end
1038
+
1039
+ # Start a Server
1040
+ # This will start a server. If the server's public IP was deallocated then a new IP will be assigned
1041
+ # @param datacenter_id [String] The unique ID of the datacenter
1042
+ # @param server_id [String] The unique ID of the Server
1043
+ # @param [Hash] opts the optional parameters
1044
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1045
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
1046
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1047
+ # @return [Object]
1048
+ def datacenters_servers_start_post(datacenter_id, server_id, opts = {})
1049
+ data, _status_code, _headers = datacenters_servers_start_post_with_http_info(datacenter_id, server_id, opts)
1050
+ data
1051
+ end
1052
+
1053
+ # Start a Server
1054
+ # This will start a server. If the server&#39;s public IP was deallocated then a new IP will be assigned
1055
+ # @param datacenter_id [String] The unique ID of the datacenter
1056
+ # @param server_id [String] The unique ID of the Server
1057
+ # @param [Hash] opts the optional parameters
1058
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1059
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
1060
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1061
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1062
+ def datacenters_servers_start_post_with_http_info(datacenter_id, server_id, opts = {})
1063
+ if @api_client.config.debugging
1064
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_start_post ...'
1065
+ end
1066
+ # verify the required parameter 'datacenter_id' is set
1067
+ if @api_client.config.client_side_validation && datacenter_id.nil?
1068
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_start_post"
1069
+ end
1070
+ # verify the required parameter 'server_id' is set
1071
+ if @api_client.config.client_side_validation && server_id.nil?
1072
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_start_post"
1073
+ end
1074
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
1075
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_start_post, must be smaller than or equal to 10.'
1076
+ end
1077
+
1078
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
1079
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_start_post, must be greater than or equal to 0.'
1080
+ end
1081
+
1082
+ # resource path
1083
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/start'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
1084
+
1085
+ # query parameters
1086
+ query_params = opts[:query_params] || {}
1087
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1088
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1089
+
1090
+ # header parameters
1091
+ header_params = opts[:header_params] || {}
1092
+ # HTTP header 'Accept' (if needed)
1093
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1094
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1095
+
1096
+ # form parameters
1097
+ form_params = opts[:form_params] || {}
1098
+
1099
+ # http body (model)
1100
+ post_body = opts[:debug_body]
1101
+
1102
+ # return_type
1103
+ return_type = opts[:debug_return_type] || 'Object'
1104
+
1105
+ # auth_names
1106
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
1107
+
1108
+ new_options = opts.merge(
1109
+ :operation => :"ServerApi.datacenters_servers_start_post",
1110
+ :header_params => header_params,
1111
+ :query_params => query_params,
1112
+ :form_params => form_params,
1113
+ :body => post_body,
1114
+ :auth_names => auth_names,
1115
+ :return_type => return_type
1116
+ )
1117
+
1118
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1119
+ if @api_client.config.debugging
1120
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_start_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1121
+ end
1122
+ return data, status_code, headers
1123
+ end
1124
+
1125
+ # Stop a Server
1126
+ # This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated. The operation is not supported for Cube servers.
1127
+ # @param datacenter_id [String] The unique ID of the datacenter
1128
+ # @param server_id [String] The unique ID of the Server
1129
+ # @param [Hash] opts the optional parameters
1130
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1131
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
1132
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1133
+ # @return [Object]
1134
+ def datacenters_servers_stop_post(datacenter_id, server_id, opts = {})
1135
+ data, _status_code, _headers = datacenters_servers_stop_post_with_http_info(datacenter_id, server_id, opts)
1136
+ data
1137
+ end
1138
+
1139
+ # Stop a Server
1140
+ # This will stop a server. The machine will be forcefully powered off, billing will cease, and the public IP, if one is allocated, will be deallocated. The operation is not supported for Cube servers.
1141
+ # @param datacenter_id [String] The unique ID of the datacenter
1142
+ # @param server_id [String] The unique ID of the Server
1143
+ # @param [Hash] opts the optional parameters
1144
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1145
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
1146
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1147
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1148
+ def datacenters_servers_stop_post_with_http_info(datacenter_id, server_id, opts = {})
1149
+ if @api_client.config.debugging
1150
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_stop_post ...'
1151
+ end
1152
+ # verify the required parameter 'datacenter_id' is set
1153
+ if @api_client.config.client_side_validation && datacenter_id.nil?
1154
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_stop_post"
1155
+ end
1156
+ # verify the required parameter 'server_id' is set
1157
+ if @api_client.config.client_side_validation && server_id.nil?
1158
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_stop_post"
1159
+ end
1160
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
1161
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_stop_post, must be smaller than or equal to 10.'
1162
+ end
1163
+
1164
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
1165
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_stop_post, must be greater than or equal to 0.'
1166
+ end
1167
+
1168
+ # resource path
1169
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/stop'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
1170
+
1171
+ # query parameters
1172
+ query_params = opts[:query_params] || {}
1173
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1174
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1175
+
1176
+ # header parameters
1177
+ header_params = opts[:header_params] || {}
1178
+ # HTTP header 'Accept' (if needed)
1179
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1180
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1181
+
1182
+ # form parameters
1183
+ form_params = opts[:form_params] || {}
1184
+
1185
+ # http body (model)
1186
+ post_body = opts[:debug_body]
1187
+
1188
+ # return_type
1189
+ return_type = opts[:debug_return_type] || 'Object'
1190
+
1191
+ # auth_names
1192
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
1193
+
1194
+ new_options = opts.merge(
1195
+ :operation => :"ServerApi.datacenters_servers_stop_post",
1196
+ :header_params => header_params,
1197
+ :query_params => query_params,
1198
+ :form_params => form_params,
1199
+ :body => post_body,
1200
+ :auth_names => auth_names,
1201
+ :return_type => return_type
1202
+ )
1203
+
1204
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1205
+ if @api_client.config.debugging
1206
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_stop_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1207
+ end
1208
+ return data, status_code, headers
1209
+ end
1210
+
1211
+ # Upgrade a Server
1212
+ # This will upgrade the version of the server, if needed. To verify if there is an upgrade available for a server, call '/datacenters/{datacenterId}/servers?upgradeNeeded=true'
1213
+ # @param datacenter_id [String] The unique ID of the datacenter
1214
+ # @param server_id [String] The unique ID of the Server
1215
+ # @param [Hash] opts the optional parameters
1216
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1217
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
1218
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1219
+ # @return [Object]
1220
+ def datacenters_servers_upgrade_post(datacenter_id, server_id, opts = {})
1221
+ data, _status_code, _headers = datacenters_servers_upgrade_post_with_http_info(datacenter_id, server_id, opts)
1222
+ data
1223
+ end
1224
+
1225
+ # Upgrade a Server
1226
+ # This will upgrade the version of the server, if needed. To verify if there is an upgrade available for a server, call &#39;/datacenters/{datacenterId}/servers?upgradeNeeded&#x3D;true&#39;
1227
+ # @param datacenter_id [String] The unique ID of the datacenter
1228
+ # @param server_id [String] The unique ID of the Server
1229
+ # @param [Hash] opts the optional parameters
1230
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1231
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
1232
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1233
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1234
+ def datacenters_servers_upgrade_post_with_http_info(datacenter_id, server_id, opts = {})
1235
+ if @api_client.config.debugging
1236
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_upgrade_post ...'
1237
+ end
1238
+ # verify the required parameter 'datacenter_id' is set
1239
+ if @api_client.config.client_side_validation && datacenter_id.nil?
1240
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_upgrade_post"
1241
+ end
1242
+ # verify the required parameter 'server_id' is set
1243
+ if @api_client.config.client_side_validation && server_id.nil?
1244
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_upgrade_post"
1245
+ end
1246
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
1247
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_upgrade_post, must be smaller than or equal to 10.'
1248
+ end
1249
+
1250
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
1251
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_upgrade_post, must be greater than or equal to 0.'
1252
+ end
1253
+
1254
+ # resource path
1255
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/upgrade'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
1256
+
1257
+ # query parameters
1258
+ query_params = opts[:query_params] || {}
1259
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1260
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1261
+
1262
+ # header parameters
1263
+ header_params = opts[:header_params] || {}
1264
+ # HTTP header 'Accept' (if needed)
1265
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1266
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1267
+
1268
+ # form parameters
1269
+ form_params = opts[:form_params] || {}
1270
+
1271
+ # http body (model)
1272
+ post_body = opts[:debug_body]
1273
+
1274
+ # return_type
1275
+ return_type = opts[:debug_return_type] || 'Object'
1276
+
1277
+ # auth_names
1278
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
1279
+
1280
+ new_options = opts.merge(
1281
+ :operation => :"ServerApi.datacenters_servers_upgrade_post",
1282
+ :header_params => header_params,
1283
+ :query_params => query_params,
1284
+ :form_params => form_params,
1285
+ :body => post_body,
1286
+ :auth_names => auth_names,
1287
+ :return_type => return_type
1288
+ )
1289
+
1290
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1291
+ if @api_client.config.debugging
1292
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_upgrade_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1293
+ end
1294
+ return data, status_code, headers
1295
+ end
1296
+
1297
+ # Detach a volume
1298
+ # This will detach the volume from the server. This will not delete the volume from your datacenter. You will need to make a separate request to perform a deletion
1299
+ # @param datacenter_id [String] The unique ID of the Datacenter
1300
+ # @param server_id [String] The unique ID of the Server
1301
+ # @param volume_id [String] The unique ID of the Volume
1302
+ # @param [Hash] opts the optional parameters
1303
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1304
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
1305
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1306
+ # @return [Object]
1307
+ def datacenters_servers_volumes_delete(datacenter_id, server_id, volume_id, opts = {})
1308
+ data, _status_code, _headers = datacenters_servers_volumes_delete_with_http_info(datacenter_id, server_id, volume_id, opts)
1309
+ data
1310
+ end
1311
+
1312
+ # Detach a volume
1313
+ # This will detach the volume from the server. This will not delete the volume from your datacenter. You will need to make a separate request to perform a deletion
1314
+ # @param datacenter_id [String] The unique ID of the Datacenter
1315
+ # @param server_id [String] The unique ID of the Server
1316
+ # @param volume_id [String] The unique ID of the Volume
1317
+ # @param [Hash] opts the optional parameters
1318
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1319
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
1320
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1321
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
1322
+ def datacenters_servers_volumes_delete_with_http_info(datacenter_id, server_id, volume_id, opts = {})
1323
+ if @api_client.config.debugging
1324
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_delete ...'
1325
+ end
1326
+ # verify the required parameter 'datacenter_id' is set
1327
+ if @api_client.config.client_side_validation && datacenter_id.nil?
1328
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_delete"
1329
+ end
1330
+ # verify the required parameter 'server_id' is set
1331
+ if @api_client.config.client_side_validation && server_id.nil?
1332
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_delete"
1333
+ end
1334
+ # verify the required parameter 'volume_id' is set
1335
+ if @api_client.config.client_side_validation && volume_id.nil?
1336
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling ServerApi.datacenters_servers_volumes_delete"
1337
+ end
1338
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
1339
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_delete, must be smaller than or equal to 10.'
1340
+ end
1341
+
1342
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
1343
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_delete, must be greater than or equal to 0.'
1344
+ end
1345
+
1346
+ # resource path
1347
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
1348
+
1349
+ # query parameters
1350
+ query_params = opts[:query_params] || {}
1351
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1352
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1353
+
1354
+ # header parameters
1355
+ header_params = opts[:header_params] || {}
1356
+ # HTTP header 'Accept' (if needed)
1357
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1358
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1359
+
1360
+ # form parameters
1361
+ form_params = opts[:form_params] || {}
1362
+
1363
+ # http body (model)
1364
+ post_body = opts[:debug_body]
1365
+
1366
+ # return_type
1367
+ return_type = opts[:debug_return_type] || 'Object'
1368
+
1369
+ # auth_names
1370
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
1371
+
1372
+ new_options = opts.merge(
1373
+ :operation => :"ServerApi.datacenters_servers_volumes_delete",
1374
+ :header_params => header_params,
1375
+ :query_params => query_params,
1376
+ :form_params => form_params,
1377
+ :body => post_body,
1378
+ :auth_names => auth_names,
1379
+ :return_type => return_type
1380
+ )
1381
+
1382
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1383
+ if @api_client.config.debugging
1384
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1385
+ end
1386
+ return data, status_code, headers
1387
+ end
1388
+
1389
+ # Retrieve an attached volume
1390
+ # This will retrieve the properties of an attached volume.
1391
+ # @param datacenter_id [String] The unique ID of the Datacenter
1392
+ # @param server_id [String] The unique ID of the Server
1393
+ # @param volume_id [String] The unique ID of the Volume
1394
+ # @param [Hash] opts the optional parameters
1395
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1396
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
1397
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1398
+ # @return [Volume]
1399
+ def datacenters_servers_volumes_find_by_id(datacenter_id, server_id, volume_id, opts = {})
1400
+ data, _status_code, _headers = datacenters_servers_volumes_find_by_id_with_http_info(datacenter_id, server_id, volume_id, opts)
1401
+ data
1402
+ end
1403
+
1404
+ # Retrieve an attached volume
1405
+ # This will retrieve the properties of an attached volume.
1406
+ # @param datacenter_id [String] The unique ID of the Datacenter
1407
+ # @param server_id [String] The unique ID of the Server
1408
+ # @param volume_id [String] The unique ID of the Volume
1409
+ # @param [Hash] opts the optional parameters
1410
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1411
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
1412
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1413
+ # @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
1414
+ def datacenters_servers_volumes_find_by_id_with_http_info(datacenter_id, server_id, volume_id, opts = {})
1415
+ if @api_client.config.debugging
1416
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_find_by_id ...'
1417
+ end
1418
+ # verify the required parameter 'datacenter_id' is set
1419
+ if @api_client.config.client_side_validation && datacenter_id.nil?
1420
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_find_by_id"
1421
+ end
1422
+ # verify the required parameter 'server_id' is set
1423
+ if @api_client.config.client_side_validation && server_id.nil?
1424
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_find_by_id"
1425
+ end
1426
+ # verify the required parameter 'volume_id' is set
1427
+ if @api_client.config.client_side_validation && volume_id.nil?
1428
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling ServerApi.datacenters_servers_volumes_find_by_id"
1429
+ end
1430
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
1431
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_find_by_id, must be smaller than or equal to 10.'
1432
+ end
1433
+
1434
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
1435
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_find_by_id, must be greater than or equal to 0.'
1436
+ end
1437
+
1438
+ # resource path
1439
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
1440
+
1441
+ # query parameters
1442
+ query_params = opts[:query_params] || {}
1443
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1444
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1445
+
1446
+ # header parameters
1447
+ header_params = opts[:header_params] || {}
1448
+ # HTTP header 'Accept' (if needed)
1449
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1450
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1451
+
1452
+ # form parameters
1453
+ form_params = opts[:form_params] || {}
1454
+
1455
+ # http body (model)
1456
+ post_body = opts[:debug_body]
1457
+
1458
+ # return_type
1459
+ return_type = opts[:debug_return_type] || 'Volume'
1460
+
1461
+ # auth_names
1462
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
1463
+
1464
+ new_options = opts.merge(
1465
+ :operation => :"ServerApi.datacenters_servers_volumes_find_by_id",
1466
+ :header_params => header_params,
1467
+ :query_params => query_params,
1468
+ :form_params => form_params,
1469
+ :body => post_body,
1470
+ :auth_names => auth_names,
1471
+ :return_type => return_type
1472
+ )
1473
+
1474
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1475
+ if @api_client.config.debugging
1476
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1477
+ end
1478
+ return data, status_code, headers
1479
+ end
1480
+
1481
+ # List Attached Volumes
1482
+ # You can retrieve a list of volumes attached to the server
1483
+ # @param datacenter_id [String] The unique ID of the Datacenter
1484
+ # @param server_id [String] The unique ID of the Server
1485
+ # @param [Hash] opts the optional parameters
1486
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1487
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
1488
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1489
+ # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with &lt;code&gt;limit&lt;/code&gt; for pagination) (default to 0)
1490
+ # @option opts [Integer] :limit the maximum number of elements to return (use together with &lt;code&gt;offset&lt;/code&gt; for pagination) (default to 1000)
1491
+ # @return [AttachedVolumes]
1492
+ def datacenters_servers_volumes_get(datacenter_id, server_id, opts = {})
1493
+ data, _status_code, _headers = datacenters_servers_volumes_get_with_http_info(datacenter_id, server_id, opts)
1494
+ data
1495
+ end
1496
+
1497
+ # List Attached Volumes
1498
+ # You can retrieve a list of volumes attached to the server
1499
+ # @param datacenter_id [String] The unique ID of the Datacenter
1500
+ # @param server_id [String] The unique ID of the Server
1501
+ # @param [Hash] opts the optional parameters
1502
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1503
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
1504
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1505
+ # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with &lt;code&gt;limit&lt;/code&gt; for pagination)
1506
+ # @option opts [Integer] :limit the maximum number of elements to return (use together with &lt;code&gt;offset&lt;/code&gt; for pagination)
1507
+ # @return [Array<(AttachedVolumes, Integer, Hash)>] AttachedVolumes data, response status code and response headers
1508
+ def datacenters_servers_volumes_get_with_http_info(datacenter_id, server_id, opts = {})
1509
+ if @api_client.config.debugging
1510
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_get ...'
1511
+ end
1512
+ # verify the required parameter 'datacenter_id' is set
1513
+ if @api_client.config.client_side_validation && datacenter_id.nil?
1514
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_get"
1515
+ end
1516
+ # verify the required parameter 'server_id' is set
1517
+ if @api_client.config.client_side_validation && server_id.nil?
1518
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_get"
1519
+ end
1520
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
1521
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_get, must be smaller than or equal to 10.'
1522
+ end
1523
+
1524
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
1525
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_get, must be greater than or equal to 0.'
1526
+ end
1527
+
1528
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
1529
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ServerApi.datacenters_servers_volumes_get, must be greater than or equal to 0.'
1530
+ end
1531
+
1532
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000
1533
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_volumes_get, must be smaller than or equal to 10000.'
1534
+ end
1535
+
1536
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1537
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ServerApi.datacenters_servers_volumes_get, must be greater than or equal to 1.'
1538
+ end
1539
+
1540
+ # resource path
1541
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
1542
+
1543
+ # query parameters
1544
+ query_params = opts[:query_params] || {}
1545
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1546
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1547
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1548
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1549
+
1550
+ # header parameters
1551
+ header_params = opts[:header_params] || {}
1552
+ # HTTP header 'Accept' (if needed)
1553
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1554
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1555
+
1556
+ # form parameters
1557
+ form_params = opts[:form_params] || {}
1558
+
1559
+ # http body (model)
1560
+ post_body = opts[:debug_body]
1561
+
1562
+ # return_type
1563
+ return_type = opts[:debug_return_type] || 'AttachedVolumes'
1564
+
1565
+ # auth_names
1566
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication']
1567
+
1568
+ new_options = opts.merge(
1569
+ :operation => :"ServerApi.datacenters_servers_volumes_get",
1570
+ :header_params => header_params,
1571
+ :query_params => query_params,
1572
+ :form_params => form_params,
1573
+ :body => post_body,
1574
+ :auth_names => auth_names,
1575
+ :return_type => return_type
1576
+ )
1577
+
1578
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1579
+ if @api_client.config.debugging
1580
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1581
+ end
1582
+ return data, status_code, headers
1583
+ end
1584
+
1585
+ # Attach a volume
1586
+ # This will attach a pre-existing storage volume to the server. It is also possible to create and attach a volume in one step just by providing a new volume description as payload. Combine count of Nics and volumes attached to the server should not exceed size 24.
1587
+ # @param datacenter_id [String] The unique ID of the Datacenter
1588
+ # @param server_id [String] The unique ID of the Server
1589
+ # @param volume [Volume] Volume to be attached (created and attached)
1590
+ # @param [Hash] opts the optional parameters
1591
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1592
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on (default to 0)
1593
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1594
+ # @return [Volume]
1595
+ def datacenters_servers_volumes_post(datacenter_id, server_id, volume, opts = {})
1596
+ data, _status_code, _headers = datacenters_servers_volumes_post_with_http_info(datacenter_id, server_id, volume, opts)
1597
+ data
1598
+ end
1599
+
1600
+ # Attach a volume
1601
+ # This will attach a pre-existing storage volume to the server. It is also possible to create and attach a volume in one step just by providing a new volume description as payload. Combine count of Nics and volumes attached to the server should not exceed size 24.
1602
+ # @param datacenter_id [String] The unique ID of the Datacenter
1603
+ # @param server_id [String] The unique ID of the Server
1604
+ # @param volume [Volume] Volume to be attached (created and attached)
1605
+ # @param [Hash] opts the optional parameters
1606
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1607
+ # @option opts [Integer] :depth Controls the details depth of response objects. Eg. GET /datacenters/[ID] - depth&#x3D;0: only direct properties are included. Children (servers etc.) are not included - depth&#x3D;1: direct properties and children references are included - depth&#x3D;2: direct properties and children properties are included - depth&#x3D;3: direct properties and children properties and children&#39;s children are included - depth&#x3D;... and so on
1608
+ # @option opts [Integer] :x_contract_number Users having more than 1 contract need to provide contract number, against which all API requests should be executed
1609
+ # @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
1610
+ def datacenters_servers_volumes_post_with_http_info(datacenter_id, server_id, volume, opts = {})
1611
+ if @api_client.config.debugging
1612
+ @api_client.config.logger.debug 'Calling API: ServerApi.datacenters_servers_volumes_post ...'
1613
+ end
1614
+ # verify the required parameter 'datacenter_id' is set
1615
+ if @api_client.config.client_side_validation && datacenter_id.nil?
1616
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling ServerApi.datacenters_servers_volumes_post"
1617
+ end
1618
+ # verify the required parameter 'server_id' is set
1619
+ if @api_client.config.client_side_validation && server_id.nil?
1620
+ fail ArgumentError, "Missing the required parameter 'server_id' when calling ServerApi.datacenters_servers_volumes_post"
1621
+ end
1622
+ # verify the required parameter 'volume' is set
1623
+ if @api_client.config.client_side_validation && volume.nil?
1624
+ fail ArgumentError, "Missing the required parameter 'volume' when calling ServerApi.datacenters_servers_volumes_post"
1625
+ end
1626
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
1627
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_post, must be smaller than or equal to 10.'
1628
+ end
1629
+
1630
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
1631
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling ServerApi.datacenters_servers_volumes_post, must be greater than or equal to 0.'
1632
+ end
1633
+
1634
+ # resource path
1635
+ local_var_path = '/datacenters/{datacenterId}/servers/{serverId}/volumes'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'serverId' + '}', CGI.escape(server_id.to_s))
1636
+
1637
+ # query parameters
1638
+ query_params = opts[:query_params] || {}
1639
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
1640
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
1641
+
1642
+ # header parameters
1643
+ header_params = opts[:header_params] || {}
1644
+ # HTTP header 'Accept' (if needed)
1645
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1646
+ # HTTP header 'Content-Type'
1647
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1648
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
1649
+
1650
+ # form parameters
1651
+ form_params = opts[:form_params] || {}
1652
+
1653
+ # http body (model)
1654
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(volume)
1655
+
1656
+ # return_type
1657
+ return_type = opts[:debug_return_type] || 'Volume'
1658
+
1659
+ # auth_names
1660
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication']
1661
+
1662
+ new_options = opts.merge(
1663
+ :operation => :"ServerApi.datacenters_servers_volumes_post",
1664
+ :header_params => header_params,
1665
+ :query_params => query_params,
1666
+ :form_params => form_params,
1667
+ :body => post_body,
1668
+ :auth_names => auth_names,
1669
+ :return_type => return_type
1670
+ )
1671
+
1672
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1673
+ if @api_client.config.debugging
1674
+ @api_client.config.logger.debug "API called: ServerApi#datacenters_servers_volumes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1675
+ end
1676
+ return data, status_code, headers
1677
+ end
1678
+ end
1679
+ end