Class: OCI::Database::DatabaseClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database/database_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, signer: nil) ⇒ DatabaseClient

Creates a new DatabaseClient. If a config is not specified, then the global OCI.config will be used.

A region must be specified in either the config or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.

  • signer (OCI::BaseSigner) (defaults to: nil)

    A signer implementation which can be used by this client. If this is not provided then a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication, so that the instance principals signer can be provided to the client



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/oci/database/database_client.rb', line 34

def initialize(config:nil, region:nil, signer:nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
  # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
  # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
  # pass it to this constructor.
  #
  # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
  # so try and load the config from the default file.
  config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
  config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)

  if signer.nil?
    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::STANDARD)
  end

  @api_client = ApiClient.new(config, signer)

  region ||= config.region
  region ||= signer.region if signer.respond_to?(:region)
  self.region = region
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



12
13
14
# File 'lib/oci/database/database_client.rb', line 12

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


16
17
18
# File 'lib/oci/database/database_client.rb', line 16

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


20
21
22
# File 'lib/oci/database/database_client.rb', line 20

def region
  @region
end

Instance Method Details

#create_backup(create_backup_details, opts = {}) ⇒ Response

Creates a new backup in the specified database based on the request parameters you provide. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work.

Parameters:

  • create_backup_details (CreateBackupDetails)

    Request to create a new database backup.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::Backup



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/oci/database/database_client.rb', line 86

def create_backup(create_backup_details, opts = {})
  logger.debug "Calling operation DatabaseClient#create_backup." if logger

  raise "Missing the required parameter 'create_backup_details' when calling create_backup." if create_backup_details.nil?

  path = "/backups"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_backup_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::Backup')
end

#create_data_guard_association(database_id, create_data_guard_association_details, opts = {}) ⇒ Response

Creates a new Data Guard association. A Data Guard association represents the replication relationship between the specified database and a peer database. For more information, see [Using Oracle Data Guard](docs.us-phoenix-1.oraclecloud.com/Content/Database/Tasks/usingdataguard.htm).

All Oracle Cloud Infrastructure resources, including Data Guard associations, get an Oracle-assigned, unique ID called an Oracle Cloud Identifier (OCID). When you create a resource, you can find its OCID in the response. You can also retrieve a resource’s OCID by using a List API operation on that resource type, or by viewing the resource in the Console. For more information, see [Resource Identifiers](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).

Parameters:

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DataGuardAssociation



133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/oci/database/database_client.rb', line 133

