
                         F   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  \R(                  \R*                  " \R,                  R.                  5       " S S\R0                  5      5       5       rSSS.\l        g)z$Command for creating Gateway spokes.    )absolute_import)division)unicode_literals)networkconnectivity_api)networkconnectivity_util)apis)waiter)base)flags)labels_util)log)	resourcesc                   .    \ rS rSrSr\S 5       rS rSrg)Create!   z9Create a new Gateway spoke.

Create a new Gateway spoke.
c                 6   [         R                  " SS5      n[        R                  " U S[        R                  R
                  5        [        R                  " U SSSS9  [        R                  " U 5        [        R                  " U SS9  [        R                  " U S5        [        R                  " U 5        [        R                  " U 5        [        R                  " UR                  U 5        [        R                  " U 5        [        R                   " U 5        g )	Nnetworkconnectivityv1betaz	to createFT)supports_region_wildcardhiddenrequired)r   z#Description of the spoke to create.)r   GetMessagesModuler   AddSpokeResourceArgResourceLocationTypeREGION_ONLYAddRegionFlag
AddHubFlagAddGroupFlagAddDescriptionFlagAddAsyncFlagAddLandingNetworkFlagAddCapacityFlag+GoogleCloudNetworkconnectivityV1betaGatewayAddIpRangeReservationsFlagr   AddCreateLabelsFlags)parsermessagess     :lib/surface/network_connectivity/spokes/gateways/create.pyArgsCreate.Args)   s    %%&;XFH	U77CC 
ut 
V	v-	V%JK	v	'	<<f 
$$V,$$V,    c           
      	   [         R                  " U R                  5       S9nUR                  R                  R                  5       nU R                  5       [        R                  R                  :X  GaG  [        R                  " UUR                  R                  R                  5      nUR                   Vs/ s H  nUR                  R                  US9PM     nnUR                  (       a$  UR                  R!                  UR                  S9nOS nUR                  R                  UR"                  UR$                  UR                  R'                  [(        R*                  " UR                  R&                  5      R-                  UR.                  5      UUS9UR0                  US9nUR3                  X85      n	GOD[        R                  " XR                  R4                  R                  5      nUR                   Vs/ s H  nUR                  R7                  US9PM     nnUR                  (       a$  UR                  R9                  UR                  S9nOS nUR                  R5                  UR"                  UR$                  UR                  R;                  [(        R*                  " UR                  R:                  5      R-                  UR.                  5      UUS9UR0                  US9nUR=                  X85      n	[>        R@                  RC                  SRE                  URG                  5       5      5        U	RH                  (       a%  [>        RJ                  " URG                  5       SS9  U	$ URL                  (       a:  [>        R@                  RC                  S	RE                  U	RN                  5      5        U	$ [P        RR                  RU                  U	RN                  S
[V        RX                  U R                  5          S9n
[Z        R\                  " UR^                  UR`                  5      n[Z        Rb                  " UU
SRE                  U	RN                  5      5      n[>        RJ                  " URG                  5       SS9  U$ s  snf s  snf )N)release_track)ipRange)network)capacitylandingNetworkipRangeReservations)hubgroupgatewaydescriptionlabelszCreate request issued for: [{}]spoke)kindz Check operation [{}] for status.z1networkconnectivity.projects.locations.operations)
collectionapi_versionz&Waiting for operation [{}] to complete)2r   SpokesClientReleaseTrackCONCEPTSr8   Parser
   BETAr   ParseCreateArgsr'   )GoogleCloudNetworkconnectivityV1betaSpokeLabelsValueip_range_reservations6GoogleCloudNetworkconnectivityV1betaIpRangeReservationlanding_network2GoogleCloudNetworkconnectivityV1betaLandingNetworkr3   r4   r#   r   GetCapacityArgGetEnumForChoicer0   r6   CreateSpokeBetaSpokeIpRangeReservationLandingNetworkGatewayCreateSpoker   statusPrintformatNamedoneCreatedResourceasync_namer   REGISTRYParseRelativeNamer   VERSION_MAPr	   CloudOperationPollerspoke_serviceoperation_serviceWaitFor)selfargsclient	spoke_refr7   ip_rangerange_reservationsrF   r8   op_refop_resourcepollerress                r(   Run
Create.Run>   s   $11'')F ##))+Id//444**

//
C
C
O
Of 44	 5h //
P
P Q  5	   
		OONN,, O  	 ooGGhh

//MM++//MM  /,"4 N  && H e %%i7f**
%%11f 444h //
,
,X
,
>4  
 
		 //88(( 9 
 oo##hh

//))++//))  /,"4 *  && $ e !!)3fJJ6==inn>NOP{{	)..*9m{{	jj9@@MNm$$66F,889J9J9LM 7 K
 ((f66F ..077DC
 	(w7JmFs   7#R=#R
 N)	__name__
__module____qualname____firstlineno____doc__staticmethodr)   ri   __static_attributes__rk   r+   r(   r   r   !   s!    
 - -(cr+   r   a`     To create a Gateway spoke named ``myspoke'' in us-central1, with a capacity of 10 Gbps and IP range reservations of 10.1.1.0/24

    $ {command} myspoke --hub=my-hub --region us-central1 --group gateways --capacity 10g --ip-range-reservations 10.1.1.0/24

  To create a Gateway spoke named ``myspoke'' in us-central1, with a capacity of 10 Gbps, IP range reservations of 10.1.1.0/24 and 10.1.2.0/24, and a landing network of my-vpc, run:

    $ {command} myspoke --hub=my-hub --region us-central1 --group gateways --capacity 10g --ip-range-reservations 10.1.1.0/24,10.1.2.0/24  --landing-network my-vpc
  z   This command uses the networkconnectivity/v1 API. The full documentation
  for this API can be found at:
  https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest
  )EXAMPLESzAPI REFERENCEN)rp   
__future__r   r   r   +googlecloudsdk.api_lib.network_connectivityr   r   googlecloudsdk.api_lib.utilr   r	   googlecloudsdk.callioper
   /googlecloudsdk.command_lib.network_connectivityr   $googlecloudsdk.command_lib.util.argsr   googlecloudsdk.corer   r   DefaultUniverseOnlyReleaseTracksr=   r@   Commandr   detailed_helprk   r+   r(   <module>r      s     + &  ' O P , . ( A < # ) D%%**+~T\\ ~ , ~D r+   