
    N\                        S r SSKrSSK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                  " / S	Q5      rS
SSS.rSr\R$                  \R&                  " \R(                  R*                  \R(                  R,                  \R(                  R.                  5       " S S\R0                  5      5       5       rS7S jr   S8S jrS7S jrS r\R(                  R.                  4S jrS rS r S9S jr!S r"S r#S r$S r%S:S jr&S r'S r(S  r)S! r*S" r+S# r,S$ r-S% r.S& r/S' r0S( r1S) r2S* r3S+ r4S, r5S:S- jr6S. r7S:S/ jr8S9S0 jr9S1 r:S2 r;S3 r<S4 r=S5 r>S6 r?g);z9Flags and helpers for the compute interconnects commands.    N)arg_parsers)base)
completers)flags)resource_manager_tags_utils)	arg_utils))50mz	50 Mbit/s)100mz
100 Mbit/s)200mz
200 Mbit/s)300mz
300 Mbit/s)400mz
400 Mbit/s)500mz
500 Mbit/s)1gz1 Gbit/s)2gz2 Gbit/s)5gz5 Gbit/s)10gz	10 Gbit/s)20gz	20 Gbit/s)50gz	50 Gbit/s)100gz
100 Gbit/szEdge Availability Domain 1zEdge Availability Domain 2zAny Availability Domain)zavailability-domain-1zavailability-domain-2any)IPSECNONEc                   (   ^  \ rS rSrU 4S jrSrU =r$ ) InterconnectAttachmentsCompleter4   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ncompute.interconnectAttachmentsz,compute interconnects attachments list --uri)
collectionlist_command )superr   __init__)selfkwargs	__class__s     Ilib/googlecloudsdk/command_lib/compute/interconnects/attachments/flags.pyr"   )InterconnectAttachmentsCompleter.__init__:   s(    	
*D: 4C     r    )__name__
__module____qualname____firstlineno__r"   __static_attributes____classcell__)r%   s   @r&   r   r   4   s     r(   r   c           	      X    [         R                  " S[        UU S[         R                  S9$ )Nzinterconnect attachmentr   )resource_name	completerpluralrequiredregional_collectionregion_explanation)compute_flagsResourceArgumentr   REGION_PROPERTY_EXPLANATION)r3   r2   s     r&   InterconnectAttachmentArgumentr9   B   s/    		'	'-0;&BB
D Dr(   c                     SR                  U(       a  SOS5      n[        R                  " US[        UU SSR                  U5      SS9$ )	NzinterconnectAttachment{0}s z--interconnect-attachmentr   z7The interconnect attachment of the interface being {0}.z<If not specified it will be set to the region of the router.)r0   namer1   r2   r3   r4   
short_helpr5   )formatr6   r7   r   )r3   r2   operation_typer0   s       r&   'InterconnectAttachmentArgumentForRouterrA   L   sO     .44FSK-		'	'!&0;Jvn

 
r(   c                     U R                  SSSS9nU(       a  SnOU(       a  SnOSnUR                  SSS	S
SS9  UR                  SS
S	US9  g	)a	  Adds adminEnabled flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
  default_behavior: A boolean indicates whether command allows user to set
    Administrative status.
  update: A boolean indicates whether the incoming request is update.
TFr<   mutexr3   helpz      Administrative status of the interconnect attachment.
      When this is enabled, the attachment is operational and will carry
      traffic. Use --no-enable-admin to disable it.
            Administrative status of the interconnect attachment. If not provided
      on creation, defaults to enabled.
      When this is enabled, the attachment is operational and will carry
      traffic. Use --no-enable-admin to disable it.
      z      Administrative status of the interconnect attachment. If not provided
      on creation, defaults to disabled.
      When this is enabled, the attachment is operational and will carry
      traffic. Use --no-enable-admin to disable it.
      z--admin-enabledN
store_truez((DEPRECATED) Use --enable-admin instead.)hiddendefaultactionrE   --enable-adminrJ   rI   rE   	add_groupadd_argument)parserdefault_behaviorupdategroup	help_texts        r&   AddAdminEnabledrU   ]   s{     

B

?%
I
 
I
I 5  7 |T	  Kr(   c                 (    U R                  SSSSS9  g)z6Adds enable-admin flag to the argparse.ArgumentParser.rK   rG   NrF   rL   rO   rP   s    r&   AddEnableAdminrY      s#    
	  	r(   c                     Sn[         R                  " [        5      nU[        R                  R
                  :X  a  SUS'   [        R                  " SUUUS9R                  U 5        g)a  Adds bandwidth flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
  required: A boolean indicates whether the Bandwidth is required.
  release_track: Depending on which release track is specified, different
    bandwidth options will be surfaced to customers.
z4      Provisioned capacity of the attachment.
      z
400 Gbit/s400gz--bandwidth)choicesr3   help_strN)copydeepcopy_BANDWIDTH_CHOICESr   ReleaseTrackALPHAChoiceArgumentAddToParser)rP   r3   release_trackrT   r\   s        r&   AddBandwidthrf      s]    
) MM,-'d''---"GFO
 &+f-r(   c                 .    U R                  S[        SS9  g)UAdds vlan flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--vlanz      Desired VLAN for this attachment, in the range 2-4093. If not supplied,
      Google will automatically select a VLAN.
      typerE   NrO   intrX   s    r&   AddVlanrm      s"     	
  r(   c                 R    U R                  SS[        R                  " SS5      SS9  g)rh   z
--z2z-vlanT   i  zg      Desired VLAN for this attachment, in the range 2-4093.
      Required for Z2Z attachments.
      )rH   rj   rE   N)rO   r   
BoundedIntrX   s    r&   
AddZ2zVlanrq      s2     	!!!T*
	  r(   c                 &    U R                  SUSS9  g)zAdds vlan-key flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
  required: A boolean indicates whether the vlan-key is required.
z
--vlan-keyz      Desired VLAN key for L2 forwarding mapping for the attachment. If not
      supplied, all mappings will be displayed.
     r3   rE   NrW   rP   r3   s     r&   
AddVlanKeyru      s"     		  
r(   c                 &    U R                  SSSS9  g)zeAdds appliance-ip-address flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--appliance-ip-address	ADDRESSESz A single IPv4 or IPv6 address used as the destination IP address
      for ingress packets that match on a VLAN tag, but do not match a more
      specific inner VLAN tag.
      metavarrE   NrW   rX   s    r&   AddApplianceIpAddressrz      s"     	
  r(   c                 $    U R                  SSS9  g)zjAdds L2 appliance mapping name flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--appliance-namez7      The name of the L2 appliance mapping rule.
      rE   NrW   rX   s    r&   AddApplianceNamer}      s     	
  r(   c           	      ~    U R                  S[        R                  " [        R                  " SS9[        S.S9SSS9  g	)
zqAdds inner vlan to appliance mappings flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z"--inner-vlan-to-appliance-mappings;)custom_delim_char)innerVlanTagsinnerApplianceIpAddress)specappendz      A list of mapping rules from inner VLAN tags to IP addresses. If the inner
      VLAN is not explicitly mapped to an IP address range, the
      applianceIpAddress is used.
      )rj   rJ   rE   N)rO   r   ArgDictArgListstrrX   s    r&   AddInnerVlanToApplianceMappingsr      sH     	**22SI), 
  r(   c                 .    U R                  S[        SS9  g)z\Adds partner asn flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--partner-asnz      BGP ASN of the partner. This should only be supplied by layer 3
      providers that have configured BGP on behalf of the customer.
      ri   Nrk   rX   s    r&   AddPartnerAsnr     s"     	
  r(   c                     U R                  SUSS9nUR                  SUSS9  UR                  SUSS9  UR                  S	US
S9  g)zAdds partner metadata flags to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
  required: A boolean indicates whether the PartnerMetadata is required.
FzPartner metadata.rC   z--partner-namez      Plain text name of the Partner providing this attachment. This value
      may be validated to match approved Partner values.
      rs   z--partner-interconnect-namez      Plain text name of the Interconnect this attachment is connected to,
      as displayed in the Partner's portal. For instance "Chicago 1".
      z--partner-portal-urlz      URL of the Partner's portal for this Attachment. The Partner may wish
      to customize this to be a deep-link to the specific resource on the
      Partner portal. This value may be validated to match approved Partner
      values.
      NrM   )rP   r3   rS   s      r&   AddPartnerMetadatar   "  s     

