
                         `   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SKJr  S rS rS r\	R(                  \	R*                  " \	R,                  R.                  5       " S S\	R0                  5      5       5       r\	R(                  \	R*                  " \	R,                  R4                  5       " S S\	R0                  5      5       5       r\	R(                  \	R*                  " \	R,                  R8                  5       " S S\	R0                  5      5       5       rg)z1Command for creating gRPC with TLS health checks.    )absolute_import)division)unicode_literals)base_classes)health_checks_utils)base)
exceptions)
completers)scope)flagsc                      SSS.$ )NzGCreate a gRPC with TLS health check to monitor load balanced instances.ag        *{command}* is used to create a non-legacy health check using the gRPC with TLS
      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       9lib/surface/compute/health_checks/create/grpc_with_tls.py_DetailedHelpr      s    

 r   c                    U R                   R                  [        R                  5        [        R                  " S5      R                  U SS9  [        R                  " U 5        [        R                  " U S5        U(       a  [        R                  " U 5        U R                   R                  [        R                  5        g)z7Set up arguments to create a gRPC with TLS HealthCheck.gRPC with TLScreate)operation_typeN)display_info	AddFormatr   DEFAULT_LIST_FORMATHealthCheckArgumentAddArgumentr   AddGrpcRelatedCreationArgsAddProtocolAgnosticCreationArgs AddHealthCheckLoggingRelatedArgsAddCacheUpdaterr
   HealthChecksCompleterAlpha)parserinclude_log_configs     r   _Argsr$   .   s     9 9:O,88X 9  00855foN88@%%j&K&KLr   c                    UR                   nUR                  nU R                  =(       d    U R                  (       + nU(       a  [        R
                  " SS/S5      e[        R                  " S5      R                  XR                  [        R                  R                  S9nUR                  U R                  U R                  S9n[        R                   " X5        [        R"                  " U5      (       a  UR%                  UR'                  UR)                  5       U R*                  UR&                  R,                  R.                  UU R0                  U R2                  U R4                  U R6                  S9UR8                  UR:                  S9nUR<                  R>                  n	OURA                  UR'                  UR)                  5       U R*                  UR&                  R,                  R.                  UU R0                  U R2                  U R4                  U R6                  S9UR8                  S	9nUR<                  RB                  n	U(       a%  [        RD                  " X05      URF                  l$        URK                  U	S
U4/5      $ )z9Issues the request necessary for adding the health check.z--portz--use-serving-portzOEither --port or --use-serving-port must be set for gRPC with TLS health check.r   )default_scope)portgrpcServiceName)namedescriptiontypegrpcTlsHealthCheckcheckIntervalSec
timeoutSechealthyThresholdunhealthyThreshold)healthCheckprojectregion)r1   r2   Insert)&clientmessagesr'   use_serving_portr	   OneOfArgumentsRequiredExceptionr   r   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALGRPCTLSHealthCheckgrpc_service_namer   0ValidateAndAddPortSpecificationToGRPCHealthCheckIsRegionalHealthCheckRef&ComputeRegionHealthChecksInsertRequestHealthCheckNamer*   TypeValueValuesEnumGRPC_WITH_TLScheck_intervaltimeouthealthy_thresholdunhealthy_thresholdr2   r3   apitools_clientregionHealthChecks ComputeHealthChecksInsertRequesthealthChecksCreateLogConfigr1   	logConfigMakeRequests)
argsholderr#   r5   r6   
args_unsethealth_check_refgrpc_tls_health_checkrequest
collections
             r   _RunrY   <   sM   ==&__( II6!6!67*

4
4	'(	  ..
M,C,C,J,J   
 #5599d&<&< 6  FF
 112BCC==((!&&(((%%99GG4!00||!33#77 ) 	
 !((&& > G ''::J77((!&&(((%%99GG4!00||!33#77 ) 	
 !(( 8 G ''44J$7$G$G%G! 
		z8W=>	??r   c                   @    \ rS rSrSr\" 5       rSr\S 5       r	S r
Srg)CreateAlpha~   $Create a gRPC with TLS health check.Tc                 .    [        XR                  5        g Nr$   _include_log_configclsr"   s     r   ArgsCreateAlpha.Args       	&))*r   c                 t    [        U[        R                  " U R                  5       5      U R                  5      $ r_   rY   r   ComputeApiHolderReleaseTrackra   selfrR   s     r   RunCreateAlpha.Run   2    %%d&7&7&9:   r   r   N__name__
__module____qualname____firstlineno____doc__r   detailed_helpra   classmethodrd   rm   __static_attributes__r   r   r   r[   r[   ~   +     -/-+ +r   r[   c                   @    \ rS rSrSr\" 5       rSr\S 5       r	S r
Srg)
CreateBeta   r]   Tc                 .    [        XR                  5        g r_   r`   rb   s     r   rd   CreateBeta.Args   rf   r   c                 t    [        U[        R                  " U R                  5       5      U R                  5      $ r_   rh   rk   s     r   rm   CreateBeta.Run   ro   r   r   Nrp   r   r   r   r{   r{      ry   r   r{   c                   @    \ rS rSrSr\" 5       rSr\S 5       r	S r
Srg)CreateGa   r]   Tc                 .    [        XR                  5        g r_   r`   rb   s     r   rd   CreateGa.Args   rf   r   c                 t    [        U[        R                  " U R                  5       5      U R                  5      $ r_   rh   rk   s     r   rm   CreateGa.Run   ro   r   r   Nrp   r   r   r   r   r      ry   r   r   N)ru   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   r	   "googlecloudsdk.command_lib.computer
   r   r;   0googlecloudsdk.command_lib.compute.health_checksr   r   r$   rY   DefaultUniverseOnlyReleaseTracksrj   ALPHACreateCommandr[   BETAr{   GAr   r   r   r   <module>r      s   8 &  ' 7 > ( . 9 E B M?@D D%%++,$$$  - & D%%**+##  , & D%%(()t!!  * r   