oci 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/oci.rb +8 -0
  4. data/lib/oci/api_client.rb +11 -5
  5. data/lib/oci/config.rb +3 -2
  6. data/lib/oci/config_file_loader.rb +5 -5
  7. data/lib/oci/core/blockstorage_client.rb +1 -1
  8. data/lib/oci/core/compute_client.rb +58 -4
  9. data/lib/oci/core/core.rb +1 -0
  10. data/lib/oci/core/models/capture_console_history_details.rb +13 -1
  11. data/lib/oci/core/models/create_instance_console_connection_details.rb +2 -2
  12. data/lib/oci/core/models/create_vnic_details.rb +18 -1
  13. data/lib/oci/core/models/create_volume_details.rb +14 -1
  14. data/lib/oci/core/models/instance_console_connection.rb +6 -6
  15. data/lib/oci/core/models/route_rule.rb +4 -1
  16. data/lib/oci/core/models/update_console_history_details.rb +121 -0
  17. data/lib/oci/core/models/update_vnic_details.rb +21 -4
  18. data/lib/oci/core/models/vnic.rb +18 -1
  19. data/lib/oci/core/models/volume.rb +13 -2
  20. data/lib/oci/core/models/volume_backup.rb +29 -2
  21. data/lib/oci/core/virtual_network_client.rb +7 -1
  22. data/lib/oci/database/database.rb +43 -0
  23. data/lib/oci/database/database_client.rb +1246 -0
  24. data/lib/oci/database/models/create_data_guard_association_details.rb +225 -0
  25. data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +138 -0
  26. data/lib/oci/database/models/create_database_details.rb +194 -0
  27. data/lib/oci/database/models/create_db_home_details.rb +141 -0
  28. data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +152 -0
  29. data/lib/oci/database/models/data_guard_association.rb +374 -0
  30. data/lib/oci/database/models/database.rb +261 -0
  31. data/lib/oci/database/models/database_summary.rb +261 -0
  32. data/lib/oci/database/models/db_home.rb +216 -0
  33. data/lib/oci/database/models/db_home_summary.rb +216 -0
  34. data/lib/oci/database/models/db_node.rb +220 -0
  35. data/lib/oci/database/models/db_node_summary.rb +220 -0
  36. data/lib/oci/database/models/db_system.rb +518 -0
  37. data/lib/oci/database/models/db_system_shape_summary.rb +142 -0
  38. data/lib/oci/database/models/db_system_summary.rb +518 -0
  39. data/lib/oci/database/models/db_version_summary.rb +131 -0
  40. data/lib/oci/database/models/failover_data_guard_association_details.rb +120 -0
  41. data/lib/oci/database/models/launch_db_system_details.rb +394 -0
  42. data/lib/oci/database/models/patch.rb +247 -0
  43. data/lib/oci/database/models/patch_details.rb +144 -0
  44. data/lib/oci/database/models/patch_history_entry.rb +218 -0
  45. data/lib/oci/database/models/patch_history_entry_summary.rb +218 -0
  46. data/lib/oci/database/models/patch_summary.rb +247 -0
  47. data/lib/oci/database/models/reinstate_data_guard_association_details.rb +120 -0
  48. data/lib/oci/database/models/switchover_data_guard_association_details.rb +120 -0
  49. data/lib/oci/database/models/update_db_home_details.rb +119 -0
  50. data/lib/oci/database/models/update_db_system_details.rb +153 -0
  51. data/lib/oci/database/util.rb +1 -0
  52. data/lib/oci/errors.rb +3 -4
  53. data/lib/oci/regions.rb +4 -2
  54. data/lib/oci/response_headers.rb +0 -1
  55. data/lib/oci/signer.rb +8 -7
  56. data/lib/oci/version.rb +1 -1
  57. data/lib/oraclebmc.rb +3 -1
  58. metadata +33 -2
