
    d                         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
\R                  5      rSSSS.\l        g)z3Command for getting the latest image from a family.    )absolute_import)division)unicode_literals)base_classes)base)
completers)flagsc                   .    \ rS rSrSr\S 5       rS rSrg)DescribeFromFamily   zDescribe the latest image from an image family.

*{command}* looks up the latest image from an image family and runs a describe
on it.
c                     [         R                  " 5       [        l        [        R                  R	                  U SS9  U R                  S[        R                  SS9  g )Ndescribe)operation_typez--zonezZone to query. Returns the latest image available in the image family for the specified zone. If not specified, returns the latest globally available image.)	completerhelp)r	   MakeDiskImageArgr   DiskImageArgAddArgumentadd_argumentr   ZonesCompleter)parsers    2lib/surface/compute/images/describe_from_family.pyArgsDescribeFromFamily.Args$   sX    &+&<&<&>###//z 0 + ++1  3    c                    [         R                  " U R                  5       5      nUR                  n[        R
                  R                  UUR                  [        R                  " U5      S9nUR                  nUR                  S5      (       a  U[        S5      S  n[        US5      (       ak  UR                  (       aZ  UR                  R!                  XTR"                  UR                  S9nUR%                  UR&                  R(                  SU4/5      S   $ UR                  R+                  XTR"                  S9nUR%                  UR&                  R,                  SU4/5      S   $ )	N)scope_listerzfamily/zone)familyprojectr   Getr   )r   r    GetFromFamily)r   ComputeApiHolderReleaseTrackclientr   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerimage
startswithlenhasattrr   messages!ComputeImageFamilyViewsGetRequestr    MakeRequestsapitools_clientimageFamilyViews!ComputeImagesGetFromFamilyRequestimages)selfargsholderr%   	image_refr   requests          r   RunDescribeFromFamily.Run2   s_   **4+<+<+>?F]]F"//AA"88@ B BI
 __F##c)no&ftVAA!2!2 B Dg   6#9#9#J#J#('#3 "4 5568 8 AA!2!2 B 4g   6#9#9#@#@#2G#= "> ??@B Br    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   r:   __static_attributes__r<   r   r   r   r      s!     3 3Br   r   z/Describe the latest image from an image family.z        *{command}* looks up the latest image from an image family and runs a
        describe on it. If the image is not in the default project, you need to
        specify a value for `--project`.
        z        To view the description for the latest ``debian-9'' image from the
        ``debian-cloud'' project, run:

          $ {command} debian-9 --project=debian-cloud
        )briefDESCRIPTIONEXAMPLESN)rA   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r	   r(   )googlecloudsdk.command_lib.compute.imagesDescribeCommandr   detailed_helpr<   r   r   <module>rN      sQ     : &  ' 7 ( 9 E ;.B-- .Bf 	:		$   r   