
                             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KJr   " S
 S\
R                   5      rSSS.\l        g)zECommand for getting health status of backend(s) in a backend service.    )absolute_import)division)unicode_literals)base_classes)client)base)flags)backend_services_utilsc                   L    \ rS rSrSr\R                  r\S 5       r	S r
S rSrg)	GetHealth   zGets health status.c                 :    U R                   R                  U5        g )N)_BACKEND_SERVICE_ARGAddArgument)clsparsers     2lib/surface/compute/backend_services/get_health.pyArgsGetHealth.Args#   s    ((0    c                     U R                   R                  UUR                  [        R                  " 5       [
        R                  " UR                  5      S9$ )z'Override. Don't assume a default scope.)default_scopescope_lister)r   ResolveAsResource	resourcesr
   GetDefaultScopecompute_flagsGetDefaultScopeListerr   )selfholderargss      r   GetReferenceGetHealth.GetReference'   sL    $$66,<<>"88G	 7 I Ir   c                    UR                   (       a  SUl         SUl        [        R                  " U R	                  5       5      nU R                  X!5      n[        R                  " X2R                  S9nUR                  5       $ )z4Returns a list of backendServiceGroupHealth objects.Fz4value[delimiter="
"](status.healthStatus[].instance))compute_client)	uriformatr   ComputeApiHolderReleaseTrackr"   r   BackendServicer   )r   r!   r    refbackend_services        r   RunGetHealth.Run/   sh    xxdhKdk**4+<+<+>?F


F
)C++MM+O $$&&r    N)__name__
__module____qualname____firstlineno____doc__r	   #GLOBAL_REGIONAL_BACKEND_SERVICE_ARGr   classmethodr   r"   r-   __static_attributes__r/   r   r   r   r      s.    BB1 1I'r   r   z3Get backend health statuses from a backend service.a  
        *{command}* is used to request the current health status of
        instances in a backend service. Every group in the service
        is checked and the health status of each configured instance
        is printed.

        If a group contains names of instances that don't exist or
        instances that haven't yet been pushed to the load-balancing
        system, they will not show up. Those that are listed as
        ``HEALTHY'' are able to receive load-balanced traffic. Those that
        are marked as ``UNHEALTHY'' are either failing the configured
        health-check or not responding to it.

        Since the health checks are performed continuously and in
        a distributed manner, the state returned by this command is
        the most recent result of a vote of several redundant health
        checks. Backend services that do not have a valid global
        forwarding rule referencing it will not be health checked and
        so will have no health status.
    )briefDESCRIPTIONN)r4   
__future__r   r   r   googlecloudsdk.api_lib.computer   /googlecloudsdk.api_lib.compute.backend_servicesr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r   3googlecloudsdk.command_lib.compute.backend_servicesr
   ListCommandr   detailed_helpr/   r   r   <module>rB      sN     L &  ' 7 B ( E V E'   'B C	 r   