
                          4   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	\	R                  5      r " S
 S\	R                  5      r " S S\R"                  5      rSS jrS rS rS rS rS rSS jrS rS rS rS rS rSS jrg)z5Flags and helpers for the compute addresses commands.    )absolute_import)division)unicode_literals)arg_parsers)
completers)flagsc                   (   ^  \ rS rSrU 4S jrSrU =r$ )RegionalAddressesCompleter   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ncompute.addressesz.compute addresses list --filter=region:* --uri
collectionlist_command )superr
   __init__selfkwargs	__class__s     9lib/googlecloudsdk/command_lib/compute/addresses/flags.pyr   #RegionalAddressesCompleter.__init__   s(    	
$d4 &E     r   __name__
__module____qualname____firstlineno__r   __static_attributes____classcell__r   s   @r   r
   r
           r   r
   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )GlobalAddressesCompleter$   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ncompute.globalAddressesz+alpha compute addresses list --global --urir   r   )r   r%   r   r   s     r   r   !GlobalAddressesCompleter.__init__&   s(    	
"D2 ,B r   r   r   r"   s   @r   r%   r%   $   r#   r   r%   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )AddressesCompleter-   c                 F   > [         [        U ]
  " SS[        [        /0UD6  g )Nr   r   )r   r+   r   r
   r%   r   s     r   r   AddressesCompleter.__init__/   s)    	
d, .0HI
r   r   r   r"   s   @r   r+   r+   -   s     r   r+   c           
      >    [         R                  " S[        USU SSS9$ )Naddress	addressesr   r(   )resource_name	completerpluralcustom_pluralrequiredregional_collectionglobal_collection)compute_flagsResourceArgumentr+   )r6   r4   s     r   AddressArgumentr;   5   s*    		'	'"-1
3 3r   c            
      6    [         R                  " SSSSSSSS9$ )	Nz--subnetsubnetFzcompute.subnetworksTz-The subnet in which to reserve the addresses.ac        If specified, the subnet name in which the address(es) should be reserved.
      The subnet must be in the same region as the address.

      The address will represent an internal IP reservation from within the
      subnet. If --address is specified, it must be within the subnet's
      IP range.

      May not be specified with --global.
      )namer2   r6   r7   region_hidden
short_helpdetailed_helpr9   r:   r   r   r   SubnetworkArgumentrC   @   s,    		'	'/@	

 r   c            	      4    [         R                  " SSSSSSS9$ )Nz	--networknetworkFzcompute.networksz.The network in which to reserve the addresses.z      If specified, the network resource in which the address(es) should be
      reserved.

      This is only available for global internal address, which represents
      an internal IP range reservation from within the network.
      )r>   r2   r6   r8   r@   rA   rB   r   r   r   NetworkArgumentrF   T   s)    		'	'*A

 r   c                 L    U R                  SS[        R                  " SS9SS9  g)zAdds the Addresses flag.z--addressesADDRESS   )
min_lengthaY        Ephemeral IP addresses to promote to reserved status. Only addresses
      that are being used by resources in the project can be promoted. When
      providing this flag, a parallel list of names for the addresses can
      be provided. For example,

          $ {command} ADDRESS-1 ADDRESS-2             --addresses 162.222.181.197,162.222.181.198             --region us-central1

      will result in 162.222.181.197 being reserved as
      'ADDRESS-1' and 162.222.181.198 as 'ADDRESS-2'. If
      no names are given, server-generated names will be assigned
      to the IP addresses.
      )metavartypehelpN)add_argumentr   ArgListparsers    r   AddAddressesrR   d   s.    !,
	  r   c                 L    U R                  S[        R                  " SSS9SS9  g)zAdds the prefix-length flag.z--prefix-length   `   )lower_boundupper_boundav        The prefix length of the IP range. If the address is an IPv4 address, it
      must be a value between 8 and 30 inclusive. If the address is an IPv6
      address, the only allowed value is 96. If not present, it means the
      address field is a single IP address.

      This field is not applicable to external IPv4 addresses or global IPv6
      addresses.
      rL   rM   N)rN   r   
