
    p                         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  SSKJr  SS	KJr  SS
KJr  SSS.r " S S\R&                  5      r\\l        g)zDelete node pool command.    )absolute_import)division)unicode_literals)
exceptions)util)base)flags)log)
console_ioa          *{command}* deletes a node pool from a Google Kubernetes Engine (GKE)
        cluster. When you delete a node pool, GKE drains all the nodes in the
        node pool. The draining process involves GKE deleting Pods on each node
        in the node pool. Each node in a node pool is drained by deleting Pods
        with an allotted graceful termination period of `MAX_POD`. `MAX_POD` is
        the maximum `terminationGracePeriodSeconds` set on the Pods scheduled to
        the node with a cap of one hour.
        z        To delete the "node-pool-1" node pool from the cluster
        "sample-cluster", run:

          $ {command} node-pool-1 --cluster=sample-cluster
        )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)Delete3   z2Delete an existing node pool in a running cluster.c                     [         R                  " U S5        U R                  S[        SSSS9  [         R                  " U 5        [         R
                  " U S5        g)	zRegister flags for this command.

Args:
  parser: An argparse.ArgumentParser-like object. It is mocked out in order
    to capture some information, but behaves like an ArgumentParser.
z$The name of the node pool to delete.z	--timeouti  TzTHIS ARGUMENT NEEDS HELP TEXT.)typedefaulthiddenhelpz/The cluster from which to delete the node pool.N)r	   AddNodePoolNameArgadd_argumentintAddAsyncFlagAddNodePoolClusterFlag)parsers    *lib/surface/container/node_pools/delete.pyArgsDelete.Args6   s\     
V%KL
-  / 
v	  AC    c           	         U R                   S   nU R                   S   nU" U5      nUR                  UR                  U5      n[        R                  " SR                  UR                  UR                  UR                  U5      S9SSS9   UR                  U5        UR                  U5      nUR                  (       a>  UR                  U5      nUR                  S5      (       d  [        R                  Ul        U$ UR!                  USR                  UR                  5      UR"                  S	9  [.        R0                  " U5        U$ ! [$        R&                   a*  n[(        R*                  " U[        R,                  5      eS
nAff = f)zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Some value that we want to have printed later.
api_adapterlocation_getzVThe following node pool will be deleted.
[{name}] in cluster [{clusterId}] in [{zone}])name	clusterIdzoneT)messagethrow_if_unattendedcancel_on_noformatzDeleting node pool {0})	timeout_sN)contextParseNodePoolr#   r   PromptContinuer)   
nodePoolIdr$   ZoneGetNodePoolDeleteNodePoolasync_GetOperationIsSpecifiedr   OPERATIONS_FORMATWaitForOperationtimeoutapitools_exceptions	HttpErrorr   HttpExceptionHTTP_ERROR_FORMATr
   DeletedResource)	selfargsadapterr"   locationpool_refop_refoperrors	            r   Run
Delete.RunJ   sc    ll=)G<</LD!H$$TYY9HABH&"--'11!,,x0 CI C2 !D(#%%h/f	!!&)))..$+	

"
)
)(*=*=
>LL  " !M	 (( D$$UD,B,BCCDs   A0E	 =4E	 	F%FF N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rE   __static_attributes__rG   r   r   r   r   3   s    :C C&+r   r   N)rL   
__future__r   r   r   apitools.base.pyr   r8    googlecloudsdk.api_lib.containerr   googlecloudsdk.callioper   $googlecloudsdk.command_lib.containerr	   googlecloudsdk.corer
   googlecloudsdk.core.consoler   DETAILED_HELPDeleteCommandr   detailed_helprG   r   r   <module>rY      sX      &  ' > 1 ( . 6 # 2		*BT BJ % r   