
    @              
          S r SSKJr  SSKJr  SSKJ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
  S
rSrSS/r " S S\R(                  5      r " S S\R,                  5      r " S S\
R0                  5      rS\S jrS\S jrS\S jrS]S jr\R<                  " SSSSSSSS9rS  r \R<                  " S!SS"S#S$S%SS&9r!\R<                  " S'SS(S)S*S+SS&9r"S, r#S- r$S. r%S/ r&\R<                  " S0SS1S2S3\RN                  " S45      \RP                  -   S59r)\R<                  " S6SS7S8S9S:SS&9r*\R<                  " S;SS<S=S>\RN                  " S?5      S@9r+SA r,\," 5       r-\R<                  " SBSSCSDSESFSS&9r.SG r/SH r0  S^SI jr1  S^SJ jr2  S^SK jr3   S_SL jr4SM r5SN r6SO r7SP r8SQ r9SR r:SS r;ST r<SU r=SV r>SW r?SX r@SY rA " SZ S[\B5      rCg)`z<Flags and helpers for the compute forwarding-rules commands.    )absolute_import)division)unicode_literalsN)actions)arg_parsers)
completers)flagsa  
A forwarding rule directs traffic that matches a destination IP address
(and possibly a TCP or UDP port) to a forwarding target (load balancer,
VPN gateway or VM instance).

Forwarding rules can be either global or regional, specified with the
``--global'' or ``--region=REGION'' flags. For more information about
the scope of a forwarding rule, refer to
https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts.

Forwarding rules can be external, internal, internal managed, or
internal self-managed, specified with the
``--load-balancing-scheme=[EXTERNAL|EXTERNAL_MANAGED|INTERNAL|INTERNAL_MANAGED|INTERNAL_SELF_MANAGED]''
flag. External forwarding rules are accessible from the internet, while
internal forwarding rules are only accessible from within their VPC
networks. You can specify a reserved static external or internal IP
address with the ``--address=ADDRESS'' flag for the forwarding rule.
Otherwise, if the flag is unspecified, an ephemeral IP address is
automatically assigned (global IP addresses for global forwarding rules
and regional IP addresses for regional forwarding rules); an internal
forwarding rule is automatically assigned an ephemeral internal IP
address from the subnet specified with the ``--subnet'' flag. You must
provide an IP address for an internal self-managed forwarding rule.

