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,763 @@
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 VolumeApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Volume Snapshot
23
+ # Creates a snapshot of a volume within the datacenter. You can use a snapshot to create a new storage volume or to restore a storage volume.
24
+ # @param datacenter_id [String] The unique ID of the datacenter
25
+ # @param volume_id [String] The unique ID of the Volume
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
28
+ # @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)
29
+ # @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
30
+ # @option opts [String] :name The name of the snapshot
31
+ # @option opts [String] :description The description of the snapshot
32
+ # @option opts [Boolean] :sec_auth_protection Flag representing if extra protection is enabled on snapshot e.g. Two Factor protection etc.
33
+ # @option opts [String] :licence_type The OS type of this Snapshot
34
+ # @return [Snapshot]
35
+ def datacenters_volumes_create_snapshot_post(datacenter_id, volume_id, opts = {})
36
+ data, _status_code, _headers = datacenters_volumes_create_snapshot_post_with_http_info(datacenter_id, volume_id, opts)
37
+ data
38
+ end
39
+
40
+ # Create Volume Snapshot
41
+ # Creates a snapshot of a volume within the datacenter. You can use a snapshot to create a new storage volume or to restore a storage volume.
42
+ # @param datacenter_id [String] The unique ID of the datacenter
43
+ # @param volume_id [String] The unique ID of the Volume
44
+ # @param [Hash] opts the optional parameters
45
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
46
+ # @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
47
+ # @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
48
+ # @option opts [String] :name The name of the snapshot
49
+ # @option opts [String] :description The description of the snapshot
50
+ # @option opts [Boolean] :sec_auth_protection Flag representing if extra protection is enabled on snapshot e.g. Two Factor protection etc.
51
+ # @option opts [String] :licence_type The OS type of this Snapshot
52
+ # @return [Array<(Snapshot, Integer, Hash)>] Snapshot data, response status code and response headers
53
+ def datacenters_volumes_create_snapshot_post_with_http_info(datacenter_id, volume_id, opts = {})
54
+ if @api_client.config.debugging
55
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_create_snapshot_post ...'
56
+ end
57
+ # verify the required parameter 'datacenter_id' is set
58
+ if @api_client.config.client_side_validation && datacenter_id.nil?
59
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling VolumeApi.datacenters_volumes_create_snapshot_post"
60
+ end
61
+ # verify the required parameter 'volume_id' is set
62
+ if @api_client.config.client_side_validation && volume_id.nil?
63
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling VolumeApi.datacenters_volumes_create_snapshot_post"
64
+ end
65
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
66
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_create_snapshot_post, must be smaller than or equal to 10.'
67
+ end
68
+
69
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
70
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_create_snapshot_post, must be greater than or equal to 0.'
71
+ end
72
+
73
+ allowable_values = ["UNKNOWN", "WINDOWS", "WINDOWS2016", "LINUX", "OTHER"]
74
+ if @api_client.config.client_side_validation && opts[:'licence_type'] && !allowable_values.include?(opts[:'licence_type'])
75
+ fail ArgumentError, "invalid value for \"licence_type\", must be one of #{allowable_values}"
76
+ end
77
+ # resource path
78
+ local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}/create-snapshot'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
79
+
80
+ # query parameters
81
+ query_params = opts[:query_params] || {}
82
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
83
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
84
+
85
+ # header parameters
86
+ header_params = opts[:header_params] || {}
87
+ # HTTP header 'Accept' (if needed)
88
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
89
+ # HTTP header 'Content-Type'
90
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
91
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
92
+
93
+ # form parameters
94
+ form_params = opts[:form_params] || {}
95
+ form_params['name'] = opts[:'name'] if !opts[:'name'].nil?
96
+ form_params['description'] = opts[:'description'] if !opts[:'description'].nil?
97
+ form_params['secAuthProtection'] = opts[:'sec_auth_protection'] if !opts[:'sec_auth_protection'].nil?
98
+ form_params['licenceType'] = opts[:'licence_type'] if !opts[:'licence_type'].nil?
99
+
100
+ # http body (model)
101
+ post_body = opts[:debug_body]
102
+
103
+ # return_type
104
+ return_type = opts[:debug_return_type] || 'Snapshot'
105
+
106
+ # auth_names
107
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
108
+
109
+ new_options = opts.merge(
110
+ :operation => :"VolumeApi.datacenters_volumes_create_snapshot_post",
111
+ :header_params => header_params,
112
+ :query_params => query_params,
113
+ :form_params => form_params,
114
+ :body => post_body,
115
+ :auth_names => auth_names,
116
+ :return_type => return_type
117
+ )
118
+
119
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
120
+ if @api_client.config.debugging
121
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_create_snapshot_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
122
+ end
123
+ return data, status_code, headers
124
+ end
125
+
126
+ # Delete a Volume
127
+ # Deletes the specified volume. This will result in the volume being removed from your datacenter. Use this with caution.
128
+ # @param datacenter_id [String] The unique ID of the datacenter
129
+ # @param volume_id [String] The unique ID of the Volume
130
+ # @param [Hash] opts the optional parameters
131
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
132
+ # @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)
133
+ # @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
134
+ # @return [Object]
135
+ def datacenters_volumes_delete(datacenter_id, volume_id, opts = {})
136
+ data, _status_code, _headers = datacenters_volumes_delete_with_http_info(datacenter_id, volume_id, opts)
137
+ data
138
+ end
139
+
140
+ # Delete a Volume
141
+ # Deletes the specified volume. This will result in the volume being removed from your datacenter. Use this with caution.
142
+ # @param datacenter_id [String] The unique ID of the datacenter
143
+ # @param volume_id [String] The unique ID of the Volume
144
+ # @param [Hash] opts the optional parameters
145
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
146
+ # @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
147
+ # @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
148
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
149
+ def datacenters_volumes_delete_with_http_info(datacenter_id, volume_id, opts = {})
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_delete ...'
152
+ end
153
+ # verify the required parameter 'datacenter_id' is set
154
+ if @api_client.config.client_side_validation && datacenter_id.nil?
155
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling VolumeApi.datacenters_volumes_delete"
156
+ end
157
+ # verify the required parameter 'volume_id' is set
158
+ if @api_client.config.client_side_validation && volume_id.nil?
159
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling VolumeApi.datacenters_volumes_delete"
160
+ end
161
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
162
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_delete, must be smaller than or equal to 10.'
163
+ end
164
+
165
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
166
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_delete, must be greater than or equal to 0.'
167
+ end
168
+
169
+ # resource path
170
+ local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
171
+
172
+ # query parameters
173
+ query_params = opts[:query_params] || {}
174
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
175
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
181
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
182
+
183
+ # form parameters
184
+ form_params = opts[:form_params] || {}
185
+
186
+ # http body (model)
187
+ post_body = opts[:debug_body]
188
+
189
+ # return_type
190
+ return_type = opts[:debug_return_type] || 'Object'
191
+
192
+ # auth_names
193
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
194
+
195
+ new_options = opts.merge(
196
+ :operation => :"VolumeApi.datacenters_volumes_delete",
197
+ :header_params => header_params,
198
+ :query_params => query_params,
199
+ :form_params => form_params,
200
+ :body => post_body,
201
+ :auth_names => auth_names,
202
+ :return_type => return_type
203
+ )
204
+
205
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
206
+ if @api_client.config.debugging
207
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
+ end
209
+ return data, status_code, headers
210
+ end
211
+
212
+ # Retrieve a Volume
213
+ # Retrieves the attributes of a given Volume
214
+ # @param datacenter_id [String] The unique ID of the datacenter
215
+ # @param volume_id [String] The unique ID of the Volume
216
+ # @param [Hash] opts the optional parameters
217
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
218
+ # @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)
219
+ # @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
220
+ # @return [Volume]
221
+ def datacenters_volumes_find_by_id(datacenter_id, volume_id, opts = {})
222
+ data, _status_code, _headers = datacenters_volumes_find_by_id_with_http_info(datacenter_id, volume_id, opts)
223
+ data
224
+ end
225
+
226
+ # Retrieve a Volume
227
+ # Retrieves the attributes of a given Volume
228
+ # @param datacenter_id [String] The unique ID of the datacenter
229
+ # @param volume_id [String] The unique ID of the Volume
230
+ # @param [Hash] opts the optional parameters
231
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
232
+ # @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
233
+ # @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
234
+ # @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
235
+ def datacenters_volumes_find_by_id_with_http_info(datacenter_id, volume_id, opts = {})
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_find_by_id ...'
238
+ end
239
+ # verify the required parameter 'datacenter_id' is set
240
+ if @api_client.config.client_side_validation && datacenter_id.nil?
241
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling VolumeApi.datacenters_volumes_find_by_id"
242
+ end
243
+ # verify the required parameter 'volume_id' is set
244
+ if @api_client.config.client_side_validation && volume_id.nil?
245
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling VolumeApi.datacenters_volumes_find_by_id"
246
+ end
247
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
248
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_find_by_id, must be smaller than or equal to 10.'
249
+ end
250
+
251
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
252
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_find_by_id, must be greater than or equal to 0.'
253
+ end
254
+
255
+ # resource path
256
+ local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
257
+
258
+ # query parameters
259
+ query_params = opts[:query_params] || {}
260
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
261
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
262
+
263
+ # header parameters
264
+ header_params = opts[:header_params] || {}
265
+ # HTTP header 'Accept' (if needed)
266
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
267
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
268
+
269
+ # form parameters
270
+ form_params = opts[:form_params] || {}
271
+
272
+ # http body (model)
273
+ post_body = opts[:debug_body]
274
+
275
+ # return_type
276
+ return_type = opts[:debug_return_type] || 'Volume'
277
+
278
+ # auth_names
279
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
280
+
281
+ new_options = opts.merge(
282
+ :operation => :"VolumeApi.datacenters_volumes_find_by_id",
283
+ :header_params => header_params,
284
+ :query_params => query_params,
285
+ :form_params => form_params,
286
+ :body => post_body,
287
+ :auth_names => auth_names,
288
+ :return_type => return_type
289
+ )
290
+
291
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
292
+ if @api_client.config.debugging
293
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
294
+ end
295
+ return data, status_code, headers
296
+ end
297
+
298
+ # List Volumes
299
+ # Retrieves a list of Volumes.
300
+ # @param datacenter_id [String] The unique ID of the datacenter
301
+ # @param [Hash] opts the optional parameters
302
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
303
+ # @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)
304
+ # @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
305
+ # @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)
306
+ # @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)
307
+ # @return [Volumes]
308
+ def datacenters_volumes_get(datacenter_id, opts = {})
309
+ data, _status_code, _headers = datacenters_volumes_get_with_http_info(datacenter_id, opts)
310
+ data
311
+ end
312
+
313
+ # List Volumes
314
+ # Retrieves a list of Volumes.
315
+ # @param datacenter_id [String] The unique ID of the datacenter
316
+ # @param [Hash] opts the optional parameters
317
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
318
+ # @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
319
+ # @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
320
+ # @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)
321
+ # @option opts [Integer] :limit the maximum number of elements to return (use together with &lt;code&gt;offset&lt;/code&gt; for pagination)
322
+ # @return [Array<(Volumes, Integer, Hash)>] Volumes data, response status code and response headers
323
+ def datacenters_volumes_get_with_http_info(datacenter_id, opts = {})
324
+ if @api_client.config.debugging
325
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_get ...'
326
+ end
327
+ # verify the required parameter 'datacenter_id' is set
328
+ if @api_client.config.client_side_validation && datacenter_id.nil?
329
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling VolumeApi.datacenters_volumes_get"
330
+ end
331
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
332
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_get, must be smaller than or equal to 10.'
333
+ end
334
+
335
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
336
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_get, must be greater than or equal to 0.'
337
+ end
338
+
339
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
340
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling VolumeApi.datacenters_volumes_get, must be greater than or equal to 0.'
341
+ end
342
+
343
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 10000
344
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VolumeApi.datacenters_volumes_get, must be smaller than or equal to 10000.'
345
+ end
346
+
347
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
348
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling VolumeApi.datacenters_volumes_get, must be greater than or equal to 1.'
349
+ end
350
+
351
+ # resource path
352
+ local_var_path = '/datacenters/{datacenterId}/volumes'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s))
353
+
354
+ # query parameters
355
+ query_params = opts[:query_params] || {}
356
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
357
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
358
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
359
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
360
+
361
+ # header parameters
362
+ header_params = opts[:header_params] || {}
363
+ # HTTP header 'Accept' (if needed)
364
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
365
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
366
+
367
+ # form parameters
368
+ form_params = opts[:form_params] || {}
369
+
370
+ # http body (model)
371
+ post_body = opts[:debug_body]
372
+
373
+ # return_type
374
+ return_type = opts[:debug_return_type] || 'Volumes'
375
+
376
+ # auth_names
377
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
378
+
379
+ new_options = opts.merge(
380
+ :operation => :"VolumeApi.datacenters_volumes_get",
381
+ :header_params => header_params,
382
+ :query_params => query_params,
383
+ :form_params => form_params,
384
+ :body => post_body,
385
+ :auth_names => auth_names,
386
+ :return_type => return_type
387
+ )
388
+
389
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
390
+ if @api_client.config.debugging
391
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
392
+ end
393
+ return data, status_code, headers
394
+ end
395
+
396
+ # Partially modify a Volume
397
+ # You can use update attributes of a Volume
398
+ # @param datacenter_id [String] The unique ID of the datacenter
399
+ # @param volume_id [String] The unique ID of the Volume
400
+ # @param volume [VolumeProperties] Modified properties of Volume
401
+ # @param [Hash] opts the optional parameters
402
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
403
+ # @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)
404
+ # @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
405
+ # @return [Volume]
406
+ def datacenters_volumes_patch(datacenter_id, volume_id, volume, opts = {})
407
+ data, _status_code, _headers = datacenters_volumes_patch_with_http_info(datacenter_id, volume_id, volume, opts)
408
+ data
409
+ end
410
+
411
+ # Partially modify a Volume
412
+ # You can use update attributes of a Volume
413
+ # @param datacenter_id [String] The unique ID of the datacenter
414
+ # @param volume_id [String] The unique ID of the Volume
415
+ # @param volume [VolumeProperties] Modified properties of Volume
416
+ # @param [Hash] opts the optional parameters
417
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
418
+ # @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
419
+ # @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
420
+ # @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
421
+ def datacenters_volumes_patch_with_http_info(datacenter_id, volume_id, volume, opts = {})
422
+ if @api_client.config.debugging
423
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_patch ...'
424
+ end
425
+ # verify the required parameter 'datacenter_id' is set
426
+ if @api_client.config.client_side_validation && datacenter_id.nil?
427
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling VolumeApi.datacenters_volumes_patch"
428
+ end
429
+ # verify the required parameter 'volume_id' is set
430
+ if @api_client.config.client_side_validation && volume_id.nil?
431
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling VolumeApi.datacenters_volumes_patch"
432
+ end
433
+ # verify the required parameter 'volume' is set
434
+ if @api_client.config.client_side_validation && volume.nil?
435
+ fail ArgumentError, "Missing the required parameter 'volume' when calling VolumeApi.datacenters_volumes_patch"
436
+ end
437
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
438
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_patch, must be smaller than or equal to 10.'
439
+ end
440
+
441
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
442
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_patch, must be greater than or equal to 0.'
443
+ end
444
+
445
+ # resource path
446
+ local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
447
+
448
+ # query parameters
449
+ query_params = opts[:query_params] || {}
450
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
451
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
452
+
453
+ # header parameters
454
+ header_params = opts[:header_params] || {}
455
+ # HTTP header 'Accept' (if needed)
456
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
457
+ # HTTP header 'Content-Type'
458
+ header_params['Content-Type'] = @api_client.select_header_content_type(['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] || @api_client.object_to_http_body(volume)
466
+
467
+ # return_type
468
+ return_type = opts[:debug_return_type] || 'Volume'
469
+
470
+ # auth_names
471
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
472
+
473
+ new_options = opts.merge(
474
+ :operation => :"VolumeApi.datacenters_volumes_patch",
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(:PATCH, local_var_path, new_options)
484
+ if @api_client.config.debugging
485
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
486
+ end
487
+ return data, status_code, headers
488
+ end
489
+
490
+ # Create a Volume
491
+ # Creates a volume within the datacenter. This will not attach the volume to a server. Please see the Servers section for details on how to attach storage volumes
492
+ # @param datacenter_id [String] The unique ID of the datacenter
493
+ # @param volume [Volume] Volume to be created
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 [Volume]
499
+ def datacenters_volumes_post(datacenter_id, volume, opts = {})
500
+ data, _status_code, _headers = datacenters_volumes_post_with_http_info(datacenter_id, volume, opts)
501
+ data
502
+ end
503
+
504
+ # Create a Volume
505
+ # Creates a volume within the datacenter. This will not attach the volume to a server. Please see the Servers section for details on how to attach storage volumes
506
+ # @param datacenter_id [String] The unique ID of the datacenter
507
+ # @param volume [Volume] Volume to be created
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<(Volume, Integer, Hash)>] Volume data, response status code and response headers
513
+ def datacenters_volumes_post_with_http_info(datacenter_id, volume, opts = {})
514
+ if @api_client.config.debugging
515
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_post ...'
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 VolumeApi.datacenters_volumes_post"
520
+ end
521
+ # verify the required parameter 'volume' is set
522
+ if @api_client.config.client_side_validation && volume.nil?
523
+ fail ArgumentError, "Missing the required parameter 'volume' when calling VolumeApi.datacenters_volumes_post"
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 VolumeApi.datacenters_volumes_post, 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 VolumeApi.datacenters_volumes_post, must be greater than or equal to 0.'
531
+ end
532
+
533
+ # resource path
534
+ local_var_path = '/datacenters/{datacenterId}/volumes'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_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
+ # HTTP header 'Content-Type'
546
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
547
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
548
+
549
+ # form parameters
550
+ form_params = opts[:form_params] || {}
551
+
552
+ # http body (model)
553
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(volume)
554
+
555
+ # return_type
556
+ return_type = opts[:debug_return_type] || 'Volume'
557
+
558
+ # auth_names
559
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
560
+
561
+ new_options = opts.merge(
562
+ :operation => :"VolumeApi.datacenters_volumes_post",
563
+ :header_params => header_params,
564
+ :query_params => query_params,
565
+ :form_params => form_params,
566
+ :body => post_body,
567
+ :auth_names => auth_names,
568
+ :return_type => return_type
569
+ )
570
+
571
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
572
+ if @api_client.config.debugging
573
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
574
+ end
575
+ return data, status_code, headers
576
+ end
577
+
578
+ # Modify a Volume
579
+ # You can use update attributes of a Volume
580
+ # @param datacenter_id [String] The unique ID of the datacenter
581
+ # @param volume_id [String] The unique ID of the Volume
582
+ # @param volume [Volume] Modified Volume
583
+ # @param [Hash] opts the optional parameters
584
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
585
+ # @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)
586
+ # @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
587
+ # @return [Volume]
588
+ def datacenters_volumes_put(datacenter_id, volume_id, volume, opts = {})
589
+ data, _status_code, _headers = datacenters_volumes_put_with_http_info(datacenter_id, volume_id, volume, opts)
590
+ data
591
+ end
592
+
593
+ # Modify a Volume
594
+ # You can use update attributes of a Volume
595
+ # @param datacenter_id [String] The unique ID of the datacenter
596
+ # @param volume_id [String] The unique ID of the Volume
597
+ # @param volume [Volume] Modified Volume
598
+ # @param [Hash] opts the optional parameters
599
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
600
+ # @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
601
+ # @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
602
+ # @return [Array<(Volume, Integer, Hash)>] Volume data, response status code and response headers
603
+ def datacenters_volumes_put_with_http_info(datacenter_id, volume_id, volume, opts = {})
604
+ if @api_client.config.debugging
605
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_put ...'
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 VolumeApi.datacenters_volumes_put"
610
+ end
611
+ # verify the required parameter 'volume_id' is set
612
+ if @api_client.config.client_side_validation && volume_id.nil?
613
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling VolumeApi.datacenters_volumes_put"
614
+ end
615
+ # verify the required parameter 'volume' is set
616
+ if @api_client.config.client_side_validation && volume.nil?
617
+ fail ArgumentError, "Missing the required parameter 'volume' when calling VolumeApi.datacenters_volumes_put"
618
+ end
619
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
620
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_put, must be smaller than or equal to 10.'
621
+ end
622
+
623
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
624
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_put, must be greater than or equal to 0.'
625
+ end
626
+
627
+ # resource path
628
+ local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
629
+
630
+ # query parameters
631
+ query_params = opts[:query_params] || {}
632
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
633
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
634
+
635
+ # header parameters
636
+ header_params = opts[:header_params] || {}
637
+ # HTTP header 'Accept' (if needed)
638
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
639
+ # HTTP header 'Content-Type'
640
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
641
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
642
+
643
+ # form parameters
644
+ form_params = opts[:form_params] || {}
645
+
646
+ # http body (model)
647
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(volume)
648
+
649
+ # return_type
650
+ return_type = opts[:debug_return_type] || 'Volume'
651
+
652
+ # auth_names
653
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
654
+
655
+ new_options = opts.merge(
656
+ :operation => :"VolumeApi.datacenters_volumes_put",
657
+ :header_params => header_params,
658
+ :query_params => query_params,
659
+ :form_params => form_params,
660
+ :body => post_body,
661
+ :auth_names => auth_names,
662
+ :return_type => return_type
663
+ )
664
+
665
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
666
+ if @api_client.config.debugging
667
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
668
+ end
669
+ return data, status_code, headers
670
+ end
671
+
672
+ # Restore Volume Snapshot
673
+ # This will restore a snapshot onto a volume. A snapshot is created as just another image that can be used to create subsequent volumes if you want or to restore an existing volume.
674
+ # @param datacenter_id [String] The unique ID of the datacenter
675
+ # @param volume_id [String] The unique ID of the Volume
676
+ # @param [Hash] opts the optional parameters
677
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
678
+ # @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)
679
+ # @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
680
+ # @option opts [String] :snapshot_id This is the ID of the snapshot
681
+ # @return [Object]
682
+ def datacenters_volumes_restore_snapshot_post(datacenter_id, volume_id, opts = {})
683
+ data, _status_code, _headers = datacenters_volumes_restore_snapshot_post_with_http_info(datacenter_id, volume_id, opts)
684
+ data
685
+ end
686
+
687
+ # Restore Volume Snapshot
688
+ # This will restore a snapshot onto a volume. A snapshot is created as just another image that can be used to create subsequent volumes if you want or to restore an existing volume.
689
+ # @param datacenter_id [String] The unique ID of the datacenter
690
+ # @param volume_id [String] The unique ID of the Volume
691
+ # @param [Hash] opts the optional parameters
692
+ # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
693
+ # @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
694
+ # @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
695
+ # @option opts [String] :snapshot_id This is the ID of the snapshot
696
+ # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
697
+ def datacenters_volumes_restore_snapshot_post_with_http_info(datacenter_id, volume_id, opts = {})
698
+ if @api_client.config.debugging
699
+ @api_client.config.logger.debug 'Calling API: VolumeApi.datacenters_volumes_restore_snapshot_post ...'
700
+ end
701
+ # verify the required parameter 'datacenter_id' is set
702
+ if @api_client.config.client_side_validation && datacenter_id.nil?
703
+ fail ArgumentError, "Missing the required parameter 'datacenter_id' when calling VolumeApi.datacenters_volumes_restore_snapshot_post"
704
+ end
705
+ # verify the required parameter 'volume_id' is set
706
+ if @api_client.config.client_side_validation && volume_id.nil?
707
+ fail ArgumentError, "Missing the required parameter 'volume_id' when calling VolumeApi.datacenters_volumes_restore_snapshot_post"
708
+ end
709
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] > 10
710
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_restore_snapshot_post, must be smaller than or equal to 10.'
711
+ end
712
+
713
+ if @api_client.config.client_side_validation && !opts[:'depth'].nil? && opts[:'depth'] < 0
714
+ fail ArgumentError, 'invalid value for "opts[:"depth"]" when calling VolumeApi.datacenters_volumes_restore_snapshot_post, must be greater than or equal to 0.'
715
+ end
716
+
717
+ # resource path
718
+ local_var_path = '/datacenters/{datacenterId}/volumes/{volumeId}/restore-snapshot'.sub('{' + 'datacenterId' + '}', CGI.escape(datacenter_id.to_s)).sub('{' + 'volumeId' + '}', CGI.escape(volume_id.to_s))
719
+
720
+ # query parameters
721
+ query_params = opts[:query_params] || {}
722
+ query_params[:'pretty'] = opts[:'pretty'] if !opts[:'pretty'].nil?
723
+ query_params[:'depth'] = opts[:'depth'] if !opts[:'depth'].nil?
724
+
725
+ # header parameters
726
+ header_params = opts[:header_params] || {}
727
+ # HTTP header 'Accept' (if needed)
728
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
729
+ # HTTP header 'Content-Type'
730
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
731
+ header_params[:'X-Contract-Number'] = opts[:'x_contract_number'] if !opts[:'x_contract_number'].nil?
732
+
733
+ # form parameters
734
+ form_params = opts[:form_params] || {}
735
+ form_params['snapshotId'] = opts[:'snapshot_id'] if !opts[:'snapshot_id'].nil?
736
+
737
+ # http body (model)
738
+ post_body = opts[:debug_body]
739
+
740
+ # return_type
741
+ return_type = opts[:debug_return_type] || 'Object'
742
+
743
+ # auth_names
744
+ auth_names = opts[:debug_auth_names] || ['Basic Authentication', 'Token Authentication']
745
+
746
+ new_options = opts.merge(
747
+ :operation => :"VolumeApi.datacenters_volumes_restore_snapshot_post",
748
+ :header_params => header_params,
749
+ :query_params => query_params,
750
+ :form_params => form_params,
751
+ :body => post_body,
752
+ :auth_names => auth_names,
753
+ :return_type => return_type
754
+ )
755
+
756
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
757
+ if @api_client.config.debugging
758
+ @api_client.config.logger.debug "API called: VolumeApi#datacenters_volumes_restore_snapshot_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
759
+ end
760
+ return data, status_code, headers
761
+ end
762
+ end
763
+ end