
                         J   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 ej                   ej                  ej                  j                   ej                  j"                  ej                  j$                         G d	 d
ej&                                      Zy)z&'logging operations describe' command.    )absolute_import)division)unicode_literals)util)base)log)resource_projectorc                   ,    e Zd ZdZed        Zd Zd Zy)Describea  Display the information about a long running operation.

  Display the information about a long running operation which was scheduled
  before. For example, a copy_log_entries operation scheduled by command:
  "gcloud alpha logging copy BUCKET_ID DESTINATION --location=LOCATION"
  OPERATION_ID and LOCATION are required to locate such operation.

  ## EXAMPLES

  To describe 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 describeN)add_argumentr   AddParentArgs)parsers    *lib/surface/logging/operations/describe.pyArgszDescribe.Args.   sG     -GH
t*F  H 	v67    c                    t        j                  t        j                  t        j                  |      d|j                        d|j                        }t        j
                         j                  |      }t        j                         j                  j                  |      }t        j                  |      }|j                  di       j                  dd      | _        |S )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
operations)namemetadatacancellationRequested )r   CreateResourceNameGetParentFromArgslocationr   GetMessages,LoggingProjectsLocationsOperationsGetRequest	GetClientprojects_locations_operationsGetr	   MakeSerializableget_cancellation_requested)selfargsparent_namerequestresultserialize_ops         r   RunzDescribe.Run7   s     ))""4(+t}}	Fd'')K  MM N G ^^;;??HF%66v>L#/#3#3J#C#G#G$%D  Mr   c                 \    | j                   r t        j                  j                  d       y y )NzzNote: Cancellation happens asynchronously. It may take up to 10 minutes for the operation's status to change to cancelled.)r'   r   statusPrint)r(   resources_were_displayeds     r   EpilogzDescribe.EpilogP   s)    ##	jjGH $r   N)__name__
__module____qualname____doc__staticmethodr   r.   r3    r   r   r   r      s&    
 8 82Hr   r   N)r7   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   googlecloudsdk.corer   googlecloudsdk.core.resourcer	   UniverseCompatibleReleaseTracksReleaseTrackGABETAALPHACommandr   r9   r   r   <module>rF      s    - &  ' / ( # ; $++00$2C2C2I2I5Ht|| 5H 5Hr   