ionoscloud 5.0.1 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +65 -0
  3. data/docs/AttachedVolumes.md +1 -1
  4. data/docs/Cdroms.md +1 -1
  5. data/docs/DefaultApi.md +6 -1
  6. data/docs/ImageProperties.md +5 -1
  7. data/docs/IpBlockProperties.md +1 -1
  8. data/docs/IpConsumer.md +5 -1
  9. data/docs/KubernetesApi.md +12 -12
  10. data/docs/KubernetesClusterForPost.md +28 -0
  11. data/docs/KubernetesClusterForPut.md +28 -0
  12. data/docs/KubernetesClusterProperties.md +5 -1
  13. data/docs/KubernetesClusterPropertiesForPost.md +26 -0
  14. data/docs/{KubernetesClusterPropertiesForPostAndPut.md → KubernetesClusterPropertiesForPut.md} +3 -3
  15. data/docs/KubernetesNodePoolForPost.md +26 -0
  16. data/docs/KubernetesNodePoolProperties.md +1 -1
  17. data/docs/KubernetesNodePoolPropertiesForPost.md +1 -1
  18. data/docs/KubernetesNodePoolPropertiesForPut.md +0 -14
  19. data/docs/KubernetesNodeProperties.md +3 -1
  20. data/docs/Nics.md +1 -1
  21. data/docs/README.md +3 -3
  22. data/docs/RequestApi.md +22 -6
  23. data/docs/S3KeyProperties.md +2 -2
  24. data/docs/UserManagementApi.md +7 -7
  25. data/docs/UserPost.md +18 -0
  26. data/docs/UserProperties.md +0 -2
  27. data/docs/UserPropertiesPost.md +32 -0
  28. data/docs/UserPropertiesPut.md +30 -0
  29. data/docs/UserPut.md +20 -0
  30. data/docs/VolumeProperties.md +1 -1
  31. data/docs/summary.md +17 -1
  32. data/lib/ionoscloud.rb +9 -1
  33. data/lib/ionoscloud/api/_api.rb +1 -1
  34. data/lib/ionoscloud/api/kubernetes_api.rb +11 -11
  35. data/lib/ionoscloud/api/request_api.rb +30 -6
  36. data/lib/ionoscloud/api/user_management_api.rb +8 -8
  37. data/lib/ionoscloud/api_client.rb +13 -14
  38. data/lib/ionoscloud/configuration.rb +2 -2
  39. data/lib/ionoscloud/models/datacenter_properties.rb +0 -22
  40. data/lib/ionoscloud/models/image_properties.rb +38 -4
  41. data/lib/ionoscloud/models/ip_consumer.rb +22 -4
  42. data/lib/ionoscloud/models/kubernetes_cluster_for_post.rb +303 -0
  43. data/lib/ionoscloud/models/kubernetes_cluster_for_put.rb +303 -0
  44. data/lib/ionoscloud/models/kubernetes_cluster_properties.rb +26 -4
  45. data/lib/ionoscloud/models/kubernetes_cluster_properties_for_post.rb +263 -0
  46. data/lib/ionoscloud/models/{kubernetes_cluster_properties_for_post_and_put.rb → kubernetes_cluster_properties_for_put.rb} +4 -4
  47. data/lib/ionoscloud/models/kubernetes_node_pool_for_post.rb +294 -0
  48. data/lib/ionoscloud/models/kubernetes_node_pool_properties.rb +1 -1
  49. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_post.rb +1 -1
  50. data/lib/ionoscloud/models/kubernetes_node_pool_properties_for_put.rb +1 -152
  51. data/lib/ionoscloud/models/kubernetes_node_properties.rb +11 -6
  52. data/lib/ionoscloud/models/location_properties.rb +0 -22
  53. data/lib/ionoscloud/models/s3_key_properties.rb +2 -2
  54. data/lib/ionoscloud/models/user_post.rb +221 -0
  55. data/lib/ionoscloud/models/user_properties.rb +1 -11
  56. data/lib/ionoscloud/models/user_properties_post.rb +287 -0
  57. data/lib/ionoscloud/models/user_properties_put.rb +277 -0
  58. data/lib/ionoscloud/models/user_put.rb +231 -0
  59. data/lib/ionoscloud/models/volume_properties.rb +1 -1
  60. data/lib/ionoscloud/version.rb +1 -1
  61. data/spec/api/kubernetes_api_spec.rb +4 -4
  62. data/spec/api/request_api_spec.rb +11 -3
  63. data/spec/api/user_management_api_spec.rb +2 -2
  64. data/spec/models/datacenter_properties_spec.rb +0 -4
  65. data/spec/models/image_properties_spec.rb +16 -0
  66. data/spec/models/ip_consumer_spec.rb +12 -0
  67. data/spec/models/kubernetes_cluster_for_post_spec.rb +68 -0
  68. data/spec/models/kubernetes_cluster_for_put_spec.rb +68 -0
  69. data/spec/models/kubernetes_cluster_properties_for_post_spec.rb +58 -0
  70. data/spec/models/{kubernetes_cluster_properties_for_post_and_put_spec.rb → kubernetes_cluster_properties_for_put_spec.rb} +6 -6
  71. data/spec/models/kubernetes_cluster_properties_spec.rb +12 -0
  72. data/spec/models/kubernetes_node_pool_for_post_spec.rb +62 -0
  73. data/spec/models/kubernetes_node_pool_properties_for_put_spec.rb +0 -50
  74. data/spec/models/kubernetes_node_properties_spec.rb +6 -0
  75. data/spec/models/location_properties_spec.rb +0 -4
  76. data/spec/models/user_post_spec.rb +34 -0
  77. data/spec/models/user_properties_post_spec.rb +76 -0
  78. data/spec/models/user_properties_put_spec.rb +70 -0
  79. data/spec/models/user_properties_spec.rb +0 -6
  80. data/spec/models/user_put_spec.rb +40 -0
  81. metadata +157 -124
