class OCI::Blockchain::BlockchainPlatformClientCompositeOperations

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

@return [OCI::Blockchain::BlockchainPlatformClient]

Public Class Methods

new(service_client = OCI::Blockchain::BlockchainPlatformClient.new) click to toggle source

Initializes a new BlockchainPlatformClientCompositeOperations

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

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

Public Instance Methods

change_blockchain_platform_compartment_and_wait_for_state(blockchain_platform_id, change_blockchain_platform_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#change_blockchain_platform_compartment} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [OCI::Blockchain::Models::ChangeBlockchainPlatformCompartmentDetails] change_blockchain_platform_compartment_details Input payload to move the resource to a different compartment.

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

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 41
def change_blockchain_platform_compartment_and_wait_for_state(blockchain_platform_id, change_blockchain_platform_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_blockchain_platform_compartment(blockchain_platform_id, change_blockchain_platform_compartment_details, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_blockchain_platform_and_wait_for_state(create_blockchain_platform_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#create_blockchain_platform} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [OCI::Blockchain::Models::CreateBlockchainPlatformDetails] create_blockchain_platform_details Details for the new service. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#create_blockchain_platform} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 90
def create_blockchain_platform_and_wait_for_state(create_blockchain_platform_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_blockchain_platform(create_blockchain_platform_details, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_osn_and_wait_for_state(blockchain_platform_id, create_osn_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#create_osn} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [OCI::Blockchain::Models::CreateOsnDetails] create_osn_details Input payload to create blockchain platform OSN. The payload cannot be empty.

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

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 141
def create_osn_and_wait_for_state(blockchain_platform_id, create_osn_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_osn(blockchain_platform_id, create_osn_details, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_peer_and_wait_for_state(blockchain_platform_id, create_peer_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#create_peer} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [OCI::Blockchain::Models::CreatePeerDetails] create_peer_details Input payload to create a blockchain platform peer. The payload cannot be empty.

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

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 192
def create_peer_and_wait_for_state(blockchain_platform_id, create_peer_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_peer(blockchain_platform_id, create_peer_details, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_blockchain_platform_and_wait_for_state(blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#delete_blockchain_platform} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#delete_blockchain_platform} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 241
def delete_blockchain_platform_and_wait_for_state(blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_blockchain_platform(blockchain_platform_id, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_osn_and_wait_for_state(blockchain_platform_id, osn_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#delete_osn} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [String] osn_id OSN identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#delete_osn} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 291
def delete_osn_and_wait_for_state(blockchain_platform_id, osn_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_osn(blockchain_platform_id, osn_id, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_peer_and_wait_for_state(blockchain_platform_id, peer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#delete_peer} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [String] peer_id Peer identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#delete_peer} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 341
def delete_peer_and_wait_for_state(blockchain_platform_id, peer_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_peer(blockchain_platform_id, peer_id, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_work_request_and_wait_for_state(work_request_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#delete_work_request} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] work_request_id The ID of the asynchronous request. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#delete_work_request} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 390
def delete_work_request_and_wait_for_state(work_request_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_work_request(work_request_id, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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
scale_blockchain_platform_and_wait_for_state(blockchain_platform_id, scale_blockchain_platform_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#scale_blockchain_platform} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [OCI::Blockchain::Models::ScaleBlockchainPlatformDetails] scale_blockchain_platform_details Input payload to scaleout blockchain platform. The payload cannot be empty.

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

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 441
def scale_blockchain_platform_and_wait_for_state(blockchain_platform_id, scale_blockchain_platform_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.scale_blockchain_platform(blockchain_platform_id, scale_blockchain_platform_details, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_blockchain_platform_and_wait_for_state(blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#start_blockchain_platform} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#start_blockchain_platform} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 490
def start_blockchain_platform_and_wait_for_state(blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.start_blockchain_platform(blockchain_platform_id, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_blockchain_platform_and_wait_for_state(blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#stop_blockchain_platform} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#stop_blockchain_platform} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 539
def stop_blockchain_platform_and_wait_for_state(blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.stop_blockchain_platform(blockchain_platform_id, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_blockchain_platform_and_wait_for_state(update_blockchain_platform_details, blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#update_blockchain_platform} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [OCI::Blockchain::Models::UpdateBlockchainPlatformDetails] update_blockchain_platform_details The Blockchain Platform fields to update. Fields that are not provided will not be updated. @param [String] blockchain_platform_id Unique service identifier. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Blockchain::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Blockchain::BlockchainPlatformClient#update_blockchain_platform} @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::Blockchain::Models::WorkRequest}

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 589
def update_blockchain_platform_and_wait_for_state(update_blockchain_platform_details, blockchain_platform_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_blockchain_platform(update_blockchain_platform_details, blockchain_platform_id, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_osn_and_wait_for_state(blockchain_platform_id, osn_id, update_osn_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#update_osn} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [String] osn_id OSN identifier. @param [OCI::Blockchain::Models::UpdateOsnDetails] update_osn_details Input payload to update a blockchain platform OSN. The payload cannot be empty.

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

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 641
def update_osn_and_wait_for_state(blockchain_platform_id, osn_id, update_osn_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_osn(blockchain_platform_id, osn_id, update_osn_details, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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_peer_and_wait_for_state(blockchain_platform_id, peer_id, update_peer_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Blockchain::BlockchainPlatformClient#update_peer} and then waits for the {OCI::Blockchain::Models::WorkRequest} to enter the given state(s).

@param [String] blockchain_platform_id Unique service identifier. @param [String] peer_id Peer identifier. @param [OCI::Blockchain::Models::UpdatePeerDetails] update_peer_details Input payload to update a blockchain platform peer. The payload cannot be empty.

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

# File lib/oci/blockchain/blockchain_platform_client_composite_operations.rb, line 693
def update_peer_and_wait_for_state(blockchain_platform_id, peer_id, update_peer_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_peer(blockchain_platform_id, peer_id, update_peer_details, base_operation_opts)
  use_util = OCI::Blockchain::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::Blockchain::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