
                            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      \	R,                   " S S\	R.                  5      5       5       r\	R&                  " \	R(                  R2                  5       " S S\5      5       r\	R&                  " \	R(                  R6                  5       " S S\5      5       rg)z)Command for creating HTTPS health checks.    )absolute_import)division)unicode_literals)base_classes)health_checks_utils)base)
completers)scope)flagsc                      SSS.$ )Nz>Create a HTTPS health check to monitor load balanced instancesak          *{command}* is used to create a non-legacy health check using the HTTPS
        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)
        )briefDESCRIPTION r       1lib/surface/compute/health_checks/create/https.py_DetailedHelpr      s     K	
 r   c                    U R                   R                  [        R                  5        [        R                  " S5      R                  U SS9  [        R                  " X5        [        R                  " U S5        [        R                  " U 5        U(       a  [        R                  " U 5        U(       a  [        R                  " U 5        U R                   R                  [        R                  5        g)z0Set up arguments to create an HTTPS HealthCheck.HTTPScreate)operation_typeN)display_info	AddFormatr   DEFAULT_LIST_FORMATHealthCheckArgumentAddArgumentr   AddHttpRelatedCreationArgsAddProtocolAgnosticCreationArgsAddHttpRelatedResponseArg&AddHealthCheckSourceRegionsRelatedArgs AddHealthCheckLoggingRelatedArgsAddCacheUpdaterr	   HealthChecksCompleterAlpha)parserinclude_log_configinclude_weighted_load_balancinginclude_source_regionss       r   _Argsr'   ,   s     	 9 9:G$00X 1 '00/55fgF//7>>v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                  " XP5      URP                  l)        U(       a(  U RT                  b  U RT                  URP                  l+        URY                  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httpsHealthCheckcheckIntervalSec
timeoutSechealthyThresholdunhealthyThreshold)healthCheckprojectregion)r8   r9   Insert)-clientmessagesr   r   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALHTTPSHealthCheckProxyHeaderValueValuesEnumproxy_headerr*   r+   	port_namerequest_pathr/   weight_report_modeWeightReportModeValueValuesEnumweightReportModer   ,ValidateAndAddPortSpecificationToHealthCheckIsRegionalHealthCheckRef&ComputeRegionHealthChecksInsertRequestHealthCheckNamer1   TypeValueValuesEnumr   check_intervaltimeouthealthy_thresholdunhealthy_thresholdr9   r:   apitools_clientregionHealthChecks ComputeHealthChecksInsertRequesthealthChecksCreateLogConfigr8   	logConfigsource_regionssourceRegionsMakeRequests)argsholderr$   r%   r&   r<   r=   health_check_refrE   https_health_checkrH   request
collections                r   _Runrd   A   s    ==&__(..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 ) 9 !((&& > (G ''::J77((!&&(((%%99??/!00||!33#77 ) 9 !(( 8 
*G ''44J$7$G$G%G! !4!4!@(,(;(;G%			z8W=>	??r   c                   H    \ rS 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 HTTPS health check.TFc                 \    [        UU R                  U R                  U R                  5        g N)r'   _include_log_config _include_weighted_load_balancing_include_source_regions)clsr#   s     r   ArgsCreate.Args   s(    	,,##	r   c                     [         R                  " U R                  5       5      n[        UUU R                  U R
                  U R                  5      $ ri   )r   ComputeApiHolderReleaseTrackrd   rj   rk   rl   )selfr^   r_   s      r   Run
Create.Run   sI    **4+<+<+>?F  --$$ r   r   N)__name__
__module____qualname____firstlineno____doc__rj   rk   rl   r   detailed_helpclassmethodrn   rt   __static_attributes__r   r   r   rf   rf      s7     %%*" /- r   rf   c                       \ rS rSrSrSrg)
CreateBeta   Fr   Nrv   rw   rx   ry   rk   r}   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)rz   
__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'   rd   ReleaseTracksrr   GADefaultUniverseOnlyCreateCommandrf   BETAr   ALPHAr   r   r   r   <module>r      s    0 &  ' 7 > ( 9 E BM*C@L D%%(()T   *8 D%%**++ + ,+
 D%%++,** * -*r   