
                             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 HTTPS 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)CreateHttpsHealthCheck   a  Create a legacy HTTPS health check.

Though you can use legacy HTTPS health checks in certain Google Cloud Platform
load balancing configurations and for managed instance group autohealing, you
should consider a non-legacy HTTPS health check created with `health-checks
create https` 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 HTTPS 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--porti  zg        The TCP port number that this health check monitors. The default value
        is 443.
        )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 HTTPS 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 HTTPS health check.)display_info	AddFormatr
   DEFAULT_LIST_FORMATHttpsHealthCheckArgumentHTTPS_HEALTH_CHECKS_ARGAddArgumentAddCacheUpdaterr	   HttpsHealthChecksCompleteradd_argumentintr   Duration)clsparsers     1lib/surface/compute/https_health_checks/create.pyArgsCreateHttpsHealthCheck.Args/   sx   
!!%";";<"'"@"@"BC++F8+L
''
(M(MN
   	      !!#	  	 !!#	   	   	   K  M    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)httpsHealthCheckprojectInsert)r   ComputeApiHolderReleaseTrackclientr   ResolveAsResource	resourcesmessages%ComputeHttpsHealthChecksInsertRequestHttpsHealthCheckNamer*   r+   r,   request_pathcheck_intervaltimeouthealthy_thresholdunhealthy_thresholdr3   MakeRequestsapitools_clienthttpsHealthChecks)selfargsholderr7   health_check_refrequests         r$   RunCreateHttpsHealthCheck.Run~   s   **4+<+<+>?F]]F33EE  ooCC99!&&((())!00||!33#77 : 

 !(( D *G !7!7!I!I!)7!4  5 6 6r'    )
__name__
__module____qualname____firstlineno____doc__r   classmethodr%   rK   __static_attributes__rM   r'   r$   r   r      s+      !LM LM\6r'   r   N)rR   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer	   6googlecloudsdk.command_lib.compute.https_health_checksr
   CreateCommandr   rM   r'   r$   <module>r[      s6    0 &  ' 7 / ( 9 Hy6T// y6r'   