
                             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g)z5Surface to test an ip address against firewall rules.    )absolute_import)division)unicode_literals)appengine_firewall_api_client)base)firewall_rules_util)logc                   8    \ rS rSrSrSSS.r\S 5       rS rSr	g	)
TestIp   z-Display firewall rules that match a given IP.z{description}zs          To test an IP address against the firewall rule set, run:

              $ {command} 127.1.2.3
          )DESCRIPTIONEXAMPLESc                 v    U R                   R                  [        R                  5        U R	                  SSS9  g )Nipz5An IPv4 or IPv6 address to test against the firewall.)help)display_info	AddFormatr   LIST_FORMATadd_argument)parsers    )lib/surface/app/firewall_rules/test_ip.pyArgsTestIp.Args)   s7    
!!"5"A"AB
J  L    c                    [         R                  " U R                  5       5      nUR                  UR                  5      n[        U5      nU(       a\  [        R                  R                  SR                  US   R                  5      5        [        R                  R                  S5        U$ [        R                  R                  S5        U$ )Nz/The action `{0}` will apply to the IP address.
r   zMatching RuleszNo rules match the IP address.)
api_clientGetApiClientForTrackReleaseTrackListr   listr	   statusPrintformataction)selfargsclientresponseruless        r   Run
TestIp.Run/   s    ,,T->->-@AF{{477#HNE	jjIveAhoo.0	jj'( L 
jj78Lr    N)
__name__
__module____qualname____firstlineno____doc__detailed_helpstaticmethodr   r*   __static_attributes__r,   r   r   r   r      s1    5 		- L L
r   r   N)r1   
__future__r   r   r   googlecloudsdk.api_lib.app.apir   r   googlecloudsdk.callioper   googlecloudsdk.command_lib.appr   googlecloudsdk.corer	   Commandr   r,   r   r   <module>r;      s/    < &  ' V ( > # T\\  r   