
                            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)z4Command for adding a NAT to 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)Create!   z%Add a NAT to 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5        [        R                  " U5        [        R                  " USS9  g )NNATcreate)operation_typeT)
for_create)routers_flagsRouterArgumentForNat
ROUTER_ARGAddArgumentr	   
ASYNC_FLAGAddToParsercompute_flagsAddRegionFlag
nats_flagsAddNatNameArg
AddTypeArgAddEndpointTypesArgAddCommonNatArgs)clsparsers     *lib/surface/compute/routers/nats/create.pyArgsCreate.Args(   s    "779CNNNv&OO'hGVH=&!""6*48    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                  " X5      nUR                  R!                  U5        UR#                  UR%                  UR&                  UR(                  UR+                  5       US95      n	[        R,                  R/                  U	R0                  SUR&                  UR(                  S.S9n
UR2                  (       aA  [4        R6                  " U
SR9                  UR0                  UR+                  5       5      SSS9  U	$ UR                  R/                  UR+                  5       S	UR&                  UR(                  S.S9n[:        R<                  " XK5      n[>        R@                  " XS
R9                  UR0                  UR+                  5       5      5      $ )zSee base.CreateCommand.)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"Creating NAT [{0}] in router [{1}] )!r   ComputeApiHolderReleaseTrackclientmessagesapitools_clientroutersr   ResolveAsResourcer   ComputeRoutersGetRequestGetAsDictr   CreateNatMessagenatsappendPatchComputeRoutersPatchRequestr*   r+   NameREGISTRYParsenameasync_r   CreatedResourceformatr   Pollerr   WaitFor)selfargsholderr7   service
router_refrequest_typereplacementnatresultoperation_reftarget_router_refoperation_pollers                r%   Run
Create.Run7   s    **4+<+<+>?F}}%%Hmm++33G2249I9IJJ44L++lAZ->->-@ABK

%
%d
3CC ]]++&&$$??$&	 	, 	()F &&,,-!)) ''
 - M {{	
*11#((JOO<MN3	4 m((..$!)) ''
 /  }}W@>>,33CHH4>OO4E	GH Hr(   r3   N)	__name__
__module____qualname____firstlineno____doc__classmethodr&   rX   __static_attributes__r3   r(   r%   r   r   !   s    
 .9 94Hr(   r   zQ
        *{command}* is used to create a NAT on a Compute Engine router.
        ap          Auto-allocate NAT for all IP addresses of all subnets in the region:

          $ {command} nat1 --router=my-router
            --auto-allocate-nat-external-ips --nat-all-subnet-ip-ranges

        Specify IP addresses for NAT:
        Each IP address is the name of a reserved static IP address resource in
        the same region.

          $ {command} nat1 --router=my-router
            --nat-external-ip-pool=ip-address1,ip-address2

        Specify subnet ranges for NAT:

        By default, NAT works for all primary and secondary IP ranges for all
        subnets in the region for the given VPC network. You can restrict which
        subnet primary and secondary ranges can use NAT.

          $ {command} nat1 --router=my-router
            --auto-allocate-nat-external-ips
            --nat-custom-subnet-ip-ranges=subnet-1,subnet-3:secondary-range-1
        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ReleaseTracksr5   ALPHABETAGACreateCommandr   detailed_helpr3   r(   r%   <module>rs      s    ; &  ' 7 < . ( E M O F # ) T..33T5F5F5I5IFHT FH FHV		0=' r(   