class OCI::Opsi::OperationsInsightsClientCompositeOperations

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

@return [OCI::Opsi::OperationsInsightsClient]

Public Class Methods

new(service_client = OCI::Opsi::OperationsInsightsClient.new) click to toggle source

Initializes a new OperationsInsightsClientCompositeOperations

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

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

Public Instance Methods

change_database_insight_compartment_and_wait_for_state(database_insight_id, change_database_insight_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#change_database_insight_compartment} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [String] database_insight_id Unique database insight identifier @param [OCI::Opsi::Models::ChangeDatabaseInsightCompartmentDetails] change_database_insight_compartment_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::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#change_database_insight_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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 40
def change_database_insight_compartment_and_wait_for_state(database_insight_id, change_database_insight_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_database_insight_compartment(database_insight_id, change_database_insight_compartment_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_enterprise_manager_bridge_compartment_and_wait_for_state(enterprise_manager_bridge_id, change_enterprise_manager_bridge_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#change_enterprise_manager_bridge_compartment} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [String] enterprise_manager_bridge_id Unique Enterprise Manager bridge identifier @param [OCI::Opsi::Models::ChangeEnterpriseManagerBridgeCompartmentDetails] change_enterprise_manager_bridge_compartment_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::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#change_enterprise_manager_bridge_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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 90
def change_enterprise_manager_bridge_compartment_and_wait_for_state(enterprise_manager_bridge_id, change_enterprise_manager_bridge_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_enterprise_manager_bridge_compartment(enterprise_manager_bridge_id, change_enterprise_manager_bridge_compartment_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_host_insight_compartment_and_wait_for_state(host_insight_id, change_host_insight_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#change_host_insight_compartment} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [String] host_insight_id Unique host insight identifier @param [OCI::Opsi::Models::ChangeHostInsightCompartmentDetails] change_host_insight_compartment_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::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#change_host_insight_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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 140
def change_host_insight_compartment_and_wait_for_state(host_insight_id, change_host_insight_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.change_host_insight_compartment(host_insight_id, change_host_insight_compartment_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_insight_and_wait_for_state(create_database_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#create_database_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [OCI::Opsi::Models::CreateDatabaseInsightDetails] create_database_insight_details Details for the database for which a Database Insight resource will be created in Operations Insights. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#create_database_insight} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 189
def create_database_insight_and_wait_for_state(create_database_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_database_insight(create_database_insight_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_enterprise_manager_bridge_and_wait_for_state(create_enterprise_manager_bridge_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#create_enterprise_manager_bridge} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [OCI::Opsi::Models::CreateEnterpriseManagerBridgeDetails] create_enterprise_manager_bridge_details Details for the Enterprise Manager bridge to be created in Operations Insights. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#create_enterprise_manager_bridge} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 238
def create_enterprise_manager_bridge_and_wait_for_state(create_enterprise_manager_bridge_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_enterprise_manager_bridge(create_enterprise_manager_bridge_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_host_insight_and_wait_for_state(create_host_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#create_host_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [OCI::Opsi::Models::CreateHostInsightDetails] create_host_insight_details Details for the host for which a Host Insight resource will be created in Operations Insights. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#create_host_insight} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 287
def create_host_insight_and_wait_for_state(create_host_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.create_host_insight(create_host_insight_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_insight_and_wait_for_state(database_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#delete_database_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

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

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 336
def delete_database_insight_and_wait_for_state(database_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_database_insight(database_insight_id, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_enterprise_manager_bridge_and_wait_for_state(enterprise_manager_bridge_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#delete_enterprise_manager_bridge} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [String] enterprise_manager_bridge_id Unique Enterprise Manager bridge identifier @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#delete_enterprise_manager_bridge} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 385
def delete_enterprise_manager_bridge_and_wait_for_state(enterprise_manager_bridge_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_enterprise_manager_bridge(enterprise_manager_bridge_id, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_host_insight_and_wait_for_state(host_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#delete_host_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

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

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 434
def delete_host_insight_and_wait_for_state(host_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.delete_host_insight(host_insight_id, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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
disable_database_insight_and_wait_for_state(database_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#disable_database_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

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

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 483
def disable_database_insight_and_wait_for_state(database_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.disable_database_insight(database_insight_id, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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
disable_host_insight_and_wait_for_state(host_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#disable_host_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

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

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 532
def disable_host_insight_and_wait_for_state(host_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.disable_host_insight(host_insight_id, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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
enable_database_insight_and_wait_for_state(enable_database_insight_details, database_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#enable_database_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [OCI::Opsi::Models::EnableDatabaseInsightDetails] enable_database_insight_details Details for the database to be enabled in Operations Insights. @param [String] database_insight_id Unique database insight identifier @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#enable_database_insight} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 582
def enable_database_insight_and_wait_for_state(enable_database_insight_details, database_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.enable_database_insight(enable_database_insight_details, database_insight_id, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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
enable_host_insight_and_wait_for_state(enable_host_insight_details, host_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#enable_host_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [OCI::Opsi::Models::EnableHostInsightDetails] enable_host_insight_details Details for the host to be enabled in Operations Insights. @param [String] host_insight_id Unique host insight identifier @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#enable_host_insight} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 632
def enable_host_insight_and_wait_for_state(enable_host_insight_details, host_insight_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.enable_host_insight(enable_host_insight_details, host_insight_id, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_insight_and_wait_for_state(database_insight_id, update_database_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#update_database_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [String] database_insight_id Unique database insight identifier @param [OCI::Opsi::Models::UpdateDatabaseInsightDetails] update_database_insight_details The configuration to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#update_database_insight} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 682
def update_database_insight_and_wait_for_state(database_insight_id, update_database_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_database_insight(database_insight_id, update_database_insight_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_enterprise_manager_bridge_and_wait_for_state(enterprise_manager_bridge_id, update_enterprise_manager_bridge_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#update_enterprise_manager_bridge} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [String] enterprise_manager_bridge_id Unique Enterprise Manager bridge identifier @param [OCI::Opsi::Models::UpdateEnterpriseManagerBridgeDetails] update_enterprise_manager_bridge_details The configuration to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#update_enterprise_manager_bridge} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 732
def update_enterprise_manager_bridge_and_wait_for_state(enterprise_manager_bridge_id, update_enterprise_manager_bridge_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_enterprise_manager_bridge(enterprise_manager_bridge_id, update_enterprise_manager_bridge_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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_host_insight_and_wait_for_state(host_insight_id, update_host_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) click to toggle source

Calls {OCI::Opsi::OperationsInsightsClient#update_host_insight} and then waits for the {OCI::Opsi::Models::WorkRequest} to enter the given state(s).

@param [String] host_insight_id Unique host insight identifier @param [OCI::Opsi::Models::UpdateHostInsightDetails] update_host_insight_details The configuration to be updated. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::Opsi::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::Opsi::OperationsInsightsClient#update_host_insight} @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::Opsi::Models::WorkRequest}

# File lib/oci/opsi/operations_insights_client_composite_operations.rb, line 782
def update_host_insight_and_wait_for_state(host_insight_id, update_host_insight_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {})
  operation_result = @service_client.update_host_insight(host_insight_id, update_host_insight_details, base_operation_opts)
  use_util = OCI::Opsi::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::Opsi::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