
                             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
 ddl	mZ dd	lmZ ej                   G d
 dej                               Zy)z&Command to cancel a storage operation.    )absolute_import)division)unicode_literals)api_factory)base)operations_util)storage_url)logc                   0    e Zd ZdZdddZed        Zd Zy)CancelzCancel a storage operation.z      Cancel a storage operation. Since operations are asynchronous, this
      request is best effort and may fail in cases such as when the operation
      is already complete.
      z      To cancel the operation "C894F35J" on bucket "my-bucket", run:

        $ {command} projects/_/buckets/my-bucket/operations/C894F35J
      )DESCRIPTIONEXAMPLESc                 *    | j                  dd       y )Noperation_namezGThe operation name including the Cloud Storage bucket and operation ID.)help)add_argument)parsers    (lib/surface/storage/operations/cancel.pyArgszCancel.Args-   s    
      c                 N   t        j                  |j                        \  }}t        j                  j
                  }t        j                  |      j                  ||       t        j                  j                  dj                  t        j                  ||      |             y )N)bucket_nameoperation_idz.Sent cancel request for bucket {} operation {})r   %get_operation_bucket_and_id_from_namer   r	   ProviderPrefixGCSr   get_apicancel_operationr
   statusPrintformatCloudUrl)selfargsbucketr   schemes        r   Runz
Cancel.Run7   s    ==	
 FL
 ''++F00 1  JJ8??  0,	
r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r'    r   r   r   r      s/    #


-  r   r   N)r+   
__future__r   r   r   googlecloudsdk.api_lib.storager   googlecloudsdk.callioper   "googlecloudsdk.command_lib.storager   r	   googlecloudsdk.corer
   UniverseCompatibleCommandr   r.   r   r   <module>r6      sG    - &  ' 6 ( > : # (T\\ ( (r   