
    H                     t   S r SSKJr  SSKJr  SSKJr  SSKJr  SrS\-   SR                  \5      S	.r	S
r
S r\R                  \R                  " \R                  R                  5       " S S\R                   5      5       5       r\	R%                  5       \l        \
R                  \5      \R&                  S'   g)#List Compute Engine HA Controllers.    )base_classes)lister)utils)basezHA ControllerszList Compute Engine zN          *{{command}}* displays all Compute Engine {0} in a project.
        )briefDESCRIPTIONa)            To list all {0} in a project in table form, run:

            $ {{command}}

      To list {0} in specific regions only in table form, run:

            $ {{command}} --regions=REGION1,REGION2...

      To list the URIs of all {0} in a project, run:

            $ {{command}} --uri
    c                     U (       a/  U R                  S5      (       a  U S   R                  S5      (       d  gU S   S   R                  5        H  u  pUS   (       a  M  Us  $    g)z1Returns the secondary zone for the HA Controller.status
zoneStatus 	isPrimaryN)getitems)resourcezoneconfigs      *lib/surface/compute/ha_controllers/list.py_TransformSecondaryZoner   1   s^     \\(##h##L11x(6<<>ld+k ?    c                   .    \ rS rSrSr\S 5       rS rSrg)List>   r   c                    U R                   R                  S5        U R                   R                  [        R                  " 5       5        U R                   R                  S[        05        [        R                  " U 5        g )Nz      table(
        name,
        region.basename(),
        status.primaryZone,
        secondaryZone(),
        instanceName,
        status.ongoingFailover,
        failoverInitiation,
        failoverCapacity
      )secondaryZone)	display_info	AddFormat
AddUriFuncr   MakeGetUriFuncAddTransformsr   r   AddRegionsArg)parsers    r   Args	List.ArgsC   si    
!! 
# 
 ""5#7#7#9:
%%0'   r   c                 "   [         R                  " U R                  5       5      nUR                  n[        R
                  " XR                  5      n[        R                  " X3R                  R                  5      n[        R                  " XE5      $ )N)r   ComputeApiHolderReleaseTrackclientr   ParseRegionalFlags	resourcesRegionalListerapitools_clienthaControllersInvoke)selfargsholderr(   request_datalist_implementations         r   RunList.RunV   sk    **4+<+<+>?F]]F,,T3C3CDL //&&44 ==;;r    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr#   r4   __static_attributes__r6   r   r   r   r   >   s     ,! !$
<r   r   EXAMPLESN)r;   googlecloudsdk.api_lib.computer   r   r   googlecloudsdk.callioper   RESOURCE_TYPEformatDETAILED_HELPEXAMPLE_FORMATr   DefaultUniverseOnlyReleaseTracksr'   ALPHAListCommandr   copydetailed_helpr6   r   r   <module>rK      s    * 8 1 0 (  	.	F=!
 D%%++, <4  < -  <F #'') !/!6!6}!E  : r   