
    '                         S r SSKJr  SSKJr  SSKJr  SSKJr  S rS rS r	S	 r
S
 rSS jrSS jrS rS rS rS rS rS rS rS rS rS rS rS rg)zHFlags and helpers for the compute instances network-interfaces commands.    )absolute_import)division)unicode_literals)	arg_utilsc                 &    U R                  SSSS9  g )Nz--network-interfacenic0z,The name of the network interface to update.)defaulthelp)add_argumentparsers    Llib/googlecloudsdk/command_lib/compute/instances/network_interfaces/flags.pyAddNetworkInterfaceArgForUpdater      s    9      c                 .    U R                  S[        SS9  g )Nz--parent-nic-namezT
        Name of the parent network interface of a dynamic network interface.
      typer
   r   strr   s    r   AddParentNicNameArgr       s     
  r   c                 .    U R                  S[        SS9  g )Nz--vlanz|
        VLAN tag of a dynamic network interface, must be  an integer in the
        range from 2 to 255 inclusively.
      r   r   intr   s    r   
AddVlanArgr   *   s     
  r   c                 .    U R                  S[        SS9  g )Nz	--networkz8Specifies the network this network interface belongs to.r   r   r   s    r   AddNetworkArgr   5   s    E  r   c                 .    U R                  S[        SS9  g )Nz--subnetworkz;Specifies the subnetwork this network interface belongs to.r   r   r   s    r   AddSubnetworkArgr   =   s    H  r   c                 H    U(       a  SnOSnU R                  SS[        US9  g)z1Adds --private-network-ip argument to the parser.z}
        Specifies the RFC1918 IP to assign to the network interface. The IP
        should be in the subnet IP range.
      a  
        Assign the given IP address to the interface. Can be specified only
        together with --network and/or --subnetwork to choose the IP address
        in the new subnetwork. If unspecified, then the previous IP address
        will be allocated in the new subnetwork. If the previous IP address is
        not available in the new subnetwork, then another available IP address
        will be allocated automatically from the new subnetwork CIDR range.
      z--private-network-ipprivate_network_ip)destr   r
   Nr   r   add_network_interface	help_texts      r   AddPrivateNetworkIpArgr%   E   s4    
I

