Class: OCI::Recovery::DatabaseRecoveryClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/recovery/database_recovery_client.rb

Overview

Use Oracle Database Autonomous Recovery Service API to manage Protected Databases.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ DatabaseRecoveryClient

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

This client is not thread-safe

Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via 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 OCI::Regions::REGION_ENUM, but may be an arbitrary string.

  • endpoint (String) (defaults to: nil)

    The fully qualified endpoint URL

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

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

  • proxy_settings (OCI::ApiClientProxySettings) (defaults to: nil)

    If your environment requires you to use a proxy server for outgoing HTTP requests the details for the proxy can be provided in this parameter

  • retry_config (OCI::Retry::RetryConfig) (defaults to: nil)

    The retry configuration for this service client. This represents the default retry configuration to apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/recovery/database_recovery_client.rb', line 55

def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
  # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers)
  # 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.validate_and_build_config_with_signer(config, signer)

  signer = OCI::Signer.config_file_auth_builder(config) if signer.nil?

  @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
  @retry_config = retry_config

  if endpoint
    @endpoint = endpoint + '/20210216'
  else
    region ||= config.region
    region ||= signer.region if signer.respond_to?(:region)
    self.region = region
  end
  logger.info "DatabaseRecoveryClient endpoint set to '#{@endpoint}'." if logger
end

Instance Attribute Details

#api_clientOCI::ApiClient (readonly)

Client used to make HTTP requests.

Returns:



15
16
17
# File 'lib/oci/recovery/database_recovery_client.rb', line 15

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


19
20
21
# File 'lib/oci/recovery/database_recovery_client.rb', line 19

def endpoint
  @endpoint
end

#regionString

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

Returns:

  • (String)


29
30
31
# File 'lib/oci/recovery/database_recovery_client.rb', line 29

def region
  @region
end

#retry_configOCI::Retry::RetryConfig (readonly)

The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil, which means that an operation will not perform any retries



25
26
27
# File 'lib/oci/recovery/database_recovery_client.rb', line 25

def retry_config
  @retry_config
end

Instance Method Details

#cancel_protected_database_deletion(protected_database_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use cancel_protected_database_deletion API.

Cancels the scheduled deletion of a protected database, and returns the protected database to an ACTIVE state. You can cancel the deletion only if the protected database is in the DELETE SCHEDULED state.

Parameters:

  • protected_database_id (String)

    The protected database OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



117
118
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
147
148
149
150
151
152
153
# File 'lib/oci/recovery/database_recovery_client.rb', line 117

