
    ,                         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g)z(Command for creating HTTP health checks.    )absolute_import)division)unicode_literals)base_classes)arg_parsers)base)
completers)flagsc                   2    \ rS rSrSrSr\S 5       rS rSr	g)Create   a*  Create a legacy HTTP health check.

Legacy HTTP health checks are required if you want to implement health
checking for a target pool backend of an external passthrough Network
Load Balancer. Though you can
use legacy HTTP health checks in certain other Google Cloud Platform load
balancing configurations and for managed instance group autohealing, you
should consider a non-legacy HTTP health check created with `health-checks
create http` instead.

For more information about the differences between legacy and non-legacy
health checks see:
[](https://cloud.google.com/load-balancing/docs/health-check-concepts#category_and_protocol)

For information about what type of health check to use for a particular load
balancer, see:
[](https://cloud.google.com/load-balancing/docs/health-check-concepts#lb_guide)
Nc                    UR                   R                  [        R                  5        [        R                  " 5       U l        U R
                  R                  USS9  UR                   R                  [        R                  5        UR                  SSS9  UR                  S[        SSS	9  UR                  S
SSS9  UR                  S[        R                  " 5       SSS	9  UR                  S[        R                  " 5       SSS	9  UR                  S[        SSS	9  UR                  S[        SSS	9  UR                  SSS9  g )Ncreate)operation_typez--hosta(          The value of the host header used in this HTTP health check request.
        By default, this is empty and Compute Engine automatically sets
        the host header in health requests to the same external IP address as
        the forwarding rule associated with the target pool.
        )helpz--portP   zf        The TCP port number that this health check monitors. The default value
        is 80.
        )typedefaultr   z--request-path/z        The request path that this health check monitors. For example,
        ``/healthcheck''. The default value is ``/''.
        )r   r   z--check-interval5sa          How often to perform a health check for an instance. For example,
        specifying ``10s'' will run the check every 10 seconds. The default
        value is ``5s''. See $ gcloud topic datetimes for information on
        duration formats.
        z	--timeouta          If Compute Engine doesn't receive an HTTP 200 response from the
        instance by the time specified by the value of this flag, the health
        check request is considered a failure. For example, specifying ``10s''
        will cause the check to wait for 10 seconds before considering the
        request a failure. The default value is ``5s''.
        See $ gcloud topic datetimes for information on duration formats.
        z--unhealthy-threshold   z        The number of consecutive health check failures before a healthy
        instance is marked as unhealthy. The default is 2.
        z--healthy-thresholdz        The number of consecutive successful health checks before an
        unhealthy instance is marked as healthy. The default is 2.
        z--descriptionz;An optional, textual description for the HTTP health check.)display_info	AddFormatr
   DEFAULT_LIST_FORMATHttpHealthCheckArgumentHTTP_HEALTH_CHECKS_ARGAddArgumentAddCacheUpdaterr	   HttpHealthChecksCompleteradd_argumentintr   Duration)clsparsers     0lib/surface/compute/http_health_checks/create.pyArgsCreate.Args2   sx   
!!%";";<!&!>!>!@C**6(*K
''
(L(LM
   	      !!#	  	 !!#	   	   	   J  L    c                 @   [         R                  " U R                  5       5      nUR                  nU R                  R                  XR                  5      nUR                  R                  UR                  R                  UR                  5       UR                  UR                  UR                  UR                  UR                  UR                   UR"                  UR$                  S9	UR&                  S9nUR)                  UR*                  R,                  SU4/5      $ )z9Issues the request necessary for adding the health check.)	namehostportdescriptionrequestPathcheckIntervalSec
timeoutSechealthyThresholdunhealthyThreshold)httpHealthCheckprojectInsert)r   ComputeApiHolderReleaseTrackclientr   ResolveAsResource	resourcesmessages$ComputeHttpHealthChecksInsertRequestHttpHealthCheckNamer+   r,   r-   request_pathcheck_intervaltimeouthealthy_thresholdunhealthy_thresholdr4   MakeRequestsapitools_clienthttpHealthChecks)selfargsholderr8   health_check_refrequests         r%   Run
Create.Run   s   **4+<+<+>?F]]F22DD  ooBB77!&&((())!00||!33#77 8 

 !(( C *G !7!7!H!H!)7!4  5 6 6r(    )
__name__
__module____qualname____firstlineno____doc__r   classmethodr&   rL   __static_attributes__rN   r(   r%   r   r      s+    &  LL LL\6r(   r   N)rS   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer	   5googlecloudsdk.command_lib.compute.http_health_checksr
   CreateCommandr   rN   r(   r%   <module>r\      s6    / &  ' 7 / ( 9 G|6T |6r(   