| Server IP : 162.144.4.212 / Your IP : 216.73.216.108 Web Server : Apache System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.9/site-packages/oci/file_storage/ |
Upload File : |
# coding: utf-8
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20171215
import oci # noqa: F401
from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401
class FileStorageClientCompositeOperations(object):
"""
This class provides a wrapper around :py:class:`~oci.file_storage.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
"""
def __init__(self, client, **kwargs):
"""
Creates a new FileStorageClientCompositeOperations object
:param FileStorageClient client:
The service client which will be wrapped by this object
"""
self.client = client
def cancel_downgrade_shape_mount_target_and_wait_for_state(self, mount_target_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.cancel_downgrade_shape_mount_target` and waits for the :py:class:`~oci.file_storage.models.MountTarget` acted upon
to enter the given state(s).
:param str mount_target_id: (required)
The `OCID`__ of the mount target.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.MountTarget.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.cancel_downgrade_shape_mount_target`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.cancel_downgrade_shape_mount_target(mount_target_id, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
mount_target_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_mount_target(mount_target_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_export_and_wait_for_state(self, create_export_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.create_export` and waits for the :py:class:`~oci.file_storage.models.Export` acted upon
to enter the given state(s).
:param oci.file_storage.models.CreateExportDetails create_export_details: (required)
Details for creating a new export.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Export.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.create_export`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_export(create_export_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
export_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_export(export_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_file_system_and_wait_for_state(self, create_file_system_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.create_file_system` and waits for the :py:class:`~oci.file_storage.models.FileSystem` acted upon
to enter the given state(s).
:param oci.file_storage.models.CreateFileSystemDetails create_file_system_details: (required)
Details for creating a new file system.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FileSystem.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.create_file_system`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_file_system(create_file_system_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
file_system_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_file_system(file_system_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_filesystem_snapshot_policy_and_wait_for_state(self, create_filesystem_snapshot_policy_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.create_filesystem_snapshot_policy` and waits for the :py:class:`~oci.file_storage.models.FilesystemSnapshotPolicy` acted upon
to enter the given state(s).
:param oci.file_storage.models.CreateFilesystemSnapshotPolicyDetails create_filesystem_snapshot_policy_details: (required)
Details for creating a new file system snapshot policy.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FilesystemSnapshotPolicy.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.create_filesystem_snapshot_policy`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_filesystem_snapshot_policy(create_filesystem_snapshot_policy_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
filesystem_snapshot_policy_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_filesystem_snapshot_policy(filesystem_snapshot_policy_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_mount_target_and_wait_for_state(self, create_mount_target_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.create_mount_target` and waits for the :py:class:`~oci.file_storage.models.MountTarget` acted upon
to enter the given state(s).
:param oci.file_storage.models.CreateMountTargetDetails create_mount_target_details: (required)
Details for creating a new mount target.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.MountTarget.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.create_mount_target`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_mount_target(create_mount_target_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
mount_target_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_mount_target(mount_target_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_outbound_connector_and_wait_for_state(self, create_outbound_connector_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.create_outbound_connector` and waits for the :py:class:`~oci.file_storage.models.OutboundConnector` acted upon
to enter the given state(s).
:param oci.file_storage.models.CreateOutboundConnectorDetails create_outbound_connector_details: (required)
Details for creating a new outbound connector.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.OutboundConnector.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.create_outbound_connector`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_outbound_connector(create_outbound_connector_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
outbound_connector_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_outbound_connector(outbound_connector_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_replication_and_wait_for_state(self, create_replication_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.create_replication` and waits for the :py:class:`~oci.file_storage.models.Replication` acted upon
to enter the given state(s).
:param oci.file_storage.models.CreateReplicationDetails create_replication_details: (required)
Details for creating a new replication.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Replication.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.create_replication`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_replication(create_replication_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
replication_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_replication(replication_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def create_snapshot_and_wait_for_state(self, create_snapshot_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.create_snapshot` and waits for the :py:class:`~oci.file_storage.models.Snapshot` acted upon
to enter the given state(s).
:param oci.file_storage.models.CreateSnapshotDetails create_snapshot_details: (required)
Details for creating a new snapshot.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Snapshot.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.create_snapshot`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.create_snapshot(create_snapshot_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
snapshot_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_snapshot(snapshot_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_export_and_wait_for_state(self, export_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_export` and waits for the :py:class:`~oci.file_storage.models.Export` acted upon
to enter the given state(s).
:param str export_id: (required)
The `OCID`__ of the export.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Export.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_export`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_export(export_id)
operation_result = None
try:
operation_result = self.client.delete_export(export_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_export, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_file_system_and_wait_for_state(self, file_system_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_file_system` and waits for the :py:class:`~oci.file_storage.models.FileSystem` acted upon
to enter the given state(s).
:param str file_system_id: (required)
The `OCID`__ of the file system.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FileSystem.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_file_system`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_file_system(file_system_id)
operation_result = None
try:
operation_result = self.client.delete_file_system(file_system_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_file_system, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_filesystem_snapshot_policy_and_wait_for_state(self, filesystem_snapshot_policy_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_filesystem_snapshot_policy` and waits for the :py:class:`~oci.file_storage.models.FilesystemSnapshotPolicy` acted upon
to enter the given state(s).
:param str filesystem_snapshot_policy_id: (required)
The `OCID`__ of the file system snapshot policy.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FilesystemSnapshotPolicy.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_filesystem_snapshot_policy`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_filesystem_snapshot_policy(filesystem_snapshot_policy_id)
operation_result = None
try:
operation_result = self.client.delete_filesystem_snapshot_policy(filesystem_snapshot_policy_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_filesystem_snapshot_policy, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_mount_target_and_wait_for_state(self, mount_target_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_mount_target` and waits for the :py:class:`~oci.file_storage.models.MountTarget` acted upon
to enter the given state(s).
:param str mount_target_id: (required)
The `OCID`__ of the mount target.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.MountTarget.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_mount_target`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_mount_target(mount_target_id)
operation_result = None
try:
operation_result = self.client.delete_mount_target(mount_target_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_mount_target, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_outbound_connector_and_wait_for_state(self, outbound_connector_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_outbound_connector` and waits for the :py:class:`~oci.file_storage.models.OutboundConnector` acted upon
to enter the given state(s).
:param str outbound_connector_id: (required)
The `OCID`__ of the outbound connector.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.OutboundConnector.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_outbound_connector`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_outbound_connector(outbound_connector_id)
operation_result = None
try:
operation_result = self.client.delete_outbound_connector(outbound_connector_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_outbound_connector, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_replication_and_wait_for_state(self, replication_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_replication` and waits for the :py:class:`~oci.file_storage.models.Replication` acted upon
to enter the given state(s).
:param str replication_id: (required)
The `OCID`__ of the replication.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Replication.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_replication`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_replication(replication_id)
operation_result = None
try:
operation_result = self.client.delete_replication(replication_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_replication, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_replication_target_and_wait_for_state(self, replication_target_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_replication_target` and waits for the :py:class:`~oci.file_storage.models.ReplicationTarget` acted upon
to enter the given state(s).
:param str replication_target_id: (required)
The `OCID`__ of the replication target.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.ReplicationTarget.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_replication_target`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_replication_target(replication_target_id)
operation_result = None
try:
operation_result = self.client.delete_replication_target(replication_target_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_replication_target, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def delete_snapshot_and_wait_for_state(self, snapshot_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.delete_snapshot` and waits for the :py:class:`~oci.file_storage.models.Snapshot` acted upon
to enter the given state(s).
:param str snapshot_id: (required)
The `OCID`__ of the snapshot.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Snapshot.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.delete_snapshot`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
initial_get_result = self.client.get_snapshot(snapshot_id)
operation_result = None
try:
operation_result = self.client.delete_snapshot(snapshot_id, **operation_kwargs)
except oci.exceptions.ServiceError as e:
if e.status == 404:
return WAIT_RESOURCE_NOT_FOUND
else:
raise e
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
try:
if ("succeed_on_not_found" in waiter_kwargs) and (waiter_kwargs["succeed_on_not_found"] is False):
self.client.base_client.logger.warning("The waiter kwarg succeed_on_not_found was passed as False for the delete composite operation delete_snapshot, this would result in the operation to fail if the resource is not found! Please, do not pass this kwarg if this was not intended")
else:
"""
If the user does not send in this value, we set it to True by default.
We are doing this because during a delete resource scenario and waiting on its state, the service can
return a 404 NOT FOUND exception as the resource was deleted and a get on its state would fail
"""
waiter_kwargs["succeed_on_not_found"] = True
waiter_result = oci.wait_until(
self.client,
initial_get_result, # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def pause_filesystem_snapshot_policy_and_wait_for_state(self, filesystem_snapshot_policy_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.pause_filesystem_snapshot_policy` and waits for the :py:class:`~oci.file_storage.models.FilesystemSnapshotPolicy` acted upon
to enter the given state(s).
:param str filesystem_snapshot_policy_id: (required)
The `OCID`__ of the file system snapshot policy.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FilesystemSnapshotPolicy.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.pause_filesystem_snapshot_policy`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.pause_filesystem_snapshot_policy(filesystem_snapshot_policy_id, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
filesystem_snapshot_policy_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_filesystem_snapshot_policy(filesystem_snapshot_policy_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def schedule_downgrade_shape_mount_target_and_wait_for_state(self, mount_target_id, schedule_downgrade_shape_mount_target_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.schedule_downgrade_shape_mount_target` and waits for the :py:class:`~oci.file_storage.models.MountTarget` acted upon
to enter the given state(s).
:param str mount_target_id: (required)
The `OCID`__ of the mount target.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.ScheduleDowngradeShapeMountTargetDetails schedule_downgrade_shape_mount_target_details: (required)
Details for changing the shape of mount target.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.MountTarget.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.schedule_downgrade_shape_mount_target`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.schedule_downgrade_shape_mount_target(mount_target_id, schedule_downgrade_shape_mount_target_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
mount_target_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_mount_target(mount_target_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def unpause_filesystem_snapshot_policy_and_wait_for_state(self, filesystem_snapshot_policy_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.unpause_filesystem_snapshot_policy` and waits for the :py:class:`~oci.file_storage.models.FilesystemSnapshotPolicy` acted upon
to enter the given state(s).
:param str filesystem_snapshot_policy_id: (required)
The `OCID`__ of the file system snapshot policy.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FilesystemSnapshotPolicy.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.unpause_filesystem_snapshot_policy`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.unpause_filesystem_snapshot_policy(filesystem_snapshot_policy_id, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
filesystem_snapshot_policy_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_filesystem_snapshot_policy(filesystem_snapshot_policy_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_export_and_wait_for_state(self, export_id, update_export_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_export` and waits for the :py:class:`~oci.file_storage.models.Export` acted upon
to enter the given state(s).
:param str export_id: (required)
The `OCID`__ of the export.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateExportDetails update_export_details: (required)
Details object for updating an export.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Export.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_export`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_export(export_id, update_export_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
export_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_export(export_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_export_set_and_wait_for_state(self, export_set_id, update_export_set_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_export_set` and waits for the :py:class:`~oci.file_storage.models.ExportSet` acted upon
to enter the given state(s).
:param str export_set_id: (required)
The `OCID`__ of the export set.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateExportSetDetails update_export_set_details: (required)
Details object for updating an export set.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.ExportSet.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_export_set`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_export_set(export_set_id, update_export_set_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
export_set_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_export_set(export_set_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_file_system_and_wait_for_state(self, file_system_id, update_file_system_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_file_system` and waits for the :py:class:`~oci.file_storage.models.FileSystem` acted upon
to enter the given state(s).
:param str file_system_id: (required)
The `OCID`__ of the file system.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateFileSystemDetails update_file_system_details: (required)
Details object for updating a file system.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FileSystem.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_file_system`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_file_system(file_system_id, update_file_system_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
file_system_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_file_system(file_system_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_filesystem_snapshot_policy_and_wait_for_state(self, filesystem_snapshot_policy_id, update_filesystem_snapshot_policy_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_filesystem_snapshot_policy` and waits for the :py:class:`~oci.file_storage.models.FilesystemSnapshotPolicy` acted upon
to enter the given state(s).
:param str filesystem_snapshot_policy_id: (required)
The `OCID`__ of the file system snapshot policy.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateFilesystemSnapshotPolicyDetails update_filesystem_snapshot_policy_details: (required)
Details object for updating a file system snapshot policy.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.FilesystemSnapshotPolicy.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_filesystem_snapshot_policy`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_filesystem_snapshot_policy(filesystem_snapshot_policy_id, update_filesystem_snapshot_policy_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
filesystem_snapshot_policy_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_filesystem_snapshot_policy(filesystem_snapshot_policy_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_mount_target_and_wait_for_state(self, mount_target_id, update_mount_target_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_mount_target` and waits for the :py:class:`~oci.file_storage.models.MountTarget` acted upon
to enter the given state(s).
:param str mount_target_id: (required)
The `OCID`__ of the mount target.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateMountTargetDetails update_mount_target_details: (required)
Details object for updating a mount target.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.MountTarget.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_mount_target`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_mount_target(mount_target_id, update_mount_target_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
mount_target_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_mount_target(mount_target_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_outbound_connector_and_wait_for_state(self, outbound_connector_id, update_outbound_connector_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_outbound_connector` and waits for the :py:class:`~oci.file_storage.models.OutboundConnector` acted upon
to enter the given state(s).
:param str outbound_connector_id: (required)
The `OCID`__ of the outbound connector.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateOutboundConnectorDetails update_outbound_connector_details: (required)
Details object for updating a outbound connector.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.OutboundConnector.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_outbound_connector`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_outbound_connector(outbound_connector_id, update_outbound_connector_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
outbound_connector_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_outbound_connector(outbound_connector_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_replication_and_wait_for_state(self, replication_id, update_replication_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_replication` and waits for the :py:class:`~oci.file_storage.models.Replication` acted upon
to enter the given state(s).
:param str replication_id: (required)
The `OCID`__ of the replication.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateReplicationDetails update_replication_details: (required)
Details object for updating a replication.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Replication.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_replication`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_replication(replication_id, update_replication_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
replication_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_replication(replication_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def update_snapshot_and_wait_for_state(self, snapshot_id, update_snapshot_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.update_snapshot` and waits for the :py:class:`~oci.file_storage.models.Snapshot` acted upon
to enter the given state(s).
:param str snapshot_id: (required)
The `OCID`__ of the snapshot.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpdateSnapshotDetails update_snapshot_details: (required)
Details object for updating a snapshot.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.Snapshot.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.update_snapshot`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.update_snapshot(snapshot_id, update_snapshot_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
snapshot_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_snapshot(snapshot_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
def upgrade_shape_mount_target_and_wait_for_state(self, mount_target_id, upgrade_shape_mount_target_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}):
"""
Calls :py:func:`~oci.file_storage.FileStorageClient.upgrade_shape_mount_target` and waits for the :py:class:`~oci.file_storage.models.MountTarget` acted upon
to enter the given state(s).
:param str mount_target_id: (required)
The `OCID`__ of the mount target.
__ https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm
:param oci.file_storage.models.UpgradeShapeMountTargetDetails upgrade_shape_mount_target_details: (required)
Details for changing the shape of mount target.
:param list[str] wait_for_states:
An array of states to wait on. These should be valid values for :py:attr:`~oci.file_storage.models.MountTarget.lifecycle_state`
:param dict operation_kwargs:
A dictionary of keyword arguments to pass to :py:func:`~oci.file_storage.FileStorageClient.upgrade_shape_mount_target`
:param dict waiter_kwargs:
A dictionary of keyword arguments to pass to the :py:func:`oci.wait_until` function. For example, you could pass ``max_interval_seconds`` or ``max_interval_seconds``
as dictionary keys to modify how long the waiter function will wait between retries and the maximum amount of time it will wait
"""
operation_result = self.client.upgrade_shape_mount_target(mount_target_id, upgrade_shape_mount_target_details, **operation_kwargs)
if not wait_for_states:
return operation_result
lowered_wait_for_states = [w.lower() for w in wait_for_states]
mount_target_id = operation_result.data.id
try:
waiter_result = oci.wait_until(
self.client,
self.client.get_mount_target(mount_target_id), # noqa: F821
evaluate_response=lambda r: getattr(r.data, 'lifecycle_state') and getattr(r.data, 'lifecycle_state').lower() in lowered_wait_for_states,
**waiter_kwargs
)
result_to_return = waiter_result
return result_to_return
except (NameError, TypeError) as e:
if not e.args:
e.args = ('',)
e.args = e.args + ('This composite operation is currently not supported in the SDK. Please use the operation from the service client and use waiters as an alternative. For more information on waiters, visit: "https://docs.oracle.com/en-us/iaas/tools/python/latest/api/waiters.html"', )
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
except Exception as e:
raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)