class OCI::OsManagement::OsManagementClientCompositeOperations
This class provides a wrapper around {OCI::OsManagement::OsManagementClient} 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::OsManagement::OsManagementClient} used to communicate with the service_client
@return [OCI::OsManagement::OsManagementClient]
Public Class Methods
Initializes a new OsManagementClientCompositeOperations
@param [OCI::OsManagement::OsManagementClient] service_client
The client used to communicate with the service.
Defaults to a new service client created via {OCI::OsManagement::OsManagementClient#initialize} with no arguments
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 20 def initialize(service_client = OCI::OsManagement::OsManagementClient.new) @service_client = service_client end
Public Instance Methods
Calls {OCI::OsManagement::OsManagementClient#create_managed_instance_group} and then waits for the {OCI::OsManagement::Models::ManagedInstanceGroup} acted upon to enter the given state(s).
@param [OCI::OsManagement::Models::CreateManagedInstanceGroupDetails] create_managed_instance_group_details Details about a Managed Instance Group to create @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::ManagedInstanceGroup#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#create_managed_instance_group} @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::OsManagement::Models::ManagedInstanceGroup}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 39 def create_managed_instance_group_and_wait_for_state(create_managed_instance_group_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_managed_instance_group(create_managed_instance_group_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_managed_instance_group(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::OsManagement::OsManagementClient#create_scheduled_job} and then waits for the {OCI::OsManagement::Models::ScheduledJob} acted upon to enter the given state(s).
@param [OCI::OsManagement::Models::CreateScheduledJobDetails] create_scheduled_job_details Details about a Scheduled Job to create @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::ScheduledJob#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#create_scheduled_job} @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::OsManagement::Models::ScheduledJob}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 78 def create_scheduled_job_and_wait_for_state(create_scheduled_job_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_scheduled_job(create_scheduled_job_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_scheduled_job(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::OsManagement::OsManagementClient#create_software_source} and then waits for the {OCI::OsManagement::Models::SoftwareSource} acted upon to enter the given state(s).
@param [OCI::OsManagement::Models::CreateSoftwareSourceDetails] create_software_source_details Details about a Sofware Source to create @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::SoftwareSource#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#create_software_source} @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::OsManagement::Models::SoftwareSource}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 117 def create_software_source_and_wait_for_state(create_software_source_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_software_source(create_software_source_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_software_source(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::OsManagement::OsManagementClient#delete_managed_instance_group} and then waits for the {OCI::OsManagement::Models::ManagedInstanceGroup} acted upon to enter the given state(s).
@param [String] managed_instance_group_id OCID for the managed instance group @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::ManagedInstanceGroup#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#delete_managed_instance_group} @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/os_management/os_management_client_composite_operations.rb, line 156 def delete_managed_instance_group_and_wait_for_state(managed_instance_group_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_managed_instance_group(managed_instance_group_id) operation_result = @service_client.delete_managed_instance_group(managed_instance_group_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::OsManagement::OsManagementClient#delete_scheduled_job} and then waits for the {OCI::OsManagement::Models::ScheduledJob} acted upon to enter the given state(s).
@param [String] scheduled_job_id The ID of the scheduled job. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::ScheduledJob#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#delete_scheduled_job} @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/os_management/os_management_client_composite_operations.rb, line 196 def delete_scheduled_job_and_wait_for_state(scheduled_job_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_scheduled_job(scheduled_job_id) operation_result = @service_client.delete_scheduled_job(scheduled_job_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::OsManagement::OsManagementClient#delete_software_source} and then waits for the {OCI::OsManagement::Models::SoftwareSource} acted upon to enter the given state(s).
@param [String] software_source_id The OCID of the software source. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::SoftwareSource#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#delete_software_source} @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/os_management/os_management_client_composite_operations.rb, line 236 def delete_software_source_and_wait_for_state(software_source_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_software_source(software_source_id) operation_result = @service_client.delete_software_source(software_source_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::OsManagement::OsManagementClient#install_all_package_updates_on_managed_instance} and then waits for the {OCI::OsManagement::Models::WorkRequest} to enter the given state(s).
@param [String] managed_instance_id OCID for the managed instance @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#install_all_package_updates_on_managed_instance} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::OsManagement::Models::WorkRequest}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 276 def install_all_package_updates_on_managed_instance_and_wait_for_state(managed_instance_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.install_all_package_updates_on_managed_instance(managed_instance_id, base_operation_opts) use_util = OCI::OsManagement::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::OsManagement::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::OsManagement::OsManagementClient#install_all_windows_updates_on_managed_instance} and then waits for the {OCI::OsManagement::Models::WorkRequest} to enter the given state(s).
@param [String] managed_instance_id OCID for the managed instance @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#install_all_windows_updates_on_managed_instance} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::OsManagement::Models::WorkRequest}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 325 def install_all_windows_updates_on_managed_instance_and_wait_for_state(managed_instance_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.install_all_windows_updates_on_managed_instance(managed_instance_id, base_operation_opts) use_util = OCI::OsManagement::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::OsManagement::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::OsManagement::OsManagementClient#install_package_on_managed_instance} and then waits for the {OCI::OsManagement::Models::WorkRequest} to enter the given state(s).
@param [String] managed_instance_id OCID for the managed instance @param [String] software_package_name Package name @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#install_package_on_managed_instance} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::OsManagement::Models::WorkRequest}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 375 def install_package_on_managed_instance_and_wait_for_state(managed_instance_id, software_package_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.install_package_on_managed_instance(managed_instance_id, software_package_name, base_operation_opts) use_util = OCI::OsManagement::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::OsManagement::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::OsManagement::OsManagementClient#install_package_update_on_managed_instance} and then waits for the {OCI::OsManagement::Models::WorkRequest} to enter the given state(s).
@param [String] managed_instance_id OCID for the managed instance @param [String] software_package_name Package name @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#install_package_update_on_managed_instance} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::OsManagement::Models::WorkRequest}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 425 def install_package_update_on_managed_instance_and_wait_for_state(managed_instance_id, software_package_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.install_package_update_on_managed_instance(managed_instance_id, software_package_name, base_operation_opts) use_util = OCI::OsManagement::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::OsManagement::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::OsManagement::OsManagementClient#install_windows_update_on_managed_instance} and then waits for the {OCI::OsManagement::Models::WorkRequest} to enter the given state(s).
@param [String] managed_instance_id OCID for the managed instance @param [String] windows_update_name Unique identifier for the Windows update. NOTE - This is not an OCID,
but is a unique identifier assigned by Microsoft. Example: `6981d463-cd91-4a26-b7c4-ea4ded9183ed`
@param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#install_windows_update_on_managed_instance} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::OsManagement::Models::WorkRequest}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 478 def install_windows_update_on_managed_instance_and_wait_for_state(managed_instance_id, windows_update_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.install_windows_update_on_managed_instance(managed_instance_id, windows_update_name, base_operation_opts) use_util = OCI::OsManagement::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::OsManagement::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::OsManagement::OsManagementClient#remove_package_from_managed_instance} and then waits for the {OCI::OsManagement::Models::WorkRequest} to enter the given state(s).
@param [String] managed_instance_id OCID for the managed instance @param [String] software_package_name Package name @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::WorkRequest#status} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#remove_package_from_managed_instance} @param [Hash] waiter_opts Optional arguments for the waiter. Keys should be symbols, and the following keys are supported:
* max_interval_seconds: The maximum interval between queries, in seconds. * max_wait_seconds The maximum time to wait, in seconds
@return [OCI::Response] A {OCI::Response} object containing the completed {OCI::OsManagement::Models::WorkRequest}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 528 def remove_package_from_managed_instance_and_wait_for_state(managed_instance_id, software_package_name, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.remove_package_from_managed_instance(managed_instance_id, software_package_name, base_operation_opts) use_util = OCI::OsManagement::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::OsManagement::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::OsManagement::OsManagementClient#update_managed_instance_group} and then waits for the {OCI::OsManagement::Models::ManagedInstanceGroup} acted upon to enter the given state(s).
@param [String] managed_instance_group_id OCID for the managed instance group @param [OCI::OsManagement::Models::UpdateManagedInstanceGroupDetails] update_managed_instance_group_details Details about a Managed Instance Group to update @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::ManagedInstanceGroup#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#update_managed_instance_group} @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::OsManagement::Models::ManagedInstanceGroup}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 578 def update_managed_instance_group_and_wait_for_state(managed_instance_group_id, update_managed_instance_group_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_managed_instance_group(managed_instance_group_id, update_managed_instance_group_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_managed_instance_group(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::OsManagement::OsManagementClient#update_scheduled_job} and then waits for the {OCI::OsManagement::Models::ScheduledJob} acted upon to enter the given state(s).
@param [String] scheduled_job_id The ID of the scheduled job. @param [OCI::OsManagement::Models::UpdateScheduledJobDetails] update_scheduled_job_details Details about a Scheduled Job to update @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::ScheduledJob#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#update_scheduled_job} @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::OsManagement::Models::ScheduledJob}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 618 def update_scheduled_job_and_wait_for_state(scheduled_job_id, update_scheduled_job_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_scheduled_job(scheduled_job_id, update_scheduled_job_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_scheduled_job(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::OsManagement::OsManagementClient#update_software_source} and then waits for the {OCI::OsManagement::Models::SoftwareSource} acted upon to enter the given state(s).
@param [String] software_source_id The OCID of the software source. @param [OCI::OsManagement::Models::UpdateSoftwareSourceDetails] update_software_source_details Details about a Sofware Source to update @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::OsManagement::Models::SoftwareSource#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::OsManagement::OsManagementClient#update_software_source} @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::OsManagement::Models::SoftwareSource}
# File lib/oci/os_management/os_management_client_composite_operations.rb, line 658 def update_software_source_and_wait_for_state(software_source_id, update_software_source_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_software_source(software_source_id, update_software_source_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_software_source(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