
    \                        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  \
R$                  \
R&                  " \
R(                  R*                  5       " S S\
R,                  5      5       5       r\
R$                  \
R&                  " \
R(                  R0                  \
R(                  R2                  5       " S S\5      5       5       rSSS.\l        g)z(Command for creating target TCP proxies.    )absolute_import)division)unicode_literals)base_classes)target_proxies_utils)utils)base)scope)flagsc                   H    \ rS rSrSrSrSr\S 5       rS r	S r
S rS rS	rg)
Create   zCreate a target TCP proxy.Nc                    [         R                  " U5        [        R                  " SS9U l        U R                  R                  U5        [        R                  " SS9U l        U R                  R                  USS9  [        R                  " U5        UR                  SSS9  UR                  R                  [        R                  5        g )NT)allow_regionalcreate)operation_typez--descriptionz:An optional, textual description for the target TCP proxy.)help)r   AddProxyHeaderRelatedCreateArgsbackend_service_flags'BackendServiceArgumentForTargetTcpProxyBACKEND_SERVICE_ARGAddArgumentr   TargetTcpProxyArgumentTARGET_TCP_PROXY_ARGAddProxyBindadd_argumentdisplay_infoAddCacheUpdaterTargetTcpProxiesCompleter)clsparsers     0lib/surface/compute/target_tcp_proxies/create.pyArgsCreate.Args'   s    88@ 	EE	
 
 ''/$;;4PC(((I	v
I  K ''(G(GH    c                 p   [         R                  " U R                  5       5      nUR                  (       d5  UR                  (       d$  [        USS 5      Ul        [        USS 5      Ul        U R                  R                  XR                  [        R                  R                  S9nU R                  R                  XR                  [        R                  R                  S9nUR                  R                  nUR                  (       a&  UR                   R#                  UR                  5      nO UR                   R"                  R$                  nUR!                  UR&                  UR)                  5       UUR+                  5       S9nUR,                  b  UR,                  Ul        U R1                  XGU5      $ )Nregionglobal)default_scope)descriptionnameproxyHeaderservice)r   ComputeApiHolderReleaseTrackbackend_service_regionglobal_backend_servicegetattrr   ResolveAsResource	resourcescompute_scope	ScopeEnumGLOBALr   clientmessagesproxy_headerTargetTcpProxyProxyHeaderValueValuesEnumNONEr*   NameSelfLink
proxy_bind	proxyBind_MakeRequest)selfargsholderbackend_service_reftarget_tcp_proxy_refr9   r:   target_tcp_proxys           r"   Run
Create.Run<   ss   **4+<+<+>?F''4+F+F$+D(D$Ad!$+D(D$Ad!22DDm.E.E.L.L E N  44FFm.E.E.L.L G N }}%%H,,GG


l --HHMMl..$$!&&( #,,.	 / 0 "#'?? 1VLLr%   c                 r    UR                  5       S:X  a  U R                  XU5      $ U R                  XU5      $ )Nzcompute.regionTargetTcpProxies)
Collection_MakeRegionalRequest_MakeGlobalRequest)rC   rG   rH   rE   s       r"   rB   Create._MakeRequest\   sF    &&(,LL&&';'-/ /""#7#)+ +r%   c                 :   UR                   R                  nUR                   R                  nUR                  UR                  UUR
                  S9n/ nUR                   R                  UR                  SU4/U5      nU(       a  [        R                  " U5        U$ )N)projecttargetTcpProxyr'   Insert)
r8   apitools_clientr9   *ComputeRegionTargetTcpProxiesInsertRequestrQ   r'   MakeRequestsregionTargetTcpProxiesr   RaiseToolException	rC   rG   rH   rE   r8   r9   requesterrorsr4   s	            r"   rM   Create._MakeRegionalRequestc   s    ]]**F}}%%HAA$,,'#** B ,G
 F**

'
'7	;<fFI v&r%   c                 $   UR                   R                  nUR                   R                  nUR                  UR                  US9n/ nUR                   R                  UR                  SU4/U5      nU(       a  [        R                  " U5        U$ )N)rQ   rR   rS   )	r8   rT   r9   $ComputeTargetTcpProxiesInsertRequestrQ   rV   targetTcpProxiesr   rX   rY   s	            r"   rN   Create._MakeGlobalRequestt   s    ]]**F}}%%H;;$,,=M < OG F**

!
!8W	56@I v&r%    )__name__
__module____qualname____firstlineno____doc__r   r   classmethodr#   rI   rB   rM   rN   __static_attributes__ra   r%   r"   r   r      s=     #I I(M@+"r%   r   c                       \ rS rSrSrg)CreateAlphaBeta   ra   N)rb   rc   rd   re   rh   ra   r%   r"   rj   rj      s     r%   rj   zCreate a target TCP proxya8  
        *{command}* is used to create target TCP proxies. A target
        TCP proxy is referenced by one or more forwarding rules which
        define which packets the proxy is responsible for routing. The
        target TCP proxy points to a backend service which handle the
        actual requests.
        )briefDESCRIPTIONN)rf   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   r   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r5   3googlecloudsdk.command_lib.compute.backend_servicesr   r   5googlecloudsdk.command_lib.compute.target_tcp_proxiesUniverseCompatibleReleaseTracksr/   GACreateCommandr   ALPHABETArj   detailed_helpra   r%   r"   <module>r{      s    / &  ' 7 ? 0 ( E$ G D%%(()_T _ * _D D%%++T->->-C-CDf  E  	$		 r%   