H+>  @%
   #
   
  r(   c                 &    U R                  SSSS9  g)z\Adds pairing key flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--pairing-keyTzh      Value of the pairing-key from the target partner attachment provided by
      the customer.
      rs   NrW   rX   s    r&   AddPairingKeyr   D  s"     	
  r(   c                 2    U R                  S[        SSSS9  g)ziAdds edge-availability-domain flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--edge-availability-domainTAVAILABILITY_DOMAINaj        Desired edge availability domain for this attachment:
      `availability-domain-1`, `availability-domain-2`, `any`.

      In each metro where the Partner can connect to Google, there are two sets
      of redundant hardware. These sets are described as edge availability
      domain 1 and 2. Within a metro, Google will only schedule maintenance in
      one availability domain at a time. This guarantee does not apply to
      availability domains outside the metro; Google may perform maintenance in
      (say) New York availability domain 1 at the same time as Chicago
      availability domain 1.
      )r\   r3   ry   rE   N)rO   !_EDGE_AVAILABILITY_DOMAIN_CHOICESrX   s    r&   AddEdgeAvailabilityDomainr   S  s(     	"/#
  r(   c                 $    U R                  SSS9  g)z\Adds description flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--descriptionz4Human-readable plain-text description of attachment.r|   NrW   rX   s    r&   AddDescriptionr   l  s     	A  Cr(   c                 N    U R                  S[        R                  " SS9SS/ S9  g)zbAdds candidate subnets flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--candidate-subnets   
max_lengthSUBNETaP        Up to 16 candidate prefixes that can be used to restrict the allocation of
      `cloudRouterIpAddress` and `customerRouterIpAddress` for this
      attachment. All prefixes must be within link-local address space.
      Google attempts to select an unused subnet of SUBNET_LENGTH from the
      supplied candidate subnet(s), or all of link-local space if no subnets
      supplied. Google does not re-use a subnet already in-use by your project,
      even if it's contained in one of the candidate subnets. The request fails
      if all candidate subnets are in use at Google's edge.rj   ry   rE   rI   NrO   r   r   rX   s    r&   AddCandidateSubnetsr   w  s5     	"-?   r(   c                 (    U R                  SSSSS9  g)zXAdds dry-run flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z	--dry-runNrG   z:If supplied, validates the attachment without creating it.rI   rJ   rE   rW   rX   s    r&   	AddDryRunr     s$     	G	  Ir(   c                 .    U R                  S[        SS9  g)zTAdds mtu flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--mtuz      Maximum transmission unit (MTU) is the size of the largest IP packet
      passing through this interconnect attachment. Must be one of 1440, 1460,
      1500, or 8896. If not specified, the value will default to 1440.
      ri   Nrk   rX   s    r&   AddMtur     s"     	
  r(   c                 0    U R                  SS[        SS9  g)z[Adds encryption flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--encryptionFa        Indicates the user-supplied encryption option for this interconnect
      attachment (VLAN attachment).

      Possible values are:

      `NONE` - This is the default value, which means the interconnect attachment
      carries unencrypted traffic. VMs can send traffic to or
      receive traffic from such interconnect attachment.

      `IPSEC` - The interconnect attachment carries only traffic that is encrypted
      by an IPsec device; for example, an HA VPN gateway or third-party
      IPsec VPN. VMs cannot directly send traffic to or receive traffic from such
      an interconnect attachment. To use HA VPN over Cloud Interconnect,
      the interconnect attachment must be created with this option.

      )r3   r\   rE   N)rO   _ENCRYPTION_CHOICESrX   s    r&   AddEncryptionr     s%     	!
	  r(   c                 L    U R                   b  U R                   $ U R                  $ )zDetermines value of admin_enabled/enable_admin flag.

Args:
  args: A list of arguments to be parsed.

Returns:
  A boolean indicates whether admin mode is enabled in Arguments.
)enable_adminadmin_enabled)argss    r&   GetAdminEnabledFlagr     s&     #//;		SASASSr(   c                  V    [         R                  " SS[        R                  " SS9SSS9$ )zBAdds ipsec-internal-addresses flag to the argparse.ArgumentParser.z--ipsec-internal-addressesF   r   rw   a1        List of IP address range names that have been reserved for the interconnect
      attachment (VLAN attachment). Use this option only for an interconnect
      attachment that has its encryption option set as IPSEC. Currently only one
      internal IP address range can be specified for each attachment.
      When creating an HA VPN gateway for the interconnect attachment, if the
      attachment is configured to use a regional internal IP address, then the VPN
      gateway's IP address is allocated from the IP address range specified here.
      If this field is not specified when creating the interconnect attachment,
      then when creating any HA VPN gateways for this interconnect attachment,
      the HA VPN gateway's IP address is allocated from a regional external IP
      address pool.
      )r3   rj   ry   rE   )r   Argumentr   r   r    r(   r&   GetIpsecInternalAddressesFlagr     s/    	"!,

 r(   c                 *    U R                  USUUS.S9$ )zKGenerates an address reference from the specified name, region and project.zcompute.addresses)projectregion)r   params)Parse)	resourcesr=   r   r   s       r&   GetAddressRefr     s)    	
