
                            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S.r\	R                  " \	R                   R"                  5      \	R$                   " S S\	R&                  5      5       5       rg)z1VMware Engine VPC network peering create command.    )absolute_import)division)unicode_literals)networkpeering)arg_parsers)base)flags)logz
          Create a VMware Engine VPC network peering. VPC network peering creation is considered finished when the network peering is in ACTIVE state. Check the progress of a VPC network peering using `{parent_command} list`.
        a1  
          To create a VPC network peering called `new-peering` that connects the VMware Engine network `my-vmware-engine-network` with another VMware Engine network `another-vmware-engine-network` from project `another-project`, run:

          $ {command} new-peering --vmware-engine-network=my-vmware-engine-network --peer-network=another-vmware-engine-network --peer-network-type=VMWARE_ENGINE_NETWORK --peer-project=another-project

          In this example, the project is taken from gcloud properties core/project and location is taken as `global`.
    )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 VPC network peering.c                    / SQn[         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	S9  U R                  S
SUSS9  U R                  SSS9  U R                  SSS9  U R                  SSS9  U R                  SS[        R                  " SS9SS9  U R                  SSSSSS9  U R                  SSSSSS9  U R                  S SSSS!S9  U R                  S"SSSS#S9  U R                  S$SSSS%S9  g&)'z Register flags for this command.)PEER_NETWORK_TYPE_UNSPECIFIEDSTANDARDVMWARE_ENGINE_NETWORKPRIVATE_SERVICES_ACCESSNETAPP_CLOUD_VOLUMESTHIRD_PARTY_SERVICEDELL_POWERSCALEGOOGLE_CLOUD_NETAPP_VOLUMEST)
positionalyamlz--vmware-engine-networkzN        ID of the VMware Engine network to attach the new peering to.
        )requiredhelpz--peer-networkz        ID of the network to peer with the VMware Engine network. The peer network can be a consumer VPC network or another VMware Engine network.
        z--peer-network-typea<          Type of the VPC network to peer with the VMware Engine network. PEER_NETWORK_TYPE must be one of the following:
        * STANDARD: Peering connection used for connecting to another VPC network established by the same user.
          For example, a peering connection to another VPC network in the same project or to an on-premises network.
        * VMWARE_ENGINE_NETWORK: Peering connection used for connecting to another VMware Engine network.
        * PRIVATE_SERVICES_ACCESS: Peering connection used for establishing private services access.
        * NETAPP_CLOUD_VOLUMES: Peering connection used for connecting to NetApp Cloud Volumes.
        * THIRD_PARTY_SERVICE: Peering connection used for connecting to third-party services. Most third-party services require manual setup of reverse peering on the VPC network associated with the third-party service.
        * DELL_POWERSCALE: Peering connection used for connecting to Dell PowerScale Filers.
        * GOOGLE_CLOUD_NETAPP_VOLUMES: Peering connection used for connecting to Google Cloud NetApp Volumes.
        )r   choicesr   z--vmware-engine-network-projectz        Project of the VMware Engine network to attach the new peering to. Use this flag when the VMware Engine network is in another project.
        )r   z--peer-projectz}        Project ID or project number of the peer network. Use this flag when the peer network is in another project.
        z--descriptionzF        User-provided description of the VPC network peering.
        z
--peer-mtuF1GB)lower_boundz:        Maximum transmission unit (MTU) in bytes.
        )r   typer   z--export-custom-routes
store_truezz        True if custom routes are exported to the peered VPC network; false otherwise. The default value is true.
        )r   actiondefaultr   z--import-custom-routeszz        True if custom routes are imported to the peered VPC network; false otherwise. The default value is true.
        z%--import-custom-routes-with-public-ipz        True if all subnet routes with public IP address range are imported; false otherwise. The default value is true.
        z%--export-custom-routes-with-public-ipz        True if all subnet routes with public IP address range are exported; false otherwise. The default value is true.
        z--exchange-subnet-routesa)          True if full-mesh connectivity is created and managed automatically between peered VPC networks; false otherwise. This field is always true because Google Compute Engine automatically creates and manages subnetwork routes between two VPC networks when the peering state is ACTIVE.
        N)r	   AddNetworkPeeringToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argumentr   
BinarySize)parserpeer_network_choicess     -lib/surface/vmware/network_peerings/create.pyArgsCreate.Args3   s   	 
##Ft<OO'OOvt,
!!&)
!      $
	    )  
   
   
 ##6	           /   /   "      c                    UR                   R                  R                  5       n[        R                  " 5       nUR
                  nUR                  UUR                  UR                  UR                  UR                  UR                  UR                  UR                  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R1                  UR3                  5       5      S9n[&        R(                  " UR3                  5       SS9  U$ )N)vmware_engine_network_idpeer_network_idpeer_network_typedescriptionvmware_engine_network_projectpeer_projectpeer_mtuexport_custom_routesimport_custom_routes#export_custom_routes_with_public_ip#import_custom_routes_with_public_ipexchange_subnet_routeszVPC network peeringT)kindis_asyncz*waiting for vpc peering [{}] to be created)operation_refmessage)r?   )CONCEPTSnetwork_peeringParser   NetworkPeeringClientasync_r   vmware_engine_networkpeer_networkr5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r
   CreatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargspeeringclientr@   	operationresources          r.   Run
Create.Run   s2   mm++113G002F{{H!%!;!;))00$$&*&H&H&&!66!66,0,T,T,0,T,T#::  I 	
..4tE&&,,Y7<CC  "$ ' %H ,,.5JKOr1    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr/   rV   __static_attributes__rX   r1   r.   r   r   ,   s&     4-i iVr1   r   N)r]   
__future__r   r   r   googlecloudsdk.api_lib.vmwarer   googlecloudsdk.callioper   r   2googlecloudsdk.command_lib.vmware.network_peeringsr	   googlecloudsdk.corer
   r^   ReleaseTracksReleaseTrackGADefaultUniverseOnlyCreateCommandr   rX   r1   r.   <module>rl      s|    8 &  ' 8 / ( D #
		  D%%(()OT O  *Or1   