class OCI::FileStorage::FileStorageClientCompositeOperations
This class provides a wrapper around {OCI::FileStorage::FileStorageClient} 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::FileStorage::FileStorageClient} used to communicate with the service_client
@return [OCI::FileStorage::FileStorageClient]
Public Class Methods
Initializes a new FileStorageClientCompositeOperations
@param [OCI::FileStorage::FileStorageClient] service_client
The client used to communicate with the service.
Defaults to a new service client created via {OCI::FileStorage::FileStorageClient#initialize} with no arguments
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 20 def initialize(service_client = OCI::FileStorage::FileStorageClient.new) @service_client = service_client end
Public Instance Methods
Calls {OCI::FileStorage::FileStorageClient#create_export} and then waits for the {OCI::FileStorage::Models::Export} acted upon to enter the given state(s).
@param [OCI::FileStorage::Models::CreateExportDetails] create_export_details Details for creating a new export. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::Export#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#create_export} @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::FileStorage::Models::Export}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 39 def create_export_and_wait_for_state(create_export_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_export(create_export_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_export(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::FileStorage::FileStorageClient#create_file_system} and then waits for the {OCI::FileStorage::Models::FileSystem} acted upon to enter the given state(s).
@param [OCI::FileStorage::Models::CreateFileSystemDetails] create_file_system_details Details for creating a new file system. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::FileSystem#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#create_file_system} @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::FileStorage::Models::FileSystem}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 78 def create_file_system_and_wait_for_state(create_file_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_file_system(create_file_system_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_file_system(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::FileStorage::FileStorageClient#create_mount_target} and then waits for the {OCI::FileStorage::Models::MountTarget} acted upon to enter the given state(s).
@param [OCI::FileStorage::Models::CreateMountTargetDetails] create_mount_target_details Details for creating a new mount target. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::MountTarget#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#create_mount_target} @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::FileStorage::Models::MountTarget}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 117 def create_mount_target_and_wait_for_state(create_mount_target_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_mount_target(create_mount_target_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_mount_target(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::FileStorage::FileStorageClient#create_snapshot} and then waits for the {OCI::FileStorage::Models::Snapshot} acted upon to enter the given state(s).
@param [OCI::FileStorage::Models::CreateSnapshotDetails] create_snapshot_details Details for creating a new snapshot. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::Snapshot#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#create_snapshot} @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::FileStorage::Models::Snapshot}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 156 def create_snapshot_and_wait_for_state(create_snapshot_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.create_snapshot(create_snapshot_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_snapshot(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::FileStorage::FileStorageClient#delete_export} and then waits for the {OCI::FileStorage::Models::Export} acted upon to enter the given state(s).
@param [String] export_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the export. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::Export#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#delete_export} @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/file_storage/file_storage_client_composite_operations.rb, line 195 def delete_export_and_wait_for_state(export_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_export(export_id) operation_result = @service_client.delete_export(export_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::FileStorage::FileStorageClient#delete_file_system} and then waits for the {OCI::FileStorage::Models::FileSystem} acted upon to enter the given state(s).
@param [String] file_system_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::FileSystem#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#delete_file_system} @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/file_storage/file_storage_client_composite_operations.rb, line 235 def delete_file_system_and_wait_for_state(file_system_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_file_system(file_system_id) operation_result = @service_client.delete_file_system(file_system_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::FileStorage::FileStorageClient#delete_mount_target} and then waits for the {OCI::FileStorage::Models::MountTarget} acted upon to enter the given state(s).
@param [String] mount_target_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the mount target. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::MountTarget#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#delete_mount_target} @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/file_storage/file_storage_client_composite_operations.rb, line 275 def delete_mount_target_and_wait_for_state(mount_target_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_mount_target(mount_target_id) operation_result = @service_client.delete_mount_target(mount_target_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::FileStorage::FileStorageClient#delete_snapshot} and then waits for the {OCI::FileStorage::Models::Snapshot} acted upon to enter the given state(s).
@param [String] snapshot_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the snapshot. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::Snapshot#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#delete_snapshot} @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/file_storage/file_storage_client_composite_operations.rb, line 315 def delete_snapshot_and_wait_for_state(snapshot_id, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) initial_get_result = @service_client.get_snapshot(snapshot_id) operation_result = @service_client.delete_snapshot(snapshot_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::FileStorage::FileStorageClient#update_export} and then waits for the {OCI::FileStorage::Models::Export} acted upon to enter the given state(s).
@param [String] export_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the export. @param [OCI::FileStorage::Models::UpdateExportDetails] update_export_details Details object for updating an export. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::Export#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#update_export} @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::FileStorage::Models::Export}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 356 def update_export_and_wait_for_state(export_id, update_export_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_export(export_id, update_export_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_export(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::FileStorage::FileStorageClient#update_export_set} and then waits for the {OCI::FileStorage::Models::ExportSet} acted upon to enter the given state(s).
@param [String] export_set_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the export set. @param [OCI::FileStorage::Models::UpdateExportSetDetails] update_export_set_details Details object for updating an export set. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::ExportSet#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#update_export_set} @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::FileStorage::Models::ExportSet}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 396 def update_export_set_and_wait_for_state(export_set_id, update_export_set_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_export_set(export_set_id, update_export_set_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_export_set(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::FileStorage::FileStorageClient#update_file_system} and then waits for the {OCI::FileStorage::Models::FileSystem} acted upon to enter the given state(s).
@param [String] file_system_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the file system. @param [OCI::FileStorage::Models::UpdateFileSystemDetails] update_file_system_details Details object for updating a file system. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::FileSystem#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#update_file_system} @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::FileStorage::Models::FileSystem}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 436 def update_file_system_and_wait_for_state(file_system_id, update_file_system_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_file_system(file_system_id, update_file_system_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_file_system(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::FileStorage::FileStorageClient#update_mount_target} and then waits for the {OCI::FileStorage::Models::MountTarget} acted upon to enter the given state(s).
@param [String] mount_target_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the mount target. @param [OCI::FileStorage::Models::UpdateMountTargetDetails] update_mount_target_details Details object for updating a mount target. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::MountTarget#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#update_mount_target} @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::FileStorage::Models::MountTarget}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 476 def update_mount_target_and_wait_for_state(mount_target_id, update_mount_target_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_mount_target(mount_target_id, update_mount_target_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_mount_target(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::FileStorage::FileStorageClient#update_snapshot} and then waits for the {OCI::FileStorage::Models::Snapshot} acted upon to enter the given state(s).
@param [String] snapshot_id The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the snapshot. @param [OCI::FileStorage::Models::UpdateSnapshotDetails] update_snapshot_details Details object for updating a snapshot. @param [Array<String>] wait_for_states An array of states to wait on. These should be valid values for {OCI::FileStorage::Models::Snapshot#lifecycle_state} @param [Hash] base_operation_opts Any optional arguments accepted by {OCI::FileStorage::FileStorageClient#update_snapshot} @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::FileStorage::Models::Snapshot}
# File lib/oci/file_storage/file_storage_client_composite_operations.rb, line 516 def update_snapshot_and_wait_for_state(snapshot_id, update_snapshot_details, wait_for_states = [], base_operation_opts = {}, waiter_opts = {}) operation_result = @service_client.update_snapshot(snapshot_id, update_snapshot_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_snapshot(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