$ 
 
	 	r(   c                 J    U R                  SSSS.[        R                  SS9  g)z[Adds stack-type flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--stack-typez1Only IPv4 protocol is enabled on this attachment.z<Both IPv4 and IPv6 protocols are enabled on this attachment.)	IPV4_ONLY	IPV4_IPV6zFStack type of the protocol(s) enabled on this interconnect attachment.)r\   rj   rE   N)rO   r   ChoiceToEnumNamerX   s    r&   AddStackTyper     s8     	 BL	 %%  
r(   c                 N    U R                  S[        R                  " SS9SS/ S9  g)zgAdds candidate ipv6 subnets flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--candidate-ipv6-subnetsr   r   IPV6_SUBNETz6The `candididate-ipv6-subnets` field is not available.r   Nr   rX   s    r&   AddCandidateIpv6Subnetsr     s1     	 "-G  r(   c                 &    U R                  SSSS9  g)zoAdds cloud router ipv6 interface id flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z --cloud-router-ipv6-interface-idINTERFACE_IDz8`cloud-router-ipv6-interface-id` field is not available.rx   NrW   rX   s    r&   AddCloudRouterIpv6InterfaceIdr     s!     	(I  Kr(   c                 &    U R                  SSSS9  g)zrAdds customer router ipv6 interface id flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z#--customer-router-ipv6-interface-idPEER_INTERFACE_IDz;`customer-router-ipv6-interface-id` field is not available.rx   NrW   rX   s    r&    AddCustomerRouterIpv6InterfaceIdr   "  s!     	+!L  Nr(   c           	      H    U R                  SS[        [        SS15      SS9  g)z^Adds subnet length flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--subnet-lengthSUBNET_LENGTH      a        Length of the IPv4 subnet mask for this attachment. 29 is the
      default value, except for attachments on Cross-Cloud Interconnects whose
      remote location's "constraints.subnetLengthRange" field specifies a
      minimum subnet length of 30. In that case, the default value is 30.
      The default value is recommended when there's no requirement on the subnet
      length.
      )ry   rj   r\   rE   N)rO   rl   	frozensetrX   s    r&   AddSubnetLengthr   .  s1     	R!
  r(   c                 2    U R                  SS[        USS9  g)z4Adds geneve vni flag to the argparse.ArgumentParser.z--geneve-vniGENEVE_HEADERz|A VNI identier for Geneve header, as defined in
      https://datatracker.ietf.org/doc/html/rfc8926, used for L2 forwarding.)ry   rj   r3   rE   Nrk   rt   s     r&   AddGeneveVnir   C  s'    P  r(   c                 &    U R                  SSSS9  g)zmAdds default appliance ip address flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
z--default-appliance-ip-addressDEFAULT_APPLIANCE_IP_ADDRESSzA single IPv4 or IPv6 address used as the default destination IP
      when there is no VLAN mapping result found for L2 forwarding.
      Unset field indicates the unmatched packet should be dropped.
      rx   NrW   rX   s    r&   AddDefaultApplianceIpAddressr   O  s"     	&,
  r(   c                 (    U R                  SSUSS9  g)zAdds tunnel endpoint ip address flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
  required: A boolean indicates whether the tunnel endpoint ip address is
    required.
z--tunnel-endpoint-ip-addressTUNNEL_ENDPOINT_IP_ADDRESSa  A single IPv4 or IPv6 address. This address will be used as the
      source IP address for L2 forwarding packets sent to the appliances, and
      must be used as the destination IP address for packets that should be sent
      out through this attachment.
      )ry   r3   rE   NrW   rt   s     r&   AddTunnelEndpointIpAddressr   _  s%     	$*
	  	r(   c                 @    U(       a  SnOSnU R                  SSSUS9  g)zAdds enableMulticast flag to the argparse.ArgumentParser.

Args:
  parser: The argparse parser.
  update: A boolean indicates whether the incoming request is an update.
z      When enabled, the attachment will be able to carry multicast traffic.
      Use --no-enable-multicast to disable it.
      z      If supplied, the attachment will be able to carry multicast traffic.
      If not provided on creation, defaults to disabled. Use
      --no-enable-multicast to disable it.
      z--enable-multicastNrG   r   rW   )rP   rR   rT   s      r&   AddEnableMulticastr   s  s6     
I
I
 		  r(   c                 $    U R                  SSS9  g)ziAdds candidate cloud router ip address flag to the ArgumentParser.

Args:
  parser: The argparse parser.
z#--candidate-cloud-router-ip-addressz      Single IPv4 address + prefix length to be configured on the cloud
      router interface for this interconnect attachment. Example:
      203.0.113.1/29
      r|   NrW   rX   s    r&    AddCandidateCloudRouterIpAddressr     s     	+
  r(   c                 $    U R                  SSS9  g)zlAdds candidate customer router ip address flag to the ArgumentParser.

Args:
  parser: The argparse parser.
z&--candidate-customer-router-ip-addressz      Single IPv4 address + prefix length to be configured on the customer
      router interface for this interconnect attachment. Example:
      203.0.113.2/29
      r|   NrW   rX   s    r&   #AddCandidateCustomerRouterIpAddressr     s     	.
  r(   c                 $    U R                  SSS9  g)zkAdds candidate cloud router ipv6 address flag to the ArgumentParser.

Args:
  parser: The argparse parser.
z%--candidate-cloud-router-ipv6-addressz      Single IPv6 address + prefix length to be configured on the cloud
      router interface for this interconnect attachment. Example:
      2001:db8::1/125
      r|   NrW   rX   s    r&   "AddCandidateCloudRouterIpv6Addressr     s     	-
  r(   c                 $    U R                  SSS9  g)znAdds candidate customer router ipv6 address flag to the ArgumentParser.

Args:
  parser: The argparse parser.
z(--candidate-customer-router-ipv6-addressz      Single IPv6 address + prefix length to be configured on the customer
      router interface for this interconnect attachment. Example:
      2001:db8::2/125
      r|   NrW   rX   s    r&   %AddCandidateCustomerRouterIpv6Addressr     s     	0
  r(   c                 N    U R                  S[        R                  " 5       SSS9  g)zEAdds the --resource-manager-tags flag to the argparse.ArgumentParser.z--resource-manager-tagsz	KEY=VALUEz^          A comma-separated list of Resource Manager tags to apply to the interconnect.
      )rj   ry   rE   N)rO   r   r   rX   s    r&   AddResourceManagerTagsr     s,     
	  r(   c           	          [         R                  " U5      nU R                  n[        UR	                  5       5       VVs/ s H  u  pEUR
                  R                  XES9PM      nnnU" UR                  US9S9$ s  snnf )zJConverts resource manager tags argument into InterconnectAttachmentParams.)keyvalue)additionalProperties)resourceManagerTags)r   GetResourceManagerTagsInterconnectAttachmentParamssorteditemsResourceManagerTagsValueAdditionalProperty)messagesresource_manager_tagsresource_manager_tags_mapr   r   r   additional_propertiess          r&   "CreateInterconnectAttachmentParamsr     s     "88
 
 00& 8>>@AA*# %%88S8NA   
 994 : 
 	s   %A:)TF)FFadded)F)T)@__doc__collectionsr^   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer   compute_completersr   r6   r   $googlecloudsdk.command_lib.util.apisr   OrderedDictr`   r   r   UniverseCompatibleReleaseTracksra   rb   BETAGAListCommandCompleterr   r9   rA   rU   rY   rf   rm   rq   ru   rz   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r(   r&   <module>r      s   @   / ( O E J : ,, .  " :9$% ! (  T..33T5F5F5I5I'9'N'N  D 6;38;B",K^ 261B1B1E1E .0 
 
,D2C.
I :	T,	&	K	N*	 (:    	r(   