def create_data_guard_association(database_id, create_data_guard_association_details, opts = {})
  logger.debug "Calling operation DatabaseClient#create_data_guard_association." if logger

  raise "Missing the required parameter 'database_id' when calling create_data_guard_association." if database_id.nil?
  raise "Missing the required parameter 'create_data_guard_association_details' when calling create_data_guard_association." if create_data_guard_association_details.nil?

  path = "/databases/{databaseId}/dataGuardAssociations".sub('{databaseId}', database_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_data_guard_association_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DataGuardAssociation')
end

#create_db_home(create_db_home_with_db_system_id_details, opts = {}) ⇒ Response

Creates a new DB Home in the specified DB System based on the request parameters you provide.

Parameters:

  • create_db_home_with_db_system_id_details (CreateDbHomeWithDbSystemIdBase)

    Request to create a new DB Home.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbHome



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/database/database_client.rb', line 173

def create_db_home(create_db_home_with_db_system_id_details, opts = {})
  logger.debug "Calling operation DatabaseClient#create_db_home." if logger

  raise "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?

  path = "/dbHomes"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_db_home_with_db_system_id_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbHome')
end

#db_node_action(db_node_id, action, opts = {}) ⇒ Response

Performs an action, such as one of the power actions (start, stop, softreset, or reset), on the specified DB Node.

start - power on

stop - power off

softreset - ACPI shutdown and power on

reset - power off and power on

Note that the stop state has no effect on the resources you consume. Billing continues for DB Nodes that you stop, and related resources continue to apply against any relevant quotas. You must terminate the DB System (terminate_db_system) to remove its resources from billing and quotas.

Parameters:

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbNode



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/oci/database/database_client.rb', line 232

def db_node_action(db_node_id, action, opts = {})
  logger.debug "Calling operation DatabaseClient#db_node_action." if logger

  raise "Missing the required parameter 'db_node_id' when calling db_node_action." if db_node_id.nil?
  raise "Missing the required parameter 'action' when calling db_node_action." if action.nil?
  unless ['STOP', 'START', 'SOFTRESET', 'RESET'].include?(action)
    raise "Invalid value for 'action', must be one of STOP, START, SOFTRESET, RESET."
  end

  path = "/dbNodes/{dbNodeId}".sub('{dbNodeId}', db_node_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'action'] = action

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbNode')
end

#delete_backup(backup_id, opts = {}) ⇒ Response

Deletes a full backup. You cannot delete automatic backups using this API.

Parameters:

  • backup_id (String)

    The backup OCID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/oci/database/database_client.rb', line 274

def delete_backup(backup_id, opts = {})
  logger.debug "Calling operation DatabaseClient#delete_backup." if logger

  raise "Missing the required parameter 'backup_id' when calling delete_backup." if backup_id.nil?

  path = "/backups/{backupId}".sub('{backupId}', backup_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_db_home(db_home_id, opts = {}) ⇒ Response

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.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

  • :perform_final_backup (BOOLEAN)

    Whether to perform a final backup of the database or not. Default is false. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work.

Returns:

  • (Response)

    A Response object with data of type nil



311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/oci/database/database_client.rb', line 311

def delete_db_home(db_home_id, opts = {})
  logger.debug "Calling operation DatabaseClient#delete_db_home." if logger

  raise "Missing the required parameter 'db_home_id' when calling delete_db_home." if db_home_id.nil?

  path = "/dbHomes/{dbHomeId}".sub('{dbHomeId}', db_home_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'performFinalBackup'] = opts[:'perform_final_backup'] if opts[:'perform_final_backup']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#failover_data_guard_association(database_id, data_guard_association_id, failover_data_guard_association_details, opts = {}) ⇒ Response

Performs a failover to transition the standby database identified by the ‘databaseId` parameter into the specified Data Guard association’s primary role after the existing primary database fails or becomes unreachable.

A failover might result in data loss depending on the protection mode in effect at the time of the primary database failure.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DataGuardAssociation



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
# File 'lib/oci/database/database_client.rb', line 354

def failover_data_guard_association(database_id, data_guard_association_id, failover_data_guard_association_details, opts = {})
  logger.debug "Calling operation DatabaseClient#failover_data_guard_association." if logger

  raise "Missing the required parameter 'database_id' when calling failover_data_guard_association." if database_id.nil?
  raise "Missing the required parameter 'data_guard_association_id' when calling failover_data_guard_association." if data_guard_association_id.nil?
  raise "Missing the required parameter 'failover_data_guard_association_details' when calling failover_data_guard_association." if failover_data_guard_association_details.nil?

  path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/failover".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(failover_data_guard_association_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DataGuardAssociation')
end

#get_backup(backup_id, opts = {}) ⇒ Response

Gets information about the specified backup.

Parameters:

  • backup_id (String)

    The backup OCID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::Backup



388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# File 'lib/oci/database/database_client.rb', line 388

def get_backup(backup_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_backup." if logger

  raise "Missing the required parameter 'backup_id' when calling get_backup." if backup_id.nil?

  path = "/backups/{backupId}".sub('{backupId}', backup_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::Backup')
end

#get_data_guard_association(database_id, data_guard_association_id, opts = {}) ⇒ Response

Gets the specified Data Guard association’s configuration information.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DataGuardAssociation



421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
# File 'lib/oci/database/database_client.rb', line 421

def get_data_guard_association(database_id, data_guard_association_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_data_guard_association." if logger

  raise "Missing the required parameter 'database_id' when calling get_data_guard_association." if database_id.nil?
  raise "Missing the required parameter 'data_guard_association_id' when calling get_data_guard_association." if data_guard_association_id.nil?

  path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DataGuardAssociation')
end

#get_database(database_id, opts = {}) ⇒ Response

Gets information about a specific database.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::Database



453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
# File 'lib/oci/database/database_client.rb', line 453

def get_database(database_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_database." if logger

  raise "Missing the required parameter 'database_id' when calling get_database." if database_id.nil?

  path = "/databases/{databaseId}".sub('{databaseId}', database_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::Database')
end

#get_db_home(db_home_id, opts = {}) ⇒ Response

Gets information about the specified database home.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbHome



484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
# File 'lib/oci/database/database_client.rb', line 484

def get_db_home(db_home_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_db_home." if logger

  raise "Missing the required parameter 'db_home_id' when calling get_db_home." if db_home_id.nil?

  path = "/dbHomes/{dbHomeId}".sub('{dbHomeId}', db_home_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbHome')
end

#get_db_home_patch(db_home_id, patch_id, opts = {}) ⇒ Response

Gets information about a specified patch package.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::Patch



517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
# File 'lib/oci/database/database_client.rb', line 517

def get_db_home_patch(db_home_id, patch_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_db_home_patch." if logger

  raise "Missing the required parameter 'db_home_id' when calling get_db_home_patch." if db_home_id.nil?
  raise "Missing the required parameter 'patch_id' when calling get_db_home_patch." if patch_id.nil?

  path = "/dbHomes/{dbHomeId}/patches/{patchId}".sub('{dbHomeId}', db_home_id.to_s).sub('{patchId}', patch_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::Patch')
end

#get_db_home_patch_history_entry(db_home_id, patch_history_entry_id, opts = {}) ⇒ Response

Gets the patch history details for the specified patchHistoryEntryId

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::PatchHistoryEntry



551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
# File 'lib/oci/database/database_client.rb', line 551

def get_db_home_patch_history_entry(db_home_id, patch_history_entry_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_db_home_patch_history_entry." if logger

  raise "Missing the required parameter 'db_home_id' when calling get_db_home_patch_history_entry." if db_home_id.nil?
  raise "Missing the required parameter 'patch_history_entry_id' when calling get_db_home_patch_history_entry." if patch_history_entry_id.nil?

  path = "/dbHomes/{dbHomeId}/patchHistoryEntries/{patchHistoryEntryId}".sub('{dbHomeId}', db_home_id.to_s).sub('{patchHistoryEntryId}', patch_history_entry_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::PatchHistoryEntry')
end

#get_db_node(db_node_id, opts = {}) ⇒ Response

Gets information about the specified database node.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbNode



583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
# File 'lib/oci/database/database_client.rb', line 583

def get_db_node(db_node_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_db_node." if logger

  raise "Missing the required parameter 'db_node_id' when calling get_db_node." if db_node_id.nil?

  path = "/dbNodes/{dbNodeId}".sub('{dbNodeId}', db_node_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbNode')
end

#get_db_system(db_system_id, opts = {}) ⇒ Response

Gets information about the specified DB System.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbSystem



614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
# File 'lib/oci/database/database_client.rb', line 614

def get_db_system(db_system_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_db_system." if logger

  raise "Missing the required parameter 'db_system_id' when calling get_db_system." if db_system_id.nil?

  path = "/dbSystems/{dbSystemId}".sub('{dbSystemId}', db_system_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbSystem')
end

#get_db_system_patch(db_system_id, patch_id, opts = {}) ⇒ Response

Gets information about a specified patch package.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::Patch



647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
# File 'lib/oci/database/database_client.rb', line 647

def get_db_system_patch(db_system_id, patch_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_db_system_patch." if logger

  raise "Missing the required parameter 'db_system_id' when calling get_db_system_patch." if db_system_id.nil?
  raise "Missing the required parameter 'patch_id' when calling get_db_system_patch." if patch_id.nil?

  path = "/dbSystems/{dbSystemId}/patches/{patchId}".sub('{dbSystemId}', db_system_id.to_s).sub('{patchId}', patch_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::Patch')
end

#get_db_system_patch_history_entry(db_system_id, patch_history_entry_id, opts = {}) ⇒ Response

Gets the patch history details for the specified patchHistoryEntryId.

Parameters:

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::PatchHistoryEntry



681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
# File 'lib/oci/database/database_client.rb', line 681

def get_db_system_patch_history_entry(db_system_id, patch_history_entry_id, opts = {})
  logger.debug "Calling operation DatabaseClient#get_db_system_patch_history_entry." if logger

  raise "Missing the required parameter 'db_system_id' when calling get_db_system_patch_history_entry." if db_system_id.nil?
  raise "Missing the required parameter 'patch_history_entry_id' when calling get_db_system_patch_history_entry." if patch_history_entry_id.nil?

  path = "/dbSystems/{dbSystemId}/patchHistoryEntries/{patchHistoryEntryId}".sub('{dbSystemId}', db_system_id.to_s).sub('{patchHistoryEntryId}', patch_history_entry_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::PatchHistoryEntry')
end

#launch_db_system(launch_db_system_details, opts = {}) ⇒ Response

Launches a new DB System in the specified compartment and Availability Domain. You’ll specify a single Oracle Database Edition that applies to all the databases on that DB System. The selected edition cannot be changed.

An initial database is created on the DB System based on the request parameters you provide and some default options. For more information, see [Default Options for the Initial Database](docs.us-phoenix-1.oraclecloud.com/Content/Database/Tasks/launchingDB.htm#Default_Options_for_the_Initial_Database).

The DB System will include a command line interface (CLI) that you can use to create additional databases and manage existing databases. For more information, see the [Oracle Database CLI Reference](docs.us-phoenix-1.oraclecloud.com/Content/Database/References/odacli.htm#Oracle_Database_CLI_Reference).

Parameters:

  • launch_db_system_details (LaunchDbSystemDetails)

    Request to launch a DB System.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbSystem



729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/oci/database/database_client.rb', line 729

def launch_db_system(launch_db_system_details, opts = {})
  logger.debug "Calling operation DatabaseClient#launch_db_system." if logger

  raise "Missing the required parameter 'launch_db_system_details' when calling launch_db_system." if launch_db_system_details.nil?

  path = "/dbSystems"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(launch_db_system_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbSystem')
end

#list_backups(opts = {}) ⇒ Response

Gets a list of backups based on the databaseId or compartmentId specified. Either one of the query parameters must be provided.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :database_id (String)

    The OCID of the database.

  • :compartment_id (String)

    The compartment OCID.

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::BackupSummary>



765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
# File 'lib/oci/database/database_client.rb', line 765

def list_backups(opts = {})
  logger.debug "Calling operation DatabaseClient#list_backups." if logger


  path = "/backups"

  # Query Params
  query_params = {}
  query_params[:'databaseId'] = opts[:'database_id'] if opts[:'database_id']
  query_params[:'compartmentId'] = opts[:'compartment_id'] if opts[:'compartment_id']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::BackupSummary>')
end

#list_data_guard_associations(database_id, opts = {}) ⇒ Response

Lists all Data Guard associations for the specified database.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::DataGuardAssociationSummary>



802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
# File 'lib/oci/database/database_client.rb', line 802

def list_data_guard_associations(database_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_data_guard_associations." if logger

  raise "Missing the required parameter 'database_id' when calling list_data_guard_associations." if database_id.nil?

  path = "/databases/{databaseId}/dataGuardAssociations".sub('{databaseId}', database_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::DataGuardAssociationSummary>')
end

#list_databases(compartment_id, db_home_id, opts = {}) ⇒ Response

Gets a list of the databases in the specified database home.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::DatabaseSummary>



839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
# File 'lib/oci/database/database_client.rb', line 839

def list_databases(compartment_id, db_home_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_databases." if logger

  raise "Missing the required parameter 'compartment_id' when calling list_databases." if compartment_id.nil?
  raise "Missing the required parameter 'db_home_id' when calling list_databases." if db_home_id.nil?

  path = "/databases"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'dbHomeId'] = db_home_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::DatabaseSummary>')
end

#list_db_home_patch_history_entries(db_home_id, opts = {}) ⇒ Response

Gets history of the actions taken for patches for the specified database home.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::PatchHistoryEntrySummary>



878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
# File 'lib/oci/database/database_client.rb', line 878

def list_db_home_patch_history_entries(db_home_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_home_patch_history_entries." if logger

  raise "Missing the required parameter 'db_home_id' when calling list_db_home_patch_history_entries." if db_home_id.nil?

  path = "/dbHomes/{dbHomeId}/patchHistoryEntries".sub('{dbHomeId}', db_home_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::PatchHistoryEntrySummary>')
end

#list_db_home_patches(db_home_id, opts = {}) ⇒ Response

Lists patches applicable to the requested database home.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::PatchSummary>



914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
# File 'lib/oci/database/database_client.rb', line 914

def list_db_home_patches(db_home_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_home_patches." if logger

  raise "Missing the required parameter 'db_home_id' when calling list_db_home_patches." if db_home_id.nil?

  path = "/dbHomes/{dbHomeId}/patches".sub('{dbHomeId}', db_home_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::PatchSummary>')
end

#list_db_homes(compartment_id, db_system_id, opts = {}) ⇒ Response

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.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::DbHomeSummary>



951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/oci/database/database_client.rb', line 951

def list_db_homes(compartment_id, db_system_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_homes." if logger

  raise "Missing the required parameter 'compartment_id' when calling list_db_homes." if compartment_id.nil?
  raise "Missing the required parameter 'db_system_id' when calling list_db_homes." if db_system_id.nil?

  path = "/dbHomes"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'dbSystemId'] = db_system_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::DbHomeSummary>')
end

#list_db_nodes(compartment_id, db_system_id, opts = {}) ⇒ Response

Gets a list of database nodes in the specified DB System and compartment. A database node is a server running database software.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::DbNodeSummary>



991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
# File 'lib/oci/database/database_client.rb', line 991

def list_db_nodes(compartment_id, db_system_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_nodes." if logger

  raise "Missing the required parameter 'compartment_id' when calling list_db_nodes." if compartment_id.nil?
  raise "Missing the required parameter 'db_system_id' when calling list_db_nodes." if db_system_id.nil?

  path = "/dbNodes"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'dbSystemId'] = db_system_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::DbNodeSummary>')
end

#list_db_system_patch_history_entries(db_system_id, opts = {}) ⇒ Response

Gets the history of the patch actions performed on the specified DB System.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::PatchHistoryEntrySummary>



1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
# File 'lib/oci/database/database_client.rb', line 1030

def list_db_system_patch_history_entries(db_system_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_system_patch_history_entries." if logger

  raise "Missing the required parameter 'db_system_id' when calling list_db_system_patch_history_entries." if db_system_id.nil?

  path = "/dbSystems/{dbSystemId}/patchHistoryEntries".sub('{dbSystemId}', db_system_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::PatchHistoryEntrySummary>')
end

#list_db_system_patches(db_system_id, opts = {}) ⇒ Response

Lists the patches applicable to the requested DB System.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::PatchSummary>



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'lib/oci/database/database_client.rb', line 1066

def list_db_system_patches(db_system_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_system_patches." if logger

  raise "Missing the required parameter 'db_system_id' when calling list_db_system_patches." if db_system_id.nil?

  path = "/dbSystems/{dbSystemId}/patches".sub('{dbSystemId}', db_system_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::PatchSummary>')
end

#list_db_system_shapes(availability_domain, compartment_id, opts = {}) ⇒ Response

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.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::DbSystemShapeSummary>



1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
# File 'lib/oci/database/database_client.rb', line 1102

def list_db_system_shapes(availability_domain, compartment_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_system_shapes." if logger

  raise "Missing the required parameter 'availability_domain' when calling list_db_system_shapes." if availability_domain.nil?
  raise "Missing the required parameter 'compartment_id' when calling list_db_system_shapes." if compartment_id.nil?

  path = "/dbSystemShapes"

  # Query Params
  query_params = {}
  query_params[:'availabilityDomain'] = availability_domain
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::DbSystemShapeSummary>')
end

#list_db_systems(compartment_id, opts = {}) ⇒ Response

Gets a list of the DB Systems in the specified compartment. You can specify a backupId to list only the DB Systems that support creating a database using this backup in this compartment.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

  • :backup_id (String)

    The OCID of the backup. Specify a backupId to list only the DB Systems that support creating a database using this backup in this compartment.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::DbSystemSummary>



1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
# File 'lib/oci/database/database_client.rb', line 1143

def list_db_systems(compartment_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_systems." if logger

  raise "Missing the required parameter 'compartment_id' when calling list_db_systems." if compartment_id.nil?

  path = "/dbSystems"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'backupId'] = opts[:'backup_id'] if opts[:'backup_id']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::DbSystemSummary>')
end

#list_db_versions(compartment_id, opts = {}) ⇒ Response

Gets a list of supported Oracle database versions.

Parameters:

Options Hash (opts):

  • :limit (Integer)

    The maximum number of items to return.

  • :page (String)

    The pagination token to continue listing from.

  • :db_system_shape (String)

    If provided, filters the results to the set of database versions which are supported for the given shape.

Returns:

  • (Response)

    A Response object with data of type Array<OCI::Database::Models::DbVersionSummary>



1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
# File 'lib/oci/database/database_client.rb', line 1181

def list_db_versions(compartment_id, opts = {})
  logger.debug "Calling operation DatabaseClient#list_db_versions." if logger

  raise "Missing the required parameter 'compartment_id' when calling list_db_versions." if compartment_id.nil?

  path = "/dbVersions"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'dbSystemShape'] = opts[:'db_system_shape'] if opts[:'db_system_shape']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OCI::Database::Models::DbVersionSummary>')
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



70
71
72
# File 'lib/oci/database/database_client.rb', line 70

def logger
  @api_client.config.logger
end

#reinstate_data_guard_association(database_id, data_guard_association_id, reinstate_data_guard_association_details, opts = {}) ⇒ Response

Reinstates the database identified by the ‘databaseId` parameter into the standby role in a Data Guard association.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DataGuardAssociation



1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
# File 'lib/oci/database/database_client.rb', line 1223

def reinstate_data_guard_association(database_id, data_guard_association_id, reinstate_data_guard_association_details, opts = {})
  logger.debug "Calling operation DatabaseClient#reinstate_data_guard_association." if logger

  raise "Missing the required parameter 'database_id' when calling reinstate_data_guard_association." if database_id.nil?
  raise "Missing the required parameter 'data_guard_association_id' when calling reinstate_data_guard_association." if data_guard_association_id.nil?
  raise "Missing the required parameter 'reinstate_data_guard_association_details' when calling reinstate_data_guard_association." if reinstate_data_guard_association_details.nil?

  path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/reinstate".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(reinstate_data_guard_association_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DataGuardAssociation')
end

#restore_database(database_id, restore_database_details, opts = {}) ⇒ Response

Restore a Database based on the request parameters you provide.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::Database



1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
# File 'lib/oci/database/database_client.rb', line 1263

def restore_database(database_id, restore_database_details, opts = {})
  logger.debug "Calling operation DatabaseClient#restore_database." if logger

  raise "Missing the required parameter 'database_id' when calling restore_database." if database_id.nil?
  raise "Missing the required parameter 'restore_database_details' when calling restore_database." if restore_database_details.nil?

  path = "/databases/{databaseId}/actions/restore".sub('{databaseId}', database_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(restore_database_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::Database')
end

#switchover_data_guard_association(database_id, data_guard_association_id, switchover_data_guard_association_details, opts = {}) ⇒ Response

Performs a switchover to transition the primary database of a Data Guard association into a standby role. The standby database associated with the ‘dataGuardAssociationId` assumes the primary database role.

A switchover guarantees no data loss.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DataGuardAssociation



1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
# File 'lib/oci/database/database_client.rb', line 1306

def switchover_data_guard_association(database_id, data_guard_association_id, switchover_data_guard_association_details, opts = {})
  logger.debug "Calling operation DatabaseClient#switchover_data_guard_association." if logger

  raise "Missing the required parameter 'database_id' when calling switchover_data_guard_association." if database_id.nil?
  raise "Missing the required parameter 'data_guard_association_id' when calling switchover_data_guard_association." if data_guard_association_id.nil?
  raise "Missing the required parameter 'switchover_data_guard_association_details' when calling switchover_data_guard_association." if switchover_data_guard_association_details.nil?

  path = "/databases/{databaseId}/dataGuardAssociations/{dataGuardAssociationId}/actions/switchover".sub('{databaseId}', database_id.to_s).sub('{dataGuardAssociationId}', data_guard_association_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(switchover_data_guard_association_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DataGuardAssociation')
end

#terminate_db_system(db_system_id, opts = {}) ⇒ Response

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.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
# File 'lib/oci/database/database_client.rb', line 1344

def terminate_db_system(db_system_id, opts = {})
  logger.debug "Calling operation DatabaseClient#terminate_db_system." if logger

  raise "Missing the required parameter 'db_system_id' when calling terminate_db_system." if db_system_id.nil?

  path = "/dbSystems/{dbSystemId}".sub('{dbSystemId}', db_system_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#update_database(database_id, update_database_details, opts = {}) ⇒ Response

Update a Database based on the request parameters you provide.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::Database



1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
# File 'lib/oci/database/database_client.rb', line 1381

def update_database(database_id, update_database_details, opts = {})
  logger.debug "Calling operation DatabaseClient#update_database." if logger

  raise "Missing the required parameter 'database_id' when calling update_database." if database_id.nil?
  raise "Missing the required parameter 'update_database_details' when calling update_database." if update_database_details.nil?

  path = "/databases/{databaseId}".sub('{databaseId}', database_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_database_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::Database')
end

#update_db_home(db_home_id, update_db_home_details, opts = {}) ⇒ Response

Patches the specified dbHome.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbHome



1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
# File 'lib/oci/database/database_client.rb', line 1419

def update_db_home(db_home_id, update_db_home_details, opts = {})
  logger.debug "Calling operation DatabaseClient#update_db_home." if logger

  raise "Missing the required parameter 'db_home_id' when calling update_db_home." if db_home_id.nil?
  raise "Missing the required parameter 'update_db_home_details' when calling update_db_home." if update_db_home_details.nil?

  path = "/dbHomes/{dbHomeId}".sub('{dbHomeId}', db_home_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_db_home_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbHome')
end

#update_db_system(db_system_id, update_db_system_details, opts = {}) ⇒ Response

Updates the properties of a DB System, such as the CPU core count.

Parameters:

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

Returns:

  • (Response)

    A Response object with data of type OCI::Database::Models::DbSystem



1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
# File 'lib/oci/database/database_client.rb', line 1457

def update_db_system(db_system_id, update_db_system_details, opts = {})
  logger.debug "Calling operation DatabaseClient#update_db_system." if logger

  raise "Missing the required parameter 'db_system_id' when calling update_db_system." if db_system_id.nil?
  raise "Missing the required parameter 'update_db_system_details' when calling update_db_system." if update_db_system_details.nil?

  path = "/dbSystems/{dbSystemId}".sub('{dbSystemId}', db_system_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_db_system_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OCI::Database::Models::DbSystem')
end