class OCI::DataFlow::DataFlowClientCompositeOperations
This class provides a wrapper around {OCI::DataFlow::DataFlowClient} 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
The {OCI::DataFlow::DataFlowClient} used to communicate with the service_client
@return [OCI::DataFlow::DataFlowClient]
Public Class Methods
Initializes a new DataFlowClientCompositeOperations
@param [OCI::DataFlow::DataFlowClient] service_client
The client used to communicate with the service.
Defaults to a new service client created via {OCI::DataFlow::DataFlowClient#initialize} with no arguments
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 20 def initialize(service_client = OCI::DataFlow::DataFlowClient.new) @service_client = service_client end
Public Instance Methods
Calls {OCI::DataFlow::DataFlowClient#change_private_endpoint_compartment} and then waits for the {OCI::DataFlow::Models::WorkRequest} to enter the given state(s).
@param [String] private_endpoint_id The unique ID for a private endpoint.
@param [OCI::DataFlow::Models::ChangePrivateEndpointCompartmentDetails] change_private_endpoint_compartment_details Details for changing a private endpoint's compartment.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#change_private_endpoint_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::DataFlow::Models::WorkRequest}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 42 def change_private_endpoint_compartment_and_wait_for_state(private_endpoint_id, change_private_endpoint_compartment_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.change_private_endpoint_compartment(private_endpoint_id, change_private_endpoint_compartment_details, base_operation_opts) use_util = OCI::DataFlow::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::DataFlow::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
Calls {OCI::DataFlow::DataFlowClient#create_application} and then waits for the {OCI::DataFlow::Models::Application} acted upon to enter the given state(s).
@param [OCI::DataFlow::Models::CreateApplicationDetails] create_application_details Details to create an application.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::Application#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#create_application} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object with data of type {OCI::DataFlow::Models::Application}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 92 def create_application_and_wait_for_state(create_application_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_application(create_application_details, base_operation_opts) return operation_result if wait_for_states.empty? lowered_wait_for_states = wait_for_states.map(&:downcase) wait_for_resource_id = operation_result.data.id begin waiter_result = @service_client.get_application(wait_for_resource_id).wait_until( eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) }, max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30, max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200 ) result_to_return = waiter_result return result_to_return rescue StandardError raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result]) end end
Calls {OCI::DataFlow::DataFlowClient#create_private_endpoint} and then waits for the {OCI::DataFlow::Models::WorkRequest} to enter the given state(s).
@param [OCI::DataFlow::Models::CreatePrivateEndpointDetails] create_private_endpoint_details The parameters required to create a private endpoint.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#create_private_endpoint} @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::DataFlow::Models::WorkRequest}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 132 def create_private_endpoint_and_wait_for_state(create_private_endpoint_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_private_endpoint(create_private_endpoint_details, base_operation_opts) use_util = OCI::DataFlow::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::DataFlow::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
Calls {OCI::DataFlow::DataFlowClient#create_run} and then waits for the {OCI::DataFlow::Models::Run} acted upon to enter the given state(s).
@param [OCI::DataFlow::Models::CreateRunDetails] create_run_details Details for creating a run of an application.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::Run#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#create_run} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object with data of type {OCI::DataFlow::Models::Run}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 182 def create_run_and_wait_for_state(create_run_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_run(create_run_details, base_operation_opts) return operation_result if wait_for_states.empty? lowered_wait_for_states = wait_for_states.map(&:downcase) wait_for_resource_id = operation_result.data.id begin waiter_result = @service_client.get_run(wait_for_resource_id).wait_until( eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) }, max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30, max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200 ) result_to_return = waiter_result return result_to_return rescue StandardError raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result]) end end
Calls {OCI::DataFlow::DataFlowClient#delete_application} and then waits for the {OCI::DataFlow::Models::Application} acted upon to enter the given state(s).
@param [String] application_id The unique ID for an application.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::Application#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#delete_application} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object with data of type nil
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 222 def delete_application_and_wait_for_state(application_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_application(application_id) operation_result = @service_client.delete_application(application_id, base_operation_opts) return operation_result if wait_for_states.empty? lowered_wait_for_states = wait_for_states.map(&:downcase) begin waiter_result = initial_get_result.wait_until( eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) }, max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30, max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200, succeed_on_not_found: true ) result_to_return = waiter_result return result_to_return rescue StandardError raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result]) end end
Calls {OCI::DataFlow::DataFlowClient#delete_private_endpoint} and then waits for the {OCI::DataFlow::Models::WorkRequest} to enter the given state(s).
@param [String] private_endpoint_id The unique ID for a private endpoint.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#delete_private_endpoint} @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::DataFlow::Models::WorkRequest}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 263 def delete_private_endpoint_and_wait_for_state(private_endpoint_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.delete_private_endpoint(private_endpoint_id, base_operation_opts) use_util = OCI::DataFlow::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::DataFlow::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
Calls {OCI::DataFlow::DataFlowClient#delete_run} and then waits for the {OCI::DataFlow::Models::Run} acted upon to enter the given state(s).
@param [String] run_id The unique ID for the run
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::Run#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#delete_run} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object with data of type nil
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 313 def delete_run_and_wait_for_state(run_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_run(run_id) operation_result = @service_client.delete_run(run_id, base_operation_opts) return operation_result if wait_for_states.empty? lowered_wait_for_states = wait_for_states.map(&:downcase) begin waiter_result = initial_get_result.wait_until( eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) }, max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30, max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200, succeed_on_not_found: true ) result_to_return = waiter_result return result_to_return rescue StandardError raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result]) end end
Calls {OCI::DataFlow::DataFlowClient#update_application} and then waits for the {OCI::DataFlow::Models::Application} acted upon to enter the given state(s).
@param [OCI::DataFlow::Models::UpdateApplicationDetails] update_application_details Details for updating an application.
@param [String] application_id The unique ID for an application.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::Application#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#update_application} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object with data of type {OCI::DataFlow::Models::Application}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 356 def update_application_and_wait_for_state(update_application_details, application_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_application(update_application_details, application_id, base_operation_opts) return operation_result if wait_for_states.empty? lowered_wait_for_states = wait_for_states.map(&:downcase) wait_for_resource_id = operation_result.data.id begin waiter_result = @service_client.get_application(wait_for_resource_id).wait_until( eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) }, max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30, max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200 ) result_to_return = waiter_result return result_to_return rescue StandardError raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result]) end end
Calls {OCI::DataFlow::DataFlowClient#update_private_endpoint} and then waits for the {OCI::DataFlow::Models::WorkRequest} to enter the given state(s).
@param [OCI::DataFlow::Models::UpdatePrivateEndpointDetails] update_private_endpoint_details Details for updating a private endpoint.
@param [String] private_endpoint_id The unique ID for a private endpoint.
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#update_private_endpoint} @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::DataFlow::Models::WorkRequest}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 398 def update_private_endpoint_and_wait_for_state(update_private_endpoint_details, private_endpoint_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_private_endpoint(update_private_endpoint_details, private_endpoint_id, base_operation_opts) use_util = OCI::DataFlow::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::DataFlow::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
Calls {OCI::DataFlow::DataFlowClient#update_run} and then waits for the {OCI::DataFlow::Models::Run} acted upon to enter the given state(s).
@param [OCI::DataFlow::Models::UpdateRunDetails] update_run_details Details for updating a run.
@param [String] run_id The unique ID for the run
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::DataFlow::Models::Run#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::DataFlow::DataFlowClient#update_run} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object with data of type {OCI::DataFlow::Models::Run}
# File lib/oci/data_flow/data_flow_client_composite_operations.rb, line 450 def update_run_and_wait_for_state(update_run_details, run_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_run(update_run_details, run_id, base_operation_opts) return operation_result if wait_for_states.empty? lowered_wait_for_states = wait_for_states.map(&:downcase) wait_for_resource_id = operation_result.data.id begin waiter_result = @service_client.get_run(wait_for_resource_id).wait_until( eval_proc: ->(response) { response.data.respond_to?(:lifecycle_state) && lowered_wait_for_states.include?(response.data.lifecycle_state.downcase) }, max_interval_seconds: waiter_opts.key?(:max_interval_seconds) ? waiter_opts[:max_interval_seconds] : 30, max_wait_seconds: waiter_opts.key?(:max_wait_seconds) ? waiter_opts[:max_wait_seconds] : 1200 ) result_to_return = waiter_result return result_to_return rescue StandardError raise OCI::Errors::CompositeOperationError.new(partial_results: [operation_result]) end end