
                            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 r\R$                  \R&                  " \R(                  R*                  5       " S	 S
\R,                  5      5       5       r\R$                  \R&                  " \R(                  R0                  5       " S S\5      5       5       r\R$                  \R&                  " \R(                  R4                  5       " S S\5      5       5       rg)z?Command for creating partner customer interconnect attachments.    )base_classes)client)base)parser_errors)flags)logc                 d    SR                  U 5      n[        R                  R                  U5        g)z9Prints the pairing key help text upon command completion.z`      Please use the pairing key to provision the attachment with your partner:
      {0}
      N)formatr   statusPrint)pairing_keymessages     ?lib/surface/compute/interconnects/attachments/partner/create.pyPrintPairingKeyEpilogr      s,    
 &
 
 **7    c                   D    \ rS rSrSrSrSrSr\S 5       r	S r
SS jrSrg)	Create$     Create a Compute Engine partner interconnect attachment.

*{command}* is used to create partner interconnect attachments. A partner
interconnect attachment binds the underlying connectivity of a provider's
Interconnect to a path into and out of the customer's cloud network.
Nc                 P   [         R                  " 5       U l        U R                  R                  U5        [        R
                  " 5       U l        U R                  R                  USS9  [        R                  " USS9  [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " U5        [        R                  " 5       R                  U5        [        R                  " U5        [        R                  " U5        g )Ncreate)operation_typeF)default_behavior)router_flagsRouterArgumentForOtherResources
ROUTER_ARGAddArgumentattachment_flagsInterconnectAttachmentArgumentINTERCONNECT_ATTACHMENT_ARGAddAdminEnabledAddEdgeAvailabilityDomainAddDescriptionAddMtuAddEncryptionGetIpsecInternalAddressesFlagAddToParserAddStackTypeAddResourceManagerTags)clsparsers     r   ArgsCreate.Args1   s     "AACCNNNv& 	779 ###//x/P$$VeD..v6##F+F#""6*224@@H!!&)++F3r   c                 p   [         R                  " U R                  5       5      nU R                  R	                  UUR
                  [        R                  " UR                  5      S9n[        R                  " X2R                  S9nUR                  c  UR                  Ul
        UR                  UR                  :w  a  [        R                  " S5      eS nUR                  b%  U R                  R	                  XR
                  5      nS nUR                  nUR                   bT  UR                    Vs/ s H=  n["        R$                  " UR
                  XUR&                  5      R)                  5       PM?     nn["        R*                  " U5      n	UR-                  UR.                  USUR0                  U	[3        USS 5      [3        USS 5      [3        USS 5      U[3        USS 5      [3        US	S 5      [3        US
S 5      [3        USS 5      [3        USS 5      UR4                  S9n
U
R6                  U l        U
$ s  snf )N)scope_lister)compute_clientz4router-region must be same as the attachment region.PARTNERdry_runmtu
encryption
stack_type!candidate_cloud_router_ip_address$candidate_customer_router_ip_address#candidate_cloud_router_ipv6_address&candidate_customer_router_ipv6_address)descriptionrouterattachment_typeedge_availability_domainadmin_enabledvalidate_onlyr3   r4   ipsec_internal_addressesr5   r6   r7   r8   r9   resource_manager_tags)r   ComputeApiHolderReleaseTrackr    ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   InterconnectAttachmentrouter_regionregionr   ArgumentExceptionr;   r   r@   r   GetAddressRefprojectSelfLinkGetAdminEnabledFlagr   r:   r=   getattrrA   
pairingKey_pairing_key)selfargsholderattachment_refinterconnect_attachment
router_refipsec_internal_addresses_urlsrJ   namer>   
attachments              r   Run
Create.RunD   s8   **4+<+<+>?F55GG"88G H IN
 %;;}}6 !)00d^222++
@B B J{{??44T;K;KLj$(!""F$$0 33' 4d 
(
()9)94)7)?)?AAIL3 $ ' %88>M(//$$!!%!>!>#dIt4D%&4t4!>4t4*15t+
 .58$.
 -47-
 07:D0
 #88/ 0 J2 #--DE's   1AH3c                 .    [        U R                  5        g N)r   rR   )rS   resources_were_displayeds     r   EpilogCreate.Epilog   s    $++,r   )rR   )T)__name__
__module____qualname____firstlineno____doc__r    INTERCONNECT_ARGr   classmethodr,   r\   ra   __static_attributes__ r   r   r   r   $   s7     !%*4 4$:x-r   r   c                   6   ^  \ rS rSrSr\U 4S j5       rSrU =r$ )
CreateBeta   r   c                    > [         TU ]  U5        [        R                  " U5        [        R                  " U5        [        R
                  " U5        [        R                  " U5        g r_   )superr,   r    AddCandidateCloudRouterIpAddress#AddCandidateCustomerRouterIpAddress"AddCandidateCloudRouterIpv6Address%AddCandidateCustomerRouterIpv6Addressr*   r+   	__class__s     r   r,   CreateBeta.Args   sG    	GL55f=88@77?::6Br   rk   	rc   rd   re   rf   rg   ri   r,   rj   __classcell__rv   s   @r   rm   rm      s     C Cr   rm   c                   6   ^  \ rS rSrSr\U 4S j5       rSrU =r$ )CreateAlpha   r   c                 P   > [         TU ]  U5        [        R                  " U5        g r_   )rp   r,   r   	AddDryRunru   s     r   r,   CreateAlpha.Args   s    	GLv&r   rk   rx   rz   s   @r   r|   r|      s     ' 'r   r|   N)rg   googlecloudsdk.api_lib.computer   8googlecloudsdk.api_lib.compute.interconnects.attachmentsr   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer   rF   <googlecloudsdk.command_lib.compute.interconnects.attachmentsr   *googlecloudsdk.command_lib.compute.routersr   googlecloudsdk.corer   r   UniverseCompatibleReleaseTracksrC   GACreateCommandr   BETArm   ALPHAr|   rk   r   r   <module>r      s    F 7 K ( 1 E b L # D%%(()[-T [- * [-| D%%**+C C , C" D%%++,'* ' - 'r   