@@ -105,9 +105,17 @@ module Ionoscloud
105
105
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
106
106
  # @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)
107
107
  # @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
108
- # @option opts [String] :filter_status Request status filter to fetch all the request based on a particular status [QUEUED, RUNNING, DONE, FAILED]
109
- # @option opts [String] :filter_created_after Filter all the requests after the created date
110
- # @option opts [String] :filter_created_before Filter all the requests before the created date
108
+ # @option opts [String] :filter_status Request filter to fetch all requests based on a particular status [QUEUED, RUNNING, DONE, FAILED]. It doesn't depend on depth query parameter
109
+ # @option opts [String] :filter_created_after Request filter to fetch all requests created after the specified date. It doesn't depend on depth query parameter. Date format e.g. 2021-01-01+00:00:00
110
+ # @option opts [String] :filter_created_before Request filter to fetch all requests created before the specified date. It doesn't depend on depth query parameter. Date format e.g. 2021-01-01+00:00:00
111
+ # @option opts [String] :filter_created_date Response filter to select and display only the requests that contains the specified createdDate. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0. Date format e.g. 2020-11-16T17:42:59Z
112
+ # @option opts [String] :filter_created_by Response filter to select and display only the requests that contains the specified createdBy. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
113
+ # @option opts [String] :filter_etag Response filter to select and display only the requests that contains the specified etag. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
114
+ # @option opts [String] :filter_request_status Response filter to select and display only the requests that contains the specified requestStatus. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
115
+ # @option opts [String] :filter_method Response filter to select and display only the requests that contains the specified method. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
116
+ # @option opts [String] :filter_headers Response filter to select and display only the requests that contains the specified headers. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
117
+ # @option opts [String] :filter_body Response filter to select and display only the requests that contains the specified body. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
118
+ # @option opts [String] :filter_url Response filter to select and display only the requests that contains the specified url. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
111
119
  # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination) (default to 0)
112
120
  # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination) (default to 1000)
113
121
  # @return [Requests]
@@ -122,9 +130,17 @@ module Ionoscloud
122
130
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
123
131
  # @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
124
132
  # @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
