
                            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 rS rS r\	R&                  " \	R(                  R*                  5       " S S\	R,                  5      5       r\	R&                  " \	R(                  R0                  5       " S S\5      5       r\	R&                  " \	R(                  R4                  5       " S S\5      5       rg)z)Command for creating HTTP2 health checks.    )absolute_import)division)unicode_literals)base_classes)health_checks_utils)base)
completers)scope)flagsc                      SSSS.$ )Nz>Create a HTTP2 health check to monitor load balanced instancesax            *{command}* is used to create a non-legacy health check using the
          HTTP/2 protocol. You can use this health check for Google Cloud
          load balancers or for managed instance group autohealing.
          For more information, see the health checks overview at:
          [](https://cloud.google.com/load-balancing/docs/health-check-concepts)
          z|          To create a HTTP2 health check with default options, run:

            $ {command} my-health-check-name
          )briefDESCRIPTIONEXAMPLES r       1lib/surface/compute/health_checks/create/http2.py_DetailedHelpr      s     K
 r   c                    U R                   R                  [        R                  5        [        R                  " S5      R                  U SS9  [        R                  " X5        [        R                  " U 5        [        R                  " U S5        U(       a  [        R                  " U 5        U R                   R                  [        R                  5        g)z0Set up arguments to create an HTTP2 HealthCheck.HTTP2create)operation_typeN)display_info	AddFormatr   DEFAULT_LIST_FORMATHealthCheckArgumentAddArgumentr   AddHttpRelatedCreationArgsAddHttpRelatedResponseArgAddProtocolAgnosticCreationArgs AddHealthCheckLoggingRelatedArgsAddCacheUpdaterr	   HealthChecksCompleterAlpha)parserinclude_log_configinclude_weighted_load_balancings      r   _Argsr&   2   s     9 9:G$00X 1 '00///755fgF88@%%j&K&KLr   c                    UR                   nUR                  n[        R                  " S5      R	                  XR
                  [        R                  R                  S9nUR                  R                  U R                  5      nUR                  U R                  U R                  U R                  U R                  UU R                   S9nU(       a<  U R"                  (       a+  UR                  R%                  U R"                  5      n	Xl        [(        R*                  " X5        [(        R,                  " U5      (       a  UR/                  UR1                  UR3                  5       U R4                  UR0                  R6                  R8                  UU R:                  U R<                  U R>                  U R@                  S9URB                  URD                  S9n
URF                  RH                  nOURK                  UR1                  UR3                  5       U R4                  UR0                  R6                  R8                  UU R:                  U R<                  U R>                  U R@                  S9URB                  S9n
URF                  RL                  nU(       a%  [(        RN                  " X@5      U
RP                  l)        URU                  USU
4/5      $ )z9Issues the request necessary for adding the health check.r   )default_scope)hostportportNamerequestPathproxyHeaderresponse)namedescriptiontypehttp2HealthCheckcheckIntervalSec
timeoutSechealthyThresholdunhealthyThreshold)healthCheckprojectregion)r7   r8   Insert)+clientmessagesr   r   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALHTTP2HealthCheckProxyHeaderValueValuesEnumproxy_headerr)   r*   	port_namerequest_pathr.   weight_report_modeWeightReportModeValueValuesEnumweightReportModer   ,ValidateAndAddPortSpecificationToHealthCheckIsRegionalHealthCheckRef&ComputeRegionHealthChecksInsertRequestHealthCheckNamer0   TypeValueValuesEnumr   check_intervaltimeouthealthy_thresholdunhealthy_thresholdr8   r9   apitools_clientregionHealthChecks ComputeHealthChecksInsertRequesthealthChecksCreateLogConfigr7   	logConfigMakeRequests)argsholderr$   r%   r;   r<   health_check_refrD   http2_health_checkrG   request
collections               r   _Runra   @   st   ==&__(..w7II
M,C,C,J,J J L**EE
,  009999~~##}} 1  %)@)@!22RR!*<'BB
  112BCC==((!&&(((%%99??/!00||!33#77 ) 	
 !((&& > (G ''::J77((!&&(((%%99??/!00||!33#77 ) 9 !(( 8 
*G ''44J$7$G$G%G! 
		z8W=>	??r   c                   D    \ rS rSrSrSrSr\" 5       r\	S 5       r
S rSrg)	Create~   zCreate a HTTP2 health check.TFc                 D    [        XR                  U R                  5        g N)r&   _include_log_config _include_weighted_load_balancing)clsr#   s     r   ArgsCreate.Args   s    	&))3+O+OPr   c                     [         R                  " U R                  5       5      n[        XU R                  U R
                  5      $ rf   )r   ComputeApiHolderReleaseTrackra   rg   rh   )selfr[   r\   s      r   Run
Create.Run   s;    **4+<+<+>?Fd66557 7r   r   N)__name__
__module____qualname____firstlineno____doc__rg   rh   r   detailed_helpclassmethodrj   rp   __static_attributes__r   r   r   rc   rc   ~   s1    $%*"/-Q Q7r   rc   c                       \ rS rSrSrSrg)
CreateBeta   Fr   Nrr   rs   rt   ru   rh   ry   r   r   r   r{   r{      s
     &+"r   r{   c                       \ rS rSrSrSrg)CreateAlpha   Tr   Nr}   r   r   r   r   r      s
     &*"r   r   N)rv   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r
   r?   0googlecloudsdk.command_lib.compute.health_checksr   r   r&   ra   ReleaseTracksrn   GACreateCommandrc   BETAr{   ALPHAr   r   r   r   <module>r      s    0 &  ' 7 > ( 9 E B*M;@| D%%(()7T 7 *7" D%%**++ + ,+
 D%%++,** * -*r   