File manager - Edit - /usr/lib/mysqlsh/lib/python3.9/site-packages/oci/distributed_database/distributed_db_service_client_composite_operations.py
Back
# coding: utf-8 # Copyright (c) 2016, 2026, 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: 20250101 import oci # noqa: F401 from oci.util import WAIT_RESOURCE_NOT_FOUND # noqa: F401 class DistributedDbServiceClientCompositeOperations(object): """ This class provides a wrapper around :py:class:`~oci.distributed_database.DistributedDbServiceClient` 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 DistributedDbServiceClientCompositeOperations object :param DistributedDbServiceClient client: The service client which will be wrapped by this object """ self.client = client def add_distributed_database_gds_control_node_and_wait_for_state(self, distributed_database_id, add_distributed_database_gds_control_node_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.add_distributed_database_gds_control_node` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param oci.distributed_database.models.AddDistributedDatabaseGdsControlNodeDetails add_distributed_database_gds_control_node_details: (required) Details required to provision the new Global database services control(GDS CTL) node for the Distributed database. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.add_distributed_database_gds_control_node` :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.add_distributed_database_gds_control_node(distributed_database_id, add_distributed_database_gds_control_node_details, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def change_distributed_database_compartment_and_wait_for_state(self, change_distributed_database_compartment_details, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.change_distributed_database_compartment` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param oci.distributed_database.models.ChangeDistributedDatabaseCompartmentDetails change_distributed_database_compartment_details: (required) Request to move the Globally distributed database to a different compartment. :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.change_distributed_database_compartment` :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.change_distributed_database_compartment(change_distributed_database_compartment_details, distributed_database_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def change_distributed_db_backup_config_and_wait_for_state(self, distributed_database_id, change_distributed_db_backup_config_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.change_distributed_db_backup_config` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param oci.distributed_database.models.ChangeDistributedDbBackupConfigDetails change_distributed_db_backup_config_details: (required) Details of the DistributedDbBackupConfig for the Globally distributed database. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.change_distributed_db_backup_config` :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.change_distributed_db_backup_config(distributed_database_id, change_distributed_db_backup_config_details, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def configure_distributed_database_gsms_and_wait_for_state(self, configure_distributed_database_gsms_details, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.configure_distributed_database_gsms` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param oci.distributed_database.models.ConfigureDistributedDatabaseGsmsDetails configure_distributed_database_gsms_details: (required) Details to configure the new GSM instances for the distributed database. :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.configure_distributed_database_gsms` :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.configure_distributed_database_gsms(configure_distributed_database_gsms_details, distributed_database_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def configure_distributed_database_sharding_and_wait_for_state(self, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.configure_distributed_database_sharding` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.configure_distributed_database_sharding` :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.configure_distributed_database_sharding(distributed_database_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def create_distributed_database_and_wait_for_state(self, create_distributed_database_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.create_distributed_database` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param oci.distributed_database.models.CreateDistributedDatabaseDetails create_distributed_database_details: (required) Details of the Globally distributed database to be created. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.create_distributed_database` :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_distributed_database(create_distributed_database_details, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def delete_distributed_database_and_wait_for_state(self, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.delete_distributed_database` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.delete_distributed_database` :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 = None try: operation_result = self.client.delete_distributed_database(distributed_database_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] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def generate_distributed_database_gsm_certificate_signing_request_and_wait_for_state(self, distributed_database_id, ca_bundle_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.generate_distributed_database_gsm_certificate_signing_request` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param str ca_bundle_id: (required) The ID of the Ca Bundle. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.generate_distributed_database_gsm_certificate_signing_request` :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.generate_distributed_database_gsm_certificate_signing_request(distributed_database_id, ca_bundle_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def move_distributed_database_replication_unit_and_wait_for_state(self, distributed_database_id, move_distributed_database_replication_unit_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.move_distributed_database_replication_unit` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param oci.distributed_database.models.MoveDistributedDatabaseReplicationUnitDetails move_distributed_database_replication_unit_details: (required) Details required to move the replication units from source shard to destination shard. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.move_distributed_database_replication_unit` :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.move_distributed_database_replication_unit(distributed_database_id, move_distributed_database_replication_unit_details, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def patch_distributed_database_and_wait_for_state(self, distributed_database_id, patch_distributed_database_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.patch_distributed_database` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param oci.distributed_database.models.PatchDistributedDatabaseDetails patch_distributed_database_details: (required) The payload containing instructions to patch the Globally distributed database. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.patch_distributed_database` :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.patch_distributed_database(distributed_database_id, patch_distributed_database_details, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def recreate_failed_distributed_database_resource_and_wait_for_state(self, distributed_database_id, resource_name, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.recreate_failed_distributed_database_resource` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param str resource_name: (required) Specify the name of Shard, Catalog or GSM. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.recreate_failed_distributed_database_resource` :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.recreate_failed_distributed_database_resource(distributed_database_id, resource_name, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def rotate_distributed_database_passwords_and_wait_for_state(self, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.rotate_distributed_database_passwords` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.rotate_distributed_database_passwords` :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.rotate_distributed_database_passwords(distributed_database_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def start_distributed_database_and_wait_for_state(self, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.start_distributed_database` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.start_distributed_database` :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.start_distributed_database(distributed_database_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def stop_distributed_database_and_wait_for_state(self, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.stop_distributed_database` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.stop_distributed_database` :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.stop_distributed_database(distributed_database_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def update_distributed_database_and_wait_for_state(self, distributed_database_id, update_distributed_database_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.update_distributed_database` and waits for the :py:class:`~oci.distributed_database.models.DistributedDatabase` acted upon to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param oci.distributed_database.models.UpdateDistributedDatabaseDetails update_distributed_database_details: (required) The configuration of the Globally distributed database to be updated. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.DistributedDatabase.lifecycle_state` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.update_distributed_database` :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_distributed_database(distributed_database_id, update_distributed_database_details, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] distributed_database_id = operation_result.data.id try: waiter_result = oci.wait_until( self.client, self.client.get_distributed_database(distributed_database_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 upload_distributed_database_signed_certificate_and_generate_wallet_and_wait_for_state(self, distributed_database_id, upload_distributed_database_signed_certificate_and_generate_wallet_details, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.upload_distributed_database_signed_certificate_and_generate_wallet` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param oci.distributed_database.models.UploadDistributedDatabaseSignedCertificateAndGenerateWalletDetails upload_distributed_database_signed_certificate_and_generate_wallet_details: (required) Details required to upload the CA signed certificates to GSM instances of Globally distributed database and generate the wallets. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.upload_distributed_database_signed_certificate_and_generate_wallet` :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.upload_distributed_database_signed_certificate_and_generate_wallet(distributed_database_id, upload_distributed_database_signed_certificate_and_generate_wallet_details, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e) def validate_distributed_database_network_and_wait_for_state(self, distributed_database_id, wait_for_states=[], operation_kwargs={}, waiter_kwargs={}): """ Calls :py:func:`~oci.distributed_database.DistributedDbServiceClient.validate_distributed_database_network` and waits for the :py:class:`~oci.distributed_database.models.WorkRequest` to enter the given state(s). :param str distributed_database_id: (required) Globally distributed database identifier :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.distributed_database.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.distributed_database.DistributedDbServiceClient.validate_distributed_database_network` :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.validate_distributed_database_network(distributed_database_id, **operation_kwargs) if not wait_for_states: return operation_result lowered_wait_for_states = [w.lower() for w in wait_for_states] if 'opc-work-request-id' not in operation_result.headers: return operation_result wait_for_resource_id = operation_result.headers['opc-work-request-id'] try: waiter_result = oci.wait_until( self.client, self.client.get_work_request(wait_for_resource_id), evaluate_response=lambda r: getattr(r.data, 'status') and getattr(r.data, 'status').lower() in lowered_wait_for_states, **waiter_kwargs ) result_to_return = waiter_result return result_to_return except Exception as e: raise oci.exceptions.CompositeOperationError(partial_results=[operation_result], cause=e)
| ver. 1.4 |
Github
|
.
| PHP 8.2.32 | Generation time: 0.06 |
proxy
|
phpinfo
|
Settings