125
- # @option opts [String] :filter_status Request status filter to fetch all the request based on a particular status [QUEUED, RUNNING, DONE, FAILED]
126
- # @option opts [String] :filter_created_after Filter all the requests after the created date
127
- # @option opts [String] :filter_created_before Filter all the requests before the created date
133
+ # @option opts [String] :filter_status Request filter to fetch all requests based on a particular status [QUEUED, RUNNING, DONE, FAILED]. It doesn't depend on depth query parameter
134
+ # @option opts [String] :filter_created_after Request filter to fetch all requests created after the specified date. It doesn't depend on depth query parameter. Date format e.g. 2021-01-01+00:00:00
135
+ # @option opts [String] :filter_created_before Request filter to fetch all requests created before the specified date. It doesn't depend on depth query parameter. Date format e.g. 2021-01-01+00:00:00
136
+ # @option opts [String] :filter_created_date Response filter to select and display only the requests that contains the specified createdDate. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0. Date format e.g. 2020-11-16T17:42:59Z
137
+ # @option opts [String] :filter_created_by Response filter to select and display only the requests that contains the specified createdBy. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
138
+ # @option opts [String] :filter_etag Response filter to select and display only the requests that contains the specified etag. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
139
+ # @option opts [String] :filter_request_status Response filter to select and display only the requests that contains the specified requestStatus. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
140
+ # @option opts [String] :filter_method Response filter to select and display only the requests that contains the specified method. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
141
+ # @option opts [String] :filter_headers Response filter to select and display only the requests that contains the specified headers. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
142
+ # @option opts [String] :filter_body Response filter to select and display only the requests that contains the specified body. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
143
+ # @option opts [String] :filter_url Response filter to select and display only the requests that contains the specified url. The value is case insensitive and it depends on depth query parameter that should have a value greater than 0.
128
144
  # @option opts [Integer] :offset the first element (of the total list of elements) to include in the response (use together with <code>limit</code> for pagination)
129
145
  # @option opts [Integer] :limit the maximum number of elements to return (use together with <code>offset</code> for pagination)
130
146
  # @return [Array<(Requests, Integer, Hash)>] Requests data, response status code and response headers
@@ -162,6 +178,14 @@ module Ionoscloud
162
178
  query_params[:'filter.status'] = opts[:'filter_status'] if !opts[:'filter_status'].nil?
163
179
  query_params[:'filter.createdAfter'] = opts[:'filter_created_after'] if !opts[:'filter_created_after'].nil?
164
180
  query_params[:'filter.createdBefore'] = opts[:'filter_created_before'] if !opts[:'filter_created_before'].nil?
181
+ query_params[:'filter.createdDate'] = opts[:'filter_created_date'] if !opts[:'filter_created_date'].nil?
182
+ query_params[:'filter.createdBy'] = opts[:'filter_created_by'] if !opts[:'filter_created_by'].nil?
183
+ query_params[:'filter.etag'] = opts[:'filter_etag'] if !opts[:'filter_etag'].nil?
184
+ query_params[:'filter.requestStatus'] = opts[:'filter_request_status'] if !opts[:'filter_request_status'].nil?
185
+ query_params[:'filter.method'] = opts[:'filter_method'] if !opts[:'filter_method'].nil?
186
+ query_params[:'filter.headers'] = opts[:'filter_headers'] if !opts[:'filter_headers'].nil?
187
+ query_params[:'filter.body'] = opts[:'filter_body'] if !opts[:'filter_body'].nil?
188
+ query_params[:'filter.url'] = opts[:'filter_url'] if !opts[:'filter_url'].nil?
165
189
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
166
190
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
167
191
 
@@ -1829,7 +1829,7 @@ module Ionoscloud
1829
1829
 
1830
1830
  # Create a user
1831
1831
  # You can use this POST method to create a user
1832
- # @param user [User] User to be created
1832
+ # @param user [UserPost] User to be created
1833
1833
  # @param [Hash] opts the optional parameters
1834
1834
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1835
1835
  # @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)
@@ -1842,7 +1842,7 @@ module Ionoscloud
1842
1842
 
1843
1843
  # Create a user
1844
1844
  # You can use this POST method to create a user
1845
- # @param user [User] User to be created
1845
+ # @param user [UserPost] User to be created
1846
1846
  # @param [Hash] opts the optional parameters
1847
1847
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1848
1848
  # @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
@@ -1912,7 +1912,7 @@ module Ionoscloud
1912
1912
  # Modify a user
1913
1913
  # You can use update attributes of a User
1914
1914
  # @param user_id [String]
1915
- # @param user [User] Modified user
1915
+ # @param user [UserPut] Modified user
1916
1916
  # @param [Hash] opts the optional parameters
1917
1917
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
1918
1918
  # @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)
@@ -1926,7 +1926,7 @@ module Ionoscloud
1926
1926
  # Modify a user
1927
1927
  # You can use update attributes of a User