def cancel_protected_database_deletion(protected_database_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#cancel_protected_database_deletion.' if logger

  raise "Missing the required parameter 'protected_database_id' when calling cancel_protected_database_deletion." if protected_database_id.nil?
  raise "Parameter value for 'protected_database_id' must not be blank" if OCI::Internal::Util.blank_string?(protected_database_id)

  path = '/protectedDatabases/{protectedDatabaseId}/actions/cancelDeletion'.sub('{protectedDatabaseId}', protected_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#cancel_protected_database_deletion') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_protected_database_compartment(protected_database_id, change_protected_database_compartment_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use change_protected_database_compartment API.

Moves a protected database resource from the existing compartment to the specified compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:

  • protected_database_id (String)

    The protected database OCID.

  • change_protected_database_compartment_details (OCI::Recovery::Models::ChangeProtectedDatabaseCompartmentDetails)

    The configuration details required to move a protected database from the existing compartment to a specified compartment.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



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
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/recovery/database_recovery_client.rb', line 178

def change_protected_database_compartment(protected_database_id, change_protected_database_compartment_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#change_protected_database_compartment.' if logger

  raise "Missing the required parameter 'protected_database_id' when calling change_protected_database_compartment." if protected_database_id.nil?
  raise "Missing the required parameter 'change_protected_database_compartment_details' when calling change_protected_database_compartment." if change_protected_database_compartment_details.nil?
  raise "Parameter value for 'protected_database_id' must not be blank" if OCI::Internal::Util.blank_string?(protected_database_id)

  path = '/protectedDatabases/{protectedDatabaseId}/actions/changeCompartment'.sub('{protectedDatabaseId}', protected_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(change_protected_database_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#change_protected_database_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_protection_policy_compartment(protection_policy_id, change_protection_policy_compartment_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use change_protection_policy_compartment API.

Moves a protection policy resource from the existing compartment to the specified compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:

  • protection_policy_id (String)

    The protection policy OCID.

  • change_protection_policy_compartment_details (OCI::Recovery::Models::ChangeProtectionPolicyCompartmentDetails)

    The configuration details required to move a protection policy from the existing compartment to a specified compartment.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



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
269
270
271
272
273
274
275
276
277
# File 'lib/oci/recovery/database_recovery_client.rb', line 240

def change_protection_policy_compartment(protection_policy_id, change_protection_policy_compartment_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#change_protection_policy_compartment.' if logger

  raise "Missing the required parameter 'protection_policy_id' when calling change_protection_policy_compartment." if protection_policy_id.nil?
  raise "Missing the required parameter 'change_protection_policy_compartment_details' when calling change_protection_policy_compartment." if change_protection_policy_compartment_details.nil?
  raise "Parameter value for 'protection_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(protection_policy_id)

  path = '/protectionPolicies/{protectionPolicyId}/actions/changeCompartment'.sub('{protectionPolicyId}', protection_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(change_protection_policy_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#change_protection_policy_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#change_recovery_service_subnet_compartment(recovery_service_subnet_id, change_recovery_service_subnet_compartment_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use change_recovery_service_subnet_compartment API.

Moves a recovery service subnet resource from the existing compartment to the specified compartment. When provided, If-Match is checked against ETag values of the resource.

Parameters:

  • recovery_service_subnet_id (String)

    The recovery service subnet OCID.

  • change_recovery_service_subnet_compartment_details (OCI::Recovery::Models::ChangeRecoveryServiceSubnetCompartmentDetails)

    The configuration details required to move a Recovery Service subnet from the existing compartment to a specified compartment.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
# File 'lib/oci/recovery/database_recovery_client.rb', line 302

def change_recovery_service_subnet_compartment(recovery_service_subnet_id, change_recovery_service_subnet_compartment_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#change_recovery_service_subnet_compartment.' if logger

  raise "Missing the required parameter 'recovery_service_subnet_id' when calling change_recovery_service_subnet_compartment." if recovery_service_subnet_id.nil?
  raise "Missing the required parameter 'change_recovery_service_subnet_compartment_details' when calling change_recovery_service_subnet_compartment." if change_recovery_service_subnet_compartment_details.nil?
  raise "Parameter value for 'recovery_service_subnet_id' must not be blank" if OCI::Internal::Util.blank_string?(recovery_service_subnet_id)

  path = '/recoveryServiceSubnets/{recoveryServiceSubnetId}/actions/changeCompartment'.sub('{recoveryServiceSubnetId}', recovery_service_subnet_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(change_recovery_service_subnet_compartment_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#change_recovery_service_subnet_compartment') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_protected_database(create_protected_database_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_protected_database API.

Creates a new Protected Database.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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 might be rejected.

  • :opc_request_id (String)

    Unique identifier for the request.

  • :opc_dry_run (BOOLEAN)

    Indicates if the request is to test the preparedness for creating a protected database, without actually creating a protected database.

    If you set the opcDryRun option as true, then Recovery Service only performs a test run to check for any missing prerequisites or configurations required to create a protected database, and then returns error messages to warn you about any missing requirements.

    If an error occurs, you can review, correct, and repeat the dry run until the createProtectedDatabase request does not return any errors.

    These are the common issues that you can identify by performing a dry run of the createProtectedDatabase request:

    • The Recovery Service subnet has insufficient free IP addresses to support the required number of private endpoints. See, troubleshooting information

    • Recovery Service does not have permissions to manage the network resources in a chosen compartment

    • Recovery Service is out of capacity. See, Service Limits for more information

    • Recovery Service resources exceed quota limits

    • A protected database, having the same database ID, already exists

    • The specified protection policy does not exist, or it is not in an Active state

    • The specified Recovery Service subnet does not exist, or it is not in an Active state

    See, Prerequisites for Using Recovery Service for more information. (default to false)

Returns:



382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
# File 'lib/oci/recovery/database_recovery_client.rb', line 382

def create_protected_database(create_protected_database_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#create_protected_database.' if logger

  raise "Missing the required parameter 'create_protected_database_details' when calling create_protected_database." if create_protected_database_details.nil?

  path = '/protectedDatabases'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'opc-dry-run'] = opts[:opc_dry_run] if !opts[:opc_dry_run].nil?
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_protected_database_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#create_protected_database') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::ProtectedDatabase'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_protection_policy(create_protection_policy_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_protection_policy API.

Creates a new Protection Policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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 might be rejected.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/oci/recovery/database_recovery_client.rb', line 445

def create_protection_policy(create_protection_policy_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#create_protection_policy.' if logger

  raise "Missing the required parameter 'create_protection_policy_details' when calling create_protection_policy." if create_protection_policy_details.nil?

  path = '/protectionPolicies'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_protection_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#create_protection_policy') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::ProtectionPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#create_recovery_service_subnet(create_recovery_service_subnet_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use create_recovery_service_subnet API.

Creates a new Recovery Service Subnet.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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 might be rejected.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
# File 'lib/oci/recovery/database_recovery_client.rb', line 507

def create_recovery_service_subnet(create_recovery_service_subnet_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#create_recovery_service_subnet.' if logger

  raise "Missing the required parameter 'create_recovery_service_subnet_details' when calling create_recovery_service_subnet." if create_recovery_service_subnet_details.nil?

  path = '/recoveryServiceSubnets'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf
  header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token

  post_body = @api_client.object_to_http_body(create_recovery_service_subnet_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#create_recovery_service_subnet') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::RecoveryServiceSubnet'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_protected_database(protected_database_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_protected_database API.

Deletes a protected database based on the specified protected database ID.

Parameters:

  • protected_database_id (String)

    The protected database OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :deletion_schedule (String)

    Defines a preferred schedule to delete a protected database after you terminate the source database. * The default schedule is DELETE_AFTER_72_HOURS, so that the delete operation can occur 72 hours (3 days) after the source database is terminated . * The alternate schedule is DELETE_AFTER_RETENTION_PERIOD. Specify this option if you want to delete a protected database only after the policy-defined backup retention period expires.

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
# File 'lib/oci/recovery/database_recovery_client.rb', line 572

def delete_protected_database(protected_database_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#delete_protected_database.' if logger

  raise "Missing the required parameter 'protected_database_id' when calling delete_protected_database." if protected_database_id.nil?

  if opts[:deletion_schedule] && !OCI::Recovery::Models::DELETION_SCHEDULE_ENUM.include?(opts[:deletion_schedule])
    raise 'Invalid value for "deletion_schedule", must be one of the values in OCI::Recovery::Models::DELETION_SCHEDULE_ENUM.'
  end
  raise "Parameter value for 'protected_database_id' must not be blank" if OCI::Internal::Util.blank_string?(protected_database_id)

  path = '/protectedDatabases/{protectedDatabaseId}'.sub('{protectedDatabaseId}', protected_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:deletionSchedule] = opts[:deletion_schedule] if opts[:deletion_schedule]

  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#delete_protected_database') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_protection_policy(protection_policy_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_protection_policy API.

Deletes a specified protection policy. You can delete custom policies only. Deleting a Oracle predefined policies will result in status code 405 Method Not Allowed.

Parameters:

  • protection_policy_id (String)

    The protection policy OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
# File 'lib/oci/recovery/database_recovery_client.rb', line 639

def delete_protection_policy(protection_policy_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#delete_protection_policy.' if logger

  raise "Missing the required parameter 'protection_policy_id' when calling delete_protection_policy." if protection_policy_id.nil?
  raise "Parameter value for 'protection_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(protection_policy_id)

  path = '/protectionPolicies/{protectionPolicyId}'.sub('{protectionPolicyId}', protection_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#delete_protection_policy') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#delete_recovery_service_subnet(recovery_service_subnet_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use delete_recovery_service_subnet API.

Deletes a specified recovery service subnet.

Parameters:

  • recovery_service_subnet_id (String)

    The recovery service subnet OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



699
700
701
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
731
732
733
734
735
# File 'lib/oci/recovery/database_recovery_client.rb', line 699

def delete_recovery_service_subnet(recovery_service_subnet_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#delete_recovery_service_subnet.' if logger

  raise "Missing the required parameter 'recovery_service_subnet_id' when calling delete_recovery_service_subnet." if recovery_service_subnet_id.nil?
  raise "Parameter value for 'recovery_service_subnet_id' must not be blank" if OCI::Internal::Util.blank_string?(recovery_service_subnet_id)

  path = '/recoveryServiceSubnets/{recoveryServiceSubnetId}'.sub('{recoveryServiceSubnetId}', recovery_service_subnet_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#delete_recovery_service_subnet') do
    @api_client.call_api(
      :DELETE,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#fetch_protected_database_configuration(protected_database_id, opts = {}, &block) ⇒ Response

Note:

Click here to see an example of how to use fetch_protected_database_configuration API.

Downloads the network service configuration file 'tnsnames.ora' for a specified protected database. Applies to user-defined recovery systems only.

Parameters:

  • protected_database_id (String)

    The protected database OCID.

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

    the optional parameters

  • [Block] (Hash)

    a customizable set of options

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :fetch_protected_database_configuration_details (OCI::Recovery::Models::FetchProtectedDatabaseConfigurationDetails)

    Which configuration to get

  • :opc_request_id (String)

    Unique identifier for the request.

  • :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.

  • :response_target (String, IO)

    Streaming http body into a file (specified by file name or File object) or IO object if the block is not given

Returns:

  • (Response)

    A Response object with data of type String if response_target and block are not given, otherwise with nil data



762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
# File 'lib/oci/recovery/database_recovery_client.rb', line 762

def fetch_protected_database_configuration(protected_database_id, opts = {}, &block)
  logger.debug 'Calling operation DatabaseRecoveryClient#fetch_protected_database_configuration.' if logger

  raise "Missing the required parameter 'protected_database_id' when calling fetch_protected_database_configuration." if protected_database_id.nil?
  raise "Parameter value for 'protected_database_id' must not be blank" if OCI::Internal::Util.blank_string?(protected_database_id)

  path = '/protectedDatabases/{protectedDatabaseId}/actions/getConfiguration'.sub('{protectedDatabaseId}', protected_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = opts[:accept] if opts[:accept]
  header_params[:accept] ||= 'application/json'
  header_params[:'accept-encoding'] = opts[:accept_encoding] if opts[:accept_encoding]
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(opts[:fetch_protected_database_configuration_details])

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#fetch_protected_database_configuration') do
    if !block.nil?
      @api_client.call_api(
        :POST,
        path,
        endpoint,
        header_params: header_params,
        query_params: query_params,
        operation_signing_strategy: operation_signing_strategy,
        body: post_body,
        return_type: 'Stream',
        &block
      )
    elsif opts[:response_target]
      if opts[:response_target].respond_to? :write
        @api_client.call_api(
          :POST,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'Stream',
          &proc { |chunk, _response| opts[:response_target].write(chunk) }
        )
      elsif opts[:response_target].is_a?(String)
        File.open(opts[:response_target], 'wb') do |output|
          return @api_client.call_api(
            :POST,
            path,
            endpoint,
            header_params: header_params,
            query_params: query_params,
            operation_signing_strategy: operation_signing_strategy,
            body: post_body,
            return_type: 'Stream',
            &proc { |chunk, _response| output.write(chunk) }
          )
        end
      end
    else
      @api_client.call_api(
        :POST,
        path,
        endpoint,
        header_params: header_params,
        query_params: query_params,
        operation_signing_strategy: operation_signing_strategy,
        body: post_body,
        return_type: 'String'
      )
    end
  end
  # rubocop:enable Metrics/BlockLength
end

#get_protected_database(protected_database_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_protected_database API.

Gets information about a specified protected database.

Parameters:

  • protected_database_id (String)

    The protected database OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



861
862
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
894
895
896
897
# File 'lib/oci/recovery/database_recovery_client.rb', line 861

def get_protected_database(protected_database_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#get_protected_database.' if logger

  raise "Missing the required parameter 'protected_database_id' when calling get_protected_database." if protected_database_id.nil?
  raise "Parameter value for 'protected_database_id' must not be blank" if OCI::Internal::Util.blank_string?(protected_database_id)

  path = '/protectedDatabases/{protectedDatabaseId}'.sub('{protectedDatabaseId}', protected_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#get_protected_database') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::ProtectedDatabase'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_protection_policy(protection_policy_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_protection_policy API.

Gets information about a specified protection policy.

Parameters:

  • protection_policy_id (String)

    The protection policy OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
# File 'lib/oci/recovery/database_recovery_client.rb', line 915

def get_protection_policy(protection_policy_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#get_protection_policy.' if logger

  raise "Missing the required parameter 'protection_policy_id' when calling get_protection_policy." if protection_policy_id.nil?
  raise "Parameter value for 'protection_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(protection_policy_id)

  path = '/protectionPolicies/{protectionPolicyId}'.sub('{protectionPolicyId}', protection_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#get_protection_policy') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::ProtectionPolicy'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_recovery_service_subnet(recovery_service_subnet_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_recovery_service_subnet API.

Gets information about a specified recovery service subnet.

Parameters:

  • recovery_service_subnet_id (String)

    The recovery service subnet OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



969
970
971
972
973
974
975
976
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
# File 'lib/oci/recovery/database_recovery_client.rb', line 969

def get_recovery_service_subnet(recovery_service_subnet_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#get_recovery_service_subnet.' if logger

  raise "Missing the required parameter 'recovery_service_subnet_id' when calling get_recovery_service_subnet." if recovery_service_subnet_id.nil?
  raise "Parameter value for 'recovery_service_subnet_id' must not be blank" if OCI::Internal::Util.blank_string?(recovery_service_subnet_id)

  path = '/recoveryServiceSubnets/{recoveryServiceSubnetId}'.sub('{recoveryServiceSubnetId}', recovery_service_subnet_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#get_recovery_service_subnet') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::RecoveryServiceSubnet'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#get_work_request(work_request_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use get_work_request API.

Gets the status of the work request based on the specified ID

Parameters:

  • work_request_id (String)

    The OCID of the work request.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



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
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
# File 'lib/oci/recovery/database_recovery_client.rb', line 1023

def get_work_request(work_request_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#get_work_request.' if logger

  raise "Missing the required parameter 'work_request_id' when calling get_work_request." if work_request_id.nil?
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#get_work_request') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::WorkRequest'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

Click here to see an example of how to use list_protected_databases API.

Lists the protected databases based on the specified parameters.

Parameters:

  • compartment_id (String)

    The compartment OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :lifecycle_state (String)

    A filter to return only the resources that match the specified lifecycle state.

  • :display_name (String)

    A filter to return only resources that match the entire 'displayname' given.

  • :id (String)

    The protected database OCID.

  • :protection_policy_id (String)

    The protection policy OCID.

  • :recovery_service_subnet_id (String)

    The recovery service subnet OCID.

  • :limit (Integer)

    The maximum number of items to return per page. (default to 10)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC). Allowed values are: - ASC - DESC (default to ASC)

  • :sort_by (String)

    The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If you do not specify a value, then TIMECREATED is used as the default sort order. Allowed values are: - TIMECREATED - DISPLAYNAME (default to timeCreated) Allowed values are: timeCreated, displayName

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



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
1122
1123
1124
1125
1126
1127
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
# File 'lib/oci/recovery/database_recovery_client.rb', line 1095

def list_protected_databases(compartment_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#list_protected_databases.' if logger

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

  if opts[:lifecycle_state] && !OCI::Recovery::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Recovery::Models::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_order] && !OCI::Recovery::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Recovery::Models::SORT_ORDER_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.'
  end

  path = '/protectedDatabases'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:protectionPolicyId] = opts[:protection_policy_id] if opts[:protection_policy_id]
  query_params[:recoveryServiceSubnetId] = opts[:recovery_service_subnet_id] if opts[:recovery_service_subnet_id]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#list_protected_databases') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::ProtectedDatabaseCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

Click here to see an example of how to use list_protection_policies API.

Gets a list of protection policies based on the specified parameters.

Parameters:

  • compartment_id (String)

    The compartment OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :lifecycle_state (String)

    A filter to return only resources their lifecycleState matches the given lifecycleState.

  • :display_name (String)

    A filter to return only resources that match the entire 'displayname' given.

  • :protection_policy_id (String)

    The protection policy OCID.

  • :owner (String)

    A filter to return only the policies that match the owner as 'Customer' or 'Oracle'. Allowed values are: oracle, customer

  • :limit (Integer)

    The maximum number of items to return. Specify a value greater than 4. (default to 10)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC). Allowed values are: - ASC - DESC (default to ASC)

  • :sort_by (String)

    The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If you do not specify a value, then TIMECREATED is used as the default sort order. Allowed values are: - TIMECREATED - DISPLAYNAME (default to timeCreated) Allowed values are: timeCreated, displayName

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
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
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
# File 'lib/oci/recovery/database_recovery_client.rb', line 1188

def list_protection_policies(compartment_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#list_protection_policies.' if logger

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

  if opts[:lifecycle_state] && !OCI::Recovery::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Recovery::Models::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:owner] && !%w[oracle customer].include?(opts[:owner])
    raise 'Invalid value for "owner", must be one of oracle, customer.'
  end

  if opts[:sort_order] && !OCI::Recovery::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Recovery::Models::SORT_ORDER_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.'
  end

  path = '/protectionPolicies'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:protectionPolicyId] = opts[:protection_policy_id] if opts[:protection_policy_id]
  query_params[:owner] = opts[:owner] if opts[:owner]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#list_protection_policies') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::ProtectionPolicyCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

Click here to see an example of how to use list_recovery_service_subnets API.

Returns a list of Recovery Service Subnets.

Parameters:

  • compartment_id (String)

    The compartment OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :lifecycle_state (String)

    A filter to return only the resources that match the specified lifecycle state.

  • :display_name (String)

    A filter to return only resources that match the entire 'displayname' given.

  • :id (String)

    The recovery service subnet OCID.

  • :vcn_id (String)

    The OCID of the virtual cloud network (VCN) associated with the recovery service subnet.

  • :limit (Integer)

    The maximum number of items to return per page. (default to 10)

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC). Allowed values are: - ASC - DESC (default to ASC)

  • :sort_by (String)

    The field to sort by. You can provide one sort order (sortOrder). Default order for TIMECREATED is descending. Default order for DISPLAYNAME is ascending. If you do not specify a value, then TIMECREATED is used as the default sort order. Allowed values are: - TIMECREATED - DISPLAYNAME (default to timeCreated) Allowed values are: timeCreated, displayName

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:



1283
1284
1285
1286
1287
1288
1289
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
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
# File 'lib/oci/recovery/database_recovery_client.rb', line 1283

def list_recovery_service_subnets(compartment_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#list_recovery_service_subnets.' if logger

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

  if opts[:lifecycle_state] && !OCI::Recovery::Models::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
    raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Recovery::Models::LIFECYCLE_STATE_ENUM.'
  end

  if opts[:sort_order] && !OCI::Recovery::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Recovery::Models::SORT_ORDER_ENUM.'
  end

  if opts[:sort_by] && !%w[timeCreated displayName].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated, displayName.'
  end

  path = '/recoveryServiceSubnets'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
  query_params[:displayName] = opts[:display_name] if opts[:display_name]
  query_params[:id] = opts[:id] if opts[:id]
  query_params[:vcnId] = opts[:vcn_id] if opts[:vcn_id]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#list_recovery_service_subnets') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::RecoveryServiceSubnetCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_errors(work_request_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_work_request_errors API.

Return a (paginated) list of errors for a given work request.

Allowed values are: timeCreated

Parameters:

  • work_request_id (String)

    The OCID of the work request.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

    The maximum number of items to return per page. (default to 10)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. (default to timeCreated)

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC). Allowed values are: - ASC - DESC (default to ASC)

Returns:



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
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
# File 'lib/oci/recovery/database_recovery_client.rb', line 1367

def list_work_request_errors(work_request_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#list_work_request_errors.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_errors." if work_request_id.nil?

  if opts[:sort_by] && !%w[timeCreated].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated.'
  end

  if opts[:sort_order] && !OCI::Recovery::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Recovery::Models::SORT_ORDER_ENUM.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/errors'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#list_work_request_errors') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::WorkRequestErrorCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#list_work_request_logs(work_request_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use list_work_request_logs API.

Return a (paginated) list of logs for a given work request.

Allowed values are: timeCreated

Parameters:

  • work_request_id (String)

    The OCID of the work request.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :opc_request_id (String)

    Unique identifier for the request.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

    The maximum number of items to return per page. (default to 10)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. (default to timeCreated)

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC). Allowed values are: - ASC - DESC (default to ASC)

Returns:



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
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
# File 'lib/oci/recovery/database_recovery_client.rb', line 1443

def list_work_request_logs(work_request_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#list_work_request_logs.' if logger

  raise "Missing the required parameter 'work_request_id' when calling list_work_request_logs." if work_request_id.nil?

  if opts[:sort_by] && !%w[timeCreated].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeCreated.'
  end

  if opts[:sort_order] && !OCI::Recovery::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Recovery::Models::SORT_ORDER_ENUM.'
  end
  raise "Parameter value for 'work_request_id' must not be blank" if OCI::Internal::Util.blank_string?(work_request_id)

  path = '/workRequests/{workRequestId}/logs'.sub('{workRequestId}', work_request_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#list_work_request_logs') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::WorkRequestLogEntryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

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

Note:

Click here to see an example of how to use list_work_requests API.

Lists the work requests in a compartment.

Allowed values are: timeAccepted

Parameters:

  • compartment_id (String)

    The compartment OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :work_request_id (String)

    Unique Oracle-assigned identifier of the work request.

  • :status (String)

    A filter to return only resources their lifecycleState matches the given OperationStatus.

  • :resource_id (String)

    The ID of the resource affected by the work request.

  • :opc_request_id (String)

    Unique identifier for the request.

  • :page (String)

    The page token representing the page at which to start retrieving results. This is usually retrieved from a previous list call.

  • :limit (Integer)

    The maximum number of items to return per page. (default to 10)

  • :sort_order (String)

    The sort order to use, either ascending (ASC) or descending (DESC). Allowed values are: - ASC - DESC (default to ASC)

  • :sort_by (String)

    The field to sort by. Only one sort order may be provided. Default order for timeAccepted is descending. (default to timeAccepted)

Returns:



1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
# File 'lib/oci/recovery/database_recovery_client.rb', line 1522

def list_work_requests(compartment_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#list_work_requests.' if logger

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

  if opts[:status] && !OCI::Recovery::Models::OPERATION_STATUS_ENUM.include?(opts[:status])
    raise 'Invalid value for "status", must be one of the values in OCI::Recovery::Models::OPERATION_STATUS_ENUM.'
  end

  if opts[:sort_order] && !OCI::Recovery::Models::SORT_ORDER_ENUM.include?(opts[:sort_order])
    raise 'Invalid value for "sort_order", must be one of the values in OCI::Recovery::Models::SORT_ORDER_ENUM.'
  end

  if opts[:sort_by] && !%w[timeAccepted].include?(opts[:sort_by])
    raise 'Invalid value for "sort_by", must be one of timeAccepted.'
  end

  path = '/workRequests'
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # Query Params
  query_params = {}
  query_params[:compartmentId] = compartment_id
  query_params[:workRequestId] = opts[:work_request_id] if opts[:work_request_id]
  query_params[:status] = opts[:status] if opts[:status]
  query_params[:resourceId] = opts[:resource_id] if opts[:resource_id]
  query_params[:page] = opts[:page] if opts[:page]
  query_params[:limit] = opts[:limit] if opts[:limit]
  query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
  query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]

  # Header Params
  header_params = {}
  header_params[:accept] = 'application/json'
  header_params[:'content-type'] = 'application/json'
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = nil

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#list_work_requests') do
    @api_client.call_api(
      :GET,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body,
      return_type: 'OCI::Recovery::Models::WorkRequestSummaryCollection'
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



94
95
96
# File 'lib/oci/recovery/database_recovery_client.rb', line 94

def logger
  @api_client.config.logger
end

#schedule_protected_database_deletion(protected_database_id, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use schedule_protected_database_deletion API.

Defines a preferred schedule to delete a protected database after you terminate the source database. The default schedule is DELETE_AFTER_72_HOURS, so that the delete operation can occur 72 hours (3 days) after the source database is terminated. The alternate schedule is DELETE_AFTER_RETENTION_PERIOD. Specify this option if you want to delete a protected database only after the policy-defined backup retention period expires.

Parameters:

  • protected_database_id (String)

    The protected database OCID.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :schedule_protected_database_deletion_details (OCI::Recovery::Models::ScheduleProtectedDatabaseDeletionDetails)

    The details for scheduling deletion of the protected database

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
# File 'lib/oci/recovery/database_recovery_client.rb', line 1605

def schedule_protected_database_deletion(protected_database_id, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#schedule_protected_database_deletion.' if logger

  raise "Missing the required parameter 'protected_database_id' when calling schedule_protected_database_deletion." if protected_database_id.nil?
  raise "Parameter value for 'protected_database_id' must not be blank" if OCI::Internal::Util.blank_string?(protected_database_id)

  path = '/protectedDatabases/{protectedDatabaseId}/actions/scheduleDeletion'.sub('{protectedDatabaseId}', protected_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(opts[:schedule_protected_database_deletion_details])

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#schedule_protected_database_deletion') do
    @api_client.call_api(
      :POST,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_protected_database(protected_database_id, update_protected_database_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_protected_database API.

Updates the Protected Database

Parameters:

  • protected_database_id (String)

    The protected database OCID.

  • update_protected_database_details (OCI::Recovery::Models::UpdateProtectedDatabaseDetails)

    Describes the parameters required to update a protected database.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
# File 'lib/oci/recovery/database_recovery_client.rb', line 1666

def update_protected_database(protected_database_id, update_protected_database_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#update_protected_database.' if logger

  raise "Missing the required parameter 'protected_database_id' when calling update_protected_database." if protected_database_id.nil?
  raise "Missing the required parameter 'update_protected_database_details' when calling update_protected_database." if update_protected_database_details.nil?
  raise "Parameter value for 'protected_database_id' must not be blank" if OCI::Internal::Util.blank_string?(protected_database_id)

  path = '/protectedDatabases/{protectedDatabaseId}'.sub('{protectedDatabaseId}', protected_database_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_protected_database_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#update_protected_database') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_protection_policy(protection_policy_id, update_protection_policy_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_protection_policy API.

Updates the specified protection policy.

Parameters:

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
# File 'lib/oci/recovery/database_recovery_client.rb', line 1728

def update_protection_policy(protection_policy_id, update_protection_policy_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#update_protection_policy.' if logger

  raise "Missing the required parameter 'protection_policy_id' when calling update_protection_policy." if protection_policy_id.nil?
  raise "Missing the required parameter 'update_protection_policy_details' when calling update_protection_policy." if update_protection_policy_details.nil?
  raise "Parameter value for 'protection_policy_id' must not be blank" if OCI::Internal::Util.blank_string?(protection_policy_id)

  path = '/protectionPolicies/{protectionPolicyId}'.sub('{protectionPolicyId}', protection_policy_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_protection_policy_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#update_protection_policy') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end

#update_recovery_service_subnet(recovery_service_subnet_id, update_recovery_service_subnet_details, opts = {}) ⇒ Response

Note:

Click here to see an example of how to use update_recovery_service_subnet API.

Updates the specified recovery service subnet.

Parameters:

  • recovery_service_subnet_id (String)

    The recovery service subnet OCID.

  • update_recovery_service_subnet_details (OCI::Recovery::Models::UpdateRecoveryServiceSubnetDetails)

    Describes the parameters required to update a recovery service subnet.

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

    the optional parameters

Options Hash (opts):

  • :retry_config (OCI::Retry::RetryConfig)

    The retry configuration to apply to this operation. If no key is provided then the service-level retry configuration defined by #retry_config will be used. If an explicit nil value is provided then the operation will not retry

  • :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.

  • :opc_request_id (String)

    Unique identifier for the request.

Returns:

  • (Response)

    A Response object with data of type nil



1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
# File 'lib/oci/recovery/database_recovery_client.rb', line 1790

def update_recovery_service_subnet(recovery_service_subnet_id, update_recovery_service_subnet_details, opts = {})
  logger.debug 'Calling operation DatabaseRecoveryClient#update_recovery_service_subnet.' if logger

  raise "Missing the required parameter 'recovery_service_subnet_id' when calling update_recovery_service_subnet." if recovery_service_subnet_id.nil?
  raise "Missing the required parameter 'update_recovery_service_subnet_details' when calling update_recovery_service_subnet." if update_recovery_service_subnet_details.nil?
  raise "Parameter value for 'recovery_service_subnet_id' must not be blank" if OCI::Internal::Util.blank_string?(recovery_service_subnet_id)

  path = '/recoveryServiceSubnets/{recoveryServiceSubnetId}'.sub('{recoveryServiceSubnetId}', recovery_service_subnet_id.to_s)
  operation_signing_strategy = :standard

  # rubocop:disable Style/NegatedIf
  # 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]
  header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
  # rubocop:enable Style/NegatedIf

  post_body = @api_client.object_to_http_body(update_recovery_service_subnet_details)

  # rubocop:disable Metrics/BlockLength
  OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'DatabaseRecoveryClient#update_recovery_service_subnet') do
    @api_client.call_api(
      :PUT,
      path,
      endpoint,
      header_params: header_params,
      query_params: query_params,
      operation_signing_strategy: operation_signing_strategy,
      body: post_body
    )
  end
  # rubocop:enable Metrics/BlockLength
end