Class: OCI::Database::DatabaseClient
- Inherits:
-
Object
- Object
- OCI::Database::DatabaseClient
- Defined in:
- lib/oci/database/database_client.rb
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
Instance Method Summary collapse
-
#create_backup(create_backup_details, opts = {}) ⇒ Response
Creates a new backup in the specified database based on the request parameters you provide.
-
#create_data_guard_association(database_id, create_data_guard_association_details, opts = {}) ⇒ Response
Creates a new Data Guard association.
-
#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.
-
#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.
-
#delete_backup(backup_id, opts = {}) ⇒ Response
Deletes a full backup.
-
#delete_db_home(db_home_id, opts = {}) ⇒ Response
Deletes a DB Home.
-
#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.
-
#get_backup(backup_id, opts = {}) ⇒ Response
Gets information about the specified backup.
-
#get_data_guard_association(database_id, data_guard_association_id, opts = {}) ⇒ Response
Gets the specified Data Guard association’s configuration information.
-
#get_database(database_id, opts = {}) ⇒ Response
Gets information about a specific database.
-
#get_db_home(db_home_id, opts = {}) ⇒ Response
Gets information about the specified database home.
-
#get_db_home_patch(db_home_id, patch_id, opts = {}) ⇒ Response
Gets information about a specified patch package.
-
#get_db_home_patch_history_entry(db_home_id, patch_history_entry_id, opts = {}) ⇒ Response
Gets the patch history details for the specified patchHistoryEntryId.
-
#get_db_node(db_node_id, opts = {}) ⇒ Response
Gets information about the specified database node.
-
#get_db_system(db_system_id, opts = {}) ⇒ Response
Gets information about the specified DB System.
-
#get_db_system_patch(db_system_id, patch_id, opts = {}) ⇒ Response
Gets information about a specified patch package.
-
#get_db_system_patch_history_entry(db_system_id, patch_history_entry_id, opts = {}) ⇒ Response
Gets the patch history details for the specified patchHistoryEntryId.
-
#initialize(config: nil, region: nil, signer: nil, proxy_settings: nil) ⇒ DatabaseClient
constructor
Creates a new DatabaseClient.
-
#launch_db_system(launch_db_system_details, opts = {}) ⇒ Response
Launches a new DB System in the specified compartment and Availability Domain.
-
#list_backups(opts = {}) ⇒ Response
Gets a list of backups based on the databaseId or compartmentId specified.
-
#list_data_guard_associations(database_id, opts = {}) ⇒ Response
Lists all Data Guard associations for the specified database.
-
#list_databases(compartment_id, db_home_id, opts = {}) ⇒ Response
Gets a list of the databases in the specified database home.
-
#list_db_home_patch_history_entries(db_home_id, opts = {}) ⇒ Response
Gets history of the actions taken for patches for the specified database home.
-
#list_db_home_patches(db_home_id, opts = {}) ⇒ Response
Lists patches applicable to the requested database home.
-
#list_db_homes(compartment_id, db_system_id, opts = {}) ⇒ Response
Gets a list of database homes in the specified DB System and compartment.
-
#list_db_nodes(compartment_id, db_system_id, opts = {}) ⇒ Response
Gets a list of database nodes in the specified DB System and compartment.
-
#list_db_system_patch_history_entries(db_system_id, opts = {}) ⇒ Response
Gets the history of the patch actions performed on the specified DB System.
-
#list_db_system_patches(db_system_id, opts = {}) ⇒ Response
Lists the patches applicable to the requested DB System.
-
#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.
-
#list_db_systems(compartment_id, opts = {}) ⇒ Response
Gets a list of the DB Systems in the specified compartment.
-
#list_db_versions(compartment_id, opts = {}) ⇒ Response
Gets a list of supported Oracle database versions.
-
#logger ⇒ Logger
The logger for this client.
-
#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.
-
#restore_database(database_id, restore_database_details, opts = {}) ⇒ Response
Restore a Database based on the request parameters you provide.
-
#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.
-
#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.
-
#update_database(database_id, update_database_details, opts = {}) ⇒ Response
Update a Database based on the request parameters you provide.
-
#update_db_home(db_home_id, update_db_home_details, opts = {}) ⇒ Response
Patches the specified dbHome.
-
#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.
Constructor Details
#initialize(config: nil, region: nil, signer: nil, proxy_settings: 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.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/database/database_client.rb', line 36 def initialize(config: nil, region: nil, signer: nil, proxy_settings: 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, proxy_settings: proxy_settings) region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
12 13 14 |
# File 'lib/oci/database/database_client.rb', line 12 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
16 17 18 |
# File 'lib/oci/database/database_client.rb', line 16 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
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.
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 113 114 |
# File 'lib/oci/database/database_client.rb', line 88 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).
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 161 162 163 |
# File 'lib/oci/database/database_client.rb', line 135 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) 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.
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/oci/database/database_client.rb', line 176 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.
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 265 266 267 268 |
# File 'lib/oci/database/database_client.rb', line 235 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 raise "Parameter value for 'db_node_id' must not be blank" if OCI::Internal::Util::blank_string?(db_node_id) 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.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 |
# File 'lib/oci/database/database_client.rb', line 278 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? raise "Parameter value for 'backup_id' must not be blank" if OCI::Internal::Util::blank_string?(backup_id) 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.
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/oci/database/database_client.rb', line 316 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? raise "Parameter value for 'db_home_id' must not be blank" if OCI::Internal::Util::blank_string?(db_home_id) 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.
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
# File 'lib/oci/database/database_client.rb', line 360 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) raise "Parameter value for 'data_guard_association_id' must not be blank" if OCI::Internal::Util::blank_string?(data_guard_association_id) 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.
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
# File 'lib/oci/database/database_client.rb', line 396 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? raise "Parameter value for 'backup_id' must not be blank" if OCI::Internal::Util::blank_string?(backup_id) 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.
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
# File 'lib/oci/database/database_client.rb', line 430 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) raise "Parameter value for 'data_guard_association_id' must not be blank" if OCI::Internal::Util::blank_string?(data_guard_association_id) 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.
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/oci/database/database_client.rb', line 464 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) 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.
496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 |
# File 'lib/oci/database/database_client.rb', line 496 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? raise "Parameter value for 'db_home_id' must not be blank" if OCI::Internal::Util::blank_string?(db_home_id) 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.
530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
# File 'lib/oci/database/database_client.rb', line 530 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? raise "Parameter value for 'db_home_id' must not be blank" if OCI::Internal::Util::blank_string?(db_home_id) raise "Parameter value for 'patch_id' must not be blank" if OCI::Internal::Util::blank_string?(patch_id) 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
566 567 568 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 566 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? raise "Parameter value for 'db_home_id' must not be blank" if OCI::Internal::Util::blank_string?(db_home_id) raise "Parameter value for 'patch_history_entry_id' must not be blank" if OCI::Internal::Util::blank_string?(patch_history_entry_id) 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.
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 626 |
# File 'lib/oci/database/database_client.rb', line 600 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? raise "Parameter value for 'db_node_id' must not be blank" if OCI::Internal::Util::blank_string?(db_node_id) 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.
632 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 |
# File 'lib/oci/database/database_client.rb', line 632 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? raise "Parameter value for 'db_system_id' must not be blank" if OCI::Internal::Util::blank_string?(db_system_id) 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.
666 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 694 |
# File 'lib/oci/database/database_client.rb', line 666 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? raise "Parameter value for 'db_system_id' must not be blank" if OCI::Internal::Util::blank_string?(db_system_id) raise "Parameter value for 'patch_id' must not be blank" if OCI::Internal::Util::blank_string?(patch_id) 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.
702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 |
# File 'lib/oci/database/database_client.rb', line 702 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? raise "Parameter value for 'db_system_id' must not be blank" if OCI::Internal::Util::blank_string?(db_system_id) raise "Parameter value for 'patch_history_entry_id' must not be blank" if OCI::Internal::Util::blank_string?(patch_history_entry_id) 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).
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 |
# File 'lib/oci/database/database_client.rb', line 752 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.
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 816 |
# File 'lib/oci/database/database_client.rb', line 788 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.
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 |
# File 'lib/oci/database/database_client.rb', line 825 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) 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.
863 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 892 893 |
# File 'lib/oci/database/database_client.rb', line 863 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.
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 928 929 930 |
# File 'lib/oci/database/database_client.rb', line 902 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? raise "Parameter value for 'db_home_id' must not be blank" if OCI::Internal::Util::blank_string?(db_home_id) 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.
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 939 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? raise "Parameter value for 'db_home_id' must not be blank" if OCI::Internal::Util::blank_string?(db_home_id) 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.
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_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.
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 1044 1045 1046 1047 |
# File 'lib/oci/database/database_client.rb', line 1017 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.
1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 |
# File 'lib/oci/database/database_client.rb', line 1056 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? raise "Parameter value for 'db_system_id' must not be blank" if OCI::Internal::Util::blank_string?(db_system_id) 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.
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 1119 1120 1121 |
# File 'lib/oci/database/database_client.rb', line 1093 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? raise "Parameter value for 'db_system_id' must not be blank" if OCI::Internal::Util::blank_string?(db_system_id) 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.
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 1157 1158 1159 1160 |
# File 'lib/oci/database/database_client.rb', line 1130 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.
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 |
# File 'lib/oci/database/database_client.rb', line 1171 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.
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 1236 1237 1238 |
# File 'lib/oci/database/database_client.rb', line 1209 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 |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
72 73 74 |
# File 'lib/oci/database/database_client.rb', line 72 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.
1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 |
# File 'lib/oci/database/database_client.rb', line 1251 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) raise "Parameter value for 'data_guard_association_id' must not be blank" if OCI::Internal::Util::blank_string?(data_guard_association_id) 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.
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 1319 1320 1321 |
# File 'lib/oci/database/database_client.rb', line 1293 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) 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.
1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 |
# File 'lib/oci/database/database_client.rb', line 1337 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) raise "Parameter value for 'data_guard_association_id' must not be blank" if OCI::Internal::Util::blank_string?(data_guard_association_id) 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.
1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 |
# File 'lib/oci/database/database_client.rb', line 1377 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? raise "Parameter value for 'db_system_id' must not be blank" if OCI::Internal::Util::blank_string?(db_system_id) 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.
1415 1416 1417 1418 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 |
# File 'lib/oci/database/database_client.rb', line 1415 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? raise "Parameter value for 'database_id' must not be blank" if OCI::Internal::Util::blank_string?(database_id) 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.
1454 1455 1456 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 |
# File 'lib/oci/database/database_client.rb', line 1454 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? raise "Parameter value for 'db_home_id' must not be blank" if OCI::Internal::Util::blank_string?(db_home_id) 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.
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 |
# File 'lib/oci/database/database_client.rb', line 1493 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? raise "Parameter value for 'db_system_id' must not be blank" if OCI::Internal::Util::blank_string?(db_system_id) 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 |