class OCI::Bds::BdsClientCompositeOperations

This class provides a wrapper around {OCI::Bds::BdsClient} 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::Bds::BdsClient} used to communicate with the service_client

@return [OCI::Bds::BdsClient]

Public Class Methods

new(service_client = OCI::Bds::BdsClient.new) click to toggle source

Initializes a new BdsClientCompositeOperations

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

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

Public Instance Methods

add_auto_scaling_configuration_and_wait_for_state(bds_instance_id, add_auto_scaling_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#add_auto_scaling_configuration} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::AddAutoScalingConfigurationDetails] add_auto_scaling_configuration_details Details for creating an autoscale configuration. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#add_auto_scaling_configuration} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 40
def add_auto_scaling_configuration_and_wait_for_state(bds_instance_id, add_auto_scaling_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.add_auto_scaling_configuration(bds_instance_id, add_auto_scaling_configuration_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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
add_block_storage_and_wait_for_state(bds_instance_id, add_block_storage_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#add_block_storage} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::AddBlockStorageDetails] add_block_storage_details Details for the added block storage. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#add_block_storage} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 90
def add_block_storage_and_wait_for_state(bds_instance_id, add_block_storage_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.add_block_storage(bds_instance_id, add_block_storage_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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
add_cloud_sql_and_wait_for_state(bds_instance_id, add_cloud_sql_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#add_cloud_sql} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::AddCloudSqlDetails] add_cloud_sql_details Details for the Cloud SQL capability @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#add_cloud_sql} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 140
def add_cloud_sql_and_wait_for_state(bds_instance_id, add_cloud_sql_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.add_cloud_sql(bds_instance_id, add_cloud_sql_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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
add_worker_nodes_and_wait_for_state(bds_instance_id, add_worker_nodes_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#add_worker_nodes} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::AddWorkerNodesDetails] add_worker_nodes_details Details for the newly added nodes. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#add_worker_nodes} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 190
def add_worker_nodes_and_wait_for_state(bds_instance_id, add_worker_nodes_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.add_worker_nodes(bds_instance_id, add_worker_nodes_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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_bds_instance_compartment_and_wait_for_state(bds_instance_id, change_bds_instance_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#change_bds_instance_compartment} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::ChangeBdsInstanceCompartmentDetails] change_bds_instance_compartment_details Details for the comparment change. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#change_bds_instance_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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 240
def change_bds_instance_compartment_and_wait_for_state(bds_instance_id, change_bds_instance_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_bds_instance_compartment(bds_instance_id, change_bds_instance_compartment_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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_shape_and_wait_for_state(bds_instance_id, change_shape_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#change_shape} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::ChangeShapeDetails] change_shape_details Individual change shape settings per node type. You can change the shape of master, worker, utility and Cloud SQL nodes. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#change_shape} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 290
def change_shape_and_wait_for_state(bds_instance_id, change_shape_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_shape(bds_instance_id, change_shape_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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_bds_instance_and_wait_for_state(create_bds_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#create_bds_instance} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [OCI::Bds::Models::CreateBdsInstanceDetails] create_bds_instance_details Details for the new cluster. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#create_bds_instance} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 339
def create_bds_instance_and_wait_for_state(create_bds_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_bds_instance(create_bds_instance_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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_bds_instance_and_wait_for_state(bds_instance_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#delete_bds_instance} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#delete_bds_instance} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 388
def delete_bds_instance_and_wait_for_state(bds_instance_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_bds_instance(bds_instance_id, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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
remove_auto_scaling_configuration_and_wait_for_state(bds_instance_id, auto_scaling_configuration_id, remove_auto_scaling_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#remove_auto_scaling_configuration} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [String] auto_scaling_configuration_id Unique Oracle-assigned identifier of the autoscale configuration. @param [OCI::Bds::Models::RemoveAutoScalingConfigurationDetails] remove_auto_scaling_configuration_details Details for the autoscale configuration @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#remove_auto_scaling_configuration} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 439
def remove_auto_scaling_configuration_and_wait_for_state(bds_instance_id, auto_scaling_configuration_id, remove_auto_scaling_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.remove_auto_scaling_configuration(bds_instance_id, auto_scaling_configuration_id, remove_auto_scaling_configuration_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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
remove_cloud_sql_and_wait_for_state(bds_instance_id, remove_cloud_sql_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#remove_cloud_sql} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::RemoveCloudSqlDetails] remove_cloud_sql_details Details for the Cloud SQL capability @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#remove_cloud_sql} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 489
def remove_cloud_sql_and_wait_for_state(bds_instance_id, remove_cloud_sql_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.remove_cloud_sql(bds_instance_id, remove_cloud_sql_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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
restart_node_and_wait_for_state(bds_instance_id, restart_node_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#restart_node} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::RestartNodeDetails] restart_node_details Details for restarting the node. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#restart_node} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 539
def restart_node_and_wait_for_state(bds_instance_id, restart_node_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.restart_node(bds_instance_id, restart_node_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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_auto_scaling_configuration_and_wait_for_state(bds_instance_id, auto_scaling_configuration_id, update_auto_scaling_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#update_auto_scaling_configuration} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [String] auto_scaling_configuration_id Unique Oracle-assigned identifier of the autoscale configuration. @param [OCI::Bds::Models::UpdateAutoScalingConfigurationDetails] update_auto_scaling_configuration_details Details for update an autoscaling configuration. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#update_auto_scaling_configuration} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 590
def update_auto_scaling_configuration_and_wait_for_state(bds_instance_id, auto_scaling_configuration_id, update_auto_scaling_configuration_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_auto_scaling_configuration(bds_instance_id, auto_scaling_configuration_id, update_auto_scaling_configuration_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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_bds_instance_and_wait_for_state(bds_instance_id, update_bds_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Bds::BdsClient#update_bds_instance} and then waits for the {OCI::Bds::Models::WorkRequest} to enter the given state(s).

@param [String] bds_instance_id The OCID of the cluster. @param [OCI::Bds::Models::UpdateBdsInstanceDetails] update_bds_instance_details Details for the cluster to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Bds::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Bds::BdsClient#update_bds_instance} @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::Bds::Models::WorkRequest}

# File lib/oci/bds/bds_client_composite_operations.rb, line 640
def update_bds_instance_and_wait_for_state(bds_instance_id, update_bds_instance_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_bds_instance(bds_instance_id, update_bds_instance_details, base_operation_opts)
  use_util = OCI::Bds::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::Bds::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