I 		  r   c                 F    U(       a  SnOSnU R                  S[        US9  g)z&Adds --aliases argument to the parser.a  
        The IP alias ranges to allocate for this interface. If there are
        multiple IP alias ranges, they are separated by semicolons.

        For example:

            --aliases="10.128.1.0/24;range1:/32"

        Each IP alias range consists of a range name and an IP range
        separated by a colon, or just the IP range.
        The range name is the name of the range within the network
        interface's subnet from which to allocate an IP alias range. If
        unspecified, it defaults to the primary IP range of the subnet.
        The IP range can be a CIDR range (e.g. `192.168.100.0/24`), a single
        IP address (e.g. `192.168.100.1`), or a netmask in CIDR format (e.g.
        `/24`). If the IP range is specified by CIDR range or single IP
        address, it must belong to the CIDR range specified by the range
        name on the subnet. If the IP range is specified by netmask, the
        IP allocator will pick an available range with the specified netmask
        and allocate it to this network interface.
      az  
        The IP alias ranges to allocate for this interface. If there are
        multiple IP alias ranges, they are separated by semicolons.

        Can be specified together with --network and/or --subnetwork to choose
        IP alias ranges in the new subnetwork. If unspecified, then the previous
        IP alias ranges will be allocated in the new subnetwork. If the previous
        IP alias ranges are not available in the new subnetwork, then other
        available IP alias ranges of the same size will be allocated in the new
        subnetwork.

        For example:

            --aliases="10.128.1.0/24;r1:/32"
      z	--aliasesr   Nr   r"   s      r   AddAliasesArgr'   ]   s1    
I,
I 	  r   c                 L    U R                  SSSSS.[        R                  SS9  g )Nz--stack-typez6The network interface will be assigned IPv4 addresses.z<The network interface can have both IPv4 and IPv6 addresses.z6The network interface will be assigned IPv6 addresses.)	IPV4_ONLY	IPV4_IPV6	IPV6_ONLYzaThe stack type for the network interface. Determines if IPv6 is enabled on the network interface.choicesr   r
   r   r   ChoiceToEnumNamer   s    r   AddStackTypeArgr0      s6    OLO %%/  r   c                 J    U R                  SSSS.[        R                  SS9  g )Nz--igmp-queryz2IGMP Query V2 on the network interface is enabled.z0IGMP Query on the network interface is disabled.)IGMP_QUERY_V2IGMP_QUERY_DISABLEDz{Determines if the Compute Engine instance can receive and respond to IGMP query packets on the specified network interface.r,   r.   r   s    r   AddIgmpQueryArgr4      s3    O@ %%9  r   c                 L    U R                  SSSSS.[        R                  SS9  g )Nz--network-tier(High quality, Google-grade network tier.zPublic internet quality.z-Public internet quality with fixed bandwidth.)PREMIUMSTANDARDFIXED_STANDARDz
        Specifies the network tier that will be used to configure the instance
        network interface. ``NETWORK_TIER'' must be one of: `PREMIUM`,
        `STANDARD`, `FIXED_STANDARD`. The default value is `PREMIUM`.
      r,   r.   r   s    r   AddNetworkTierArgr:      s6    ?0K
 %%
  r   c                 H    U R                  SSS0[        R                  SS9  g )Nz--ipv6-network-tierr7   r6   zqSpecifies the IPv6 network tier that will be used to configure the instance network interface IPv6 access config.r,   r.   r   s    r   AddIpv6NetworkTierArgr<      s/    DE%%?  r   c                 p    U R                  5       nUR                  S[        SS9  UR                  SSSS9  g)	z>Adds --address and --no-address mutex arguments to the parser.z	--addressa`  
        Assigns the given external address to the network interface. The
        address might be an IP address or the name or URI of an address
        resource. Specifying an empty string will assign an ephemeral IP.
        Mutually exclusive with no-address. If neither key is present the
        network interface will get an ephemeral IP.
      r   z--no-address
store_truez
        If specified the network interface will have no external IP.
        Mutually exclusive with address. If neither key is present the network
        interfaces will get an ephemeral IP.
      )actionr
   N)add_mutually_exclusive_groupr   r   )r   	addressess     r   AddAddressArgsrB      sN    113)
  
 
  r   c                 .    U R                  S[        SS9  g )Nz--external-ipv6-addressz
        Assigns the given external IPv6 address to an instance.
        The address must be the first IP in the range. This option is not
        applicable to instances with stack-type=IPV4_ONLY.
      r   r   r   s    r   AddExternalIpv6AddressArgrD      s     
  r   c                 .    U R                  S[        SS9  g )Nz--external-ipv6-prefix-lengthz
        The prefix length of the external IPv6 address range. This flag should be used together
        with `--external-ipv6-address`. Currently only `/96` is supported and the default value
        is `96`.
      r   r   r   s    r   AddExternalIpv6PrefixLengthArgrF      s     %
  r   c                 .    U R                  S[        SS9  g )Nz--internal-ipv6-addressa  
        Assigns the given internal IPv6 address or range to an instance.
        The address must be the first IP address in the range or a /96 IP
        address range. This option can only be used on a dual stack instance
        network interface.
      r   r   r   s    r   AddInternalIpv6AddressArgrH      s     
  	r   c                 .    U R                  S[        SS9  g )Nz--internal-ipv6-prefix-lengtha  
        Optional field that indicates the prefix length of the internal IPv6
        address range, should be used together with
        `--internal-ipv6-address=fd20::`. Only /96 IP address range is supported
        and the default value is 96. If not set, then  either the prefix length
        from `--internal-ipv6-address=fd20::/96` will be used or the default
        value of 96 will be assigned.
      r   r   r   s    r   AddInternalIpv6PrefixLengthArgrJ     s     %
  r   c                 .    U R                  S[        SS9  g )Nz--ipv6-addressz
        Assigns the given external IPv6 address to an instance.
        The address must be the first IP in the range. This option is applicable
        only to dual-stack instances with stack-type=IPV4_ONLY.
      r   r   r   s    r   AddIpv6AddressArgrL     s     
  r   c                 .    U R                  S[        SS9  g )Nz--ipv6-prefix-lengthz
        The prefix length of the external IPv6 address range. This flag should be used together
        with `--ipv6-address`. Currently only `/96` is supported and the default value
        is `96`.
      r   r   r   s    r   AddIpv6PrefixLengthArgrN   &  s     
  r   c                 .    U R                  S[        SS9  g )Nz--network-attachmentzT
        The network attachment URL this network interface should connect to.
      r   r   r   s    r   AddNetworkAttachmentArgrP   2  s     
  r   N)F)__doc__
__future__r   r   r   $googlecloudsdk.command_lib.util.apisr   r   r   r   r   r   r%   r'   r0   r4   r:   r<   rB   rD   rF   rH   rJ   rL   rN   rP    r   r   <module>rU      sw    O &  ' :0,^$$"	2		
		r   