ionoscloud-dbaas-mongo 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/Gemfile.lock +70 -0
  4. data/LICENSE +201 -0
  5. data/README.md +58 -0
  6. data/Rakefile +10 -0
  7. data/docs/api/ClustersApi.md +313 -0
  8. data/docs/api/LogsApi.md +93 -0
  9. data/docs/api/MetadataApi.md +153 -0
  10. data/docs/api/RestoresApi.md +84 -0
  11. data/docs/api/SnapshotsApi.md +83 -0
  12. data/docs/api/TemplatesApi.md +80 -0
  13. data/docs/api/UsersApi.md +321 -0
  14. data/docs/models/APIVersion.md +20 -0
  15. data/docs/models/ClusterList.md +28 -0
  16. data/docs/models/ClusterListAllOf.md +22 -0
  17. data/docs/models/ClusterLogs.md +18 -0
  18. data/docs/models/ClusterLogsInstances.md +20 -0
  19. data/docs/models/ClusterLogsMessages.md +20 -0
  20. data/docs/models/ClusterProperties.md +32 -0
  21. data/docs/models/ClusterResponse.md +24 -0
  22. data/docs/models/Connection.md +22 -0
  23. data/docs/models/CreateClusterProperties.md +30 -0
  24. data/docs/models/CreateClusterRequest.md +20 -0
  25. data/docs/models/CreateRestoreRequest.md +18 -0
  26. data/docs/models/DayOfTheWeek.md +15 -0
  27. data/docs/models/ErrorMessage.md +20 -0
  28. data/docs/models/ErrorResponse.md +20 -0
  29. data/docs/models/MaintenanceWindow.md +20 -0
  30. data/docs/models/Metadata.md +30 -0
  31. data/docs/models/Pagination.md +22 -0
  32. data/docs/models/PaginationLinks.md +22 -0
  33. data/docs/models/ResourceType.md +15 -0
  34. data/docs/models/SnapshotList.md +28 -0
  35. data/docs/models/SnapshotListAllOf.md +22 -0
  36. data/docs/models/SnapshotProperties.md +22 -0
  37. data/docs/models/SnapshotResponse.md +22 -0
  38. data/docs/models/State.md +15 -0
  39. data/docs/models/TemplateList.md +18 -0
  40. data/docs/models/TemplateListAllOf.md +18 -0
  41. data/docs/models/TemplateResponse.md +24 -0
  42. data/docs/models/User.md +22 -0
  43. data/docs/models/UserMetadata.md +24 -0
  44. data/docs/models/UserProperties.md +24 -0
  45. data/docs/models/UserRoles.md +20 -0
  46. data/docs/models/UsersList.md +22 -0
  47. data/docs/summary.md +50 -0
  48. data/git_push.sh +56 -0
  49. data/ionoscloud-dbaas-mongo.gemspec +38 -0
  50. data/lib/ionoscloud-dbaas-mongo/api/clusters_api.rb +273 -0
  51. data/lib/ionoscloud-dbaas-mongo/api/logs_api.rb +109 -0
  52. data/lib/ionoscloud-dbaas-mongo/api/metadata_api.rb +136 -0
  53. data/lib/ionoscloud-dbaas-mongo/api/restores_api.rb +93 -0
  54. data/lib/ionoscloud-dbaas-mongo/api/snapshots_api.rb +85 -0
  55. data/lib/ionoscloud-dbaas-mongo/api/templates_api.rb +79 -0
  56. data/lib/ionoscloud-dbaas-mongo/api/users_api.rb +306 -0
  57. data/lib/ionoscloud-dbaas-mongo/api_client.rb +471 -0
  58. data/lib/ionoscloud-dbaas-mongo/api_error.rb +57 -0
  59. data/lib/ionoscloud-dbaas-mongo/configuration.rb +276 -0
  60. data/lib/ionoscloud-dbaas-mongo/models/api_version.rb +243 -0
  61. data/lib/ionoscloud-dbaas-mongo/models/cluster_list.rb +353 -0
  62. data/lib/ionoscloud-dbaas-mongo/models/cluster_list_all_of.rb +261 -0
  63. data/lib/ionoscloud-dbaas-mongo/models/cluster_logs.rb +227 -0
  64. data/lib/ionoscloud-dbaas-mongo/models/cluster_logs_instances.rb +244 -0
  65. data/lib/ionoscloud-dbaas-mongo/models/cluster_logs_messages.rb +243 -0
  66. data/lib/ionoscloud-dbaas-mongo/models/cluster_properties.rb +376 -0
  67. data/lib/ionoscloud-dbaas-mongo/models/cluster_response.rb +279 -0
  68. data/lib/ionoscloud-dbaas-mongo/models/connection.rb +279 -0
  69. data/lib/ionoscloud-dbaas-mongo/models/create_cluster_properties.rb +387 -0
  70. data/lib/ionoscloud-dbaas-mongo/models/create_cluster_request.rb +244 -0
  71. data/lib/ionoscloud-dbaas-mongo/models/create_restore_request.rb +233 -0
  72. data/lib/ionoscloud-dbaas-mongo/models/day_of_the_week.rb +42 -0
  73. data/lib/ionoscloud-dbaas-mongo/models/error_message.rb +245 -0
  74. data/lib/ionoscloud-dbaas-mongo/models/error_response.rb +244 -0
  75. data/lib/ionoscloud-dbaas-mongo/models/maintenance_window.rb +254 -0
  76. data/lib/ionoscloud-dbaas-mongo/models/metadata.rb +335 -0
  77. data/lib/ionoscloud-dbaas-mongo/models/pagination.rb +292 -0
  78. data/lib/ionoscloud-dbaas-mongo/models/pagination_links.rb +264 -0
  79. data/lib/ionoscloud-dbaas-mongo/models/resource_type.rb +38 -0
  80. data/lib/ionoscloud-dbaas-mongo/models/snapshot_list.rb +353 -0
  81. data/lib/ionoscloud-dbaas-mongo/models/snapshot_list_all_of.rb +261 -0
  82. data/lib/ionoscloud-dbaas-mongo/models/snapshot_properties.rb +264 -0
  83. data/lib/ionoscloud-dbaas-mongo/models/snapshot_response.rb +262 -0
  84. data/lib/ionoscloud-dbaas-mongo/models/state.rb +40 -0
  85. data/lib/ionoscloud-dbaas-mongo/models/template_list.rb +234 -0
  86. data/lib/ionoscloud-dbaas-mongo/models/template_list_all_of.rb +226 -0
  87. data/lib/ionoscloud-dbaas-mongo/models/template_response.rb +282 -0
  88. data/lib/ionoscloud-dbaas-mongo/models/user.rb +261 -0
  89. data/lib/ionoscloud-dbaas-mongo/models/user_metadata.rb +316 -0
  90. data/lib/ionoscloud-dbaas-mongo/models/user_properties.rb +294 -0
  91. data/lib/ionoscloud-dbaas-mongo/models/user_roles.rb +278 -0
  92. data/lib/ionoscloud-dbaas-mongo/models/users_list.rb +262 -0
  93. data/lib/ionoscloud-dbaas-mongo/version.rb +15 -0
  94. data/lib/ionoscloud-dbaas-mongo.rb +79 -0
  95. data/spec/api_client_spec.rb +226 -0
  96. data/spec/configuration_spec.rb +42 -0
  97. data/spec/spec_helper.rb +111 -0
  98. metadata +189 -0
