ionoscloud-dbaas-postgres 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) 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 +65 -0
  6. data/Rakefile +10 -0
  7. data/docs/README.md +163 -0
  8. data/docs/api/BackupsApi.md +232 -0
  9. data/docs/api/ClustersApi.md +540 -0
  10. data/docs/api/LogsApi.md +91 -0
  11. data/docs/api/MetadataApi.md +153 -0
  12. data/docs/api/RestoresApi.md +84 -0
  13. data/docs/models/APIVersion.md +20 -0
  14. data/docs/models/BackupLocation.md +15 -0
  15. data/docs/models/BackupMetadata.md +20 -0
  16. data/docs/models/BackupResponse.md +24 -0
  17. data/docs/models/ClusterBackup.md +26 -0
  18. data/docs/models/ClusterBackupList.md +28 -0
  19. data/docs/models/ClusterBackupListAllOf.md +22 -0
  20. data/docs/models/ClusterList.md +28 -0
  21. data/docs/models/ClusterListAllOf.md +22 -0
  22. data/docs/models/ClusterLogs.md +18 -0
  23. data/docs/models/ClusterLogsInstances.md +20 -0
  24. data/docs/models/ClusterLogsMessages.md +20 -0
  25. data/docs/models/ClusterProperties.md +40 -0
  26. data/docs/models/ClusterResponse.md +24 -0
  27. data/docs/models/Connection.md +22 -0
  28. data/docs/models/CreateClusterProperties.md +42 -0
  29. data/docs/models/CreateClusterRequest.md +20 -0
  30. data/docs/models/CreateRestoreRequest.md +20 -0
  31. data/docs/models/DBUser.md +20 -0
  32. data/docs/models/DayOfTheWeek.md +15 -0
  33. data/docs/models/ErrorMessage.md +20 -0
  34. data/docs/models/ErrorResponse.md +20 -0
  35. data/docs/models/Location.md +15 -0
  36. data/docs/models/MaintenanceWindow.md +20 -0
  37. data/docs/models/Metadata.md +30 -0
  38. data/docs/models/Pagination.md +22 -0
  39. data/docs/models/PaginationLinks.md +22 -0
  40. data/docs/models/PatchClusterProperties.md +32 -0
  41. data/docs/models/PatchClusterRequest.md +20 -0
  42. data/docs/models/PostgresVersionList.md +18 -0
  43. data/docs/models/PostgresVersionListData.md +18 -0
  44. data/docs/models/ResourceType.md +15 -0
  45. data/docs/models/State.md +15 -0
  46. data/docs/models/StorageType.md +15 -0
  47. data/docs/models/SynchronizationMode.md +15 -0
  48. data/docs/summary.md +50 -0
  49. data/git_push.sh +58 -0
  50. data/ionoscloud-dbaas-postgres.gemspec +38 -0
  51. data/lib/ionoscloud-dbaas-postgres/api/backups_api.rb +205 -0
  52. data/lib/ionoscloud-dbaas-postgres/api/clusters_api.rb +464 -0
  53. data/lib/ionoscloud-dbaas-postgres/api/logs_api.rb +102 -0
  54. data/lib/ionoscloud-dbaas-postgres/api/metadata_api.rb +136 -0
  55. data/lib/ionoscloud-dbaas-postgres/api/restores_api.rb +93 -0
  56. data/lib/ionoscloud-dbaas-postgres/api_client.rb +471 -0
  57. data/lib/ionoscloud-dbaas-postgres/api_error.rb +57 -0
  58. data/lib/ionoscloud-dbaas-postgres/configuration.rb +291 -0
  59. data/lib/ionoscloud-dbaas-postgres/models/api_version.rb +227 -0
  60. data/lib/ionoscloud-dbaas-postgres/models/backup_location.rb +36 -0
  61. data/lib/ionoscloud-dbaas-postgres/models/backup_metadata.rb +229 -0
  62. data/lib/ionoscloud-dbaas-postgres/models/backup_response.rb +247 -0
  63. data/lib/ionoscloud-dbaas-postgres/models/cluster_backup.rb +260 -0
  64. data/lib/ionoscloud-dbaas-postgres/models/cluster_backup_list.rb +305 -0
  65. data/lib/ionoscloud-dbaas-postgres/models/cluster_backup_list_all_of.rb +237 -0
  66. data/lib/ionoscloud-dbaas-postgres/models/cluster_list.rb +305 -0
  67. data/lib/ionoscloud-dbaas-postgres/models/cluster_list_all_of.rb +237 -0
  68. data/lib/ionoscloud-dbaas-postgres/models/cluster_logs.rb +219 -0
  69. data/lib/ionoscloud-dbaas-postgres/models/cluster_logs_instances.rb +228 -0
  70. data/lib/ionoscloud-dbaas-postgres/models/cluster_logs_messages.rb +227 -0
  71. data/lib/ionoscloud-dbaas-postgres/models/cluster_properties.rb +417 -0
  72. data/lib/ionoscloud-dbaas-postgres/models/cluster_response.rb +247 -0
  73. data/lib/ionoscloud-dbaas-postgres/models/connection.rb +255 -0
  74. data/lib/ionoscloud-dbaas-postgres/models/create_cluster_properties.rb +501 -0
  75. data/lib/ionoscloud-dbaas-postgres/models/create_cluster_request.rb +228 -0
  76. data/lib/ionoscloud-dbaas-postgres/models/create_restore_request.rb +235 -0
  77. data/lib/ionoscloud-dbaas-postgres/models/day_of_the_week.rb +42 -0
  78. data/lib/ionoscloud-dbaas-postgres/models/db_user.rb +239 -0
  79. data/lib/ionoscloud-dbaas-postgres/models/error_message.rb +229 -0
  80. data/lib/ionoscloud-dbaas-postgres/models/error_response.rb +228 -0
  81. data/lib/ionoscloud-dbaas-postgres/models/location.rb +41 -0
  82. data/lib/ionoscloud-dbaas-postgres/models/maintenance_window.rb +238 -0
  83. data/lib/ionoscloud-dbaas-postgres/models/metadata.rb +275 -0
  84. data/lib/ionoscloud-dbaas-postgres/models/pagination.rb +268 -0
  85. data/lib/ionoscloud-dbaas-postgres/models/pagination_links.rb +240 -0
  86. data/lib/ionoscloud-dbaas-postgres/models/patch_cluster_properties.rb +381 -0
  87. data/lib/ionoscloud-dbaas-postgres/models/patch_cluster_request.rb +228 -0
  88. data/lib/ionoscloud-dbaas-postgres/models/postgres_version_list.rb +219 -0
  89. data/lib/ionoscloud-dbaas-postgres/models/postgres_version_list_data.rb +218 -0
  90. data/lib/ionoscloud-dbaas-postgres/models/resource_type.rb +38 -0
  91. data/lib/ionoscloud-dbaas-postgres/models/state.rb +40 -0
  92. data/lib/ionoscloud-dbaas-postgres/models/storage_type.rb +37 -0
  93. data/lib/ionoscloud-dbaas-postgres/models/synchronization_mode.rb +38 -0
  94. data/lib/ionoscloud-dbaas-postgres/version.rb +15 -0
  95. data/lib/ionoscloud-dbaas-postgres.rb +79 -0
  96. data/lib/test_driver.rb +119 -0
  97. data/sonar-project.properties +12 -0
  98. data/spec/api_client_spec.rb +226 -0
  99. data/spec/configuration_spec.rb +42 -0
  100. data/spec/spec_helper.rb +111 -0
  101. metadata +190 -0
