
                         J   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  \R                  \R                  " \R                  R                   \R                  R"                  \R                  R$                  5       " S	 S
\R&                  5      5       5       rg)z&'logging operations describe' command.    )absolute_import)division)unicode_literals)util)base)log)resource_projectorc                   4    \ rS rSrSr\S 5       rS rS rSr	g)Describe   a  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                 t    U R                  SSS9  U R                  SSSS9  [        R                  " U S5        g	)
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ArgsDescribe.Args.   sG     -GH
t*F  H 	v67    c                    [         R                  " [         R                  " [         R                  " U5      SUR                  5      SUR                  5      n[         R
                  " 5       R                  US9n[         R                  " 5       R                  R                  U5      n[        R                  " U5      nUR                  S0 5      R                  SS5      U l        U$ )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   RunDescribe.Run7   s     ))""4(+t}}	Fd'')K  MM N G ^^;;??HF%66v>L#/#3#3J#C#G#G$%D  Mr   c                 f    U R                   (       a   [        R                  R                  S5        g g )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   EpilogDescribe.EpilogP   s)    ##	jjGH $r   )r)   N)
__name__
__module____qualname____firstlineno____doc__staticmethodr   r0   r6   __static_attributes__ r   r   r   r      s&    
 8 82Hr   r   N)r<   
__future__r   r   r   googlecloudsdk.api_lib.loggingr   googlecloudsdk.callioper   googlecloudsdk.corer   googlecloudsdk.core.resourcer	   UniverseCompatibleReleaseTracksReleaseTrackGABETAALPHACommandr   r?   r   r   <module>rL      s    - &  ' / ( # ; $++00$2C2C2I2I5Ht|| 5H 5Hr   