class OCI::GoldenGate::GoldenGateClientCompositeOperations

This class provides a wrapper around {OCI::GoldenGate::GoldenGateClient} and offers convenience methods for operations that would otherwise need to be chained together. For example, instead of performing an action on a resource (e.g. launching an instance, creating a load balancer) and then using a waiter to wait for the resource to enter a given state, you can call a single method in this class to accomplish the same functionality

Attributes

service_client[R]

The {OCI::GoldenGate::GoldenGateClient} used to communicate with the service_client

@return [OCI::GoldenGate::GoldenGateClient]

Public Class Methods

new(service_client = OCI::GoldenGate::GoldenGateClient.new) click to toggle source

Initializes a new GoldenGateClientCompositeOperations

@param [OCI::GoldenGate::GoldenGateClient] service_client The client used to communicate with the service.

Defaults to a new service client created via {OCI::GoldenGate::GoldenGateClient#initialize} with no arguments
# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 20
def initialize(service_client = OCI::GoldenGate::GoldenGateClient.new)
  @service_client = service_client
end

Public Instance Methods

change_database_registration_compartment_and_wait_for_state(database_registration_id, change_database_registration_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#change_database_registration_compartment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] database_registration_id A unique DatabaseRegistration identifier.

@param [OCI::GoldenGate::Models::ChangeDatabaseRegistrationCompartmentDetails] change_database_registration_compartment_details Properties to change the compartment of a DatabaseRegistration.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#change_database_registration_compartment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 42
def change_database_registration_compartment_and_wait_for_state(database_registration_id, change_database_registration_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_database_registration_compartment(database_registration_id, change_database_registration_compartment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
change_deployment_compartment_and_wait_for_state(deployment_id, change_deployment_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#change_deployment_compartment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_id A unique Deployment identifier.

@param [OCI::GoldenGate::Models::ChangeDeploymentCompartmentDetails] change_deployment_compartment_details Properties to change the compartment of a Deployment.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#change_deployment_compartment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 94
def change_deployment_compartment_and_wait_for_state(deployment_id, change_deployment_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_deployment_compartment(deployment_id, change_deployment_compartment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_database_registration_and_wait_for_state(create_database_registration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#create_database_registration} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [OCI::GoldenGate::Models::CreateDatabaseRegistrationDetails] create_database_registration_details Specification of the DatabaseRegistration to create.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#create_database_registration} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 144
def create_database_registration_and_wait_for_state(create_database_registration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_database_registration(create_database_registration_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_deployment_and_wait_for_state(create_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#create_deployment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [OCI::GoldenGate::Models::CreateDeploymentDetails] create_deployment_details Specifications to create the Deployment.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#create_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 194
def create_deployment_and_wait_for_state(create_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_deployment(create_deployment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
create_deployment_backup_and_wait_for_state(create_deployment_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#create_deployment_backup} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [OCI::GoldenGate::Models::CreateDeploymentBackupDetails] create_deployment_backup_details Specification of the DeploymentBackup to create. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#create_deployment_backup} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 243
def create_deployment_backup_and_wait_for_state(create_deployment_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_deployment_backup(create_deployment_backup_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_database_registration_and_wait_for_state(database_registration_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#delete_database_registration} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] database_registration_id A unique DatabaseRegistration identifier.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#delete_database_registration} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 293
def delete_database_registration_and_wait_for_state(database_registration_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_database_registration(database_registration_id, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_deployment_and_wait_for_state(deployment_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#delete_deployment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_id A unique Deployment identifier.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#delete_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 343
def delete_deployment_and_wait_for_state(deployment_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_deployment(deployment_id, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
delete_deployment_backup_and_wait_for_state(deployment_backup_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#delete_deployment_backup} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_backup_id A unique DeploymentBackup identifier.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#delete_deployment_backup} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 393
def delete_deployment_backup_and_wait_for_state(deployment_backup_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_deployment_backup(deployment_backup_id, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
restore_deployment_and_wait_for_state(deployment_backup_id, restore_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#restore_deployment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_backup_id A unique DeploymentBackup identifier.

@param [OCI::GoldenGate::Models::RestoreDeploymentDetails] restore_deployment_details A placeholder for any additional metadata to describe the deployment restore.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#restore_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 445
def restore_deployment_and_wait_for_state(deployment_backup_id, restore_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.restore_deployment(deployment_backup_id, restore_deployment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
start_deployment_and_wait_for_state(deployment_id, start_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#start_deployment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_id A unique Deployment identifier.

@param [OCI::GoldenGate::Models::StartDeploymentDetails] start_deployment_details A placeholder for any additional metadata to describe the deployment start.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#start_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 497
def start_deployment_and_wait_for_state(deployment_id, start_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.start_deployment(deployment_id, start_deployment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
stop_deployment_and_wait_for_state(deployment_id, stop_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#stop_deployment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_id A unique Deployment identifier.

@param [OCI::GoldenGate::Models::StopDeploymentDetails] stop_deployment_details A placeholder for any additional metadata to describe the deployment stop.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#stop_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 549
def stop_deployment_and_wait_for_state(deployment_id, stop_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.stop_deployment(deployment_id, stop_deployment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_database_registration_and_wait_for_state(database_registration_id, update_database_registration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#update_database_registration} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] database_registration_id A unique DatabaseRegistration identifier.

@param [OCI::GoldenGate::Models::UpdateDatabaseRegistrationDetails] update_database_registration_details The new DatabaseRegistration specifications to apply.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#update_database_registration} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 601
def update_database_registration_and_wait_for_state(database_registration_id, update_database_registration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_database_registration(database_registration_id, update_database_registration_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_deployment_and_wait_for_state(deployment_id, update_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#update_deployment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_id A unique Deployment identifier.

@param [OCI::GoldenGate::Models::UpdateDeploymentDetails] update_deployment_details The information to be updated.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#update_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 653
def update_deployment_and_wait_for_state(deployment_id, update_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_deployment(deployment_id, update_deployment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
update_deployment_backup_and_wait_for_state(deployment_backup_id, update_deployment_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#update_deployment_backup} and then waits for the {OCI::GoldenGate::Models::DeploymentBackup} acted upon to enter the given state(s).

@param [String] deployment_backup_id A unique DeploymentBackup identifier.

@param [OCI::GoldenGate::Models::UpdateDeploymentBackupDetails] update_deployment_backup_details The information to be updated.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::DeploymentBackup#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#update_deployment_backup} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object with data of type {OCI::GoldenGate::Models::DeploymentBackup}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 705
def update_deployment_backup_and_wait_for_state(deployment_backup_id, update_deployment_backup_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_deployment_backup(deployment_backup_id, update_deployment_backup_details, base_operation_opts)

  return operation_result if wait_for_states.empty?

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.data.id

  begin
    waiter_result = @service_client.get_deployment_backup(wait_for_resource_id).wait_until(
      eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) },
      max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
      max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
    )
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end
upgrade_deployment_and_wait_for_state(deployment_id, upgrade_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::GoldenGate::GoldenGateClient#upgrade_deployment} and then waits for the {OCI::GoldenGate::Models::WorkRequest} to enter the given state(s).

@param [String] deployment_id A unique Deployment identifier.

@param [OCI::GoldenGate::Models::UpgradeDeploymentDetails] upgrade_deployment_details A placeholder for any additional metadata to describe the deployment upgrade.

@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::GoldenGate::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::GoldenGate::GoldenGateClient#upgrade_deployment} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:

* max_interval_seconds: The maximum interval between queries, in seconds.
* max_wait_seconds The maximum time to wait, in seconds

@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::GoldenGate::Models::WorkRequest}

# File lib/oci/golden_gate/golden_gate_client_composite_operations.rb, line 747
def upgrade_deployment_and_wait_for_state(deployment_id, upgrade_deployment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.upgrade_deployment(deployment_id, upgrade_deployment_details, base_operation_opts)
  use_util = OCI::GoldenGate::Util.respond_to?(:wait_on_work_request)

  return operation_result if wait_for_states.empty? && !use_util

  lowered_wait_for_states = wait_for_states.map(&:downcase)
  wait_for_resource_id = operation_result.headers['opc-work-request-id']

  begin
    if use_util
      waiter_result = OCI::GoldenGate::Util.wait_on_work_request(
        @service_client,
        wait_for_resource_id,
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    else
      waiter_result = @service_client.get_work_request(wait_for_resource_id).wait_until(
        eval_proc: ->(response) { response.data.respond_to?(:status) && lowered_wait_for_states.include?(response.data.status.downcase) },
        max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30,
        max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200
      )
    end
    result_to_return = waiter_result

    return result_to_return
  rescue StandardError
    raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result])
  end
end