1928
1928
  # @param user_id [String]
1929
- # @param user [User] Modified user
1929
+ # @param user [UserPut] Modified user
1930
1930
  # @param [Hash] opts the optional parameters
1931
1931
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
1932
1932
  # @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
@@ -2330,10 +2330,10 @@ module Ionoscloud
2330
2330
  end
2331
2331
 
2332
2332
  # Modify a S3 key having the given key id
2333
- # You can enable or disable a given S3 key
2333
+ # You can enable or disable a given S3 key.
2334
2334
  # @param user_id [String]
2335
2335
  # @param key_id [String] The unique access key ID of the S3 key
2336
- # @param s3_key [S3Key] Modified s3 key
2336
+ # @param s3_key [S3Key] Modified S3 key
2337
2337
  # @param [Hash] opts the optional parameters
2338
2338
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines) (default to true)
2339
2339
  # @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)
@@ -2345,10 +2345,10 @@ module Ionoscloud
2345
2345
  end
2346
2346
 
2347
2347
  # Modify a S3 key having the given key id
2348
- # You can enable or disable a given S3 key
2348
+ # You can enable or disable a given S3 key.
2349
2349
  # @param user_id [String]
2350
2350
  # @param key_id [String] The unique access key ID of the S3 key
2351
- # @param s3_key [S3Key] Modified s3 key
2351
+ # @param s3_key [S3Key] Modified S3 key
2352
2352
  # @param [Hash] opts the optional parameters
2353
2353
  # @option opts [Boolean] :pretty Controls whether response is pretty-printed (with indentation and new lines)
2354
2354
  # @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
@@ -13,12 +13,17 @@ OpenAPI Generator version: 5.0.1-SNAPSHOT
13
13
  require 'date'
14
14
  require 'json'
15
15
  require 'logger'
16
- require 'net/http'
17
- require 'set'
18
16
  require 'tempfile'
19
17
  require 'time'
20
18
  require 'typhoeus'
21
19
 
20
+
21
+ TooManyRequests = 429
22
+ BadGateway = 502
23
+ ServiceUnavailable = 503
24
+ GatewayTimeout = 504
25
+
26
+
22
27
  module Ionoscloud
23
28
  class ApiClient
24
29
  # The Configuration object holding settings to be used in the API client.
@@ -60,10 +65,10 @@ module Ionoscloud
60
65
  @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n"
61
66
  end
62
67
 
63
- case Net::HTTPResponse::CODE_TO_OBJ[response.code.to_s]
64
- when Set[Net::HTTPBadGateway, Net::HTTPServiceUnavailable, Net::HTTPGatewayTimeout]
68
+ case response.code
69
+ when BadGateway, ServiceUnavailable, GatewayTimeout
65
70
  backoff_time = @config.wait_time
66
- when Set[Net::HTTPTooManyRequests]
71
+ when TooManyRequests
67
72
  backoff_time = @config.wait_time
68
73
  begin
69
74
  backoff_time = Integer(response.headers['Retry-After'])
@@ -447,17 +452,13 @@ module Ionoscloud
447
452
  break
448
453
  else
449
454
  if request.metadata.status == 'FAILED'
450
- raise Ionoscloud::ApiError.new(
451
- 'Request {0} failed to complete: {1}'.format(request_id, request.metadata.message),
452
- )
455
+ raise Ionoscloud::ApiError.new(message: "Request #{request_id} failed to complete: #{request.metadata.message}")
453
456
  end
454
457
  end
455
458
 
456
459
  current_time = Time.now.to_i
457
460
  if timeout && current_time > timeout
458
- raise Ionoscloud::ApiError.new(
459
- 'Timed out waiting for request {0}.'.format(request_id),
460
- )
461
+ raise Ionoscloud::ApiError.new(message: "Timed out waiting for request #{request_id}.")
461
462
  end
462
463
 
463
464
  if current_time > next_increase
@@ -497,9 +498,7 @@ module Ionoscloud
497
498
 
498
499
  current_time = Time.now.to_i
499
500
  if timeout && current_time > timeout
500
- raise Ionoscloud::ApiError.new(
501
- 'Timed out waiting for request {0}.'.format(request_id),
502
- )
501
+ raise Ionoscloud::ApiError.new(message: "Timed out waiting for request #{request_id}.")
503
502
  end
504
503
 
505
504
  if current_time > next_increase
