
                             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
r " S S\R"                  5      rSSSS.\l        g)zAbort operation command.    )absolute_import)division)unicode_literals)
exceptions)util)base)log)
console_iozCancelation of operation {0} has been requested. Please use gcloud container operations describe {1} to check if the operation has been canceled successfully.c                   .    \ rS rSrSr\S 5       rS rSrg)Cancel#   zCancel an operation.c                 $    U R                  SSS9  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.
operation_idzThe operation id to cancel.)helpN)add_argument)parsers    *lib/surface/container/operations/cancel.pyArgsCancel.Args&   s     -JK    c                    U R                   S   nU R                   S   nU" U5      nUR                  UR                  U5      n UR                  U5      n[        R                  " SR                  UR                  5      SSS9   UR                  U5        [        R                   R#                  [$        R                  UR                  UR                  5      5        UR                  U5      $ ! [        R
                   a*  n[        R                  " U[        R                  5      eSnAff = f! [        R
                   a  n[        R                  " U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_getNz.Are you sure you want to cancel operation {0}?T)messagethrow_if_unattendedcancel_on_no)contextParseOperationr   GetOperationapitools_exceptions	HttpErrorr   HttpExceptionr   HTTP_ERROR_FORMATr
   PromptContinueformatnameCancelOperationr	   statusPrintCANCEL_OPERATION_MESSAGE)selfargsadapterr   locationop_refoperrors           r   Run
Cancel.Run0   s1    ll=)G<</LD!H##D$5$5x@FD'b @GGGG 	,f%	jj
"
)
)$*;*;T=N=N
OQ!!&)) (( D$$UD,B,BCCD (( ,$$U++,s1   C. A(D/ .D,%D''D,/EEE N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r2   __static_attributes__r4   r   r   r   r   #   s    L L,r   r   zCancel a running operation.a  
        Cancel a running operation.

Cancel is a best-effort method for aborting a running operation. Operations that
have already completed can not be cancelled. If the operation has passed the
"point of no-return", cancel will have no effect.

An example of "point of no-return" in the context of Upgrade operations would
be if all the nodes have been upgraded but the operation hasn't been marked as
complete.

Only node pool upgrade operations support cancellation.
zX        To cancel an operation, run:

          $ {command} sample-operation-id
        )briefDESCRIPTIONEXAMPLESN)r9   
__future__r   r   r   apitools.base.pyr   r     googlecloudsdk.api_lib.containerr   googlecloudsdk.callioper   googlecloudsdk.corer	   googlecloudsdk.core.consoler
   r*   Commandr   detailed_helpr4   r   r   <module>rG      sY     &  ' > 1 ( . # 2= ,,T\\ ,,b 	&		% r   