
    j                     t   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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.                  R0                  \R.                  R2                  5       " S S\R4                  5      5       5       rg)z8Command for obtaining details about a given worker-pool.    )absolute_import)division)unicode_literals)base)connection_context)
exceptions)flags)resource_args)serverless_operations)export_printer)worker_pool_printer)concept_parsers)presentation_specs)resource_printerc                   N    \ rS rSrSrSSS.r\S 5       r\S 5       rS r	S	 r
S
rg)Describe#   )Obtain details about a given worker-pool.z"          {description}
          a            To obtain details about a given worker-pool:

              $ {command} <worker-pool-name>

          To get those details in the YAML format:

              $ {command} <worker-pool-name> --format=yaml

          To get them in YAML format suited to export (omitting metadata
          specific to this deployment and status info):

              $ {command} <worker-pool-name> --format=export
          )DESCRIPTIONEXAMPLESc                    [         R                  " U 5        [        R                  " S[        R
                  " 5       SSSS9n[        R                  " U/5      R                  U 5        [        R                  " [        R                  [        R                  5        U R                  R                  [        R                  5        [        R                  " [         R"                  [         R$                  5        g )NWORKER_POOLzWorkerPool to describe.TF)requiredprefixes)r	   AddRegionArgr   ResourcePresentationSpecr
   GetV1WorkerPoolResourceSpecr   ConceptParserAddToParserr   RegisterFormatterr   WORKER_POOL_PRINTER_FORMATWorkerPoolPrinterdisplay_info	AddFormatr   EXPORT_PRINTER_FORMATExportPrinter)parserworker_pool_presentations     (lib/surface/run/worker_pools/describe.py
CommonArgsDescribe.CommonArgs<   s    	v1JJ113!  !!#;"<=II &&66-- !!66 &&,,$$    c                 .    [         R                  U 5        g N)r   r*   )r'   s    r)   ArgsDescribe.ArgsV   s    r,   c                 ~    [         R                  " U[        R                  R                  U R                  5       5      $ r.   )r   GetConnectionContextr	   ProductRUNReleaseTrack)selfargss     r)   _ConnectionContextDescribe._ConnectionContextZ   s/    22emm!2!2!4 r,   c                    U R                  U5      nUR                  R                  R                  5       n[        R
                  " U5        [        R                  " U5       nUR                  U5      nSSS5        W(       d/  [        R                  " SR                  UR                  5      5      eU$ ! , (       d  f       NF= f)r   NzCannot find worker pool [{}])r8   CONCEPTSworker_poolParser	   ValidateResourcer   ConnectGetWorkerPoolr   ArgumentErrorformatworkerpoolsId)r6   r7   conn_contextworker_pool_refclientr<   s         r)   RunDescribe.Run_   s    **40Lmm//557O	?+		&	&|	4((9k 
5$$%C%J%J

'
'&) * * 
5	4s   "B44
C N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr*   r/   r8   rG   __static_attributes__rI   r,   r)   r   r   #   sJ     2	-(  2    

r,   r   N)rN   
__future__r   r   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.runr   r   r	   r
   r   'googlecloudsdk.command_lib.run.printersr   r   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.core.resourcer   UniverseCompatibleReleaseTracksr5   ALPHABETACommandr   rI   r,   r)   <module>r]      s    ? '  ' ( = 5 0 8 @ B G D G 9 D%%++T->->-C-CDDt|| D E Dr,   