
    ?	                        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
  \R                  " \R                  R                  \R                  R                  \R                  R                  5       " S S\R                   5      5       rg	)
zStop cluster command.    )dataproc)util)base)flags)logc                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	Stop   zStop a cluster.EXAMPLESzf
          To stop a cluster, run:

            $ {command} my-cluster --region=us-central1
          c                     [         R                  R                  U5        [        R                  " U5        [
        R                  " U R                  5       5      n[        R                  " USUR                  5        g )Nstop)
r   
ASYNC_FLAGAddToParserr   AddTimeoutFlagdpDataprocReleaseTrackAddClusterResourceArgapi_version)clsparserr   s      %lib/surface/dataproc/clusters/stop.pyArgs	Stop.Args'   sQ    OO'	 {{3++-.H	0D0DE    c                    [         R                  " U R                  5       5      nUR                  R                  R                  5       nUR                  R                  [        R                  " 5       S9nUR                  R                  UR                  UR                  UR                  US9nUR                  R                  R!                  U5      nUR"                  (       a:  [$        R&                  R)                  SR+                  X6R,                  5      5        U$ [        R.                  " UUSR+                  UR                  5      UR0                  S9nU$ )N)	requestId)clusterNameregion	projectIdstopClusterRequestz$Stopping [{0}] with operation [{1}].z"Waiting for cluster '{0}' to stop.)message	timeout_s)r   r   r   CONCEPTSclusterParsemessagesStopClusterRequestr   GetUniqueId*DataprocProjectsRegionsClustersStopRequestr   r   r    clientprojects_regions_clustersr	   async_r   statuswriteformatnameWaitForOperationtimeout)selfargsr   cluster_refstop_cluster_requestrequest	operations          r   RunStop.Run.   s"   {{4,,./H--''--/K#,,??""$ @ & JJ++!!''/	 K 1G 99>>wGI{{	jj=DD
~~' (%%4;;##%,, I r    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpclassmethodr   r:   __static_attributes__r<   r   r   r	   r	      s3       - F Fr   r	   N)rA   googlecloudsdk.api_lib.dataprocr   r   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.dataprocr   googlecloudsdk.corer   ReleaseTracksr   ALPHABETAGACommandr	   r<   r   r   <module>rN      sp      ; 0 ( 5 # D%%++T->->-C-C%%((*.4<< .*.r   