
                             S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSK
Jr  \R                   " S	 S
\R                  5      5       rg)zGImplementation of resume command for resuming Anywhere Cache instances.    )base)progress_callbacks)storage_url)task_executor)task_graph_executor)task_status)resume_anywhere_cache_taskc                   >    \ rS rSrSrSSS.r\S 5       rS rS r	S	r
g
)Resume   z Resume Anywhere Cache instances.a  

      Resume operation could be used to revert the Paused and Disabled state.
      Once a paused/disabled cache is resumed, the cache will be set to
      RUNNING/CREATING state:
        1. RUNNING if the cache is active.
        2. CREATING if the cache is pending creation.
      z

      The following command resume the anywhere cache instance of bucket
      ``my-bucket'' having anywhere_cache_id ``my-cache-id'':

        $ {command} my-bucket/my-cache-id
      )DESCRIPTIONEXAMPLESc                 0    UR                  S[        SSS9  g )Nid+zIdentifiers for a Anywhere Cache instance. They are combination of bucket_name/anywhere_cache_id. For example : test-bucket/my-cache-id.)typenargshelp)add_argumentstr)clsparsers     5lib/surface/storage/buckets/anywhere_caches/resume.pyArgsResume.Args0   s#    
(  	    c              #      #    [         R                  " U[        UR                  5      5        UR                   H=  nUR	                  [
        R                  5      u  pEn[        R                  " XF5      v   M?     g 7f)N)	r   workload_estimator_callbacklenr   
rpartitionr   CLOUD_URL_DELIMITERr	   ResumeAnywhereCacheTask)selfargstask_status_queueid_strbucket_name_anywhere_cache_ids          r   _get_task_iteratorResume._get_task_iterator=   sg     223tww< ''*0*;*;

)
)+'k' '>>
 	 s   A9A;c           
          [         R                  R                  5       nU R                  X5      n[        R
                  " USU[        R                  " [        R                  R                  S S9S9U l
        g )NT)increment_typemanifest_path)parallelizabler%   progress_manager_args)r   multiprocessing_contextQueuer*   r   execute_tasksr   ProgressManagerArgsIncrementTypeINTEGER	exit_code)r#   r$   r%   task_iterators       r   Run
Resume.RunJ   sa    +CCIIK++DDM"00+)==&44<<D
	DNr   )r7   N)__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr   r*   r9   __static_attributes__ r   r   r   r      s4    (

-$ 
 
r   r   N)r?   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r   (googlecloudsdk.command_lib.storage.tasksr   r   r   @googlecloudsdk.command_lib.storage.tasks.buckets.anywhere_cachesr	   DefaultUniverseOnlyCommandr   rC   r   r   <module>rJ      sE    N ( A : B H @ g :T\\ : :r   