
    Q                         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r
\R                  \R                  \R                  " \R                  R                  5       " S S\R                   5      5       5       5       rg	)
z<Implements the command for starting a tunnel with Cloud IAP.    )base)
iap_tunnel)flags)logz

To increase the performance of the tunnel, consider installing NumPy. For instructions,
please see https://cloud.google.com/iap/docs/using-tcp-forwarding#increasing_the_tcp_upload_bandwidth
c                   <    \ rS rSrSrSS0r\S 5       rS rS r	Sr
g	)
StartIapTunnel   z-Starts an IAP tunnel to a Cloud Run instance.DESCRIPTIONa            Starts a tunnel to Cloud Identity-Aware Proxy for TCP forwarding through which
          another process can SSH into a Cloud Run instance. This command is only to be used by
          other gcloud commands (gcloud run ssh), and should not be used directly.
          c                 2   U R                  SSSS9  U R                  SSSS9  U R                  SSSS9  U R                  S	SS
S9  U R                  SSSS9  [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        g)zAdds arguments to the parser.z--project_numberTz<The project number of the project that the deployment is in.)requiredhelpz--project_idz8The project id of the project that the deployment is in.z--workload_typez>The type of the workload. One of service, job, or worker-pool.z--deployment_namez)The name of the deployment to connect to.z--iap-tunnel-url-overridezFAllows for overriding the connection endpoint for integration testing.)hiddenr   N)add_argumentr   AddContainerArgAddInstanceArgAddRegionArg)parsers    #lib/surface/run/start_iap_tunnel.pyArgsStartIapTunnel.Args-   s     K  
 G  
 M  
 8  
 #	   
&!	 	v    c                     [         R                  " U5      n[        R                  " U5      nU R	                  5         UR                  5         g)zRuns the command.N)run_iap_tunnel CloudRunIAPWebsocketTunnelHelperr   IapTunnelStdinHelper_CheckNumpyInstalledRun)selfargstunneleriap_tunnel_helpers       r   r   StartIapTunnel.RunP   s;    >>tDH"77Ar   c                 b     SS K ng ! [         a    [        R                  " [        5         g f = f)Nr   )numpyImportErrorr   warning_NUMPY_HELP_TEXT)r   r$   s     r   r   #StartIapTunnel._CheckNumpyInstalledW   s&    
$ $	kk"#$s    $.. N)__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r   r   __static_attributes__r)   r   r   r   r      s7     6  -    D$r   r   N)r.   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   googlecloudsdk.command_lib.runr   r   googlecloudsdk.corer   r'   HiddenDefaultUniverseOnlyReleaseTracksReleaseTrackALPHACommandr   r)   r   r   <module>r<      sr    C ( 9 0 G #  D%%++,=$T\\ =$ -  =$r   