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

#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



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
154
155
# File 'lib/oci/recovery/database_recovery_client.rb', line 118

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



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
216
217
# File 'lib/oci/recovery/database_recovery_client.rb', line 180

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



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
278
279
# File 'lib/oci/recovery/database_recovery_client.rb', line 242

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.

Returns:



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
340
341
# File 'lib/oci/recovery/database_recovery_client.rb', line 304

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



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
391
392
393
394
395
396
397
398
399
400
401
402
403
# File 'lib/oci/recovery/database_recovery_client.rb', line 366

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:



428
429
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
459
460
461
462
463
464
465
# File 'lib/oci/recovery/database_recovery_client.rb', line 428

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

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



489
490
491
492
493
494
495
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
523
524
525
# File 'lib/oci/recovery/database_recovery_client.rb', line 489

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?
  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 = 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



551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
# File 'lib/oci/recovery/database_recovery_client.rb', line 551

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



611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
# File 'lib/oci/recovery/database_recovery_client.rb', line 611

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



674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
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
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
# File 'lib/oci/recovery/database_recovery_client.rb', line 674

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:



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
# File 'lib/oci/recovery/database_recovery_client.rb', line 773

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:



827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
# File 'lib/oci/recovery/database_recovery_client.rb', line 827

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:



881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
# File 'lib/oci/recovery/database_recovery_client.rb', line 881

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:



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

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:



1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
# File 'lib/oci/recovery/database_recovery_client.rb', line 1007

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:



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
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/oci/recovery/database_recovery_client.rb', line 1100

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. Allowed values are: - CREATING - UPDATING - ACTIVE - DELETING - DELETED - FAILED

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



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
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
# File 'lib/oci/recovery/database_recovery_client.rb', line 1202

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:



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
# File 'lib/oci/recovery/database_recovery_client.rb', line 1286

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:



1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
# File 'lib/oci/recovery/database_recovery_client.rb', line 1362

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:



1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
# File 'lib/oci/recovery/database_recovery_client.rb', line 1441

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

#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



1521
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
# File 'lib/oci/recovery/database_recovery_client.rb', line 1521

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



1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
# File 'lib/oci/recovery/database_recovery_client.rb', line 1583

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



1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
# File 'lib/oci/recovery/database_recovery_client.rb', line 1645

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