@@ -0,0 +1,1246 @@
1
+ # Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require "uri"
4
+ require "logger"
5
+
6
+ module OCI
7
+
8
+ class Database::DatabaseClient
9
+
10
+ # Client used to make HTTP requests.
11
+ # @return [OCI::ApiClient]
12
+ attr_reader :api_client
13
+
14
+ # Fully qualified endpoint URL
15
+ # @return [String]
16
+ attr_reader :endpoint
17
+
18
+ # The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
19
+ # @return [String]
20
+ attr_accessor :region
21
+
22
+ # Creates a new DatabaseClient.
23
+ # If a config is not specified, then the global OCI.config will be used.
24
+ #
25
+ # A region must be specified in either the config or the region parameter. If specified
26
+ # in both, then the region parameter will be used.
27
+ #
28
+ # @param [Config] config A Config object.
29
+ # @param [String] region A region used to determine the service endpoint. This will usually
30
+ # correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
31
+ #
32
+ def initialize(config:nil, region:nil)
33
+ config ||= OCI.config
34
+ config.validate
35
+
36
+ signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content, signing_strategy: Signer::OBJECT_STORAGE)
37
+ @api_client = ApiClient.new(config, signer)
38
+
39
+ region ||= config.region
40
+ self.region = region
41
+ end
42
+
43
+ # Set the region that will be used to determine the service endpoint.
44
+ # This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
45
+ # but may be an arbitrary string.
46
+ def region=(r)
47
+ @region = r
48
+
49
+ fail 'A region must be specified.' unless @region
50
+
51
+ @endpoint = OCI::Regions.get_service_endpoint(@region, :DatabaseClient) + '/20160918'
52
+ logger.info "DatabaseClient endpoint set to '#{endpoint}'." if logger
53
+ end
54
+
55
+ # @return [Logger] The logger for this client. May be nil.
56
+ def logger
57
+ @api_client.config.logger
58
+ end
59
+
60
+
61
+ # Creates a new Data Guard association. A Data Guard association represents the replication relationship between the
62
+ # specified database and a peer database. For more information, see [Using Oracle Data Guard](https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Tasks/usingdataguard.htm).
63
+ #
64
+ # All Oracle Bare Metal Cloud Services resources, including Data Guard associations, get an Oracle-assigned, unique ID
65
+ # called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response.
66
+ # You can also retrieve a resource's OCID by using a List API operation on that resource type, or by viewing the
67
+ # resource in the Console. Fore more information, see
68
+ # [Resource Identifiers](http://localhost:8000/Content/General/Concepts/identifiers.htm).
69
+ #
70
+ # @param [String] database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
71
+ # @param [CreateDataGuardAssociationDetails] create_data_guard_association_details A request to create a Data Guard association.
72
+ # @param [Hash] opts the optional parameters
73
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
74
+ # server error without risk of executing that same action again. Retry tokens expire after 24
75
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
76
+ # has been deleted and purged from the system, then a retry of the original creation request
77
+ # may be rejected).
78
+ #
79
+ # @return [Response] A Response object with data of type OCI::Database::Models::DataGuardAssociation
80
+ def create_data_guard_association(database_id, create_data_guard_association_details, opts = {})
81
+ logger.debug "Calling operation DatabaseClient#create_data_guard_association." if logger
82
+
83
+ fail "Missing the required parameter 'database_id' when calling create_data_guard_association." if database_id.nil?
84
+ fail "Missing the required parameter 'create_data_guard_association_details' when calling create_data_guard_association." if create_data_guard_association_details.nil?
85
+
86
+ path = "/databases/{databaseId}/dataGuardAssociations".sub('{databaseId}', database_id.to_s)
87
+
88
+ # Query Params
89
+ query_params = {}
90
+
91
+ # Header Params
92
+ header_params = {}
93
+ header_params['accept'] = 'application/json'
94
+ header_params['content-type'] = 'application/json'
95
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
96
+
97
+ post_body = @api_client.object_to_http_body(create_data_guard_association_details)
98
+
99
+ return @api_client.call_api(
100
+ :POST,
101
+ path,
102
+ endpoint,
103
+ :header_params => header_params,
104
+ :query_params => query_params,
105
+ :body => post_body,
106
+ :return_type => 'OCI::Database::Models::DataGuardAssociation')
107
+ end
108
+
109
+ # Creates a new DB Home in the specified DB System based on the request parameters you provide.
110
+ #
111
+ # @param [CreateDbHomeWithDbSystemIdDetails] create_db_home_with_db_system_id_details Request to create a new DB Home.
112
+ # @param [Hash] opts the optional parameters
113
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
114
+ # server error without risk of executing that same action again. Retry tokens expire after 24
115
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
116
+ # has been deleted and purged from the system, then a retry of the original creation request
117
+ # may be rejected).
118
+ #
119
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbHome
120
+ def create_db_home(create_db_home_with_db_system_id_details, opts = {})
121
+ logger.debug "Calling operation DatabaseClient#create_db_home." if logger
122
+
123
+ fail "Missing the required parameter 'create_db_home_with_db_system_id_details' when calling create_db_home." if create_db_home_with_db_system_id_details.nil?
124
+
125
+ path = "/dbHomes"
126
+
127
+ # Query Params
128
+ query_params = {}
129
+
130
+ # Header Params
131
+ header_params = {}
132
+ header_params['accept'] = 'application/json'
133
+ header_params['content-type'] = 'application/json'
134
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
135
+
136
+ post_body = @api_client.object_to_http_body(create_db_home_with_db_system_id_details)
137
+
138
+ return @api_client.call_api(
139
+ :POST,
140
+ path,
141
+ endpoint,
142
+ :header_params => header_params,
143
+ :query_params => query_params,
144
+ :body => post_body,
145
+ :return_type => 'OCI::Database::Models::DbHome')
146
+ end
147
+
148
+ # Performs an action, such as one of the power actions (start, stop, softreset, or reset), on the specified DB Node.
149
+ #
150
+ # **start** - power on
151
+ #
152
+ # **stop** - power off
153
+ #
154
+ # **softreset** - ACPI shutdown and power on
155
+ #
156
+ # **reset** - power off and power on
157
+ #
158
+ # Note that the **stop** state has no effect on the resources you consume.
159
+ # Billing continues for DB Nodes that you stop, and related resources continue
160
+ # to apply against any relevant quotas. You must terminate the DB System
161
+ # ({#terminate_db_system terminate_db_system})
162
+ # to remove its resources from billing and quotas.
163
+ #
164
+ # @param [String] db_node_id The database node [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
165
+ # @param [String] action The action to perform on the DB Node.
166
+ # @param [Hash] opts the optional parameters
167
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
168
+ # server error without risk of executing that same action again. Retry tokens expire after 24
169
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
170
+ # has been deleted and purged from the system, then a retry of the original creation request
171
+ # may be rejected).
172
+ #
173
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
174
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
175
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
176
+ #
177
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbNode
178
+ def db_node_action(db_node_id, action, opts = {})
179
+ logger.debug "Calling operation DatabaseClient#db_node_action." if logger
180
+
181
+ fail "Missing the required parameter 'db_node_id' when calling db_node_action." if db_node_id.nil?
182
+ fail "Missing the required parameter 'action' when calling db_node_action." if action.nil?
183
+ unless ['STOP', 'START', 'SOFTRESET', 'RESET'].include?(action)
184
+ fail "Invalid value for 'action', must be one of STOP, START, SOFTRESET, RESET."
185
+ end
186
+
187
+ path = "/dbNodes/{dbNodeId}".sub('{dbNodeId}', db_node_id.to_s)
188
+
189
+ # Query Params
190
+ query_params = {}
191
+ query_params[:'action'] = action
192
+
193
+ # Header Params
194
+ header_params = {}
195
+ header_params['accept'] = 'application/json'
196
+ header_params['content-type'] = 'application/json'
197
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
198
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
199
+
200
+ post_body = nil
201
+
202
+ return @api_client.call_api(
203
+ :POST,
204
+ path,
205
+ endpoint,
206
+ :header_params => header_params,
207
+ :query_params => query_params,
208
+ :body => post_body,
209
+ :return_type => 'OCI::Database::Models::DbNode')
210
+ end
211
+
212
+ # Deletes a DB Home. The DB Home and its database data are local to the DB System and will be lost when it is deleted. Oracle recommends that you back up any data in the DB System prior to deleting it.
213
+ #
214
+ # @param [String] db_home_id The database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
215
+ # @param [Hash] opts the optional parameters
216
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
217
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
218
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
219
+ #
220
+ # @return [Response] A Response object with data of type nil
221
+ def delete_db_home(db_home_id, opts = {})
222
+ logger.debug "Calling operation DatabaseClient#delete_db_home." if logger
223
+
224
+ fail "Missing the required parameter 'db_home_id' when calling delete_db_home." if db_home_id.nil?
225
+
226
+ path = "/dbHomes/{dbHomeId}".sub('{dbHomeId}', db_home_id.to_s)
227
+
228
+ # Query Params
229
+ query_params = {}
230
+
231
+ # Header Params
232
+ header_params = {}
233
+ header_params['accept'] = 'application/json'
234
+ header_params['content-type'] = 'application/json'
235
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
236
+
237
+ post_body = nil
238
+
239
+ return @api_client.call_api(
240
+ :DELETE,
241
+ path,
242
+ endpoint,
243
+ :header_params => header_params,
244
+ :query_params => query_params,
245
+ :body => post_body)
246
+ end
247
+
248
+ # Performs a failover to transition the standby database identified by the `databaseId` parameter into the
249
+ # specified Data Guard association's primary role after the existing primary database fails or becomes unreachable.
250
+ #
251
+ # A failover might result in data loss depending on the protection mode in effect at the time of the primary
252
+ # database failure.
253
+ #
254
+ # @param [String] database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
255
+ # @param [String] data_guard_association_id The Data Guard association's [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
256
+ # @param [FailoverDataGuardAssociationDetails] failover_data_guard_association_details A request to perform a failover, transitioning a standby database into a primary database.
257
+ # @param [Hash] opts the optional parameters
258
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
259
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
260
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
261
+ #
262
+ # @return [Response] A Response object with data of type OCI::Database::Models::DataGuardAssociation
263
+ def failover_data_guard_association(database_id, data_guard_association_id, failover_data_guard_association_details, opts = {})
264
+ logger.debug "Calling operation DatabaseClient#failover_data_guard_association." if logger
265
+
266
+ fail "Missing the required parameter 'database_id' when calling failover_data_guard_association." if database_id.nil?
267
+ fail "Missing the required parameter 'data_guard_association_id' when calling failover_data_guard_association." if data_guard_association_id.nil?
268
+ fail "Missing the required parameter 'failover_data_guard_association_details' when calling failover_data_guard_association." if failover_data_guard_association_details.nil?
269
+
270
+ path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/failover".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)
271
+
272
+ # Query Params
273
+ query_params = {}
274
+
275
+ # Header Params
276
+ header_params = {}
277
+ header_params['accept'] = 'application/json'
278
+ header_params['content-type'] = 'application/json'
279
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
280
+
281
+ post_body = @api_client.object_to_http_body(failover_data_guard_association_details)
282
+
283
+ return @api_client.call_api(
284
+ :POST,
285
+ path,
286
+ endpoint,
287
+ :header_params => header_params,
288
+ :query_params => query_params,
289
+ :body => post_body,
290
+ :return_type => 'OCI::Database::Models::DataGuardAssociation')
291
+ end
292
+
293
+ # Gets the specified Data Guard association's configuration information.
294
+ #
295
+ # @param [String] database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
296
+ # @param [String] data_guard_association_id The Data Guard association's [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
297
+ # @param [Hash] opts the optional parameters
298
+ # @return [Response] A Response object with data of type OCI::Database::Models::DataGuardAssociation
299
+ def get_data_guard_association(database_id, data_guard_association_id, opts = {})
300
+ logger.debug "Calling operation DatabaseClient#get_data_guard_association." if logger
301
+
302
+ fail "Missing the required parameter 'database_id' when calling get_data_guard_association." if database_id.nil?
303
+ fail "Missing the required parameter 'data_guard_association_id' when calling get_data_guard_association." if data_guard_association_id.nil?
304
+
305
+ path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)
306
+
307
+ # Query Params
308
+ query_params = {}
309
+
310
+ # Header Params
311
+ header_params = {}
312
+ header_params['accept'] = 'application/json'
313
+ header_params['content-type'] = 'application/json'
314
+
315
+ post_body = nil
316
+
317
+ return @api_client.call_api(
318
+ :GET,
319
+ path,
320
+ endpoint,
321
+ :header_params => header_params,
322
+ :query_params => query_params,
323
+ :body => post_body,
324
+ :return_type => 'OCI::Database::Models::DataGuardAssociation')
325
+ end
326
+
327
+ # Gets information about a specific database.
328
+ # @param [String] database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
329
+ # @param [Hash] opts the optional parameters
330
+ # @return [Response] A Response object with data of type OCI::Database::Models::Database
331
+ def get_database(database_id, opts = {})
332
+ logger.debug "Calling operation DatabaseClient#get_database." if logger
333
+
334
+ fail "Missing the required parameter 'database_id' when calling get_database." if database_id.nil?
335
+
336
+ path = "/databases/{databaseId}".sub('{databaseId}', database_id.to_s)
337
+
338
+ # Query Params
339
+ query_params = {}
340
+
341
+ # Header Params
342
+ header_params = {}
343
+ header_params['accept'] = 'application/json'
344
+ header_params['content-type'] = 'application/json'
345
+
346
+ post_body = nil
347
+
348
+ return @api_client.call_api(
349
+ :GET,
350
+ path,
351
+ endpoint,
352
+ :header_params => header_params,
353
+ :query_params => query_params,
354
+ :body => post_body,
355
+ :return_type => 'OCI::Database::Models::Database')
356
+ end
357
+
358
+ # Gets information about the specified database home.
359
+ # @param [String] db_home_id The database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
360
+ # @param [Hash] opts the optional parameters
361
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbHome
362
+ def get_db_home(db_home_id, opts = {})
363
+ logger.debug "Calling operation DatabaseClient#get_db_home." if logger
364
+
365
+ fail "Missing the required parameter 'db_home_id' when calling get_db_home." if db_home_id.nil?
366
+
367
+ path = "/dbHomes/{dbHomeId}".sub('{dbHomeId}', db_home_id.to_s)
368
+
369
+ # Query Params
370
+ query_params = {}
371
+
372
+ # Header Params
373
+ header_params = {}
374
+ header_params['accept'] = 'application/json'
375
+ header_params['content-type'] = 'application/json'
376
+
377
+ post_body = nil
378
+
379
+ return @api_client.call_api(
380
+ :GET,
381
+ path,
382
+ endpoint,
383
+ :header_params => header_params,
384
+ :query_params => query_params,
385
+ :body => post_body,
386
+ :return_type => 'OCI::Database::Models::DbHome')
387
+ end
388
+
389
+ # Gets information about a specified patch package.
390
+ #
391
+ # @param [String] db_home_id The database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
392
+ # @param [String] patch_id The OCID of the patch.
393
+ # @param [Hash] opts the optional parameters
394
+ # @return [Response] A Response object with data of type OCI::Database::Models::Patch
395
+ def get_db_home_patch(db_home_id, patch_id, opts = {})
396
+ logger.debug "Calling operation DatabaseClient#get_db_home_patch." if logger
397
+
398
+ fail "Missing the required parameter 'db_home_id' when calling get_db_home_patch." if db_home_id.nil?
399
+ fail "Missing the required parameter 'patch_id' when calling get_db_home_patch." if patch_id.nil?
400
+
401
+ path = "/dbHomes/{dbHomeId}/patches/{patchId}".sub('{dbHomeId}', db_home_id.to_s).sub('{patchId}', patch_id.to_s)
402
+
403
+ # Query Params
404
+ query_params = {}
405
+
406
+ # Header Params
407
+ header_params = {}
408
+ header_params['accept'] = 'application/json'
409
+ header_params['content-type'] = 'application/json'
410
+
411
+ post_body = nil
412
+
413
+ return @api_client.call_api(
414
+ :GET,
415
+ path,
416
+ endpoint,
417
+ :header_params => header_params,
418
+ :query_params => query_params,
419
+ :body => post_body,
420
+ :return_type => 'OCI::Database::Models::Patch')
421
+ end
422
+
423
+ # Gets the patch history details for the specified patchHistoryEntryId
424
+ #
425
+ # @param [String] db_home_id The database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
426
+ # @param [String] patch_history_entry_id The OCID of the patch history entry.
427
+ # @param [Hash] opts the optional parameters
428
+ # @return [Response] A Response object with data of type OCI::Database::Models::PatchHistoryEntry
429
+ def get_db_home_patch_history_entry(db_home_id, patch_history_entry_id, opts = {})
430
+ logger.debug "Calling operation DatabaseClient#get_db_home_patch_history_entry." if logger
431
+
432
+ fail "Missing the required parameter 'db_home_id' when calling get_db_home_patch_history_entry." if db_home_id.nil?
433
+ fail "Missing the required parameter 'patch_history_entry_id' when calling get_db_home_patch_history_entry." if patch_history_entry_id.nil?
434
+
435
+ path = "/dbHomes/{dbHomeId}/patchHistoryEntries/{patchHistoryEntryId}".sub('{dbHomeId}', db_home_id.to_s).sub('{patchHistoryEntryId}', patch_history_entry_id.to_s)
436
+
437
+ # Query Params
438
+ query_params = {}
439
+
440
+ # Header Params
441
+ header_params = {}
442
+ header_params['accept'] = 'application/json'
443
+ header_params['content-type'] = 'application/json'
444
+
445
+ post_body = nil
446
+
447
+ return @api_client.call_api(
448
+ :GET,
449
+ path,
450
+ endpoint,
451
+ :header_params => header_params,
452
+ :query_params => query_params,
453
+ :body => post_body,
454
+ :return_type => 'OCI::Database::Models::PatchHistoryEntry')
455
+ end
456
+
457
+ # Gets information about the specified database node.
458
+ # @param [String] db_node_id The database node [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
459
+ # @param [Hash] opts the optional parameters
460
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbNode
461
+ def get_db_node(db_node_id, opts = {})
462
+ logger.debug "Calling operation DatabaseClient#get_db_node." if logger
463
+
464
+ fail "Missing the required parameter 'db_node_id' when calling get_db_node." if db_node_id.nil?
465
+
466
+ path = "/dbNodes/{dbNodeId}".sub('{dbNodeId}', db_node_id.to_s)
467
+
468
+ # Query Params
469
+ query_params = {}
470
+
471
+ # Header Params
472
+ header_params = {}
473
+ header_params['accept'] = 'application/json'
474
+ header_params['content-type'] = 'application/json'
475
+
476
+ post_body = nil
477
+
478
+ return @api_client.call_api(
479
+ :GET,
480
+ path,
481
+ endpoint,
482
+ :header_params => header_params,
483
+ :query_params => query_params,
484
+ :body => post_body,
485
+ :return_type => 'OCI::Database::Models::DbNode')
486
+ end
487
+
488
+ # Gets information about the specified DB System.
489
+ # @param [String] db_system_id The DB System [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
490
+ # @param [Hash] opts the optional parameters
491
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbSystem
492
+ def get_db_system(db_system_id, opts = {})
493
+ logger.debug "Calling operation DatabaseClient#get_db_system." if logger
494
+
495
+ fail "Missing the required parameter 'db_system_id' when calling get_db_system." if db_system_id.nil?
496
+
497
+ path = "/dbSystems/{dbSystemId}".sub('{dbSystemId}', db_system_id.to_s)
498
+
499
+ # Query Params
500
+ query_params = {}
501
+
502
+ # Header Params
503
+ header_params = {}
504
+ header_params['accept'] = 'application/json'
505
+ header_params['content-type'] = 'application/json'
506
+
507
+ post_body = nil
508
+
509
+ return @api_client.call_api(
510
+ :GET,
511
+ path,
512
+ endpoint,
513
+ :header_params => header_params,
514
+ :query_params => query_params,
515
+ :body => post_body,
516
+ :return_type => 'OCI::Database::Models::DbSystem')
517
+ end
518
+
519
+ # Gets information about a specified patch package.
520
+ #
521
+ # @param [String] db_system_id The DB System [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
522
+ # @param [String] patch_id The OCID of the patch.
523
+ # @param [Hash] opts the optional parameters
524
+ # @return [Response] A Response object with data of type OCI::Database::Models::Patch
525
+ def get_db_system_patch(db_system_id, patch_id, opts = {})
526
+ logger.debug "Calling operation DatabaseClient#get_db_system_patch." if logger
527
+
528
+ fail "Missing the required parameter 'db_system_id' when calling get_db_system_patch." if db_system_id.nil?
529
+ fail "Missing the required parameter 'patch_id' when calling get_db_system_patch." if patch_id.nil?
530
+
531
+ path = "/dbSystems/{dbSystemId}/patches/{patchId}".sub('{dbSystemId}', db_system_id.to_s).sub('{patchId}', patch_id.to_s)
532
+
533
+ # Query Params
534
+ query_params = {}
535
+
536
+ # Header Params
537
+ header_params = {}
538
+ header_params['accept'] = 'application/json'
539
+ header_params['content-type'] = 'application/json'
540
+
541
+ post_body = nil
542
+
543
+ return @api_client.call_api(
544
+ :GET,
545
+ path,
546
+ endpoint,
547
+ :header_params => header_params,
548
+ :query_params => query_params,
549
+ :body => post_body,
550
+ :return_type => 'OCI::Database::Models::Patch')
551
+ end
552
+
553
+ # Gets the patch history details for the specified patchHistoryEntryId.
554
+ #
555
+ # @param [String] db_system_id The DB System [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
556
+ # @param [String] patch_history_entry_id The OCID of the patch history entry.
557
+ # @param [Hash] opts the optional parameters
558
+ # @return [Response] A Response object with data of type OCI::Database::Models::PatchHistoryEntry
559
+ def get_db_system_patch_history_entry(db_system_id, patch_history_entry_id, opts = {})
560
+ logger.debug "Calling operation DatabaseClient#get_db_system_patch_history_entry." if logger
561
+
562
+ fail "Missing the required parameter 'db_system_id' when calling get_db_system_patch_history_entry." if db_system_id.nil?
563
+ fail "Missing the required parameter 'patch_history_entry_id' when calling get_db_system_patch_history_entry." if patch_history_entry_id.nil?
564
+
565
+ path = "/dbSystems/{dbSystemId}/patchHistoryEntries/{patchHistoryEntryId}".sub('{dbSystemId}', db_system_id.to_s).sub('{patchHistoryEntryId}', patch_history_entry_id.to_s)
566
+
567
+ # Query Params
568
+ query_params = {}
569
+
570
+ # Header Params
571
+ header_params = {}
572
+ header_params['accept'] = 'application/json'
573
+ header_params['content-type'] = 'application/json'
574
+
575
+ post_body = nil
576
+
577
+ return @api_client.call_api(
578
+ :GET,
579
+ path,
580
+ endpoint,
581
+ :header_params => header_params,
582
+ :query_params => query_params,
583
+ :body => post_body,
584
+ :return_type => 'OCI::Database::Models::PatchHistoryEntry')
585
+ end
586
+
587
+ # Launches a new DB System in the specified compartment and Availability Domain. You'll specify a single Oracle
588
+ # Database Edition that applies to all the databases on that DB System. The selected edition cannot be changed.
589
+ #
590
+ # An initial database is created on the DB System based on the request parameters you provide and some default
591
+ # options. For more information,
592
+ # see [Default Options for the Initial Database](https://docs.us-phoenix-1.oraclecloud.com/Content/Database/Tasks/launchingDB.htm#Default_Options_for_the_Initial_Database).
593
+ #
594
+ # The DB System will include a command line interface (CLI) that you can use to create additional databases and
595
+ # manage existing databases. For more information, see the
596
+ # [Oracle Database CLI Reference](https://docs.us-phoenix-1.oraclecloud.com/Content/Database/References/odacli.htm#Oracle_Database_CLI_Reference).
597
+ #
598
+ # @param [LaunchDbSystemDetails] launch_db_system_details Request to launch a DB System.
599
+ # @param [Hash] opts the optional parameters
600
+ # @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
601
+ # server error without risk of executing that same action again. Retry tokens expire after 24
602
+ # hours, but can be invalidated before then due to conflicting operations (for example, if a resource
603
+ # has been deleted and purged from the system, then a retry of the original creation request
604
+ # may be rejected).
605
+ #
606
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbSystem
607
+ def launch_db_system(launch_db_system_details, opts = {})
608
+ logger.debug "Calling operation DatabaseClient#launch_db_system." if logger
609
+
610
+ fail "Missing the required parameter 'launch_db_system_details' when calling launch_db_system." if launch_db_system_details.nil?
611
+
612
+ path = "/dbSystems"
613
+
614
+ # Query Params
615
+ query_params = {}
616
+
617
+ # Header Params
618
+ header_params = {}
619
+ header_params['accept'] = 'application/json'
620
+ header_params['content-type'] = 'application/json'
621
+ header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
622
+
623
+ post_body = @api_client.object_to_http_body(launch_db_system_details)
624
+
625
+ return @api_client.call_api(
626
+ :POST,
627
+ path,
628
+ endpoint,
629
+ :header_params => header_params,
630
+ :query_params => query_params,
631
+ :body => post_body,
632
+ :return_type => 'OCI::Database::Models::DbSystem')
633
+ end
634
+
635
+ # Lists all Data Guard associations for the specified database.
636
+ #
637
+ # @param [String] database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
638
+ # @param [Hash] opts the optional parameters
639
+ # @option opts [Integer] :limit The maximum number of items to return.
640
+ # @option opts [String] :page The pagination token to continue listing from.
641
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::DataGuardAssociation>
642
+ def list_data_guard_associations(database_id, opts = {})
643
+ logger.debug "Calling operation DatabaseClient#list_data_guard_associations." if logger
644
+
645
+ fail "Missing the required parameter 'database_id' when calling list_data_guard_associations." if database_id.nil?
646
+
647
+ path = "/databases/{databaseId}/dataGuardAssociations".sub('{databaseId}', database_id.to_s)
648
+
649
+ # Query Params
650
+ query_params = {}
651
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
652
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
653
+
654
+ # Header Params
655
+ header_params = {}
656
+ header_params['accept'] = 'application/json'
657
+ header_params['content-type'] = 'application/json'
658
+
659
+ post_body = nil
660
+
661
+ return @api_client.call_api(
662
+ :GET,
663
+ path,
664
+ endpoint,
665
+ :header_params => header_params,
666
+ :query_params => query_params,
667
+ :body => post_body,
668
+ :return_type => 'Array<OCI::Database::Models::DataGuardAssociation>')
669
+ end
670
+
671
+ # Gets a list of the databases in the specified database home.
672
+ #
673
+ # @param [String] compartment_id The compartment [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
674
+ # @param [String] db_home_id A database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
675
+ # @param [Hash] opts the optional parameters
676
+ # @option opts [Integer] :limit The maximum number of items to return.
677
+ # @option opts [String] :page The pagination token to continue listing from.
678
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::DatabaseSummary>
679
+ def list_databases(compartment_id, db_home_id, opts = {})
680
+ logger.debug "Calling operation DatabaseClient#list_databases." if logger
681
+
682
+ fail "Missing the required parameter 'compartment_id' when calling list_databases." if compartment_id.nil?
683
+ fail "Missing the required parameter 'db_home_id' when calling list_databases." if db_home_id.nil?
684
+
685
+ path = "/databases"
686
+
687
+ # Query Params
688
+ query_params = {}
689
+ query_params[:'compartmentId'] = compartment_id
690
+ query_params[:'dbHomeId'] = db_home_id
691
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
692
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
693
+
694
+ # Header Params
695
+ header_params = {}
696
+ header_params['accept'] = 'application/json'
697
+ header_params['content-type'] = 'application/json'
698
+
699
+ post_body = nil
700
+
701
+ return @api_client.call_api(
702
+ :GET,
703
+ path,
704
+ endpoint,
705
+ :header_params => header_params,
706
+ :query_params => query_params,
707
+ :body => post_body,
708
+ :return_type => 'Array<OCI::Database::Models::DatabaseSummary>')
709
+ end
710
+
711
+ # Gets history of the actions taken for patches for the specified database home.
712
+ #
713
+ # @param [String] db_home_id The database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
714
+ # @param [Hash] opts the optional parameters
715
+ # @option opts [Integer] :limit The maximum number of items to return.
716
+ # @option opts [String] :page The pagination token to continue listing from.
717
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::PatchHistoryEntrySummary>
718
+ def list_db_home_patch_history_entries(db_home_id, opts = {})
719
+ logger.debug "Calling operation DatabaseClient#list_db_home_patch_history_entries." if logger
720
+
721
+ fail "Missing the required parameter 'db_home_id' when calling list_db_home_patch_history_entries." if db_home_id.nil?
722
+
723
+ path = "/dbHomes/{dbHomeId}/patchHistoryEntries".sub('{dbHomeId}', db_home_id.to_s)
724
+
725
+ # Query Params
726
+ query_params = {}
727
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
728
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
729
+
730
+ # Header Params
731
+ header_params = {}
732
+ header_params['accept'] = 'application/json'
733
+ header_params['content-type'] = 'application/json'
734
+
735
+ post_body = nil
736
+
737
+ return @api_client.call_api(
738
+ :GET,
739
+ path,
740
+ endpoint,
741
+ :header_params => header_params,
742
+ :query_params => query_params,
743
+ :body => post_body,
744
+ :return_type => 'Array<OCI::Database::Models::PatchHistoryEntrySummary>')
745
+ end
746
+
747
+ # Lists patches applicable to the requested database home.
748
+ #
749
+ # @param [String] db_home_id The database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
750
+ # @param [Hash] opts the optional parameters
751
+ # @option opts [Integer] :limit The maximum number of items to return.
752
+ # @option opts [String] :page The pagination token to continue listing from.
753
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::PatchSummary>
754
+ def list_db_home_patches(db_home_id, opts = {})
755
+ logger.debug "Calling operation DatabaseClient#list_db_home_patches." if logger
756
+
757
+ fail "Missing the required parameter 'db_home_id' when calling list_db_home_patches." if db_home_id.nil?
758
+
759
+ path = "/dbHomes/{dbHomeId}/patches".sub('{dbHomeId}', db_home_id.to_s)
760
+
761
+ # Query Params
762
+ query_params = {}
763
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
764
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
765
+
766
+ # Header Params
767
+ header_params = {}
768
+ header_params['accept'] = 'application/json'
769
+ header_params['content-type'] = 'application/json'
770
+
771
+ post_body = nil
772
+
773
+ return @api_client.call_api(
774
+ :GET,
775
+ path,
776
+ endpoint,
777
+ :header_params => header_params,
778
+ :query_params => query_params,
779
+ :body => post_body,
780
+ :return_type => 'Array<OCI::Database::Models::PatchSummary>')
781
+ end
782
+
783
+ # Gets a list of database homes in the specified DB System and compartment. A database home is a directory where Oracle database software is installed.
784
+ #
785
+ # @param [String] compartment_id The compartment [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
786
+ # @param [String] db_system_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System.
787
+ # @param [Hash] opts the optional parameters
788
+ # @option opts [Integer] :limit The maximum number of items to return.
789
+ # @option opts [String] :page The pagination token to continue listing from.
790
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::DbHomeSummary>
791
+ def list_db_homes(compartment_id, db_system_id, opts = {})
792
+ logger.debug "Calling operation DatabaseClient#list_db_homes." if logger
793
+
794
+ fail "Missing the required parameter 'compartment_id' when calling list_db_homes." if compartment_id.nil?
795
+ fail "Missing the required parameter 'db_system_id' when calling list_db_homes." if db_system_id.nil?
796
+
797
+ path = "/dbHomes"
798
+
799
+ # Query Params
800
+ query_params = {}
801
+ query_params[:'compartmentId'] = compartment_id
802
+ query_params[:'dbSystemId'] = db_system_id
803
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
804
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
805
+
806
+ # Header Params
807
+ header_params = {}
808
+ header_params['accept'] = 'application/json'
809
+ header_params['content-type'] = 'application/json'
810
+
811
+ post_body = nil
812
+
813
+ return @api_client.call_api(
814
+ :GET,
815
+ path,
816
+ endpoint,
817
+ :header_params => header_params,
818
+ :query_params => query_params,
819
+ :body => post_body,
820
+ :return_type => 'Array<OCI::Database::Models::DbHomeSummary>')
821
+ end
822
+
823
+ # Gets a list of database nodes in the specified DB System and compartment. A database node is a server running database software.
824
+ #
825
+ # @param [String] compartment_id The compartment [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
826
+ # @param [String] db_system_id The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the DB System.
827
+ # @param [Hash] opts the optional parameters
828
+ # @option opts [Integer] :limit The maximum number of items to return.
829
+ # @option opts [String] :page The pagination token to continue listing from.
830
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::DbNodeSummary>
831
+ def list_db_nodes(compartment_id, db_system_id, opts = {})
832
+ logger.debug "Calling operation DatabaseClient#list_db_nodes." if logger
833
+
834
+ fail "Missing the required parameter 'compartment_id' when calling list_db_nodes." if compartment_id.nil?
835
+ fail "Missing the required parameter 'db_system_id' when calling list_db_nodes." if db_system_id.nil?
836
+
837
+ path = "/dbNodes"
838
+
839
+ # Query Params
840
+ query_params = {}
841
+ query_params[:'compartmentId'] = compartment_id
842
+ query_params[:'dbSystemId'] = db_system_id
843
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
844
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
845
+
846
+ # Header Params
847
+ header_params = {}
848
+ header_params['accept'] = 'application/json'
849
+ header_params['content-type'] = 'application/json'
850
+
851
+ post_body = nil
852
+
853
+ return @api_client.call_api(
854
+ :GET,
855
+ path,
856
+ endpoint,
857
+ :header_params => header_params,
858
+ :query_params => query_params,
859
+ :body => post_body,
860
+ :return_type => 'Array<OCI::Database::Models::DbNodeSummary>')
861
+ end
862
+
863
+ # Gets the history of the patch actions performed on the specified DB System.
864
+ #
865
+ # @param [String] db_system_id The DB System [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
866
+ # @param [Hash] opts the optional parameters
867
+ # @option opts [Integer] :limit The maximum number of items to return.
868
+ # @option opts [String] :page The pagination token to continue listing from.
869
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::PatchHistoryEntrySummary>
870
+ def list_db_system_patch_history_entries(db_system_id, opts = {})
871
+ logger.debug "Calling operation DatabaseClient#list_db_system_patch_history_entries." if logger
872
+
873
+ fail "Missing the required parameter 'db_system_id' when calling list_db_system_patch_history_entries." if db_system_id.nil?
874
+
875
+ path = "/dbSystems/{dbSystemId}/patchHistoryEntries".sub('{dbSystemId}', db_system_id.to_s)
876
+
877
+ # Query Params
878
+ query_params = {}
879
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
880
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
881
+
882
+ # Header Params
883
+ header_params = {}
884
+ header_params['accept'] = 'application/json'
885
+ header_params['content-type'] = 'application/json'
886
+
887
+ post_body = nil
888
+
889
+ return @api_client.call_api(
890
+ :GET,
891
+ path,
892
+ endpoint,
893
+ :header_params => header_params,
894
+ :query_params => query_params,
895
+ :body => post_body,
896
+ :return_type => 'Array<OCI::Database::Models::PatchHistoryEntrySummary>')
897
+ end
898
+
899
+ # Lists the patches applicable to the requested DB System.
900
+ #
901
+ # @param [String] db_system_id The DB System [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
902
+ # @param [Hash] opts the optional parameters
903
+ # @option opts [Integer] :limit The maximum number of items to return.
904
+ # @option opts [String] :page The pagination token to continue listing from.
905
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::PatchSummary>
906
+ def list_db_system_patches(db_system_id, opts = {})
907
+ logger.debug "Calling operation DatabaseClient#list_db_system_patches." if logger
908
+
909
+ fail "Missing the required parameter 'db_system_id' when calling list_db_system_patches." if db_system_id.nil?
910
+
911
+ path = "/dbSystems/{dbSystemId}/patches".sub('{dbSystemId}', db_system_id.to_s)
912
+
913
+ # Query Params
914
+ query_params = {}
915
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
916
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
917
+
918
+ # Header Params
919
+ header_params = {}
920
+ header_params['accept'] = 'application/json'
921
+ header_params['content-type'] = 'application/json'
922
+
923
+ post_body = nil
924
+
925
+ return @api_client.call_api(
926
+ :GET,
927
+ path,
928
+ endpoint,
929
+ :header_params => header_params,
930
+ :query_params => query_params,
931
+ :body => post_body,
932
+ :return_type => 'Array<OCI::Database::Models::PatchSummary>')
933
+ end
934
+
935
+ # Gets a list of the shapes that can be used to launch a new DB System. The shape determines resources to allocate to the DB system - CPU cores and memory for VM shapes; CPU cores, memory and storage for non-VM (or bare metal) shapes.
936
+ # @param [String] availability_domain The name of the Availability Domain.
937
+ # @param [String] compartment_id The compartment [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
938
+ # @param [Hash] opts the optional parameters
939
+ # @option opts [Integer] :limit The maximum number of items to return.
940
+ # @option opts [String] :page The pagination token to continue listing from.
941
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::DbSystemShapeSummary>
942
+ def list_db_system_shapes(availability_domain, compartment_id, opts = {})
943
+ logger.debug "Calling operation DatabaseClient#list_db_system_shapes." if logger
944
+
945
+ fail "Missing the required parameter 'availability_domain' when calling list_db_system_shapes." if availability_domain.nil?
946
+ fail "Missing the required parameter 'compartment_id' when calling list_db_system_shapes." if compartment_id.nil?
947
+
948
+ path = "/dbSystemShapes"
949
+
950
+ # Query Params
951
+ query_params = {}
952
+ query_params[:'availabilityDomain'] = availability_domain
953
+ query_params[:'compartmentId'] = compartment_id
954
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
955
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
956
+
957
+ # Header Params
958
+ header_params = {}
959
+ header_params['accept'] = 'application/json'
960
+ header_params['content-type'] = 'application/json'
961
+
962
+ post_body = nil
963
+
964
+ return @api_client.call_api(
965
+ :GET,
966
+ path,
967
+ endpoint,
968
+ :header_params => header_params,
969
+ :query_params => query_params,
970
+ :body => post_body,
971
+ :return_type => 'Array<OCI::Database::Models::DbSystemShapeSummary>')
972
+ end
973
+
974
+ # Gets a list of the DB Systems in the specified compartment.
975
+ #
976
+ #
977
+ # @param [String] compartment_id The compartment [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
978
+ # @param [Hash] opts the optional parameters
979
+ # @option opts [Integer] :limit The maximum number of items to return.
980
+ # @option opts [String] :page The pagination token to continue listing from.
981
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::DbSystemSummary>
982
+ def list_db_systems(compartment_id, opts = {})
983
+ logger.debug "Calling operation DatabaseClient#list_db_systems." if logger
984
+
985
+ fail "Missing the required parameter 'compartment_id' when calling list_db_systems." if compartment_id.nil?
986
+
987
+ path = "/dbSystems"
988
+
989
+ # Query Params
990
+ query_params = {}
991
+ query_params[:'compartmentId'] = compartment_id
992
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
993
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
994
+
995
+ # Header Params
996
+ header_params = {}
997
+ header_params['accept'] = 'application/json'
998
+ header_params['content-type'] = 'application/json'
999
+
1000
+ post_body = nil
1001
+
1002
+ return @api_client.call_api(
1003
+ :GET,
1004
+ path,
1005
+ endpoint,
1006
+ :header_params => header_params,
1007
+ :query_params => query_params,
1008
+ :body => post_body,
1009
+ :return_type => 'Array<OCI::Database::Models::DbSystemSummary>')
1010
+ end
1011
+
1012
+ # Gets a list of supported Oracle database versions.
1013
+ # @param [String] compartment_id The compartment [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1014
+ # @param [Hash] opts the optional parameters
1015
+ # @option opts [Integer] :limit The maximum number of items to return.
1016
+ # @option opts [String] :page The pagination token to continue listing from.
1017
+ # @option opts [String] :db_system_shape If provided, filters the results to the set of database versions which are supported for the given shape.
1018
+ # @return [Response] A Response object with data of type Array<OCI::Database::Models::DbVersionSummary>
1019
+ def list_db_versions(compartment_id, opts = {})
1020
+ logger.debug "Calling operation DatabaseClient#list_db_versions." if logger
1021
+
1022
+ fail "Missing the required parameter 'compartment_id' when calling list_db_versions." if compartment_id.nil?
1023
+
1024
+ path = "/dbVersions"
1025
+
1026
+ # Query Params
1027
+ query_params = {}
1028
+ query_params[:'compartmentId'] = compartment_id
1029
+ query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
1030
+ query_params[:'page'] = opts[:'page'] if opts[:'page']
1031
+ query_params[:'dbSystemShape'] = opts[:'db_system_shape'] if opts[:'db_system_shape']
1032
+
1033
+ # Header Params
1034
+ header_params = {}
1035
+ header_params['accept'] = 'application/json'
1036
+ header_params['content-type'] = 'application/json'
1037
+
1038
+ post_body = nil
1039
+
1040
+ return @api_client.call_api(
1041
+ :GET,
1042
+ path,
1043
+ endpoint,
1044
+ :header_params => header_params,
1045
+ :query_params => query_params,
1046
+ :body => post_body,
1047
+ :return_type => 'Array<OCI::Database::Models::DbVersionSummary>')
1048
+ end
1049
+
1050
+ # Reinstates the database identified by the `databaseId` parameter into the standby role in a Data Guard association.
1051
+ #
1052
+ # @param [String] database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1053
+ # @param [String] data_guard_association_id The Data Guard association's [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1054
+ # @param [ReinstateDataGuardAssociationDetails] reinstate_data_guard_association_details A request to reinstate a database in a standby role.
1055
+ # @param [Hash] opts the optional parameters
1056
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1057
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1058
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1059
+ #
1060
+ # @return [Response] A Response object with data of type OCI::Database::Models::DataGuardAssociation
1061
+ def reinstate_data_guard_association(database_id, data_guard_association_id, reinstate_data_guard_association_details, opts = {})
1062
+ logger.debug "Calling operation DatabaseClient#reinstate_data_guard_association." if logger
1063
+
1064
+ fail "Missing the required parameter 'database_id' when calling reinstate_data_guard_association." if database_id.nil?
1065
+ fail "Missing the required parameter 'data_guard_association_id' when calling reinstate_data_guard_association." if data_guard_association_id.nil?
1066
+ fail "Missing the required parameter 'reinstate_data_guard_association_details' when calling reinstate_data_guard_association." if reinstate_data_guard_association_details.nil?
1067
+
1068
+ path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/reinstate".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)
1069
+
1070
+ # Query Params
1071
+ query_params = {}
1072
+
1073
+ # Header Params
1074
+ header_params = {}
1075
+ header_params['accept'] = 'application/json'
1076
+ header_params['content-type'] = 'application/json'
1077
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1078
+
1079
+ post_body = @api_client.object_to_http_body(reinstate_data_guard_association_details)
1080
+
1081
+ return @api_client.call_api(
1082
+ :POST,
1083
+ path,
1084
+ endpoint,
1085
+ :header_params => header_params,
1086
+ :query_params => query_params,
1087
+ :body => post_body,
1088
+ :return_type => 'OCI::Database::Models::DataGuardAssociation')
1089
+ end
1090
+
1091
+ # Performs a switchover to transition the primary database of a Data Guard association into a standby role. The
1092
+ # standby database associated with the `dataGuardAssociationId` assumes the primary database role.
1093
+ #
1094
+ # A switchover guarantees no data loss.
1095
+ #
1096
+ # @param [String] database_id The database [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1097
+ # @param [String] data_guard_association_id The Data Guard association's [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1098
+ # @param [SwitchoverDataGuardAssociationDetails] switchover_data_guard_association_details Request to swtichover a primary to a standby.
1099
+ # @param [Hash] opts the optional parameters
1100
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1101
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1102
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1103
+ #
1104
+ # @return [Response] A Response object with data of type OCI::Database::Models::DataGuardAssociation
1105
+ def switchover_data_guard_association(database_id, data_guard_association_id, switchover_data_guard_association_details, opts = {})
1106
+ logger.debug "Calling operation DatabaseClient#switchover_data_guard_association." if logger
1107
+
1108
+ fail "Missing the required parameter 'database_id' when calling switchover_data_guard_association." if database_id.nil?
1109
+ fail "Missing the required parameter 'data_guard_association_id' when calling switchover_data_guard_association." if data_guard_association_id.nil?
1110
+ fail "Missing the required parameter 'switchover_data_guard_association_details' when calling switchover_data_guard_association." if switchover_data_guard_association_details.nil?
1111
+
1112
+ path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/switchover".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)
1113
+
1114
+ # Query Params
1115
+ query_params = {}
1116
+
1117
+ # Header Params
1118
+ header_params = {}
1119
+ header_params['accept'] = 'application/json'
1120
+ header_params['content-type'] = 'application/json'
1121
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1122
+
1123
+ post_body = @api_client.object_to_http_body(switchover_data_guard_association_details)
1124
+
1125
+ return @api_client.call_api(
1126
+ :POST,
1127
+ path,
1128
+ endpoint,
1129
+ :header_params => header_params,
1130
+ :query_params => query_params,
1131
+ :body => post_body,
1132
+ :return_type => 'OCI::Database::Models::DataGuardAssociation')
1133
+ end
1134
+
1135
+ # Terminates a DB System and permanently deletes it and any databases running on it, and any storage volumes attached to it. The database data is local to the DB System and will be lost when the system is terminated. Oracle recommends that you back up any data in the DB System prior to terminating it.
1136
+ # @param [String] db_system_id The DB System [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1137
+ # @param [Hash] opts the optional parameters
1138
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1139
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1140
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1141
+ #
1142
+ # @return [Response] A Response object with data of type nil
1143
+ def terminate_db_system(db_system_id, opts = {})
1144
+ logger.debug "Calling operation DatabaseClient#terminate_db_system." if logger
1145
+
1146
+ fail "Missing the required parameter 'db_system_id' when calling terminate_db_system." if db_system_id.nil?
1147
+
1148
+ path = "/dbSystems/{dbSystemId}".sub('{dbSystemId}', db_system_id.to_s)
1149
+
1150
+ # Query Params
1151
+ query_params = {}
1152
+
1153
+ # Header Params
1154
+ header_params = {}
1155
+ header_params['accept'] = 'application/json'
1156
+ header_params['content-type'] = 'application/json'
1157
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1158
+
1159
+ post_body = nil
1160
+
1161
+ return @api_client.call_api(
1162
+ :DELETE,
1163
+ path,
1164
+ endpoint,
1165
+ :header_params => header_params,
1166
+ :query_params => query_params,
1167
+ :body => post_body)
1168
+ end
1169
+
1170
+ # Patches the specified dbHome.
1171
+ # @param [String] db_home_id The database home [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1172
+ # @param [UpdateDbHomeDetails] update_db_home_details Request to update the properties of a DB Home.
1173
+ # @param [Hash] opts the optional parameters
1174
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1175
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1176
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1177
+ #
1178
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbHome
1179
+ def update_db_home(db_home_id, update_db_home_details, opts = {})
1180
+ logger.debug "Calling operation DatabaseClient#update_db_home." if logger
1181
+
1182
+ fail "Missing the required parameter 'db_home_id' when calling update_db_home." if db_home_id.nil?
1183
+ fail "Missing the required parameter 'update_db_home_details' when calling update_db_home." if update_db_home_details.nil?
1184
+
1185
+ path = "/dbHomes/{dbHomeId}".sub('{dbHomeId}', db_home_id.to_s)
1186
+
1187
+ # Query Params
1188
+ query_params = {}
1189
+
1190
+ # Header Params
1191
+ header_params = {}
1192
+ header_params['accept'] = 'application/json'
1193
+ header_params['content-type'] = 'application/json'
1194
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1195
+
1196
+ post_body = @api_client.object_to_http_body(update_db_home_details)
1197
+
1198
+ return @api_client.call_api(
1199
+ :PUT,
1200
+ path,
1201
+ endpoint,
1202
+ :header_params => header_params,
1203
+ :query_params => query_params,
1204
+ :body => post_body,
1205
+ :return_type => 'OCI::Database::Models::DbHome')
1206
+ end
1207
+
1208
+ # Updates the properties of a DB System, such as the CPU core count.
1209
+ # @param [String] db_system_id The DB System [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
1210
+ # @param [UpdateDbSystemDetails] update_db_system_details Request to update the properties of a DB System.
1211
+ # @param [Hash] opts the optional parameters
1212
+ # @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
1213
+ # parameter to the value of the etag from a previous GET or POST response for that resource. The resource
1214
+ # will be updated or deleted only if the etag you provide matches the resource's current etag value.
1215
+ #
1216
+ # @return [Response] A Response object with data of type OCI::Database::Models::DbSystem
1217
+ def update_db_system(db_system_id, update_db_system_details, opts = {})
1218
+ logger.debug "Calling operation DatabaseClient#update_db_system." if logger
1219
+
1220
+ fail "Missing the required parameter 'db_system_id' when calling update_db_system." if db_system_id.nil?
1221
+ fail "Missing the required parameter 'update_db_system_details' when calling update_db_system." if update_db_system_details.nil?
1222
+
1223
+ path = "/dbSystems/{dbSystemId}".sub('{dbSystemId}', db_system_id.to_s)
1224
+
1225
+ # Query Params
1226
+ query_params = {}
1227
+
1228
+ # Header Params
1229
+ header_params = {}
1230
+ header_params['accept'] = 'application/json'
1231
+ header_params['content-type'] = 'application/json'
1232
+ header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
1233
+
1234
+ post_body = @api_client.object_to_http_body(update_db_system_details)
1235
+
1236
+ return @api_client.call_api(
1237
+ :PUT,
1238
+ path,
1239
+ endpoint,
1240
+ :header_params => header_params,
1241
+ :query_params => query_params,
1242
+ :body => post_body,
1243
+ :return_type => 'OCI::Database::Models::DbSystem')
1244
+ end
1245
+ end
1246
+ end