
    H                         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
S.r\R                  " \R                  R                   5       " S S\R"                  5      5       rg)z)'vmware network-policies create' command.    )absolute_import)division)unicode_literals)NetworkPoliciesClient)base)flags)logz
          Create a VMware Engine network policy. Only one network policy applies to a VMware Engine network per region. Check the progress of a network policy creation using `{parent_command} list`.
        am  
          To create a network policy called `my-network-policy` which connects to the VMware Engine network `my-vmware-engine-network` using the edge services address range `192.168.0.0/26` with the internet access service enabled and the external IP access service disabled, run:

            $ {command} my-network-policy --location=us-west2 --project=my-project --vmware-engine-network=my-vmware-engine-network --edge-services-cidr=192.168.0.0/26 --internet-access --no-external-ip-access

          Or:

            $ {command} my-network-policy --vmware-engine-network=my-vmware-engine-network --edge-services-cidr=192.168.0.0/26 --internet-access

          In the second example, the project and the location are taken from gcloud properties core/project and compute/region respectively. If the `--external-ip-access` flag is not specified, it is taken as `False`.
    )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Create-   z&Create a VMware Engine network policy.c                    [         R                  " U SS9  [        R                  R	                  U 5        [        R                  R                  U S5        U R                  R                  S5        U R                  SSSS9  U R                  SSS	9  U R                  S
SSS9  U R                  SSSSS9  U R                  SSSSS9  g)z Register flags for this command.T)
positionalyamlz--vmware-engine-networkzV        Resource ID of the VMware Engine network to attach the new policy to.
        )requiredhelpz--descriptionzA        User-provided description of the network policy.
        )r   z--edge-services-cidrz        IP address range to use for internet access and external IP access gateways, in CIDR notation. An RFC 1918 CIDR block with a "/26" prefix is required.
        z--internet-access
store_trueFz        Enable or disable network service that allows VMware workloads to access the internet. Use `--no-internet-access` to disable. If the flag is not provided, internet access is disabled.
        )actiondefaultr   z--external-ip-accessaE          Enable or disable network service that allows external IP addresses to be assigned to VMware workloads. To enable this service, `internet-access` must also be enabled. Use `--no-external-ip-access` to disable. If the flag is not provided, access to VMware workloads through external IP addresses is disabled.
        N)	r   AddNetworkPolicyToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argument)parsers    -lib/surface/vmware/network_policies/create.pyArgsCreate.Args2   s     
""6d;OO'OOvt,
!!&)
!     
    	   	      c           	         UR                   R                  R                  5       n[        5       nUR                  nUR                  UUR                  UR                  UR                  UR                  UR                  S9nU(       a!  [        R                  " UR                  SSS9  g UR                  UR                  U5      SR!                  UR#                  5       5      S9n[        R                  " UR#                  5       SS9  U$ )N)vmware_engine_network_idedge_services_cidrdescriptioninternet_accessexternal_ip_accesszVMware Engine network policyT)kindis_asyncz-waiting for network policy [{}] to be created)operation_refmessage)r)   )CONCEPTSnetwork_policyParser   async_r   vmware_engine_networkr%   r&   r'   r(   r	   CreatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr.   clientr*   	operationresources          r   Run
Create.RunY   s    ]]11779N"$F{{H!%!;!;22$$,,22  I 	
..=N&&,,Y7?FF'')
 ' H ##%,J Or"    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr    r=   __static_attributes__r?   r"   r   r   r   -   s"    .-$ $Lr"   r   N)rD   
__future__r   r   r   -googlecloudsdk.api_lib.vmware.networkpoliciesr   googlecloudsdk.callioper   2googlecloudsdk.command_lib.vmware.network_policiesr   googlecloudsdk.corer	   rE   ReleaseTracksReleaseTrackGACreateCommandr   r?   r"   r   <module>rR      sk    0 &  ' O ( D #	
	( D%%(()ET E *Er"   