
                             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)zBImplementation of pause command to pause Anywhere Cache instances.    )base)plurality_checkable_iterator)progress_callbacks)task_executor)task_graph_executor)task_status)pause_anywhere_cache_taskc                   >    \ rS rSrSrSSS.r\S 5       rS rS r	S	r
g
)Pause   zPause Anywhere Cache instances.z

        The pause operation can be used to stop the data ingestion of a cache
        instance in RUNNING state (read-only cache) until the Resume is invoked.
      z

      The following command pause 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     4lib/surface/storage/buckets/anywhere_caches/pause.pyArgs
Pause.Args-   s#    
(  	    c              #      #    [         R                  " U[        UR                  5      5        UR                   H/  nUR	                  S5      u  pEn[
        R                  " XF5      v   M1     g 7f)N/)r   workload_estimator_callbacklenr   
rpartitionr	   PauseAnywhereCacheTask)selfargstask_status_queueid_strbucket_name_anywhere_cache_ids          r   get_task_iteratorPause.get_task_iterator:   s\     223tww< ''*0*;*;C*@'k'%<<
  s   A+A-c                 4   [         R                  R                  5       nU R                  X5      n[        R
                  " U5      n[        R                  " USU[        R                  " [        R                  R                  S S9[        USS5      S9U l        g )NT)increment_typemanifest_pathcontinue_on_errorF)parallelizabler%   progress_manager_argsr/   )r   multiprocessing_contextQueuer*   r   PluralityCheckableIteratorr   execute_tasksr   ProgressManagerArgsIncrementTypeINTEGERgetattr	exit_code)r#   r$   r%   task_iterator!plurality_checkable_task_iterators        r   Run	Pause.RunE   s    +CCIIK**4CM$??N & #00)+)==&44<<D
 "$(;UCDNr   )r:   N)__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr   r*   r=   __static_attributes__ r   r   r   r      s4    '


- 
 
	r   r   N)rC   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r   (googlecloudsdk.command_lib.storage.tasksr   r   r   @googlecloudsdk.command_lib.storage.tasks.buckets.anywhere_cachesr	   DefaultUniverseOnlyCommandr   rG   r   r   <module>rN      sE    I ( K A B H @ f 9DLL 9 9r   