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) ⇒ 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.



32
33
34
35
36
37
38
39
40
41
# File 'lib/oci/database/database_client.rb', line 32

def initialize(config:nil, region:nil)
  config ||= OCI.config
  config.validate

  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)
  @api_client = ApiClient.new(config, signer)

  region ||= config.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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/database/database_client.rb', line 72

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

  fail "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. Fore more information, see [Resource Identifiers](localhost:8000/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



119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/oci/database/database_client.rb', line 119

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

  fail "Missing the required parameter 'database_id' when calling create_data_guard_association." if database_id.nil?
  fail "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



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/database/database_client.rb', line 159

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

  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?

  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



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/oci/database/database_client.rb', line 218

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

  fail "Missing the required parameter 'db_node_id' when calling db_node_action." if db_node_id.nil?
  fail "Missing the required parameter 'action' when calling db_node_action." if action.nil?
  unless ['STOP', 'START', 'SOFTRESET', 'RESET'].include?(action)
    fail "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



260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/database/database_client.rb', line 260

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

  fail "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



297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
# File 'lib/oci/database/database_client.rb', line 297

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

  fail "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



340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/oci/database/database_client.rb', line 340

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

  fail "Missing the required parameter 'database_id' when calling failover_data_guard_association." if database_id.nil?
  fail "Missing the required parameter 'data_guard_association_id' when calling failover_data_guard_association." if data_guard_association_id.nil?
  fail "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



374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File 'lib/oci/database/database_client.rb', line 374

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

  fail "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



407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
# File 'lib/oci/database/database_client.rb', line 407

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

  fail "Missing the required parameter 'database_id' when calling get_data_guard_association." if database_id.nil?
  fail "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



439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
# File 'lib/oci/database/database_client.rb', line 439

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

  fail "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



470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/oci/database/database_client.rb', line 470

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

  fail "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



503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/oci/database/database_client.rb', line 503

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

  fail "Missing the required parameter 'db_home_id' when calling get_db_home_patch." if db_home_id.nil?
  fail "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



537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/oci/database/database_client.rb', line 537

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

  fail "Missing the required parameter 'db_home_id' when calling get_db_home_patch_history_entry." if db_home_id.nil?
  fail "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



569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
# File 'lib/oci/database/database_client.rb', line 569

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

  fail "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



600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/oci/database/database_client.rb', line 600

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

  fail "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



633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
# File 'lib/oci/database/database_client.rb', line 633

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

  fail "Missing the required parameter 'db_system_id' when calling get_db_system_patch." if db_system_id.nil?
  fail "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



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
# File 'lib/oci/database/database_client.rb', line 667

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

  fail "Missing the required parameter 'db_system_id' when calling get_db_system_patch_history_entry." if db_system_id.nil?
  fail "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



715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
# File 'lib/oci/database/database_client.rb', line 715

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

  fail "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>



751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
# File 'lib/oci/database/database_client.rb', line 751

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>



788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/oci/database/database_client.rb', line 788

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

  fail "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>



825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/oci/database/database_client.rb', line 825

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

  fail "Missing the required parameter 'compartment_id' when calling list_databases." if compartment_id.nil?
  fail "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>



864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
# File 'lib/oci/database/database_client.rb', line 864

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

  fail "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>



900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/oci/database/database_client.rb', line 900

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

  fail "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>



937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
# File 'lib/oci/database/database_client.rb', line 937

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

  fail "Missing the required parameter 'compartment_id' when calling list_db_homes." if compartment_id.nil?
  fail "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>



977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
# File 'lib/oci/database/database_client.rb', line 977

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

  fail "Missing the required parameter 'compartment_id' when calling list_db_nodes." if compartment_id.nil?
  fail "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>



1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'lib/oci/database/database_client.rb', line 1016

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

  fail "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>



1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
# File 'lib/oci/database/database_client.rb', line 1052

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

  fail "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>



1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
# File 'lib/oci/database/database_client.rb', line 1088

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

  fail "Missing the required parameter 'availability_domain' when calling list_db_system_shapes." if availability_domain.nil?
  fail "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.

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::DbSystemSummary>



1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
# File 'lib/oci/database/database_client.rb', line 1128

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

  fail "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']

  # 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>



1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
# File 'lib/oci/database/database_client.rb', line 1165

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

  fail "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.



56
57
58
# File 'lib/oci/database/database_client.rb', line 56

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



1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
# File 'lib/oci/database/database_client.rb', line 1207

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

  fail "Missing the required parameter 'database_id' when calling reinstate_data_guard_association." if database_id.nil?
  fail "Missing the required parameter 'data_guard_association_id' when calling reinstate_data_guard_association." if data_guard_association_id.nil?
  fail "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



1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
# File 'lib/oci/database/database_client.rb', line 1247

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

  fail "Missing the required parameter 'database_id' when calling restore_database." if database_id.nil?
  fail "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



1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
# File 'lib/oci/database/database_client.rb', line 1290

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

  fail "Missing the required parameter 'database_id' when calling switchover_data_guard_association." if database_id.nil?
  fail "Missing the required parameter 'data_guard_association_id' when calling switchover_data_guard_association." if data_guard_association_id.nil?
  fail "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



1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
# File 'lib/oci/database/database_client.rb', line 1328

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

  fail "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



1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
# File 'lib/oci/database/database_client.rb', line 1365

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

  fail "Missing the required parameter 'database_id' when calling update_database." if database_id.nil?
  fail "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



1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
# File 'lib/oci/database/database_client.rb', line 1403

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

  fail "Missing the required parameter 'db_home_id' when calling update_db_home." if db_home_id.nil?
  fail "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



1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
# File 'lib/oci/database/database_client.rb', line 1441

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

  fail "Missing the required parameter 'db_system_id' when calling update_db_system." if db_system_id.nil?
  fail "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