Ë
    €Ïð  ã                   ó²   — 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 ddlmZ  G d
„ de
j                   «      Zdddœe_        y)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                   óD   — e Zd ZdZej
                  Zed„ «       Zd„ Z	d„ Z
y)Ú	GetHealthzGets health status.c                 ó:   — | j                   j                  |«       y )N)Ú_BACKEND_SERVICE_ARGÚAddArgument)ÚclsÚparsers     ú2lib/surface/compute/backend_services/get_health.pyÚArgszGetHealth.Args#   s   € à×Ñ×(Ñ(¨Õ0ó    c                 ó²   — | j                   j                  ||j                  t        j                  «       t        j                  |j                  «      ¬«      S )z'Override. Don't assume a default scope.)Údefault_scopeÚscope_lister)r   ÚResolveAsResourceÚ	resourcesr
   ÚGetDefaultScopeÚcompute_flagsÚGetDefaultScopeListerr   )ÚselfÚholderÚargss      r   ÚGetReferencezGetHealth.GetReference'   sL   € à×$Ñ$×6Ñ6ØØ×ÑÜ,×<Ñ<Ó>Ü"×8Ñ8¸¿¹ÓGð	 7ó Ið Ir   c                 ó  — |j                   rd|_         d|_        t        j                  | j	                  «       «      }| j                  ||«      }t        j                  ||j                  ¬«      }|j                  «       S )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   ÚRunzGetHealth.Run/   sl   € à‡x‚xØ€d„hØK€d„kä×*Ñ*¨4×+<Ñ+<Ó+>Ó?€FØ
×
Ñ
˜F DÓ
)€Cä×+Ñ+Ø˜FŸM™Mô+€Oð ×$Ñ$Ó&Ð&r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r	   Ú#GLOBAL_REGIONAL_BACKEND_SERVICE_ARGr   Úclassmethodr   r    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)r.   Ú
__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_helpr1   r   r   Ú<module>r<      sN   ðñ  Lå &Ý Ý 'å 7Ý BÝ (Ý EÝ VÝ Eô'× Ñ ô 'ðB Cðñ€	Õ r   