
    X                     N   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d	Zd
 Z ej                  ej                  j                  ej                  j                   ej                  j"                        ej$                   G d dej&                                      Zy)z*Describes a Gcloud Deploy target resource.    )
exceptions)base)describe)flags)resource_argsz{description}z     To describe a target called 'test' for delivery pipeline 'test-pipeline' in region 'us-central1', run:

       $ {command} test --delivery-pipeline=test-pipeline --region=us-central1

  )DESCRIPTIONEXAMPLESc                     t        j                  | d       t        j                  | d       t        j                  |        t        j
                  |        y)zRegister flags for this command.

  Args:
    parser: An argparse.ArgumentParser-like object. It is mocked out in order to
      capture some information, but behaves like an ArgumentParser.
  T)
positionalF)requiredN)r   AddTargetResourceArgr   AddDeliveryPipelineAddListAllPipelinesAddSkipPipelineLookupparsers    &lib/surface/deploy/targets/describe.py_CommonArgsr   &   s@     $$V=FU3F#f%    c                   h    e Zd ZdZeZed        Z ej                  e
j                        d        Zy)Describea  Describes details specific to the individual target, delivery pipeline qualified.

  The output contains four sections:

  Target:

    detail of the target to be described.

  Latest Release:

    the detail of the active release in the target.

  Latest Rollout:

    the detail of the active rollout in the target.

  Deployed:

    timestamp of the last successful deployment.

  Pending Approvals:

    list of the rollouts that require approval.
  c                     t        |        y )N)r   r   s    r   ArgszDescribe.ArgsR   s
    r   c                     |j                   j                  j                         }t        j                  ||j
                  |j                  |j                        S )z9This is what gets called when the user runs this command.)CONCEPTStargetParser   DescribeTargetdelivery_pipelineskip_pipeline_lookuplist_all_pipelines)selfargs
target_refs      r   RunzDescribe.RunV   sK    
 %%++-J"":t/E/E#'#<#<#'#:#:< <r   N)__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr   gcloud_exception CatchHTTPErrorRaiseHTTPExceptiondeploy_exceptionsHTTP_ERROR_FORMATr%    r   r   r   r   3   sK    2 !-  544))<<r   r   N)r)   googlecloudsdk.api_lib.utilr   r-   googlecloudsdk.callioper   !googlecloudsdk.command_lib.deployr   r/   r   r   r*   r   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyDescribeCommandr   r1   r   r   <module>r<      s    1 G ( 6 M 3 ; 			

& D%%++T->->-C-C%%((*)<t## )< *)<r   