@@ -165,8 +165,8 @@ module Ionoscloud
165
165
  @force_ending_format = false
166
166
  @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
167
167
  @max_retries = 3
168
- @wait_time = 100
169
- @max_wait_time = 2000
168
+ @wait_time = 0.1
169
+ @max_wait_time = 2
170
170
 
171
171
  yield(self) if block_given?
172
172
  end
@@ -33,28 +33,6 @@ module Ionoscloud
33
33
  # Boolean value representing if the data center requires extra protection e.g. two factor protection
34
34
  attr_accessor :sec_auth_protection
35
35
 
36
- class EnumAttributeValidator
37
- attr_reader :datatype
38
- attr_reader :allowable_values
39
-
40
- def initialize(datatype, allowable_values)
41
- @allowable_values = allowable_values.map do |value|
42
- case datatype.to_s
43
- when /Integer/i
44
- value.to_i
45
- when /Float/i
46
- value.to_f
47
- else
48
- value
49
- end
50
- end
51
- end
52
-
53
- def valid?(value)
54
- !value || allowable_values.include?(value)
55
- end
56
- end
57
-
58
36
  # Attribute mapping from ruby-style variable name to JSON key.
59
37
  def self.attribute_map
60
38
  {
@@ -66,6 +66,12 @@ module Ionoscloud
66
66
  # Indicates if the image is part of the public repository or not
67
67
  attr_accessor :public
68
68
 
69
+ # List of image aliases mapped for this Image
70
+ attr_accessor :image_aliases
71
+
72
+ # Cloud init compatibility
73
+ attr_accessor :cloud_init
74
+
69
75
  class EnumAttributeValidator
70
76
  attr_reader :datatype
71
77
  attr_reader :allowable_values
@@ -107,7 +113,9 @@ module Ionoscloud
107
113
  :'disc_scsi_hot_unplug' => :'discScsiHotUnplug',
108
114
  :'licence_type' => :'licenceType',
109
115
  :'image_type' => :'imageType',
110
- :'public' => :'public'
116
+ :'public' => :'public',
117
+ :'image_aliases' => :'imageAliases',
118
+ :'cloud_init' => :'cloudInit'
111
119
  }
112
120
  end
113
121
 
@@ -135,7 +143,9 @@ module Ionoscloud
135
143
  :'disc_scsi_hot_unplug' => :'Boolean',
136
144
  :'licence_type' => :'String',
137
145
  :'image_type' => :'String',
138
- :'public' => :'Boolean'
146
+ :'public' => :'Boolean',
147
+ :'image_aliases' => :'Array<String>',
148
+ :'cloud_init' => :'String'
139
149
  }
140
150
  end
141
151
 
@@ -227,6 +237,16 @@ module Ionoscloud
227
237
  if attributes.key?(:'public')
228
238
  self.public = attributes[:'public']
229
239
  end
240
+
241
+ if attributes.key?(:'image_aliases')
242
+ if (value = attributes[:'image_aliases']).is_a?(Array)
243
+ self.image_aliases = value
244
+ end
245
+ end
246
+
247
+ if attributes.key?(:'cloud_init')
248
+ self.cloud_init = attributes[:'cloud_init']
249
+ end
230
250
  end
231
251
 
232
252
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -248,6 +268,8 @@ module Ionoscloud
248
268
  return false unless licence_type_validator.valid?(@licence_type)
249
269
  image_type_validator = EnumAttributeValidator.new('String', ["HDD", "CDROM"])
250
270
  return false unless image_type_validator.valid?(@image_type)
271
+ cloud_init_validator = EnumAttributeValidator.new('String', ["NONE", "V1"])
272
+ return false unless cloud_init_validator.valid?(@cloud_init)
251
273
  true
252
274
  end
253
275
 
@@ -271,6 +293,16 @@ module Ionoscloud
271
293
  @image_type = image_type
272
294
  end
273
295
 
296
+ # Custom attribute writer method checking allowed values (enum).
297
+ # @param [Object] cloud_init Object to be assigned
298
+ def cloud_init=(cloud_init)
299
+ validator = EnumAttributeValidator.new('String', ["NONE", "V1"])
300
+ unless validator.valid?(cloud_init)
301
+ fail ArgumentError, "invalid value for \"cloud_init\", must be one of #{validator.allowable_values}."
302
+ end
303
+ @cloud_init = cloud_init
304
+ end
305
+
274
306
  # Checks equality by comparing each attribute.