Different types of load balancers work at different layers of the OSI
networking model (http://en.wikipedia.org/wiki/Network_layer). Layer 3/4
targets include target pools, target SSL proxies, target TCP proxies,
and backend services. Layer 7 targets include target HTTP proxies and
target HTTPS proxies. For more information, refer to
https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts.
a  A forwarding rule directs traffic that matches a destination IP address
(and possibly a TCP or UDP port) to a forwarding target (load balancer,
VPN gateway or VM instance).

Forwarding rules can be either global or regional, specified with the
``--global'' or ``--region=REGION'' flag. For more information about
the scope of a forwarding rule, refer to
https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts.

Forwarding rules can be external, external managed, internal, internal managed, or
internal self-managed, specified with the
``--load-balancing-scheme=[EXTERNAL|EXTERNAL_MANAGED|INTERNAL|INTERNAL_MANAGED|INTERNAL_SELF_MANAGED]''
flag. External forwarding rules are accessible from the internet, while
internal forwarding rules are only accessible from within their VPC
networks. You can specify a reserved static external or internal IP
address with the ``--address=ADDRESS'' flag for the forwarding rule.
Otherwise, if the flag is unspecified, an ephemeral IP address is
automatically assigned (global IP addresses for global forwarding rules
and regional IP addresses for regional forwarding rules); an internal
forwarding rule is automatically assigned an ephemeral internal IP
address from the subnet specified with the ``--subnet'' flag. You must
provide an IP address for an internal self-managed forwarding rule.

Different types of load balancers work at different layers of the OSI
networking model (http://en.wikipedia.org/wiki/Network_layer). Layer 3
targets include target pools, target SSL proxies, target TCP proxies,
and backend services. Layer 7 targets include target HTTP proxies,
target HTTPS and target gRPC proxies. For more information, refer to
https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts.
zall-apiszvpc-scc                   (   ^  \ rS rSrU 4S jrSrU =r$ )ForwardingRulesZonalCompleterc   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ncompute.forwardingRulesz5compute forwarding-rules list --filter=region:* --uri
collectionlist_command )superr   __init__selfkwargs	__class__s     @lib/googlecloudsdk/command_lib/compute/forwarding_rules/flags.pyr   &ForwardingRulesZonalCompleter.__init__e   s(    	
'7 ,M     r   __name__
__module____qualname____firstlineno__r   __static_attributes____classcell__r   s   @r   r   r   c   s     r   r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )ForwardingRulesGlobalCompleterl   c                 4   > [         [        U ]
  " SSSS.UD6  g )Ncompute.globalForwardingRulesz,compute forwarding-rules list --global --urir   r   )r   r%   r   r   s     r   r   'ForwardingRulesGlobalCompleter.__init__o   s(    	
($8 2C r   r   r   r#   s   @r   r%   r%   l   s     r   r%   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )ForwardingRulesCompleterv   c                 F   > [         [        U ]
  " SS[        [        /0UD6  g )Nr   r   )r   r+   r   r%   r   r   s     r   r   !ForwardingRulesCompleter.__init__x   s-    	
"D2 *,I
 	r   r   r   r#   s   @r   r+   r+   v   s     r   r+   c           	      X    [         R                  " S[        U SS[         R                  S9$ )Nforwarding ruler   r(   )resource_name	completerrequiredregional_collectionglobal_collectionregion_explanationcompute_flagsResourceArgumentr+   REGION_PROPERTY_EXPLANATIONr3   s    r   ForwardingRuleArgumentr<      s/    		'	'%(37&BB
D Dr   c           
      Z    [         R                  " S[        SU SS[         R                  S9$ )Nr0   Tr   r(   )r1   r2   pluralr3   r4   r5   r6   r7   r;   s    r   ForwardingRuleArgumentPluralr?      s2    		'	'%(37&BB
D Dr   c                 \    [         R                  " SS[        SU SS[         R                  S9$ )Nr0   z--next-hop-ilbFr   7Target forwarding rule that receives forwarded traffic.)r1   namer2   r>   r3   r4   
short_helpr6   r7   r;   s    r   ForwardingRuleArgumentForRouterD      s5    		'	'%(3J&BB
D Dr   Fc                 ^    [         R                  " SS[        SU SSS[         R                  S9	$ )Nr0   z--producer-forwarding-ruleFr   r(   rA   )	r1   rB   r2   r>   r3   r4   r5   rC   r6   r7   r;   s    r   *ForwardingRuleArgumentForServiceAttachmentrF      s8    		'	'%'(37J&BB	
D 	Dr   z--backend-servicezbackend servicezcompute.regionBackendServiceszcompute.targetBackendServicesz1Target backend service that receives the traffic.zIIf not specified, the region is set to the region of the forwarding rule.)rB   r3   r1   r4   r5   rC   r6   c            	      >    Sn [         R                  " SSSSSSU -  S9$ )	zReturns the network parameter.z--load-balancing-scheme=INTERNAL or --load-balancing-scheme=INTERNAL_SELF_MANAGED or --load-balancing-scheme=EXTERNAL_MANAGED (regional) or --load-balancing-scheme=INTERNAL_MANAGED	--networkFnetworkzcompute.networksz-Network that this forwarding rule applies to.z
          (Only for %s) Network that this
          forwarding rule applies to. If this field is not specified, the default
          network is used. In the absence of the default network, this field
          must be specified.
          rB   r3   r1   r5   rC   detailed_helpr8   r9   )load_balancing_schemes    r   
NetworkArgrN      s>    J
 
	'	'*@
 &&
' 'r   --subnet
subnetworkzcompute.subnetworksz,Subnet that this forwarding rule applies to.a          (Only for --load-balancing-scheme=INTERNAL and
        --load-balancing-scheme=INTERNAL_MANAGED) Subnetwork that this
        forwarding rule applies to. If the network is auto mode, this flag is
        optional. If the network is custom mode, this flag is required.
        rB   r3   r1   r4   rC   rK   r6   z--ip-collectionzpublic delegated prefixzcompute.publicDelegatedPrefixesz.Resource reference to a PublicDelegatedPrefix.z
        Resource reference to a public delegated prefix. The PublicDelegatedPrefix (PDP) must
        be a sub-prefix in EXTERNAL_IPV6_FORWARDING_RULE_CREATION mode.
        c            
      :    [         R                  " SSSSSSSS9n U $ )z;Return a resource argument for parsing a target gRPC proxy.z--target-grpc-proxyFztarget gRPC proxyzcompute.targetGrpcProxiesz,Target gRPC proxy that receives the traffic.N)rB   r3   r1   r5   rC   rK   r6   rL   )target_grpc_proxy_args    r   TargetGrpcProxyArgrT      s2     (88 '3?C 
r   c                      [         R                  " SSSSSS[        R                  " S5      [         R                  S9n U $ )	z;Return a resource argument for parsing a target http proxy.z--target-http-proxyFz
http proxyzcompute.targetHttpProxieszcompute.regionTargetHttpProxiesz,Target HTTP proxy that receives the traffic.z      Target HTTP proxy that receives the traffic. For the acceptable ports, see [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#port_specifications).
      rB   r3   r1   r5   r4   rC   rK   r6   r8   r9   textwrapdedentr:   )target_http_proxy_args    r   TargetHttpProxyArgr[      sK     (88  3;?OO %
  'BB 
r   c                      [         R                  " SSSSSS[        R                  " S5      [         R                  S9n U $ )	z<Return a resource argument for parsing a target https proxy.z--target-https-proxyFzhttps proxyzcompute.targetHttpsProxiesz compute.regionTargetHttpsProxiesz-Target HTTPS proxy that receives the traffic.z      Target HTTPS proxy that receives the traffic. For the acceptable ports, see [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#port_specifications).
      rV   rW   target_https_proxy_args    r   TargetHttpsProxyArgr_     sK     )99!!4<@OO %
  'BB 
 r   c            
      V    [         R                  " SSSSSS[         R                  S9n U $ )zCReturn a resource argument for parsing a target service attachment.z--target-service-attachmentFztarget service attachmentzcompute.serviceAttachmentsz4Target service attachment that receives the traffic.zTarget service attachment that receives the traffic. The target service attachment must be in the same region as the forwarding rule.rQ   )r8   r9   r:   )target_service_attachment_args    r   TargetServiceAttachmentArgrb   "  s=     #0"@"@(/6G 'BB
#D 
'&r   z--target-instanceztarget instancezcompute.targetInstancesz6Name of the target instance that receives the traffic.z      Name of the target instance that receives the traffic. The
      target instance must be in a zone in the forwarding rule's
      region. Global forwarding rules cannot direct traffic to target
      instances.
      )rB   r3   r1   zonal_collectionrC   rK   z--target-poolztarget poolzcompute.targetPoolsz&Target pool that receives the traffic.z      Target pool that receives the traffic. The target pool
      must be in the same region as the forwarding rule. Global
      forwarding rules cannot direct traffic to target pools.
      z--target-ssl-proxyz	ssl proxyzcompute.targetSslProxiesz+Target SSL proxy that receives the traffic.z      Target SSL proxy that receives the traffic. For the acceptable ports, see [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#port_specifications).
      rJ   c                      [         R                  " SSSSS[         R                  S[        R                  " S5      S9n U $ )	z:Return a resource argument for parsing a target tcp proxy.z--target-tcp-proxyFz	tcp proxyzcompute.targetTcpProxieszcompute.regionTargetTcpProxiesz+Target TCP proxy that receives the traffic.z      Target TCP proxy that receives the traffic. For the acceptable ports, see [Port specifications](https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#port_specifications).
      )rB   r3   r1   r5   r4   r6   rC   rK   )r8   r9   r:   rX   rY   r]   s    r   TargetTcpProxyArgre   Y  sI     )992:&BB>OO %
  
 r   z--target-vpn-gatewayzVPN gatewayzcompute.targetVpnGatewaysz3Target VPN gateway that receives forwarded traffic.zTarget VPN gateway (Cloud VPN Classic gateway) that receives forwarded traffic. Acceptable values for --ports flag are: 500, 4500.c                  <    Sn SU -  n[         R                  " U5      $ )z-Build the help text for the address argument.zO(EXTERNAL, EXTERNAL_MANAGED, INTERNAL, INTERNAL_SELF_MANAGED, INTERNAL_MANAGED)a      The IP address that the forwarding rule serves. When a client sends traffic
    to this IP address, the forwarding rule directs the traffic to the
    target that you specify in the forwarding rule.

    If you don't specify a reserved IP address, an ephemeral IP address is
    assigned. You can specify the IP address as a literal IP address or as a
    reference to an existing Address resource. The following examples are
    all valid:
    * 100.1.2.3
    * 2600:1901::/96
    * https://compute.googleapis.com/compute/v1/projects/project-1/regions/us-central1/addresses/address-1
    * projects/project-1/regions/us-central1/addresses/address-1
    * regions/us-central1/addresses/address-1
    * global/addresses/address-1
    * address-1

    The load-balancing-scheme %s and the target of the forwarding rule
    determine the type of IP address that you can use. The address
    type must be external for load-balancing-scheme EXTERNAL or
    EXTERNAL_MANAGED. For other load-balancing-schemes, the address type
    must be internal. For detailed information, refer to
    https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#ip_address_specifications.
  )rX   rY   )
lb_schemesrK   s     r   AddressArgHelprh   |  s+    $*0 1-4 
	''r   c                      [         R                  " SSS[        R                  SS[         R                  S[        5       S9	$ )Nz	--addressFaddresszcompute.addresseszcompute.globalAddressesz/IP address that the forwarding rule will serve.)	rB   r3   r1   r2   r4   r5   r6   rC   rK   )r8   r9   addresses_flagsAddressesCompleterr:   rh   r   r   r   
AddressArgrm     s?    		'	'22-1&BBB"$	
& 	&r   c                    U R                  SS9n[        5       R                  XS9  U(       a  [        5       R                  XS9  [	        5       R                  XS9  [        5       R                  XS9  [        R                  XS9  [        R                  XS9  [        R                  XS9  [        5       R                  XS9  [        R                  XS9  [        R                  XS9  U(       a  UR                  SSSSS9  g	g	)
z7Adds common flags for mutating forwarding rule targets.Tr;   )mutex_groupz--target-google-apis-bundleFzTarget bundle of Google APIs that will receive forwarded traffic via Private Service Connect. Acceptable values are all-apis, meaning all Google APIs, or vpc-sc, meaning just the APIs that support VPC Service Controlsstorer3   helpactionN)add_mutually_exclusive_grouprT   AddArgumentrb   r[   r_   TARGET_INSTANCE_ARGTARGET_POOL_ARGTARGET_SSL_PROXY_ARGre   TARGET_VPN_GATEWAY_ARGBACKEND_SERVICE_ARGadd_argument)parserinclude_psc_google_apis!include_target_service_attachmenttargets       r   AddUpdateTargetArgsr     s     ...=&""6">& ,,V,H""6">##F#?!!&!=f9""6">!!&!=$$V$@!!&!=
%N    r   c                     [        XU5        [        5       R                  U 5        [        R                  U 5        [        R                  U 5        [        U UUS9  g)z0Adds common flags for creating forwarding rules.)r}   r~   N)r   rN   ru   
SUBNET_ARGIP_COLLECTION_ARGAddLoadBalancingScheme)r|   r}   r~   s      r   AddCreateArgsr     sQ     'H ,6" '5(Ir   c                     [        XU5        S nU R                  SSSU" S5      S9  U R                  SSSU" S5      S9  U R                  SSS	U" S5      S9  [        U UUU" S
5      S9  g)z&Adds flags for the set-target command.c                 0    [         R                  " U SSSS9$ )NzThe {flag_name} option is deprecated and will be removed in an upcoming release. If you're currently using this argument, you should remove it from your workflows.Frp   )warnremovedrs   )r   DeprecationAction)rB   s    r   CreateDeprecationAction1AddSetTargetArgs.<locals>.CreateDeprecationAction  s%    $$:  r   rH   Fan  Only for --load-balancing-scheme=INTERNAL or --load-balancing-scheme=INTERNAL_SELF_MANAGED or --load-balancing-scheme=EXTERNAL_MANAGED (regional) or --load-balancing-scheme=INTERNAL_MANAGED) Network that this forwarding rule applies to. If this field is not specified, the default network is used. In the absence of the default network, this field must be specified.rq   rO   zOnly for --load-balancing-scheme=INTERNAL and --load-balancing-scheme=INTERNAL_MANAGED) Subnetwork that this forwarding rule applies to. If the network is auto mode, this flag is optional. If the network is custom mode, this flag is required.z--subnet-regionzRegion of the subnetwork to operate on. If not specified, the region is set to the region of the forwarding rule. Overrides the default compute/region property value for this command invocation.--load-balancing-scheme)r}   r~   deprecation_actionN)r   r{   r   )r|   r}   r~   r   s       r   AddSetTargetArgsr     s     'H
 	5 %[1  
3 	O
 %Z0  
 	
 %%67  
 5(I01JK	r   c           	          SSSSSS.nU=(       d    UnSnSnU R                  S	US
 U(       a  SOSU(       a  UOUUS9  g)z$Adds the load-balancing-scheme flag.a3  Classic Application Load Balancers, global external proxy Network  Load Balancers, external passthrough Network Load Balancers or  protocol forwarding, used with one of --target-http-proxy, --target-https-proxy, --target-tcp-proxy, --target-ssl-proxy, --target-pool, --target-vpn-gateway, --target-instance.zGlobal and regional external Application Load Balancers, and regional external proxy Network Load Balancers, used with --target-http-proxy, --target-https-proxy, --target-tcp-proxy.z`Internal passthrough Network Load Balancers or protocol forwarding, used with --backend-service.zoTraffic Director, used with --target-http-proxy, --target-https-proxy, --target-grpc-proxy, --target-tcp-proxy.zInternal Application Load Balancers and internal proxy Network Load Balancers, used with --target-http-proxy, --target-https-proxy, --target-tcp-proxy.)EXTERNALEXTERNAL_MANAGEDINTERNALINTERNAL_SELF_MANAGEDINTERNAL_MANAGEDzThis defines the forwarding rule's load balancing scheme. Note that it defaults to EXTERNAL and is not applicable for Private Service Connect forwarding rules.z9This defines the forwarding rule's load balancing scheme.r   c                 B    U R                  SS5      R                  5       $ N-_replaceupperxs    r   <lambda>(AddLoadBalancingScheme.<locals>.<lambda>T      QYYsC(..0r   Nr   )choicestypedefaultrr   rs   r{   )r|   r}   r~   r   load_balancing_choicesinclude_pschelp_text_with_pschelp_text_disabled_pscs           r   r   r   "  sx    K
5L!/> (L+L+  B  	$0!dz!,2H  r   c                 :    [         R                  " SS9nU" U 5      $ )N   )
min_length)r   ArgListstring_value
type_parses     r   SourceIpRangesParserr   [  s    ""a0*	L	!!r   c                 2    U R                  SS[        SSS9  g)zjAdds source-ip-ranges flag to the argparse.

Args:
  parser: The parser that parses args from user input.
z--source-ip-rangeszSOURCE_IP_RANGE,[...]Nz      List of comma-separated IP addresses or IP ranges. If set, this forwarding
      rule only forwards traffic when the packet's source IP address matches one
      of the IP ranges set here.
      metavarr   r   rr   )r{   r   r|   s    r   AddSourceIpRangesr   `  s(     	%
  	r   c                 (    U R                  SSSSS9  g)z.Adds allow global access flag to the argparse.z--allow-global-access
store_trueNaR        If True, then clients from all regions can access this internal
      forwarding rule. This can only be specified for forwarding rules with
      the LOAD_BALANCING_SCHEME set to INTERNAL or INTERNAL_MANAGED. For
      forwarding rules of type INTERNAL, the target must be either a backend
      service or a target instance.
      rs   r   rr   r   r   s    r   AddAllowGlobalAccessr   r  s#    
	  
r   c                 (    U R                  SSSSS9  g)z2Adds allow PSC global access flag to the argparse.z--allow-psc-global-accessr   Nz      If specified, clients from all regions can access this Private
      Service Connect forwarding rule. This can only be specified if the
      forwarding rule's target is a service attachment
      (--target-service-attachment).
      r   r   r   s    r   AddAllowPscGlobalAccessr     s#    !
	  	r   c                 (    U R                  SSSSS9  g)z4Adds disable automate dns zone flag to the argparse.z--disable-automate-dns-zoner   NaV        If specified, then a DNS zone will not be auto-generated for this Private
      Service Connect forwarding rule. This can only be specified if the
      forwarding rule's target is a service attachment
      (`--target-service-attachment=SERVICE_ATTACHMENT`) or Google APIs bundle
      (`--target-google-apis-bundle=API_BUNDLE`)
      r   r   r   s    r   AddDisableAutomateDnsZoner     s#    #
	  
r   c                 l    / SQnU(       a  UR                  S5        SnOSnU R                  SUS US9  g)	zAdds IP protocols flag, with values available in the given version.

Args:
  parser: The parser that parses args from user input.
  support_all_protocol: Whether to include "ALL" in the protocols list.
)AHESPICMPSCTPTCPUDP
L3_DEFAULTALLa>        IP protocol that the rule will serve. The default is `TCP`.

      Note that if the load-balancing scheme is `INTERNAL`, the protocol must
      be one of: `TCP`, `UDP`, `ALL`, `L3_DEFAULT`.

      For a load-balancing scheme that is `EXTERNAL`, all IP_PROTOCOL
      options other than `ALL` are valid.
        a$        IP protocol that the rule will serve. The default is `TCP`.

      Note that if the load-balancing scheme is `INTERNAL`, the protocol must
      be one of: `TCP`, `UDP`, `L3_DEFAULT`.

      For a load-balancing scheme that is `EXTERNAL`, all IP_PROTOCOL
      options are valid.
      z--ip-protocolc                 "    U R                  5       $ Nr   r   s    r   r    AddIPProtocols.<locals>.<lambda>  
    QWWYr   r   r   rr   N)appendr{   )r|   support_all_protocol	protocolshelp_strs       r   AddIPProtocolsr     sJ     H)UH
H 		  r   c                 d    [        5       nUR                  U 5        U R                  SSS/S SS9  g)z$Adds Addresses and IP versions flag.z--ip-versionIPV4IPV6c                 "    U R                  5       $ r   r   r   s    r   r   +AddAddressesAndIPVersions.<locals>.<lambda>  r   r   z^      Version of the IP address to be allocated or assigned.
      The default is IPv4.
      r   N)rm   ru   r{   )r|   address_args     r   AddAddressesAndIPVersionsr     s?     +&!v
	  r   c                 $    U R                  SSS9  g)zAdds description flag.z--descriptionz5Optional textual description for the forwarding rule.)rr   Nr   r   s    r   AddDescriptionr     s     	B  Dr   c                     U R                  5       nSnSnUR                  SU[        R                  5       SUS9  UR                  S[        R
                  R                  SSS	9  g)
z Adds ports and port range flags.z(ALL | [PORT | START_PORT-END_PORT],[...]aA    List of comma-separated ports. The forwarding rule forwards packets with
  matching destination ports. Port specification requirements vary
  depending on the load-balancing scheme and target.
  For more information, refer to https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#port_specifications.
  z--portsNr   z--port-rangez[PORT | START_PORT-END_PORT]z      DEPRECATED, use --ports. If specified, only packets addressed to ports in
      the specified range are forwarded. For more information, refer to
      https://cloud.google.com/load-balancing/docs/forwarding-rule-concepts#port_specifications.
      )r   r   rr   )rt   r{   PortRangesWithAllCreateParserr   RangeParse)r|   ports_scopeports_metavar
ports_helps       r   AddPortsAndPortRanger     sz     335+<-* ))+   "",
	  r   c                 \    U(       a  U R                  SS SS9  gU R                  SS SS9  g)zAdds network tier flag.z--network-tierc                 "    U R                  5       $ r   r   r   s    r   r    AddNetworkTier.<locals>.<lambda>  
    qwwyr   z        Update the network tier of a forwarding rule. It does not allow to
        change from `PREMIUM` to `STANDARD` and visa versa.
        r   rr   c                 "    U R                  5       $ r   r   r   s    r   r   r     r   r   z        Network tier to assign to the forwarding rules. ``NETWORK_TIER''
        must be one of: `PREMIUM`, `STANDARD`. The default value is `PREMIUM`.
        Nr   )r|   
for_updates     r   AddNetworkTierr     sC    
       r   c                 (    U R                  SSS SS9  g )Nz--is-mirroring-collectorr   z      If set, this forwarding rule can be used as a collector for packet
      mirroring. This can only be specified for forwarding rules with the
      LOAD_BALANCING_SCHEME set to INTERNAL.
      r   r   r   s    r   AddIsMirroringCollectorr     s#     
	  r   c                 2    U R                  S[        SSSS9  g)z9Adds service-directory-registration flag to the argparse.z --service-directory-registrationrp   Nz      The Service Directory service in which to register this forwarding rule as
      an endpoint. The Service Directory service must be in the same project and
      region as the forwarding rule you are creating.
      )r   rs   r   rr   )r{   strr   s    r   AddServiceDirectoryRegistrationr     s&    (
  	r   c                     U R                  5       nUR                  S/ SQS SSS9  UR                  SSS	SS
S9  U R                  S[        R                  " SSS9SS9  U R                  SSS/SS9  g)z3Add flags related to Gfe2 to Gfe3 canary migration.z1--external-managed-backend-bucket-migration-state)PREPARETEST_BY_PERCENTAGETEST_ALL_TRAFFICc                 B    U R                  SS5      R                  5       $ r   r   r   s    r   r   &AddExternalMigration.<locals>.<lambda>/  r   r   NaE        Specifies the migration state. Possible values are PREPARE,
      TEST_BY_PERCENTAGE, and TEST_ALL_TRAFFIC.

      To begin the migration from EXTERNAL to EXTERNAL_MANAGED, the state must
      be changed to PREPARE. The state must be changed to TEST_ALL_TRAFFIC
      before the loadBalancingScheme can be changed to EXTERNAL_MANAGED.
      Optionally, the TEST_BY_PERCENTAGE state can be used to migrate traffic to
      backend buckets attached to this forwarding rule by percentage using the
      --external-managed-backend-bucket-migration-testing-percentage flag.
    )r   r   r   rr   z7--clear-external-managed-backend-bucket-migration-stateFr   z3Clears current state of external managed migration.)r3   rs   r   rr   z>--external-managed-backend-bucket-migration-testing-percentageg        g      Y@)lower_boundupper_boundz      Determines the fraction of requests that should be processed by
      the Global external Application Load Balancer.

      The value of this field must be in the range [0, 100].
    r   r   r   r   z      Only for the Global external Application Load Balancer migration.

      The value of this field must be EXTERNAL or EXTERNAL_MANAGED.
    )r   rr   )rt   r{   r   BoundedFloat)r|   groups     r   AddExternalMigrationr   )  s    

-
-
/%9C0
  " ?@   	F##G  	 	-.  r   c                   .    \ rS rSrSrS r\S 5       rSrg)r   iY  z6Particular keyword 'all' or a range of integer values.c                     Xl         X l        g r   all_specifiedranges)r   r   r  s      r   r   PortRangesWithAll.__init__\  s    &Kr   c                      S n U $ )z?Creates parser to parse keyword 'all' first before parse range.c                     U R                  5       S:X  a  [        S/ 5      $ [        R                  " S[        R                  R
                  S9n[        SU" U 5      5      $ )NallTr   )r   element_typeF)lowerr   r   r   r   r   r   s     r   _Parse.PortRangesWithAll.CreateParser.<locals>._Parsed  sT    					& r** (({'8'8'>'>@
 
<(@AAr   r   )r  s    r   r   PortRangesWithAll.CreateParser`  s    B Mr   r   N)	r   r   r   r    __doc__r   staticmethodr   r!   r   r   r   r   r   Y  s    >  r   r   )T)F)FF)FFN)Dr  
__future__r   r   r   rX   googlecloudsdk.callioper   r   "googlecloudsdk.command_lib.computer   compute_completersr	   r8   ,googlecloudsdk.command_lib.compute.addressesrk   googlecloudsdk.command_lib.utilFORWARDING_RULES_OVERVIEWFORWARDING_RULES_OVERVIEW_ALPHAPSC_GOOGLE_APIS_BUNDLESListCommandCompleterr   GlobalListCommandCompleterr%   MultiResourceCompleterr+   r<   r?   rD   rF   r9   rz   rN   r   r   rT   r[   r_   rb   rY   ZONE_PROPERTY_EXPLANATIONrv   rw   rx   re   TARGET_TCP_PROXY_ARGry   rh   rm   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   objectr   r   r   r   <module>r     s   C &  '  + / O E Q 6 @# D &x0 $6$K$K 11z@@ DD	D
D $44	#75B:< ', ++	-=:<
  "22	+9?
	* "$ $'" $44	#.G// #
 
 4456   00	-7

:< %55	0<// #
   & )* &77	3D	=:<  (F
& "&+F "&+. "&+=D "&+	6r"
$#LD<,	-` r   