
    B                         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S	KJr  \
R"                   " S
 S\
R$                  5      5       rSSS.\l        g)z<Command for listing bgp routes from a Compute Engine router.    )absolute_import)division)unicode_literals)
list_pager)base_classes)base)flags)	arg_utilsc                   8    \ rS rSrSrSr\S 5       rS rS r	Sr
g)ListBgpRoutes   zdList routes advertised and learned on individual BGP sessions, both pre- and post-policy evaluation.Nc                    [         R                  " 5       [        l        [        R                  R	                  USS9  UR
                  R                  [         R                  5        UR                  SSSS9  UR                  S[        R                  SS	S
.SSS9  UR                  S[        R                  SSS.SSS9  UR                  SSSSS9  UR                  SSSS9  g )Nlist)operation_typez--peerz6Limit results to routes learned from this peer (name).T)helprequiredz--address-familyzInterface with IPv4-based BGP.zInterface with IPv6-based BGP.)IPV4IPV6zCLimit results to routes learned for this Address Family Identifier.)typechoicesr   r   z--route-directionzLearned routes.zAdvertised routes.)INBOUNDOUTBOUNDz*Limit results to routes in this direction.z--policy-applied
store_truez+Routes returned are post-policy evaluation.)actiondefaultr   z--destination-rangezLimit results to prefixes.
CIDR_RANGE)r   metavar)r	   RouterArgumentr   
ROUTER_ARGAddArgumentdisplay_infoAddCacheUpdaterRoutersCompleteradd_argumentr
   ChoiceToEnumName)clsparsers     .lib/surface/compute/routers/list_bgp_routes.pyArgsListBgpRoutes.Args$   s
   $335M(((G
''(>(>?
I  
 ''44
 W  	 ''(,
 >  	 >	   -      c                    [         R                  " U R                  5       5      nUR                  n[        R
                  R                  UUR                  [        R                  " U5      S9nUR                  R                  R                  UR                  5      nUR                  R                  R                  U R                  UR                   5      5      nUR                  R                  " S	0 UR#                  5       DUR$                  UUUR&                  UR(                  S.D6n[*        R,                  " UR.                  R0                  UUR2                  UR4                  SSSSSS9	$ )
z@Issues a request necessary for listing bgp routes from a Router.)scope_lister)peeraddressFamily	routeTypepolicyApplieddestinationPrefixr   result	pageTokennextPageToken
maxResults)limit
batch_sizemethodfieldcurrent_token_attributenext_token_attributebatch_size_attribute )r   ComputeApiHolderReleaseTrackclientr   r   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListermessages"ComputeRoutersListBgpRoutesRequestAddressFamilyValueValuesEnumaddress_familyRouteTypeValueValuesEnumConvertRouteDirectionroute_directionAsDictr.   policy_applieddestination_ranger   YieldFromListapitools_clientroutersr7   	page_size)selfargsholderrA   
router_refrI   
route_typerequests           r(   RunListBgpRoutes.RunN   s=   **4+<+<+>?F]]F));;"88@ < J
 __GGddN CC\\""4#7#78J oo@@ 



YY$))00G ##&&jj>> +,)
 
r+   c                 "    US:X  a  gUS:X  a  gU$ )Nr   LEARNEDr   
ADVERTISEDr>   )rT   rL   s     r(   rK   #ListBgpRoutes.ConvertRouteDirections   s    )#	J	&r+   r>   )__name__
__module____qualname____firstlineno____doc__r   classmethodr)   rZ   rK   __static_attributes__r>   r+   r(   r   r      s(    l*' 'R#Jr+   r   zv  *{command}* lists routes advertised and learned on individual BGP sessions, both pre- and post-policy evaluation.
  a            To list inbound BGP routes limited to IPv4 addess family from a router `my-router` BGP peer `my-bgp-peer` in region `us-central1`, run:

              $ {command} my-router --region=us-central1 --address-family=IPV4 --peer=my-bgp-peer --route-direction=INBOUND"
          )DESCRIPTIONEXAMPLESN)rd   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   rD   *googlecloudsdk.command_lib.compute.routers$googlecloudsdk.command_lib.util.apisr
   UniverseCompatibleListCommandr   detailed_helpr>   r+   r(   <module>rs      se     C &  ' ' 7 ( E < : ZD$$ Z Z|		 r+   