
                             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\R                  5      r
 " S	 S
\R                  5      rg)z#`gcloud app versions list` command.    )appengine_api_client)version_util)base)
exceptions)logc                       \ rS rSrSrg)ServiceNotFoundError    N)__name__
__module____qualname____firstlineno____static_attributes__r        lib/surface/app/versions/list.pyr	   r	      s    r   r	   c                   6    \ rS rSrSrSS0r\S 5       rS rSr	g)	List   zList your existing versions.

This command lists all the versions of all services that are currently
deployed to the App Engine server.
EXAMPLESa%            To list all services and versions, run:

            $ {command}

          To list all versions for a specific service, run:

            $ {command} --service=service1

          To list only versions that are receiving traffic, run:

            $ {command} --hide-no-traffic

          To list all version information in JSON, run:

            $ {command} --format="json"

          To list versions created after a specific date, run:

            $ {command} --filter="version.createTime.date('%Y-%m-%d', Z)>'2017-11-03'"
          c                     U R                  SSSS9  U R                  SSSS9  U R                  R                  S	5        U R                  R                  [        R
                  5        g )
Nz	--servicez-sz%Only show versions from this service.)helpz--hide-no-traffic
store_truez.Only show versions that are receiving traffic.)actionr   a6  
          table(
            service,
            version.id:label=VERSION.ID,
            traffic_split.format("{0:.2f}", .),
            last_deployed_time.date("%Y-%m-%dT%H:%M:%S%Oz", undefined="-")
              :label=LAST_DEPLOYED,
            version.servingStatus:label=SERVING_STATUS
          )
    )add_argumentdisplay_info	AddFormat
AddUriFuncr   GetUri)parsers    r   Args	List.Args<   sn    
TD  F
+LM  O
!! 	# 		 ""<#6#67r   c                 <   [         R                  " U R                  5       5      nUR                  5       nU Vs/ s H  oDR                  PM     nn[
        R                  " SR                  U5      5        UR                  (       a4  UR                  U;  a$  [        SR                  UR                  5      5      eUR                  (       a-  U Vs/ s H   oDR                  UR                  :X  d  M  UPM"     nnUR                  U5      nUR                  (       a-  U Vs/ s H   owR                  UR                  :X  d  M  UPM"     nnUR                  (       a$  U Vs/ s H  owR                  (       d  M  UPM     nn[        U[        S9$ s  snf s  snf s  snf s  snf )NzAll services: {0}zService [{0}] not found.)key)r   GetApiClientForTrackReleaseTrackListServicesidr   debugformatservicer	   ListVersionshide_no_traffictraffic_splitsortedstr)selfargs
api_clientservicessservice_idsversionsvs           r   RunList.RunN   s/   %::4;L;L;NOJ&&(H!)*A44K*II!((56||K7 
$
+
+DLL
9; ; ||%>X)=!Xh>&&x0H||%CXdll)B!XhC %9X!Xh9($$' + ?
 D :s)   F
F0FF?FF4Fr   N)
r   r   r   r   __doc__detailed_helpstaticmethodr!   r9   r   r   r   r   r   r      s1      -0 8 8"%r   r   N)r;   googlecloudsdk.api_lib.appr   r   googlecloudsdk.callioper   googlecloudsdk.corer   r   Errorr	   ListCommandr   r   r   r   <module>rC      sA    * < 3 ( * #:++ G%4 G%r   