275
307
  # @param [Object] Object to be compared
276
308
  def ==(o)
@@ -292,7 +324,9 @@ module Ionoscloud
292
324
  disc_scsi_hot_unplug == o.disc_scsi_hot_unplug &&
293
325
  licence_type == o.licence_type &&
294
326
  image_type == o.image_type &&
295
- public == o.public
327
+ public == o.public &&
328
+ image_aliases == o.image_aliases &&
329
+ cloud_init == o.cloud_init
296
330
  end
297
331
 
298
332
  # @see the `==` method
@@ -304,7 +338,7 @@ module Ionoscloud
304
338
  # Calculates hash code according to all attributes.
305
339
  # @return [Integer] Hash code
306
340
  def hash
307
- [name, description, location, size, cpu_hot_plug, cpu_hot_unplug, ram_hot_plug, ram_hot_unplug, nic_hot_plug, nic_hot_unplug, disc_virtio_hot_plug, disc_virtio_hot_unplug, disc_scsi_hot_plug, disc_scsi_hot_unplug, licence_type, image_type, public].hash
341
+ [name, description, location, size, cpu_hot_plug, cpu_hot_unplug, ram_hot_plug, ram_hot_unplug, nic_hot_plug, nic_hot_unplug, disc_virtio_hot_plug, disc_virtio_hot_unplug, disc_scsi_hot_plug, disc_scsi_hot_unplug, licence_type, image_type, public, image_aliases, cloud_init].hash
308
342
  end
309
343
 
310
344
  # Builds the object from hash
@@ -29,6 +29,10 @@ module Ionoscloud
29
29
 
30
30
  attr_accessor :datacenter_name
31
31
 
32
+ attr_accessor :k8s_node_pool_uuid
33
+
34
+ attr_accessor :k8s_cluster_uuid
35
+
32
36
  # Attribute mapping from ruby-style variable name to JSON key.
33
37
  def self.attribute_map
34
38
  {
@@ -38,7 +42,9 @@ module Ionoscloud
38
42
  :'server_id' => :'serverId',
39
43
  :'server_name' => :'serverName',
40
44
  :'datacenter_id' => :'datacenterId',
41
- :'datacenter_name' => :'datacenterName'
45
+ :'datacenter_name' => :'datacenterName',
46
+ :'k8s_node_pool_uuid' => :'k8sNodePoolUuid',
47
+ :'k8s_cluster_uuid' => :'k8sClusterUuid'
42
48
  }
43
49
  end
44
50
 
@@ -56,7 +62,9 @@ module Ionoscloud
56
62
  :'server_id' => :'String',
57
63
  :'server_name' => :'String',
58
64
  :'datacenter_id' => :'String',
59
- :'datacenter_name' => :'String'
65
+ :'datacenter_name' => :'String',
66
+ :'k8s_node_pool_uuid' => :'String',
67
+ :'k8s_cluster_uuid' => :'String'
60
68
  }
61
69
  end
62
70
 
@@ -108,6 +116,14 @@ module Ionoscloud
108
116
  if attributes.key?(:'datacenter_name')
109
117
  self.datacenter_name = attributes[:'datacenter_name']
110
118
  end
119
+
120
+ if attributes.key?(:'k8s_node_pool_uuid')
121
+ self.k8s_node_pool_uuid = attributes[:'k8s_node_pool_uuid']
122
+ end
123
+
124
+ if attributes.key?(:'k8s_cluster_uuid')
125
+ self.k8s_cluster_uuid = attributes[:'k8s_cluster_uuid']
126
+ end
111
127
  end
112
128
 
113
129
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -134,7 +150,9 @@ module Ionoscloud
134
150
  server_id == o.server_id &&
135
151
  server_name == o.server_name &&
136
152
  datacenter_id == o.datacenter_id &&
137
- datacenter_name == o.datacenter_name
153
+ datacenter_name == o.datacenter_name &&
154
+ k8s_node_pool_uuid == o.k8s_node_pool_uuid &&
155
+ k8s_cluster_uuid == o.k8s_cluster_uuid
138
156
  end
139
157
 
140
158
  # @see the `==` method
@@ -146,7 +164,7 @@ module Ionoscloud
146
164
  # Calculates hash code according to all attributes.