@@ -0,0 +1,205 @@
1
+ =begin
2
+ #IONOS DBaaS REST API
3
+
4
+ #An enterprise-grade Database is provided as a Service (DBaaS) 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 create additional database clusters or modify existing ones. 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: 0.0.1
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 IonoscloudDbaasPostgres
16
+ class BackupsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List backups of cluster
23
+ # Retrieves a list of all backups of the given PostgreSQL cluster.
24
+ # @param cluster_id [String] The unique ID of the cluster.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [ClusterBackupList]
27
+ def cluster_backups_get(cluster_id, opts = {})
28
+ data, _status_code, _headers = cluster_backups_get_with_http_info(cluster_id, opts)
29
+ data
30
+ end
31
+
32
+ # List backups of cluster
33
+ # Retrieves a list of all backups of the given PostgreSQL cluster.
34
+ # @param cluster_id [String] The unique ID of the cluster.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(ClusterBackupList, Integer, Hash)>] ClusterBackupList data, response status code and response headers
37
+ def cluster_backups_get_with_http_info(cluster_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: BackupsApi.cluster_backups_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 BackupsApi.cluster_backups_get"
44
+ end
45
+ # resource path
46
+ local_var_path = '/clusters/{clusterId}/backups'.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] || 'ClusterBackupList'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"BackupsApi.cluster_backups_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: BackupsApi#cluster_backups_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Fetch a cluster backup
86
+ # Retrieve a PostgreSQL cluster backup by using its ID. This value can be found when you GET a list of PostgreSQL cluster backups.
87
+ # @param backup_id [String] The unique ID of the backup.
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [BackupResponse]
90
+ def clusters_backups_find_by_id(backup_id, opts = {})
91
+ data, _status_code, _headers = clusters_backups_find_by_id_with_http_info(backup_id, opts)
92
+ data
93
+ end
94
+
95
+ # Fetch a cluster backup
96
+ # Retrieve a PostgreSQL cluster backup by using its ID. This value can be found when you GET a list of PostgreSQL cluster backups.
97
+ # @param backup_id [String] The unique ID of the backup.
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(BackupResponse, Integer, Hash)>] BackupResponse data, response status code and response headers
100
+ def clusters_backups_find_by_id_with_http_info(backup_id, opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: BackupsApi.clusters_backups_find_by_id ...'
103
+ end
104
+ # verify the required parameter 'backup_id' is set
105
+ if @api_client.config.client_side_validation && backup_id.nil?
106
+ fail ArgumentError, "Missing the required parameter 'backup_id' when calling BackupsApi.clusters_backups_find_by_id"
107
+ end
108
+ # resource path
109
+ local_var_path = '/clusters/backups/{backupId}'.sub('{' + 'backupId' + '}', CGI.escape(backup_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] || 'BackupResponse'
127
+
128
+ # auth_names
129
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
130
+
131
+ new_options = opts.merge(
132
+ :operation => :"BackupsApi.clusters_backups_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: BackupsApi#clusters_backups_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # List cluster backups
149
+ # Retrieves a list of all PostgreSQL cluster backups.
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [ClusterBackupList]
152
+ def clusters_backups_get(opts = {})
153
+ data, _status_code, _headers = clusters_backups_get_with_http_info(opts)
154
+ data
155
+ end
156
+
157
+ # List cluster backups
158
+ # Retrieves a list of all PostgreSQL cluster backups.
159
+ # @param [Hash] opts the optional parameters
160
+ # @return [Array<(ClusterBackupList, Integer, Hash)>] ClusterBackupList data, response status code and response headers
161
+ def clusters_backups_get_with_http_info(opts = {})
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug 'Calling API: BackupsApi.clusters_backups_get ...'
164
+ end
165
+ # resource path
166
+ local_var_path = '/clusters/backups'
167
+
168
+ # query parameters
169
+ query_params = opts[:query_params] || {}
170
+
171
+ # header parameters
172
+ header_params = opts[:header_params] || {}
173
+ # HTTP header 'Accept' (if needed)
174
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
175
+
176
+ # form parameters
177
+ form_params = opts[:form_params] || {}
178
+
179
+ # http body (model)
180
+ post_body = opts[:debug_body]
181
+
182
+ # return_type
183
+ return_type = opts[:debug_return_type] || 'ClusterBackupList'
184
+
185
+ # auth_names
186
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
187
+
188
+ new_options = opts.merge(
189
+ :operation => :"BackupsApi.clusters_backups_get",
190
+ :header_params => header_params,
191
+ :query_params => query_params,
192
+ :form_params => form_params,
193
+ :body => post_body,
194
+ :auth_names => auth_names,
195
+ :return_type => return_type
196
+ )
197
+
198
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
199
+ if @api_client.config.debugging
200
+ @api_client.config.logger.debug "API called: BackupsApi#clusters_backups_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
201
+ end
202
+ return data, status_code, headers
203
+ end
204
+ end
205
+ end
@@ -0,0 +1,464 @@
1
+ =begin
2
+ #IONOS DBaaS REST API
3
+
4
+ #An enterprise-grade Database is provided as a Service (DBaaS) 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 create additional database clusters or modify existing ones. 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: 0.0.1
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 IonoscloudDbaasPostgres
16
+ class ClustersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # List PostgreSQL versions
23
+ # Retrieves a list of all PostgreSQL versions available for this cluster including the current version.
24
+ # @param cluster_id [String] The unique ID of the cluster.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [PostgresVersionList]
27
+ def cluster_postgres_versions_get(cluster_id, opts = {})
28
+ data, _status_code, _headers = cluster_postgres_versions_get_with_http_info(cluster_id, opts)
29
+ data
30
+ end
31
+
32
+ # List PostgreSQL versions
33
+ # Retrieves a list of all PostgreSQL versions available for this cluster including the current version.
34
+ # @param cluster_id [String] The unique ID of the cluster.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(PostgresVersionList, Integer, Hash)>] PostgresVersionList data, response status code and response headers
37
+ def cluster_postgres_versions_get_with_http_info(cluster_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ClustersApi.cluster_postgres_versions_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 ClustersApi.cluster_postgres_versions_get"
44
+ end
45
+ # resource path
46
+ local_var_path = '/clusters/{clusterId}/postgresversions'.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] || 'PostgresVersionList'
64
+
65
+ # auth_names
66
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
67
+
68
+ new_options = opts.merge(
69
+ :operation => :"ClustersApi.cluster_postgres_versions_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: ClustersApi#cluster_postgres_versions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
81
+ end
82
+ return data, status_code, headers
83
+ end
84
+
85
+ # Delete a cluster
86
+ # Delete a PostgreSQL cluster.
87
+ # @param cluster_id [String] The unique ID of the cluster.
88
+ # @param [Hash] opts the optional parameters
89
+ # @return [ClusterResponse]
90
+ def clusters_delete(cluster_id, opts = {})
91
+ data, _status_code, _headers = clusters_delete_with_http_info(cluster_id, opts)
92
+ data
93
+ end
94
+
95
+ # Delete a cluster
96
+ # Delete a PostgreSQL cluster.
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_delete_with_http_info(cluster_id, opts = {})
101
+ if @api_client.config.debugging
102
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_delete ...'
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_delete"
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_delete",
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(:DELETE, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # Fetch a cluster
149
+ # You can retrieve a PostgreSQL cluster by using its ID. This value can be found in the response body when a PostgreSQL cluster is created or when you GET a list of PostgreSQL clusters.
150
+ # @param cluster_id [String] The unique ID of the cluster.
151
+ # @param [Hash] opts the optional parameters
152
+ # @return [ClusterResponse]
153
+ def clusters_find_by_id(cluster_id, opts = {})
154
+ data, _status_code, _headers = clusters_find_by_id_with_http_info(cluster_id, opts)
155
+ data
156
+ end
157
+
158
+ # Fetch a cluster
159
+ # You can retrieve a PostgreSQL cluster by using its ID. This value can be found in the response body when a PostgreSQL cluster is created or when you GET a list of PostgreSQL clusters.
160
+ # @param cluster_id [String] The unique ID of the cluster.
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [Array<(ClusterResponse, Integer, Hash)>] ClusterResponse data, response status code and response headers
163
+ def clusters_find_by_id_with_http_info(cluster_id, opts = {})
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_find_by_id ...'
166
+ end
167
+ # verify the required parameter 'cluster_id' is set
168
+ if @api_client.config.client_side_validation && cluster_id.nil?
169
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling ClustersApi.clusters_find_by_id"
170
+ end
171
+ # resource path
172
+ local_var_path = '/clusters/{clusterId}'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
173
+
174
+ # query parameters
175
+ query_params = opts[:query_params] || {}
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
181
+
182
+ # form parameters
183
+ form_params = opts[:form_params] || {}
184
+
185
+ # http body (model)
186
+ post_body = opts[:debug_body]
187
+
188
+ # return_type
189
+ return_type = opts[:debug_return_type] || 'ClusterResponse'
190
+
191
+ # auth_names
192
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
193
+
194
+ new_options = opts.merge(
195
+ :operation => :"ClustersApi.clusters_find_by_id",
196
+ :header_params => header_params,
197
+ :query_params => query_params,
198
+ :form_params => form_params,
199
+ :body => post_body,
200
+ :auth_names => auth_names,
201
+ :return_type => return_type
202
+ )
203
+
204
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
207
+ end
208
+ return data, status_code, headers
209
+ end
210
+
211
+ # List clusters
212
+ # Retrieves a list of PostgreSQL clusters.
213
+ # @param [Hash] opts the optional parameters
214
+ # @option opts [String] :filter_name Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the &#39;displayName&#39; field.
215
+ # @return [ClusterList]
216
+ def clusters_get(opts = {})
217
+ data, _status_code, _headers = clusters_get_with_http_info(opts)
218
+ data
219
+ end
220
+
221
+ # List clusters
222
+ # Retrieves a list of PostgreSQL clusters.
223
+ # @param [Hash] opts the optional parameters
224
+ # @option opts [String] :filter_name Response filter to list only the PostgreSQL clusters that contain the specified name. The value is case insensitive and matched on the &#39;displayName&#39; field.
225
+ # @return [Array<(ClusterList, Integer, Hash)>] ClusterList data, response status code and response headers
226
+ def clusters_get_with_http_info(opts = {})
227
+ if @api_client.config.debugging
228
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_get ...'
229
+ end
230
+ # resource path
231
+ local_var_path = '/clusters'
232
+
233
+ # query parameters
234
+ query_params = opts[:query_params] || {}
235
+ query_params[:'filter.name'] = opts[:'filter_name'] if !opts[:'filter_name'].nil?
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
+
242
+ # form parameters
243
+ form_params = opts[:form_params] || {}
244
+
245
+ # http body (model)
246
+ post_body = opts[:debug_body]
247
+
248
+ # return_type
249
+ return_type = opts[:debug_return_type] || 'ClusterList'
250
+
251
+ # auth_names
252
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
253
+
254
+ new_options = opts.merge(
255
+ :operation => :"ClustersApi.clusters_get",
256
+ :header_params => header_params,
257
+ :query_params => query_params,
258
+ :form_params => form_params,
259
+ :body => post_body,
260
+ :auth_names => auth_names,
261
+ :return_type => return_type
262
+ )
263
+
264
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
265
+ if @api_client.config.debugging
266
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
267
+ end
268
+ return data, status_code, headers
269
+ end
270
+
271
+ # Patch a cluster
272
+ # Patch attributes of a PostgreSQL cluster.
273
+ # @param cluster_id [String] The unique ID of the cluster.
274
+ # @param patch_cluster_request [PatchClusterRequest] The modified cluster.
275
+ # @param [Hash] opts the optional parameters
276
+ # @return [ClusterResponse]
277
+ def clusters_patch(cluster_id, patch_cluster_request, opts = {})
278
+ data, _status_code, _headers = clusters_patch_with_http_info(cluster_id, patch_cluster_request, opts)
279
+ data
280
+ end
281
+
282
+ # Patch a cluster
283
+ # Patch attributes of a PostgreSQL cluster.
284
+ # @param cluster_id [String] The unique ID of the cluster.
285
+ # @param patch_cluster_request [PatchClusterRequest] The modified cluster.
286
+ # @param [Hash] opts the optional parameters
287
+ # @return [Array<(ClusterResponse, Integer, Hash)>] ClusterResponse data, response status code and response headers
288
+ def clusters_patch_with_http_info(cluster_id, patch_cluster_request, opts = {})
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_patch ...'
291
+ end
292
+ # verify the required parameter 'cluster_id' is set
293
+ if @api_client.config.client_side_validation && cluster_id.nil?
294
+ fail ArgumentError, "Missing the required parameter 'cluster_id' when calling ClustersApi.clusters_patch"
295
+ end
296
+ # verify the required parameter 'patch_cluster_request' is set
297
+ if @api_client.config.client_side_validation && patch_cluster_request.nil?
298
+ fail ArgumentError, "Missing the required parameter 'patch_cluster_request' when calling ClustersApi.clusters_patch"
299
+ end
300
+ # resource path
301
+ local_var_path = '/clusters/{clusterId}'.sub('{' + 'clusterId' + '}', CGI.escape(cluster_id.to_s))
302
+
303
+ # query parameters
304
+ query_params = opts[:query_params] || {}
305
+
306
+ # header parameters
307
+ header_params = opts[:header_params] || {}
308
+ # HTTP header 'Accept' (if needed)
309
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
310
+ # HTTP header 'Content-Type'
311
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
312
+
313
+ # form parameters
314
+ form_params = opts[:form_params] || {}
315
+
316
+ # http body (model)
317
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_cluster_request)
318
+
319
+ # return_type
320
+ return_type = opts[:debug_return_type] || 'ClusterResponse'
321
+
322
+ # auth_names
323
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
324
+
325
+ new_options = opts.merge(
326
+ :operation => :"ClustersApi.clusters_patch",
327
+ :header_params => header_params,
328
+ :query_params => query_params,
329
+ :form_params => form_params,
330
+ :body => post_body,
331
+ :auth_names => auth_names,
332
+ :return_type => return_type
333
+ )
334
+
335
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
336
+ if @api_client.config.debugging
337
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
338
+ end
339
+ return data, status_code, headers
340
+ end
341
+
342
+ # Create a cluster
343
+ # Creates a new PostgreSQL cluster. If the `fromBackup` field is populated, the new cluster will be created based on the given backup.
344
+ # @param create_cluster_request [CreateClusterRequest] The cluster to be created.
345
+ # @param [Hash] opts the optional parameters
346
+ # @return [ClusterResponse]
347
+ def clusters_post(create_cluster_request, opts = {})
348
+ data, _status_code, _headers = clusters_post_with_http_info(create_cluster_request, opts)
349
+ data
350
+ end
351
+
352
+ # Create a cluster
353
+ # Creates a new PostgreSQL cluster. If the &#x60;fromBackup&#x60; field is populated, the new cluster will be created based on the given backup.
354
+ # @param create_cluster_request [CreateClusterRequest] The cluster to be created.
355
+ # @param [Hash] opts the optional parameters
356
+ # @return [Array<(ClusterResponse, Integer, Hash)>] ClusterResponse data, response status code and response headers
357
+ def clusters_post_with_http_info(create_cluster_request, opts = {})
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug 'Calling API: ClustersApi.clusters_post ...'
360
+ end
361
+ # verify the required parameter 'create_cluster_request' is set
362
+ if @api_client.config.client_side_validation && create_cluster_request.nil?
363
+ fail ArgumentError, "Missing the required parameter 'create_cluster_request' when calling ClustersApi.clusters_post"
364
+ end
365
+ # resource path
366
+ local_var_path = '/clusters'
367
+
368
+ # query parameters
369
+ query_params = opts[:query_params] || {}
370
+
371
+ # header parameters
372
+ header_params = opts[:header_params] || {}
373
+ # HTTP header 'Accept' (if needed)
374
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
375
+ # HTTP header 'Content-Type'
376
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
377
+
378
+ # form parameters
379
+ form_params = opts[:form_params] || {}
380
+
381
+ # http body (model)
382
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_cluster_request)
383
+
384
+ # return_type
385
+ return_type = opts[:debug_return_type] || 'ClusterResponse'
386
+
387
+ # auth_names
388
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
389
+
390
+ new_options = opts.merge(
391
+ :operation => :"ClustersApi.clusters_post",
392
+ :header_params => header_params,
393
+ :query_params => query_params,
394
+ :form_params => form_params,
395
+ :body => post_body,
396
+ :auth_names => auth_names,
397
+ :return_type => return_type
398
+ )
399
+
400
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
401
+ if @api_client.config.debugging
402
+ @api_client.config.logger.debug "API called: ClustersApi#clusters_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
403
+ end
404
+ return data, status_code, headers
405
+ end
406
+
407
+ # List PostgreSQL versions
408
+ # Retrieves a list of all available PostgreSQL versions.
409
+ # @param [Hash] opts the optional parameters
410
+ # @return [PostgresVersionList]
411
+ def postgres_versions_get(opts = {})
412
+ data, _status_code, _headers = postgres_versions_get_with_http_info(opts)
413
+ data
414
+ end
415
+
416
+ # List PostgreSQL versions
417
+ # Retrieves a list of all available PostgreSQL versions.
418
+ # @param [Hash] opts the optional parameters
419
+ # @return [Array<(PostgresVersionList, Integer, Hash)>] PostgresVersionList data, response status code and response headers
420
+ def postgres_versions_get_with_http_info(opts = {})
421
+ if @api_client.config.debugging
422
+ @api_client.config.logger.debug 'Calling API: ClustersApi.postgres_versions_get ...'
423
+ end
424
+ # resource path
425
+ local_var_path = '/clusters/postgresversions'
426
+
427
+ # query parameters
428
+ query_params = opts[:query_params] || {}
429
+
430
+ # header parameters
431
+ header_params = opts[:header_params] || {}
432
+ # HTTP header 'Accept' (if needed)
433
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
434
+
435
+ # form parameters
436
+ form_params = opts[:form_params] || {}
437
+
438
+ # http body (model)
439
+ post_body = opts[:debug_body]
440
+
441
+ # return_type
442
+ return_type = opts[:debug_return_type] || 'PostgresVersionList'
443
+
444
+ # auth_names
445
+ auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']
446
+
447
+ new_options = opts.merge(
448
+ :operation => :"ClustersApi.postgres_versions_get",
449
+ :header_params => header_params,
450
+ :query_params => query_params,
451
+ :form_params => form_params,
452
+ :body => post_body,
453
+ :auth_names => auth_names,
454
+ :return_type => return_type
455
+ )
456
+
457
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
458
+ if @api_client.config.debugging
459
+ @api_client.config.logger.debug "API called: ClustersApi#postgres_versions_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
460
+ end
461
+ return data, status_code, headers
462
+ end
463
+ end
464
+ end