ionoscloud-dbaas-mongo 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
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,85 @@
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 SnapshotsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get the snapshots of your cluster
23
+ # Retrieves MongoDB snapshots.
24
+ # @param cluster_id [String] The unique ID of the cluster.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [SnapshotList]
27
+ def clusters_snapshots_get(cluster_id, opts = {})
28
+ data, _status_code, _headers = clusters_snapshots_get_with_http_info(cluster_id, opts)
29
+ data
30
+ end
31
+
32
+ # Get the snapshots of your cluster
33
+ # Retrieves MongoDB snapshots.
34
+ # @param cluster_id [String] The unique ID of the cluster.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(SnapshotList, Integer, Hash)>] SnapshotList data, response status code and response headers
37
+ def clusters_snapshots_get_with_http_info(cluster_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: SnapshotsApi.clusters_snapshots_get ...'
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 SnapshotsApi.clusters_snapshots_get"
44
+ end
45
+ # resource path
46
+ local_var_path = '/clusters/{clusterId}/snapshots'.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] || 'SnapshotList'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"SnapshotsApi.clusters_snapshots_get",
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(:GET, local_var_path, new_options)
79
+ if @api_client.config.debugging
80
+ @api_client.config.logger.debug "API called: SnapshotsApi#clusters_snapshots_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,79 @@
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 TemplatesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get Templates
23
+ # Retrieves a list of valid templates. These templates can be used to create MongoDB clusters; they contain properties, such as number of cores, RAM, and the storage size.
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [TemplateList]
26
+ def templates_get(opts = {})
27
+ data, _status_code, _headers = templates_get_with_http_info(opts)
28
+ data
29
+ end
30
+
31
+ # Get Templates
32
+ # Retrieves a list of valid templates. These templates can be used to create MongoDB clusters; they contain properties, such as number of cores, RAM, and the storage size.
33
+ # @param [Hash] opts the optional parameters
34
+ # @return [Array<(TemplateList, Integer, Hash)>] TemplateList data, response status code and response headers
35
+ def templates_get_with_http_info(opts = {})
36
+ if @api_client.config.debugging
37
+ @api_client.config.logger.debug 'Calling API: TemplatesApi.templates_get ...'
38
+ end
39
+ # resource path
40
+ local_var_path = '/templates'
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] || 'TemplateList'
58
+
59
+ # auth_names
60
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
61
+
62
+ new_options = opts.merge(
63
+ :operation => :"TemplatesApi.templates_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: TemplatesApi#templates_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+ end
79
+ end
@@ -0,0 +1,306 @@
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 UsersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete a MongoDB User by ID
23
+ # Deletes a MongoDB user specified by its ID.
24
+ # @param cluster_id [String] The unique ID of the cluster.
25
+ # @param database [String] The authentication database.
26
+ # @param username [String] The authentication username.
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [User]
29
+ def clusters_users_delete(cluster_id, database, username, opts = {})
30
+ data, _status_code, _headers = clusters_users_delete_with_http_info(cluster_id, database, username, opts)
31
+ data
32
+ end
33
+
34
+ # Delete a MongoDB User by ID
35
+ # Deletes a MongoDB user specified by its ID.
36
+ # @param cluster_id [String] The unique ID of the cluster.
37
+ # @param database [String] The authentication database.
38
+ # @param username [String] The authentication username.
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
41
+ def clusters_users_delete_with_http_info(cluster_id, database, username, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: UsersApi.clusters_users_delete ...'
44
+ end
45
+ # verify the required parameter 'cluster_id' is set
46
+ if @api_client.config.client_side_validation && cluster_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling UsersApi.clusters_users_delete"
48
+ end
49
+ # verify the required parameter 'database' is set
50
+ if @api_client.config.client_side_validation && database.nil?
51
+ fail ArgumentError, "Missing the required parameter 'database' when calling UsersApi.clusters_users_delete"
52
+ end
53
+ # verify the required parameter 'username' is set
54
+ if @api_client.config.client_side_validation && username.nil?
55
+ fail ArgumentError, "Missing the required parameter 'username' when calling UsersApi.clusters_users_delete"
56
+ end
57
+ # resource path
58
+ local_var_path = '/clusters/{clusterId}/users/{database}/{username}'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s)).sub('{' + 'database' + '}', CGI.escape(database.to_s)).sub('{' + 'username' + '}', CGI.escape(username.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
67
+
68
+ # form parameters
69
+ form_params = opts[:form_params] || {}
70
+
71
+ # http body (model)
72
+ post_body = opts[:debug_body]
73
+
74
+ # return_type
75
+ return_type = opts[:debug_return_type] || 'User'
76
+
77
+ # auth_names
78
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
79
+
80
+ new_options = opts.merge(
81
+ :operation => :"UsersApi.clusters_users_delete",
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: UsersApi#clusters_users_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Get a MongoDB User by ID
98
+ # Retrieves the MongoDB user identified by the username and database parameters.
99
+ # @param cluster_id [String] The unique ID of the cluster.
100
+ # @param database [String] The authentication database.
101
+ # @param username [String] The authentication username.
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [User]
104
+ def clusters_users_find_by_id(cluster_id, database, username, opts = {})
105
+ data, _status_code, _headers = clusters_users_find_by_id_with_http_info(cluster_id, database, username, opts)
106
+ data
107
+ end
108
+
109
+ # Get a MongoDB User by ID
110
+ # Retrieves the MongoDB user identified by the username and database parameters.
111
+ # @param cluster_id [String] The unique ID of the cluster.
112
+ # @param database [String] The authentication database.
113
+ # @param username [String] The authentication username.
114
+ # @param [Hash] opts the optional parameters
115
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
116
+ def clusters_users_find_by_id_with_http_info(cluster_id, database, username, opts = {})
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug 'Calling API: UsersApi.clusters_users_find_by_id ...'
119
+ end
120
+ # verify the required parameter 'cluster_id' is set
121
+ if @api_client.config.client_side_validation && cluster_id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling UsersApi.clusters_users_find_by_id"
123
+ end
124
+ # verify the required parameter 'database' is set
125
+ if @api_client.config.client_side_validation && database.nil?
126
+ fail ArgumentError, "Missing the required parameter 'database' when calling UsersApi.clusters_users_find_by_id"
127
+ end
128
+ # verify the required parameter 'username' is set
129
+ if @api_client.config.client_side_validation && username.nil?
130
+ fail ArgumentError, "Missing the required parameter 'username' when calling UsersApi.clusters_users_find_by_id"
131
+ end
132
+ # resource path
133
+ local_var_path = '/clusters/{clusterId}/users/{database}/{username}'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s)).sub('{' + 'database' + '}', CGI.escape(database.to_s)).sub('{' + 'username' + '}', CGI.escape(username.to_s))
134
+
135
+ # query parameters
136
+ query_params = opts[:query_params] || {}
137
+
138
+ # header parameters
139
+ header_params = opts[:header_params] || {}
140
+ # HTTP header 'Accept' (if needed)
141
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
142
+
143
+ # form parameters
144
+ form_params = opts[:form_params] || {}
145
+
146
+ # http body (model)
147
+ post_body = opts[:debug_body]
148
+
149
+ # return_type
150
+ return_type = opts[:debug_return_type] || 'User'
151
+
152
+ # auth_names
153
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
154
+
155
+ new_options = opts.merge(
156
+ :operation => :"UsersApi.clusters_users_find_by_id",
157
+ :header_params => header_params,
158
+ :query_params => query_params,
159
+ :form_params => form_params,
160
+ :body => post_body,
161
+ :auth_names => auth_names,
162
+ :return_type => return_type
163
+ )
164
+
165
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug "API called: UsersApi#clusters_users_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
+ end
169
+ return data, status_code, headers
170
+ end
171
+
172
+ # Get a Cluster Users
173
+ # Retrieves a list of MongoDB users.
174
+ # @param cluster_id [String] The unique ID of the cluster.
175
+ # @param [Hash] opts the optional parameters
176
+ # @return [UsersList]
177
+ def clusters_users_get(cluster_id, opts = {})
178
+ data, _status_code, _headers = clusters_users_get_with_http_info(cluster_id, opts)
179
+ data
180
+ end
181
+
182
+ # Get a Cluster Users
183
+ # Retrieves a list of MongoDB users.
184
+ # @param cluster_id [String] The unique ID of the cluster.
185
+ # @param [Hash] opts the optional parameters
186
+ # @return [Array<(UsersList, Integer, Hash)>] UsersList data, response status code and response headers
187
+ def clusters_users_get_with_http_info(cluster_id, opts = {})
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug 'Calling API: UsersApi.clusters_users_get ...'
190
+ end
191
+ # verify the required parameter 'cluster_id' is set
192
+ if @api_client.config.client_side_validation && cluster_id.nil?
193
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling UsersApi.clusters_users_get"
194
+ end
195
+ # resource path
196
+ local_var_path = '/clusters/{clusterId}/users'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
197
+
198
+ # query parameters
199
+ query_params = opts[:query_params] || {}
200
+
201
+ # header parameters
202
+ header_params = opts[:header_params] || {}
203
+ # HTTP header 'Accept' (if needed)
204
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
205
+
206
+ # form parameters
207
+ form_params = opts[:form_params] || {}
208
+
209
+ # http body (model)
210
+ post_body = opts[:debug_body]
211
+
212
+ # return_type
213
+ return_type = opts[:debug_return_type] || 'UsersList'
214
+
215
+ # auth_names
216
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
217
+
218
+ new_options = opts.merge(
219
+ :operation => :"UsersApi.clusters_users_get",
220
+ :header_params => header_params,
221
+ :query_params => query_params,
222
+ :form_params => form_params,
223
+ :body => post_body,
224
+ :auth_names => auth_names,
225
+ :return_type => return_type
226
+ )
227
+
228
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
229
+ if @api_client.config.debugging
230
+ @api_client.config.logger.debug "API called: UsersApi#clusters_users_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
231
+ end
232
+ return data, status_code, headers
233
+ end
234
+
235
+ # Create MongoDB User
236
+ # Creates a MongoDB user.
237
+ # @param cluster_id [String] The unique ID of the cluster.
238
+ # @param user [User] The user to be created.
239
+ # @param [Hash] opts the optional parameters
240
+ # @return [User]
241
+ def clusters_users_post(cluster_id, user, opts = {})
242
+ data, _status_code, _headers = clusters_users_post_with_http_info(cluster_id, user, opts)
243
+ data
244
+ end
245
+
246
+ # Create MongoDB User
247
+ # Creates a MongoDB user.
248
+ # @param cluster_id [String] The unique ID of the cluster.
249
+ # @param user [User] The user to be created.
250
+ # @param [Hash] opts the optional parameters
251
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
252
+ def clusters_users_post_with_http_info(cluster_id, user, opts = {})
253
+ if @api_client.config.debugging
254
+ @api_client.config.logger.debug 'Calling API: UsersApi.clusters_users_post ...'
255
+ end
256
+ # verify the required parameter 'cluster_id' is set
257
+ if @api_client.config.client_side_validation && cluster_id.nil?
258
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling UsersApi.clusters_users_post"
259
+ end
260
+ # verify the required parameter 'user' is set
261
+ if @api_client.config.client_side_validation && user.nil?
262
+ fail ArgumentError, "Missing the required parameter 'user' when calling UsersApi.clusters_users_post"
263
+ end
264
+ # resource path
265
+ local_var_path = '/clusters/{clusterId}/users'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
266
+
267
+ # query parameters
268
+ query_params = opts[:query_params] || {}
269
+
270
+ # header parameters
271
+ header_params = opts[:header_params] || {}
272
+ # HTTP header 'Accept' (if needed)
273
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
274
+ # HTTP header 'Content-Type'
275
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
276
+
277
+ # form parameters
278
+ form_params = opts[:form_params] || {}
279
+
280
+ # http body (model)
281
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
282
+
283
+ # return_type
284
+ return_type = opts[:debug_return_type] || 'User'
285
+
286
+ # auth_names
287
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
288
+
289
+ new_options = opts.merge(
290
+ :operation => :"UsersApi.clusters_users_post",
291
+ :header_params => header_params,
292
+ :query_params => query_params,
293
+ :form_params => form_params,
294
+ :body => post_body,
295
+ :auth_names => auth_names,
296
+ :return_type => return_type
297
+ )
298
+
299
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug "API called: UsersApi#clusters_users_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
302
+ end
303
+ return data, status_code, headers
304
+ end
305
+ end
306
+ end