a Of+S@s(ddlZddlmZGdddeZdS)N)WAIT_RESOURCE_NOT_FOUNDc@seZdZdZddZgiifddZgiifddZgiifdd Zgiifd d Zgiifd d Z giifddZ giifddZ giifddZ giifddZ dS)OdaClientCompositeOperationsa This class provides a wrapper around :py:class:`~oci.oda.OdaClient` 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 cKs ||_dS)z Creates a new OdaClientCompositeOperations object :param OdaClient client: The service client which will be wrapped by this object N)client)selfrkwargsr/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/oci/oda/oda_client_composite_operations.py__init__sz%OdaClientCompositeOperations.__init__c s|jj||fi|}|s|Sdd|D|jd}z4tj|j|j|fdfddi|}|} | WSty} ztjj|g| dWYd} ~ n d} ~ 00dS) a Calls :py:func:`~oci.oda.OdaClient.change_oda_instance_compartment` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param oci.oda.models.ChangeOdaInstanceCompartmentDetails change_oda_instance_compartment_details: (required) The compartment to which the Digital Assistant instance should be moved. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.change_oda_instance_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 cSsg|] }|qSrlower.0wrrr 3zcOdaClientCompositeOperations.change_oda_instance_compartment_and_wait_for_state..opc-work-request-idevaluate_responsecs t|jdot|jdvSNstatusgetattrdatar rlowered_wait_for_statesrr:rzaOdaClientCompositeOperations.change_oda_instance_compartment_and_wait_for_state..partial_resultscauseN) rchange_oda_instance_compartmentheadersoci wait_untilget_work_request Exception exceptionsCompositeOperationError) roda_instance_id'change_oda_instance_compartment_detailswait_for_statesoperation_kwargs waiter_kwargsoperation_resultwait_for_resource_id waiter_resultresult_to_returnerrr2change_oda_instance_compartment_and_wait_for_states$   zOOdaClientCompositeOperations.change_oda_instance_compartment_and_wait_for_statec s|jj|fi|}|s|Sdd|D|jd}z@tj|j|j|fdfddi|}|j|jj}|WSt y} ztj j |g| dWYd} ~ n d} ~ 00dS) a Calls :py:func:`~oci.oda.OdaClient.create_oda_instance` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param oci.oda.models.CreateOdaInstanceDetails create_oda_instance_details: (required) Details for the new Digital Assistant instance. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.create_oda_instance` :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 cSsg|] }|qSrr r rrrrYrzWOdaClientCompositeOperations.create_oda_instance_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrr`rzUOdaClientCompositeOperations.create_oda_instance_and_wait_for_state..rN) rcreate_oda_instancer!r"r#r$get_oda_instancerr(r%r&r') rcreate_oda_instance_detailsr*r+r,r-r.r/r0r1rrr&create_oda_instance_and_wait_for_stateCs$   zCOdaClientCompositeOperations.create_oda_instance_and_wait_for_statec s|jj||fi|}|s|Sdd|D|jd}z4tj|j|j|fdfddi|}|} | WSty} ztjj|g| dWYd} ~ n d} ~ 00dS) a} Calls :py:func:`~oci.oda.OdaClient.create_oda_instance_attachment` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param oci.oda.models.CreateOdaInstanceAttachmentDetails create_oda_instance_attachment_details: (required) Details for the new Digital Assistant instance attachment. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.create_oda_instance_attachment` :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 cSsg|] }|qSrr r rrrrrzbOdaClientCompositeOperations.create_oda_instance_attachment_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrrrz`OdaClientCompositeOperations.create_oda_instance_attachment_and_wait_for_state..rN) rcreate_oda_instance_attachmentr!r"r#r$r%r&r') rr(&create_oda_instance_attachment_detailsr*r+r,r-r.r/r0r1rrr1create_oda_instance_attachment_and_wait_for_stateis$   zNOdaClientCompositeOperations.create_oda_instance_attachment_and_wait_for_statec sd}z|jj|fi|}WnFtjjyb}z*|jdkrJtWYd}~S|WYd}~n d}~00|sl|Sdd|D|jd}z4tj|j|j |fdfddi|}|} | WSt y}ztjj |g|d WYd}~n d}~00dS) a Calls :py:func:`~oci.oda.OdaClient.delete_oda_instance` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.delete_oda_instance` :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 NcSsg|] }|qSrr r rrrrrzWOdaClientCompositeOperations.delete_oda_instance_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrrrzUOdaClientCompositeOperations.delete_oda_instance_and_wait_for_state..r) rdelete_oda_instancer"r& ServiceErrorrrr!r#r$r%r') rr(r*r+r,r-r1r.r/r0rrr&delete_oda_instance_and_wait_for_states0    zCOdaClientCompositeOperations.delete_oda_instance_and_wait_for_statec sd}z|jj||fi|}WnFtjjyd}z*|jdkrLtWYd}~S|WYd}~n d}~00|sn|Sdd|D|jd}z4tj|j|j |fdfddi|} | } | WSt y}ztjj |g|d WYd}~n d}~00dS) a4 Calls :py:func:`~oci.oda.OdaClient.delete_oda_instance_attachment` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param str attachment_id: (required) Unique Digital Assistant instance attachment identifier. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.delete_oda_instance_attachment` :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 Nr:cSsg|] }|qSrr r rrrrrzbOdaClientCompositeOperations.delete_oda_instance_attachment_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrrrz`OdaClientCompositeOperations.delete_oda_instance_attachment_and_wait_for_state..r) rdelete_oda_instance_attachmentr"r&r<rrr!r#r$r%r') rr( attachment_idr*r+r,r-r1r.r/r0rrr1delete_oda_instance_attachment_and_wait_for_states0    zNOdaClientCompositeOperations.delete_oda_instance_attachment_and_wait_for_statec s|jj|fi|}|s|Sdd|D|jd}z4tj|j|j|fdfddi|}|}|WSty} ztjj|g| dWYd} ~ n d} ~ 00dS) a Calls :py:func:`~oci.oda.OdaClient.start_oda_instance` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.start_oda_instance` :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 cSsg|] }|qSrr r rrrrrzVOdaClientCompositeOperations.start_oda_instance_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrrrzTOdaClientCompositeOperations.start_oda_instance_and_wait_for_state..rN) rstart_oda_instancer!r"r#r$r%r&r' rr(r*r+r,r-r.r/r0r1rrr%start_oda_instance_and_wait_for_states$   zBOdaClientCompositeOperations.start_oda_instance_and_wait_for_statec s|jj|fi|}|s|Sdd|D|jd}z4tj|j|j|fdfddi|}|}|WSty} ztjj|g| dWYd} ~ n d} ~ 00dS) a Calls :py:func:`~oci.oda.OdaClient.stop_oda_instance` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.stop_oda_instance` :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 cSsg|] }|qSrr r rrrr-rzUOdaClientCompositeOperations.stop_oda_instance_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrr4rzSOdaClientCompositeOperations.stop_oda_instance_and_wait_for_state..rN) rstop_oda_instancer!r"r#r$r%r&r'rBrrr$stop_oda_instance_and_wait_for_states$   zAOdaClientCompositeOperations.stop_oda_instance_and_wait_for_statec s|jj||fi|}|s|Sdd|D|jj}z4tj|j|j|fdfddi|}|}|WSttfy} z6| j sd| _ | j d| _ tj j |g| dWYd } ~ n>d } ~ 0t y} ztj j |g| dWYd } ~ n d } ~ 00d S) aF Calls :py:func:`~oci.oda.OdaClient.update_oda_instance` and waits for the :py:class:`~oci.oda.models.OdaInstance` acted upon to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param oci.oda.models.UpdateOdaInstanceDetails update_oda_instance_details: (required) The information to update. :param list[str] wait_for_states: An array of states to wait on. These should be valid values for :py:attr:`~oci.oda.models.OdaInstance.lifecycle_state` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.update_oda_instance` :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 cSsg|] }|qSrr r rrrrVrzWOdaClientCompositeOperations.update_oda_instance_and_wait_for_state..rcs t|jdot|jdvS)Nlifecycle_staterrrrrr]rzUOdaClientCompositeOperations.update_oda_instance_and_wait_for_state..))aThis 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"rN) rupdate_oda_instanceridr"r#r4 NameError TypeErrorargsr&r'r%) rr(update_oda_instance_detailsr*r+r,r-r/r0r1rrr&update_oda_instance_and_wait_for_state=s.   &zCOdaClientCompositeOperations.update_oda_instance_and_wait_for_statec s|jj|||fi|}|s |Sdd|D|jd}z4tj|j|j|fdfddi|} | } | WSty} ztjj|g| dWYd} ~ n d} ~ 00dS) a Calls :py:func:`~oci.oda.OdaClient.update_oda_instance_attachment` and waits for the :py:class:`~oci.oda.models.WorkRequest` to enter the given state(s). :param str oda_instance_id: (required) Unique Digital Assistant instance identifier. :param str attachment_id: (required) Unique Digital Assistant instance attachment identifier. :param oci.oda.models.UpdateOdaInstanceAttachmentDetails update_oda_instance_attachment_details: (required) The information 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.oda.models.WorkRequest.status` :param dict operation_kwargs: A dictionary of keyword arguments to pass to :py:func:`~oci.oda.OdaClient.update_oda_instance_attachment` :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 cSsg|] }|qSrr r rrrrrzbOdaClientCompositeOperations.update_oda_instance_attachment_and_wait_for_state..rrcs t|jdot|jdvSrrrrrrrrz`OdaClientCompositeOperations.update_oda_instance_attachment_and_wait_for_state..rN) rupdate_oda_instance_attachmentr!r"r#r$r%r&r') rr(r?&update_oda_instance_attachment_detailsr*r+r,r-r.r/r0r1rrr1update_oda_instance_attachment_and_wait_for_stateks$   zNOdaClientCompositeOperations.update_oda_instance_attachment_and_wait_for_stateN)__name__ __module__ __qualname____doc__r r2r6r9r=r@rCrErNrQrrrrr s )&).1&&.r)r"oci.utilrobjectrrrrrs