147
165
  # @return [Integer] Hash code
148
166
  def hash
149
- [ip, mac, nic_id, server_id, server_name, datacenter_id, datacenter_name].hash
167
+ [ip, mac, nic_id, server_id, server_name, datacenter_id, datacenter_name, k8s_node_pool_uuid, k8s_cluster_uuid].hash
150
168
  end
151
169
 
152
170
  # Builds the object from hash
@@ -0,0 +1,303 @@
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 'date'
14
+ require 'time'
15
+
16
+ module Ionoscloud
17
+ class KubernetesClusterForPost
18
+ # The resource's unique identifier.
19
+ attr_accessor :id
20
+
21
+ # The type of object
22
+ attr_accessor :type
23
+
24
+ # URL to the object representation (absolute path)
25
+ attr_accessor :href
26
+
27
+ attr_accessor :metadata
28
+
29
+ attr_accessor :properties
30
+
31
+ attr_accessor :entities
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'id' => :'id',
59
+ :'type' => :'type',
60
+ :'href' => :'href',
61
+ :'metadata' => :'metadata',
62
+ :'properties' => :'properties',
63
+ :'entities' => :'entities'
64
+ }
65
+ end
66
+
67
+ # Returns all the JSON keys this model knows about
68
+ def self.acceptable_attributes
69
+ attribute_map.values
70
+ end
71
+
72
+ # Attribute type mapping.
73
+ def self.openapi_types
74
+ {
75
+ :'id' => :'String',
76
+ :'type' => :'String',
77
+ :'href' => :'String',
78
+ :'metadata' => :'DatacenterElementMetadata',
79
+ :'properties' => :'KubernetesClusterPropertiesForPost',
80
+ :'entities' => :'KubernetesClusterEntities'
81
+ }
82
+ end
83
+
84
+ # List of attributes with nullable: true
85
+ def self.openapi_nullable
86
+ Set.new([
87
+ ])
88
+ end
89
+
90
+ # Initializes the object
91
+ # @param [Hash] attributes Model attributes in the form of hash
92
+ def initialize(attributes = {})
93
+ if (!attributes.is_a?(Hash))
94
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Ionoscloud::KubernetesClusterForPost` initialize method"
95
+ end
96
+
97
+ # check to see if the attribute exists and convert string to symbol for hash key
98
+ attributes = attributes.each_with_object({}) { |(k, v), h|
99
+ if (!self.class.attribute_map.key?(k.to_sym))
100
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::KubernetesClusterForPost`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
101
+ end
102
+ h[k.to_sym] = v
103
+ }
104
+
105
+ if attributes.key?(:'id')
106
+ self.id = attributes[:'id']
107
+ end
108
+
109
+ if attributes.key?(:'type')
110
+ self.type = attributes[:'type']
111
+ end
112
+
113
+ if attributes.key?(:'href')
114
+ self.href = attributes[:'href']
115
+ end
116
+
117
+ if attributes.key?(:'metadata')
118
+ self.metadata = attributes[:'metadata']
119
+ end
120
+
121
+ if attributes.key?(:'properties')
122
+ self.properties = attributes[:'properties']
123
+ end
124
+
125
+ if attributes.key?(:'entities')
126
+ self.entities = attributes[:'entities']
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ invalid_properties = Array.new
134
+ if @properties.nil?
135
+ invalid_properties.push('invalid value for "properties", properties cannot be nil.')
136
+ end
137
+
138
+ invalid_properties
139
+ end
140
+
141
+ # Check to see if the all the properties in the model are valid
142
+ # @return true if the model is valid
143
+ def valid?
144
+ type_validator = EnumAttributeValidator.new('String', ["k8s"])
145
+ return false unless type_validator.valid?(@type)
146
+ return false if @properties.nil?
147
+ true
148
+ end
149
+
150
+ # Custom attribute writer method checking allowed values (enum).
151
+ # @param [Object] type Object to be assigned
152
+ def type=(type)
153
+ validator = EnumAttributeValidator.new('String', ["k8s"])
154
+ unless validator.valid?(type)
155
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
156
+ end
157
+ @type = type
158
+ end
159
+
160
+ # Checks equality by comparing each attribute.
161
+ # @param [Object] Object to be compared
162
+ def ==(o)
163
+ return true if self.equal?(o)
164
+ self.class == o.class &&
165
+ id == o.id &&
166
+ type == o.type &&
167
+ href == o.href &&
168
+ metadata == o.metadata &&
169
+ properties == o.properties &&
170
+ entities == o.entities
171
+ end
172
+
173
+ # @see the `==` method
174
+ # @param [Object] Object to be compared
175
+ def eql?(o)
176
+ self == o
177
+ end
178
+
179
+ # Calculates hash code according to all attributes.
180
+ # @return [Integer] Hash code
181
+ def hash
182
+ [id, type, href, metadata, properties, entities].hash
183
+ end
184
+
185
+ # Builds the object from hash
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ # @return [Object] Returns the model itself
188
+ def self.build_from_hash(attributes)
189
+ new.build_from_hash(attributes)
190
+ end
191
+
192
+ # Builds the object from hash
193
+ # @param [Hash] attributes Model attributes in the form of hash
194
+ # @return [Object] Returns the model itself
195
+ def build_from_hash(attributes)
196
+ return nil unless attributes.is_a?(Hash)
197
+ self.class.openapi_types.each_pair do |key, type|
198
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
199
+ self.send("#{key}=", nil)
200
+ elsif type =~ /\AArray<(.*)>/i
201
+ # check to ensure the input is an array given that the attribute
202
+ # is documented as an array but the input is not
203
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
204
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
205
+ end
206
+ elsif !attributes[self.class.attribute_map[key]].nil?
207
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
208
+ end
209
+ end
210
+
211
+ self
212
+ end
213
+
214
+ # Deserializes the data based on type
215
+ # @param string type Data type
216
+ # @param string value Value to be deserialized
217
+ # @return [Object] Deserialized data
218
+ def _deserialize(type, value)
219
+ case type.to_sym
220
+ when :Time
221
+ Time.parse(value)
222
+ when :Date
223
+ Date.parse(value)
224
+ when :String
225
+ value.to_s
226
+ when :Integer
227
+ value.to_i
228
+ when :Float
229
+ value.to_f
230
+ when :Boolean
231
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
232
+ true
233
+ else
234
+ false
235
+ end
236
+ when :Object
237
+ # generic object (usually a Hash), return directly
238
+ value
239
+ when /\AArray<(?<inner_type>.+)>\z/
240
+ inner_type = Regexp.last_match[:inner_type]
241
+ value.map { |v| _deserialize(inner_type, v) }
242
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
243
+ k_type = Regexp.last_match[:k_type]
244
+ v_type = Regexp.last_match[:v_type]
245
+ {}.tap do |hash|
246
+ value.each do |k, v|
247
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
248
+ end
249
+ end
250
+ else # model
251
+ # models (e.g. Pet) or oneOf
252
+ klass = Ionoscloud.const_get(type)
253
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
254
+ end
255
+ end
256
+
257
+ # Returns the string representation of the object
258
+ # @return [String] String presentation of the object
259
+ def to_s
260
+ to_hash.to_s
261
+ end
262
+
263
+ # to_body is an alias to to_hash (backward compatibility)
264
+ # @return [Hash] Returns the object in the form of hash
265
+ def to_body
266
+ to_hash
267
+ end
268
+
269
+ # Returns the object in the form of hash
270
+ # @return [Hash] Returns the object in the form of hash
271
+ def to_hash
272
+ hash = {}
273
+ self.class.attribute_map.each_pair do |attr, param|
274
+ value = self.send(attr)
275
+ if value.nil?
276
+ is_nullable = self.class.openapi_nullable.include?(attr)
277
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
278
+ end
279
+
280
+ hash[param] = _to_hash(value)
281
+ end
282
+ hash
283
+ end
284
+
285
+ # Outputs non-array value in the form of hash
286
+ # For object, use to_hash. Otherwise, just return the value
287
+ # @param [Object] value Any valid value
288
+ # @return [Hash] Returns the value in the form of hash
289
+ def _to_hash(value)
290
+ if value.is_a?(Array)
291
+ value.compact.map { |v| _to_hash(v) }
292
+ elsif value.is_a?(Hash)
293
+ {}.tap do |hash|
294
+ value.each { |k, v| hash[k] = _to_hash(v) }
295
+ end
296
+ elsif value.respond_to? :to_hash
297
+ value.to_hash
298
+ else
299
+ value
300
+ end
301
+ end
302
+ end
303
+ end