
    p                        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S
KJr  SSKJr  SSKJr  \R0                  \R2                  " \R4                  R6                  \R4                  R8                  \R4                  R:                  5       " S S\R<                  5      5       5       rSSSS.\l         g)z6Command for updating a NAT on a Compute Engine router.    )absolute_import)division)unicode_literals)base_classes)poller)waiter)base)flags)
nats_utils)log)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)Update!   z(Update a NAT on a Compute Engine router.c                 ,   [         R                  " 5       U l        U R                  R                  U5        [        R
                  R                  U5        [        R                  " USSS9  [        R                  " USS9  [        R                  " USS9  g )NNATcreate)operation_typeF)
for_create)routers_flagsRouterArgumentForNat
ROUTER_ARGAddArgumentr	   
ASYNC_FLAGAddToParsercompute_flagsAddRegionFlag
nats_flagsAddNatNameArgAddCommonNatArgs)clsparsers     *lib/surface/compute/routers/nats/update.pyArgsUpdate.Args(   sh    "779CNNNv&OO'hGVH=59    c           	         [         R                  " U R                  5       5      nUR                  R                  nUR                  R
                  R                  nU R                  R                  XR                  5      nUR                  nUR                  U" S0 UR                  5       D65      n[        R                  " XqR                  5      n[        R                   " XU5      n	UR"                  nUR%                  U" UR&                  UR(                  UR+                  5       US95      n
[        R,                  R/                  U
R                  SUR&                  UR(                  S.S9nUR0                  (       aA  [2        R4                  " USR7                  U	R                  UR+                  5       5      SSS9  U
$ UR                  R/                  UR+                  5       S	UR&                  UR(                  S.S9n[8        R:                  " XL5      n[<        R>                  " XS
R7                  U	R                  UR+                  5       5      5      $ )N)projectregionrouterrouterResourcezcompute.regionOperations)r(   r)   )
collectionparamsznat [{0}] in router [{1}]Tz[Run the [gcloud compute operations describe] command to check the status of this operation.)kindis_asyncdetailszcompute.routersz"Updating nat [{0}] in router [{1}] ) r   ComputeApiHolderReleaseTrackclientmessagesapitools_clientroutersr   ResolveAsResourcer   ComputeRoutersGetRequestGetAsDictr   FindNatOrRaisenameUpdateNatMessageComputeRoutersPatchRequestPatchr(   r)   NameREGISTRYParseasync_r   UpdatedResourceformatr   Pollerr   WaitFor)selfargsholderr5   service
router_refrequest_typereplacementexisting_natnatresultoperation_reftarget_router_refoperation_pollers                 r#   Run
Update.Run4   s   **4+<+<+>?F}}%%Hmm++33G2249I9IJJ44L++lAZ->->-@ABK ,,[))DL

%
%l&
AC66L]]&&$$??$&		()F &&,,-!)) ''
 - M {{	
*11#((JOO<MN3	4 m((..$!)) ''
 /  }}W@>>,33CHH4>OO4E	GH Hr&   r1   N)	__name__
__module____qualname____firstlineno____doc__classmethodr$   rV   __static_attributes__r1   r&   r#   r   r   !   s    
 1	: 	:3Hr&   r   zQ
        *{command}* is used to update a NAT in a Compute Engine router.
        a          Change subnetworks and IP address resources associated with NAT:

          $ {command} nat1 --router=my-router
            --nat-external-ip-pool=ip-address2,ip-address3
            --nat-custom-subnet-ip-ranges=subnet-2,subnet-3:secondary-range-2

        Change minimum default ports allocated per VM associated with NAT:

          $ {command} nat1 --router=my-router --min-ports-per-vm=128

        Change connection timeouts associated with NAT:

          $ {command} nat1 --router=my-router
            --udp-idle-timeout=60s
            --icmp-idle-timeout=60s
            --tcp-established-idle-timeout=60s
            --tcp-transitory-idle-timeout=60s

        Reset connection timeouts associated NAT to default values:

          $ {command} nat1 --router=my-router
            --clear-udp-idle-timeout --clear-icmp-idle-timeout
            --clear-tcp-established-idle-timeout
            --clear-tcp-transitory-idle-timeout
        a      This command, when specified without alpha or beta, uses the compute/v1/routers API. The full documentation
    for this API can be found at: https://cloud.google.com/compute/docs/reference/rest/v1/routers/

    The beta command uses the compute/beta/routers API. The full documentation
    for this API can be found at: https://cloud.google.com/compute/docs/reference/rest/beta/routers/

    The alpha command uses the compute/alpha/routers API. Full documentation is not available for the alpha API.
    )DESCRIPTIONEXAMPLESzAPI REFERENCEN)!r\   
__future__r   r   r   googlecloudsdk.api_lib.computer   )googlecloudsdk.api_lib.compute.operationsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   "googlecloudsdk.command_lib.computer
   r   *googlecloudsdk.command_lib.compute.routersr   /googlecloudsdk.command_lib.compute.routers.natsr   r   googlecloudsdk.corer   r   UniverseCompatibleReleaseTracksr3   ALPHABETAGAUpdateCommandr   detailed_helpr1   r&   r#   <module>rq      s    = &  ' 7 < . ( E M O F # ) T..33T5F5F5I5IBHT BH BHL4=' r&   