
    y                         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  G d
 dej                        Zy)z-Command to describe an Apigee API deployment.    )absolute_import)division)unicode_literals)apigee)base)defaults)errors)resource_argsc                   0    e Zd ZdZdddZed        Zd Zy)Describez(Describe an Apigee API proxy deployment.z  {description}

  `{command}` retrieves the status of a specific API proxy's deployment to a
  specific environment.
          a>    To get the status of a deployment in the active Cloud Platform project, which
  deploys ``my-proxy'' into the ``prod'' environment, run:

      $ {command} --api=my-proxy --environment=prod

  To get the status of that deployment as a JSON object, run:

      $ {command} --api=my-proxy --environment=prod --format=json

  To get the status of a deployment in an organization called ``my-org'', which
  deploys version 3 of the proxy ``my-proxy'' into the ``test'' environment,
  run:

      $ {command} 3 --organization=my-org --environment=test --api=my-proxy
          )DESCRIPTIONEXAMPLESc                     dddd}t        j                         t        j                  dd      g}t        j                  | dd||	       y )
NzDeployed API proxy.z,Environment in which the proxy was deployed.zApigee Organization of the proxy and environment. If unspecified, the Cloud Platform project's associated organization will be used.)apienvironmentorganizationrevisionautoz%organization.environment.api.revisiona  API proxy revision and environment of the deployment to be described.


To get a list of deployed proxies and their environments, run:

    $ {parent_command} list

REVISION can either be a positive revision number, or the special value
``auto'', which will choose whichever revision of API is currently deployed in
ENVIRONMENT, or return an error if more than one revision is deployed.


If REVISION is unspecified, the default is ``auto''.

)fallthroughs
help_texts)r   !GCPProductOrganizationFallthroughStaticFallthroughr
   AddSingleResourceArgument)parser	help_textr   s      *lib/surface/apigee/deployments/describe.pyArgszDescribe.Args9   s^     %E6I 	224"":v6L ++/	  ")    c                     |j                   j                  j                         j                         }|d   dk(  r|d= t	        j
                  |       t        j                  j                  |      }|st        j                  d|d      |d   S )zRun the describe command.revisionsIdr   
deploymentGETr   )CONCEPTSr   ParseAsDictr   FallBackToDeployedProxyRevisionr   DeploymentsClientListr	   EntityNotFoundError)selfargsidentifiersdeploymentss       r   RunzDescribe.Run\   s    --((..0779K=!V+
m
$..{; **//<K&&|[%HHq>r   N)__name__
__module____qualname____doc__detailed_helpstaticmethodr   r.    r   r   r   r      s0    0-6    Dr   r   N)r2   
__future__r   r   r   googlecloudsdk.api_libr   googlecloudsdk.callioper   !googlecloudsdk.command_lib.apigeer   r	   r
   DescribeCommandr   r5   r   r   <module>r;      s6    4 &  ' ) ( 6 4 ;Mt## Mr   