BoundedIntrP   s    r   AddPrefixLengthrZ   {   s-    !!aR@
  r   c                 .    U R                  SSS/S SS9  g)z4Adds IP versions flag in a mutually exclusive group.z--ip-versionIPV4IPV6c                 "    U R                  5       $ Nupperxs    r   <lambda>#AddIpVersionGroup.<locals>.<lambda>   
    QWWYr   aF        Version of the IP address to be allocated and reserved.
      The default is IPV4.

      IP version can only be specified for global addresses that are generated
      automatically (i.e., along with
      the `--global` flag, given `--addresses` is not specified) and if the
      `--network-tier` is `PREMIUM`.
      choicesrL   rM   NrN   rP   s    r   AddIpVersionGrouprj      s(    v
	  r   c                 N    U R                  US9n[        U5        [        U5        g)z$Adds Addresses and IP versions flag.r6   N)add_mutually_exclusive_grouprj   rR   )rQ   r6   groups      r   AddAddressesAndIPVersionsro      s%    

-
-x
-
@%Eur   c                 $    U R                  SSS9  g)zAdds the Description flag.--descriptionz2An optional textual description for the addresses.rM   Nri   rP   s    r   AddDescriptionrs      s    ?  Ar   c                 (    U R                  SS SS9  g)zAdds network tier flag.z--network-tierc                 "    U R                  5       $ r_   r`   rb   s    r   rd    AddNetworkTier.<locals>.<lambda>   rf   r   a        The network tier to assign to the reserved IP addresses. ``NETWORK_TIER''
      must be one of: `PREMIUM`, `STANDARD`. The default value is `PREMIUM`.

      While regional external addresses (`--region` specified, `--subnet`
      omitted) can use either `PREMIUM` or `STANDARD`, global external
      addresses (`--global` specified, `--subnet` omitted) can only use
      `PREMIUM`. Internal addresses can only use `PREMIUM`.
      rX   Nri   rP   s    r   AddNetworkTierrw      s"     	
  r   c                 2    SS/nU R                  SUS SS9  g)zAdds IPv6 EndPoint flag.VMNETLBz--endpoint-typec                 "    U R                  5       $ r_   r`   rb   s    r   rd   %AddIPv6EndPointType.<locals>.<lambda>   rf   r   zM        The endpoint type of the external IPv6 address to be reserved.
      rg   Nri   )rQ   rh   s     r   AddIPv6EndPointTyper}      s,    7O'
	  r   c                 b    / SQnU(       a  UR                  S5        U R                  SUS SS9  g)zAdds purpose flag.)VPC_PEERINGSHARED_LOADBALANCER_VIPGCE_ENDPOINTIPSEC_INTERCONNECTPRIVATE_SERVICE_CONNECTz	--purposec                 "    U R                  5       $ r_   r`   rb   s    r   rd   AddPurpose.<locals>.<lambda>   rf   r   zk      The purpose of the address resource. This field is not applicable to
      external addresses.
      rg   N)appendrN   )rQ   support_psc_google_apisrh   s      r   
AddPurposer      s<    ' NN,-
	  r   c                 f    U R                  SSSS9  U R                  SSS9  U R                  SS	S9  g
)zAdd flags for move.z--target-projectTzThe target project to move address to. It can be either a project name or a project numerical ID. It must not be the same as the current project.)r6   rM   z
--new-namezLName of moved new address. If not specified, current address's name is used.rr   rq   z!Description of moved new address.Nri   rP   s    r   AddMoveArgumentsr      sS       	!  " 	o,OPr   c           
      6    [         R                  " SSU SSSSS9$ )NipCollectionz--ip-collectionzcompute.publicDelegatedPrefixesTz0Resource reference to a public delegated prefix.zIf specified, the public delegated prefix (PDP) from which to allocate the BYOIP IP address. The PDP must support enhanced IPv4 allocations. If not specified, the address will be allocated from the Google-owned IP pool.)r2   r>   r6   r7   r?   r@   rA   rB   rl   s    r   IpCollectionArgumentr      s,    		'	'";C&
 r   N)TT)T)F) __doc__
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   compute_completersr   r9   googlecloudsdk.command_lib.utilListCommandCompleterr
   GlobalListCommandCompleterr%   MultiResourceCompleterr+   r;   rC   rF   rR   rZ   rj   ro   rs   rw   r}   r   r   r   r   r   r   <module>r      s    < &  ' / O E 6!3!H!H 1LL :: 3( . "A&	$Qr   