
    h
                     >   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ej                   ej                  ej                  j                  ej                  j                  ej                  j                          G d d	ej"                                      Zy
)z$'logging operations cancel' command.    )absolute_import)division)unicode_literals)util)base)
console_ioc                   &    e Zd ZdZed        Zd Zy)Cancela"  Cancel a long running operation.

  Cancel a long running operation with given OPERATION_ID in given LOCATION.
  This operation can be a copy_log_entries operation which is scheduled before.

  ## EXAMPLES

  To cancel an operation, run:

    $ {command} OPERATION_ID --location=LOCATION
  c                 ~    | j                  dd       | j                  ddd       t        j                  | d       y	)
z Register flags for this command.operation_idzThe Id of the operation.)helpz
--locationTzLocation of the operation.)requiredr   zoperation to cancelN)add_argumentr   AddParentArgs)parsers    (lib/surface/logging/operations/cancel.pyArgszCancel.Args+   sG     -GH
t*F  H 	v45    c                    t        j                  t        j                  t        j                  |      d|j                        d|j                        }t        j
                  |j                  |      }t        j                  d|z  d       t        j                         j                  |      }t        j                         j                  j                  |       t        d|z         t        d       y	)
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:
      A long running operation.
    	locations
operationszReally cancel operation [%s]?T)cancel_on_no)namezCancelled [%s]zKNote:it may take up to 10 minutes for the operation's status to be updated.N)r   CreateResourceNameGetParentFromArgslocationr   GetOperationReferencer   PromptContinueGetMessages/LoggingProjectsLocationsOperationsCancelRequest	GetClientprojects_locations_operationsr
   print)selfargsoperation_nameoperation_referencerequests        r   Runz
Cancel.Run4   s     ,,""4(+t}}	Fd'')N 44T5F5FM=N+/1  55>5J  	NN2299'B	
0
01	 . /r   N)__name__
__module____qualname____doc__staticmethodr   r)    r   r   r
   r
      s     

 6 6/r   r
   N)r-   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksReleaseTrackGABETAALPHACommandr
   r/   r   r   <module>r;      s    + &  ' / ( 2 $++00$2C2C2I2I0/T\\ 0/ 0/r   