@@ -0,0 +1,273 @@
1
+ =begin
2
+ #IONOS DBaaS MongoDB REST API
3
+
4
+ #With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IonoscloudDbaasMongo
16
+ class ClustersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete a Cluster
23
+ # Deletes a MongoDB cluster.
24
+ # @param cluster_id [String] The unique ID of the cluster.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [ClusterResponse]
27
+ def clusters_delete(cluster_id, opts = {})
28
+ data, _status_code, _headers = clusters_delete_with_http_info(cluster_id, opts)
29
+ data
30
+ end
31
+
32
+ # Delete a Cluster
33
+ # Deletes a MongoDB cluster.
34
+ # @param cluster_id [String] The unique ID of the cluster.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(ClusterResponse, Integer, Hash)>] ClusterResponse data, response status code and response headers
37
+ def clusters_delete_with_http_info(cluster_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_delete ...'
40
+ end
41
+ # verify the required parameter 'cluster_id' is set
42
+ if @api_client.config.client_side_validation && cluster_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling ClustersApi.clusters_delete"
44
+ end
45
+ # resource path
46
+ local_var_path = '/clusters/{clusterId}'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = opts[:form_params] || {}
58
+
59
+ # http body (model)
60
+ post_body = opts[:debug_body]
61
+
62
+ # return_type
63
+ return_type = opts[:debug_return_type] || 'ClusterResponse'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"ClustersApi.clusters_delete",
70
+ :header_params => header_params,
71
+ :query_params => query_params,
72
+ :form_params => form_params,
73
+ :body => post_body,
74
+ :auth_names => auth_names,
75
+ :return_type => return_type
76
+ )
77
+
78
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Get a cluster by id
86
+ # Get a cluster by id.
87
+ # @param cluster_id [String] The unique ID of the cluster.
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [ClusterResponse]
90
+ def clusters_find_by_id(cluster_id, opts = {})
91
+ data, _status_code, _headers = clusters_find_by_id_with_http_info(cluster_id, opts)
92
+ data
93
+ end
94
+
95
+ # Get a cluster by id
96
+ # Get a cluster by id.
97
+ # @param cluster_id [String] The unique ID of the cluster.
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(ClusterResponse, Integer, Hash)>] ClusterResponse data, response status code and response headers
100
+ def clusters_find_by_id_with_http_info(cluster_id, opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_find_by_id ...'
103
+ end
104
+ # verify the required parameter 'cluster_id' is set
105
+ if @api_client.config.client_side_validation && cluster_id.nil?
106
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling ClustersApi.clusters_find_by_id"
107
+ end
108
+ # resource path
109
+ local_var_path = '/clusters/{clusterId}'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
110
+
111
+ # query parameters
112
+ query_params = opts[:query_params] || {}
113
+
114
+ # header parameters
115
+ header_params = opts[:header_params] || {}
116
+ # HTTP header 'Accept' (if needed)
117
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
118
+
119
+ # form parameters
120
+ form_params = opts[:form_params] || {}
121
+
122
+ # http body (model)
123
+ post_body = opts[:debug_body]
124
+
125
+ # return_type
126
+ return_type = opts[:debug_return_type] || 'ClusterResponse'
127
+
128
+ # auth_names
129
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
130
+
131
+ new_options = opts.merge(
132
+ :operation => :"ClustersApi.clusters_find_by_id",
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => return_type
139
+ )
140
+
141
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # Get Clusters
149
+ # Retrieves a list of MongoDB clusters.
150
+ # @param [Hash] opts the optional parameters
151
+ # @option opts [String] :filter_name Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the &#39;displayName&#39; field.
152
+ # @return [ClusterList]
153
+ def clusters_get(opts = {})
154
+ data, _status_code, _headers = clusters_get_with_http_info(opts)
155
+ data
156
+ end
157
+
158
+ # Get Clusters
159
+ # Retrieves a list of MongoDB clusters.
160
+ # @param [Hash] opts the optional parameters
161
+ # @option opts [String] :filter_name Response filter to list only the MongoDB clusters that contain the specified name. The value is case insensitive and matched on the &#39;displayName&#39; field.
162
+ # @return [Array<(ClusterList, Integer, Hash)>] ClusterList data, response status code and response headers
163
+ def clusters_get_with_http_info(opts = {})
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_get ...'
166
+ end
167
+ # resource path
168
+ local_var_path = '/clusters'
169
+
170
+ # query parameters
171
+ query_params = opts[:query_params] || {}
172
+ query_params[:'filter.name'] = opts[:'filter_name'] if !opts[:'filter_name'].nil?
173
+
174
+ # header parameters
175
+ header_params = opts[:header_params] || {}
176
+ # HTTP header 'Accept' (if needed)
177
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
178
+
179
+ # form parameters
180
+ form_params = opts[:form_params] || {}
181
+
182
+ # http body (model)
183
+ post_body = opts[:debug_body]
184
+
185
+ # return_type
186
+ return_type = opts[:debug_return_type] || 'ClusterList'
187
+
188
+ # auth_names
189
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
190
+
191
+ new_options = opts.merge(
192
+ :operation => :"ClustersApi.clusters_get",
193
+ :header_params => header_params,
194
+ :query_params => query_params,
195
+ :form_params => form_params,
196
+ :body => post_body,
197
+ :auth_names => auth_names,
198
+ :return_type => return_type
199
+ )
200
+
201
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
202
+ if @api_client.config.debugging
203
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
204
+ end
205
+ return data, status_code, headers
206
+ end
207
+
208
+ # Create a Cluster
209
+ # Creates a new MongoDB cluster.
210
+ # @param create_cluster_request [CreateClusterRequest] The cluster to be created.
211
+ # @param [Hash] opts the optional parameters
212
+ # @return [ClusterResponse]
213
+ def clusters_post(create_cluster_request, opts = {})
214
+ data, _status_code, _headers = clusters_post_with_http_info(create_cluster_request, opts)
215
+ data
216
+ end
217
+
218
+ # Create a Cluster
219
+ # Creates a new MongoDB cluster.
220
+ # @param create_cluster_request [CreateClusterRequest] The cluster to be created.
221
+ # @param [Hash] opts the optional parameters
222
+ # @return [Array<(ClusterResponse, Integer, Hash)>] ClusterResponse data, response status code and response headers
223
+ def clusters_post_with_http_info(create_cluster_request, opts = {})
224
+ if @api_client.config.debugging
225
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_post ...'
226
+ end
227
+ # verify the required parameter 'create_cluster_request' is set
228
+ if @api_client.config.client_side_validation && create_cluster_request.nil?
229
+ fail ArgumentError, "Missing the required parameter 'create_cluster_request' when calling ClustersApi.clusters_post"
230
+ end
231
+ # resource path
232
+ local_var_path = '/clusters'
233
+
234
+ # query parameters
235
+ query_params = opts[:query_params] || {}
236
+
237
+ # header parameters
238
+ header_params = opts[:header_params] || {}
239
+ # HTTP header 'Accept' (if needed)
240
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
241
+ # HTTP header 'Content-Type'
242
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
243
+
244
+ # form parameters
245
+ form_params = opts[:form_params] || {}
246
+
247
+ # http body (model)
248
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_cluster_request)
249
+
250
+ # return_type
251
+ return_type = opts[:debug_return_type] || 'ClusterResponse'
252
+
253
+ # auth_names
254
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
255
+
256
+ new_options = opts.merge(
257
+ :operation => :"ClustersApi.clusters_post",
258
+ :header_params => header_params,
259
+ :query_params => query_params,
260
+ :form_params => form_params,
261
+ :body => post_body,
262
+ :auth_names => auth_names,
263
+ :return_type => return_type
264
+ )
265
+
266
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
269
+ end
270
+ return data, status_code, headers
271
+ end
272
+ end
273
+ end
@@ -0,0 +1,109 @@
1
+ =begin
2
+ #IONOS DBaaS MongoDB REST API
3
+
4
+ #With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IonoscloudDbaasMongo
16
+ class LogsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get logs of your cluster
23
+ # Retrieves MongoDB logs based on the given parameters.
24
+ # @param cluster_id [String] The unique ID of the cluster.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [Time] :start The start time for the query in RFC3339 format. Must not be more than 30 days ago but before the end parameter. The default is 30 days ago.
27
+ # @option opts [Time] :_end The end time for the query in RFC3339 format. Must not be greater than now. The default is the current timestamp.
28
+ # @option opts [String] :direction The direction in which to scan through the logs. The logs are returned in order of the direction. (default to 'BACKWARD')
29
+ # @option opts [Integer] :limit The maximal number of log lines to return. If the limit is reached then log lines will be cut at the end (respecting the scan direction). (default to 100)
30
+ # @return [ClusterLogs]
31
+ def clusters_logs_get(cluster_id, opts = {})
32
+ data, _status_code, _headers = clusters_logs_get_with_http_info(cluster_id, opts)
33
+ data
34
+ end
35
+
36
+ # Get logs of your cluster
37
+ # Retrieves MongoDB logs based on the given parameters.
38
+ # @param cluster_id [String] The unique ID of the cluster.
39
+ # @param [Hash] opts the optional parameters
40
+ # @option opts [Time] :start The start time for the query in RFC3339 format. Must not be more than 30 days ago but before the end parameter. The default is 30 days ago.
41
+ # @option opts [Time] :_end The end time for the query in RFC3339 format. Must not be greater than now. The default is the current timestamp.
42
+ # @option opts [String] :direction The direction in which to scan through the logs. The logs are returned in order of the direction.
43
+ # @option opts [Integer] :limit The maximal number of log lines to return. If the limit is reached then log lines will be cut at the end (respecting the scan direction).
44
+ # @return [Array<(ClusterLogs, Integer, Hash)>] ClusterLogs data, response status code and response headers
45
+ def clusters_logs_get_with_http_info(cluster_id, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: LogsApi.clusters_logs_get ...'
48
+ end
49
+ # verify the required parameter 'cluster_id' is set
50
+ if @api_client.config.client_side_validation && cluster_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling LogsApi.clusters_logs_get"
52
+ end
53
+ allowable_values = ["BACKWARD", "FORWARD"]
54
+ if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])
55
+ fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}"
56
+ end
57
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 5000
58
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LogsApi.clusters_logs_get, must be smaller than or equal to 5000.'
59
+ end
60
+
61
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
62
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling LogsApi.clusters_logs_get, must be greater than or equal to 1.'
63
+ end
64
+
65
+ # resource path
66
+ local_var_path = '/clusters/{clusterId}/logs'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
67
+
68
+ # query parameters
69
+ query_params = opts[:query_params] || {}
70
+ query_params[:'start'] = opts[:'start'] if !opts[:'start'].nil?
71
+ query_params[:'end'] = opts[:'_end'] if !opts[:'_end'].nil?
72
+ query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
73
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
74
+
75
+ # header parameters
76
+ header_params = opts[:header_params] || {}
77
+ # HTTP header 'Accept' (if needed)
78
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
79
+
80
+ # form parameters
81
+ form_params = opts[:form_params] || {}
82
+
83
+ # http body (model)
84
+ post_body = opts[:debug_body]
85
+
86
+ # return_type
87
+ return_type = opts[:debug_return_type] || 'ClusterLogs'
88
+
89
+ # auth_names
90
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
91
+
92
+ new_options = opts.merge(
93
+ :operation => :"LogsApi.clusters_logs_get",
94
+ :header_params => header_params,
95
+ :query_params => query_params,
96
+ :form_params => form_params,
97
+ :body => post_body,
98
+ :auth_names => auth_names,
99
+ :return_type => return_type
100
+ )
101
+
102
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug "API called: LogsApi#clusters_logs_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
105
+ end
106
+ return data, status_code, headers
107
+ end
108
+ end
109
+ end
@@ -0,0 +1,136 @@
1
+ =begin
2
+ #IONOS DBaaS MongoDB REST API
3
+
4
+ #With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IonoscloudDbaasMongo
16
+ class MetadataApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get API Version
23
+ # Retrieves the current version of the responding API.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [APIVersion]
26
+ def infos_version_get(opts = {})
27
+ data, _status_code, _headers = infos_version_get_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Get API Version
32
+ # Retrieves the current version of the responding API.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(APIVersion, Integer, Hash)>] APIVersion data, response status code and response headers
35
+ def infos_version_get_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: MetadataApi.infos_version_get ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/infos/version'
41
+
42
+ # query parameters
43
+ query_params = opts[:query_params] || {}
44
+
45
+ # header parameters
46
+ header_params = opts[:header_params] || {}
47
+ # HTTP header 'Accept' (if needed)
48
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
+
50
+ # form parameters
51
+ form_params = opts[:form_params] || {}
52
+
53
+ # http body (model)
54
+ post_body = opts[:debug_body]
55
+
56
+ # return_type
57
+ return_type = opts[:debug_return_type] || 'APIVersion'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"MetadataApi.infos_version_get",
64
+ :header_params => header_params,
65
+ :query_params => query_params,
66
+ :form_params => form_params,
67
+ :body => post_body,
68
+ :auth_names => auth_names,
69
+ :return_type => return_type
70
+ )
71
+
72
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: MetadataApi#infos_version_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ # Get All API Versions
80
+ # Retrieves all available versions of the responding API.
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [Array<APIVersion>]
83
+ def infos_versions_get(opts = {})
84
+ data, _status_code, _headers = infos_versions_get_with_http_info(opts)
85
+ data
86
+ end
87
+
88
+ # Get All API Versions
89
+ # Retrieves all available versions of the responding API.
90
+ # @param [Hash] opts the optional parameters
91
+ # @return [Array<(Array<APIVersion>, Integer, Hash)>] Array<APIVersion> data, response status code and response headers
92
+ def infos_versions_get_with_http_info(opts = {})
93
+ if @api_client.config.debugging
94
+ @api_client.config.logger.debug 'Calling API: MetadataApi.infos_versions_get ...'
95
+ end
96
+ # resource path
97
+ local_var_path = '/infos/versions'
98
+
99
+ # query parameters
100
+ query_params = opts[:query_params] || {}
101
+
102
+ # header parameters
103
+ header_params = opts[:header_params] || {}
104
+ # HTTP header 'Accept' (if needed)
105
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
106
+
107
+ # form parameters
108
+ form_params = opts[:form_params] || {}
109
+
110
+ # http body (model)
111
+ post_body = opts[:debug_body]
112
+
113
+ # return_type
114
+ return_type = opts[:debug_return_type] || 'Array<APIVersion>'
115
+
116
+ # auth_names
117
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
118
+
119
+ new_options = opts.merge(
120
+ :operation => :"MetadataApi.infos_versions_get",
121
+ :header_params => header_params,
122
+ :query_params => query_params,
123
+ :form_params => form_params,
124
+ :body => post_body,
125
+ :auth_names => auth_names,
126
+ :return_type => return_type
127
+ )
128
+
129
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
130
+ if @api_client.config.debugging
131
+ @api_client.config.logger.debug "API called: MetadataApi#infos_versions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
132
+ end
133
+ return data, status_code, headers
134
+ end
135
+ end
136
+ end
@@ -0,0 +1,93 @@
1
+ =begin
2
+ #IONOS DBaaS MongoDB REST API
3
+
4
+ #With IONOS Cloud Database as a Service, you have the ability to quickly set up and manage a MongoDB database. You can also delete clusters, manage backups and users via the API. MongoDB is an open source, cross-platform, document-oriented database program. Classified as a NoSQL database program, it uses JSON-like documents with optional schemas. The MongoDB API allows you to create additional database clusters or modify existing ones. Both tools, the Data Center Designer (DCD) and the API use the same concepts consistently and are well suited for smooth and intuitive use.
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IonoscloudDbaasMongo
16
+ class RestoresApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # In-place restore of a cluster
23
+ # Triggers an in-place restore of the given MongoDB cluster.
24
+ # @param cluster_id [String] The unique ID of the cluster.
25
+ # @param create_restore_request [CreateRestoreRequest] The restore request to create.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [nil]
28
+ def clusters_restore_post(cluster_id, create_restore_request, opts = {})
29
+ clusters_restore_post_with_http_info(cluster_id, create_restore_request, opts)
30
+ nil
31
+ end
32
+
33
+ # In-place restore of a cluster
34
+ # Triggers an in-place restore of the given MongoDB cluster.
35
+ # @param cluster_id [String] The unique ID of the cluster.
36
+ # @param create_restore_request [CreateRestoreRequest] The restore request to create.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
+ def clusters_restore_post_with_http_info(cluster_id, create_restore_request, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: RestoresApi.clusters_restore_post ...'
42
+ end
43
+ # verify the required parameter 'cluster_id' is set
44
+ if @api_client.config.client_side_validation && cluster_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling RestoresApi.clusters_restore_post"
46
+ end
47
+ # verify the required parameter 'create_restore_request' is set
48
+ if @api_client.config.client_side_validation && create_restore_request.nil?
49
+ fail ArgumentError, "Missing the required parameter 'create_restore_request' when calling RestoresApi.clusters_restore_post"
50
+ end
51
+ # resource path
52
+ local_var_path = '/clusters/{clusterId}/restore'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+ # HTTP header 'Content-Type'
62
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_restore_request)
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type]
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"RestoresApi.clusters_restore_post",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: RestoresApi#clusters_restore_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+ end
93
+ end