
                             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S.r\	R                  " \	R                   R"                  5       " S S\	R$                  5      5       rg)z.'vmware external-access-rules update' command.    )absolute_import)division)unicode_literals)ExternalAccessRulesClient)arg_parsers)base)flags)logzI
          Update a VMware Engine external access firewall rule.
        a  
          To update an external access firewall rule named `my-external-access-rule` so that it denies the traffic for that rule, run:

            $ {command} my-external-access-rule --network-policy=my-network-policy --action=DENY --location=us-west2 --project=my-project

          Or:

            $ {command} my-external-access-rule --network-policy=my-network-policy --action=DENY

          In the second example, the project and the location are taken from gcloud properties core/project and compute/regions respectively.
    )DESCRIPTIONEXAMPLESc                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Update/   z&Update a VMware Engine network policy.c                    [         R                  " U SS9  [        R                  R	                  U 5        [        R                  R                  U S5        U R                  R                  S5        U R                  SSS9  U R                  S[        R                  " SS	5      S
S9  U R                  S/ SQSS9  U R                  S[        R                  " SS9SSS9  U R                  S[        R                  " SS9SSS9  U R                  S[        R                  " SS9SSS9  U R                  S[        R                  " SS9SSS9  U R                  SS S!/S"S9  g#)$z Register flags for this command.T)
positionalyamlz--descriptionzG        User-provided description of the external access rule.
        )helpz
--priorityd   i   z        Priority of this external access rule. Valid values are numbers between 100 and 4096, with 100 being the highest priority. Firewall rules are processed from highest to lowest priority.
        )typer   z--ip-protocol)TCPUDPICMPz\        Internet protocol covered by the rule. Valid values are TCP, UDP, and ICMP.
        )choicesr   z--source-ranges   )
min_lengthSOURCE_IP_RANGESz        A list of source IP addresses that the rule applies to. Each entry in the list can be a CIDR notation or a single IP address. When the value is set to `0.0.0.0/0`, all IP addresses are allowed.
        )r   metavarr   z--destination-rangesDESTINATION_IP_RANGESz        A list of destination IP addresses that the rule applies to. Each entry in the list be an ExternalAddress resource name or `0.0.0.0/0`. When the value is set to `0.0.0.0/0`, all IP addresses are allowed.
        z--source-portsSOURCE_PORTSz_        List of allowed source ports. Each entry must be either an integer or a range.
        z--destination-portsDESTINATION_PORTSzd        List of allowed destination ports. Each entry must be either an integer or a range.
        z--actionALLOWDENYze        Whether the firewall rule allows or denies traffic based on a successful rule match.
        N)r	   AddExternalAccessRuleToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argumentr   
BoundedIntArgList)parsers    Clib/surface/vmware/network_policies/external_access_rules/update.pyArgsUpdate.Args4   s    
''4@OO'OOvt,
!!&)
  
 ##C.   &     A."	     A.'	     A.	     A.#	   &!      c                 Z   UR                   R                  R                  5       n[        5       nUR                  nUR                  X!R                  UR                  UR                  UR                  UR                  UR                  UR                  UR                  5	      nU(       a!  [        R                  " UR                   SSS9  g UR#                  UR%                  U5      SR'                  UR)                  5       5      SS9n[        R                  " UR)                  5       SS9  U$ )Nz"VMware Engine external access ruleT)kindis_asyncz3waiting for external access rule [{}] to be updated)operation_refmessage
has_result)r2   )CONCEPTSexternal_access_ruleParser   async_r   priorityip_protocolsource_rangesdestination_rangessource_portsdestination_portsdescriptionactionr
   UpdatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr8   clientr3   	operationresources          r-   Run
Update.Runo   s   ====CCE&(F{{H2MM"..0B0B"55t7H7H"44d6F6F"kk	+I
 	
..3 &&,,Y7ELL --/1	 ' H
 ))+1 Or0    N)__name__
__module____qualname____firstlineno____doc__DETAILED_HELPdetailed_helpstaticmethodr.   rN   __static_attributes__rP   r0   r-   r   r   /   s"    .-8 8tr0   r   N)rU   
__future__r   r   r   1googlecloudsdk.api_lib.vmware.externalaccessrulesr   googlecloudsdk.callioper   r   2googlecloudsdk.command_lib.vmware.network_policiesr	   googlecloudsdk.corer
   rV   ReleaseTracksReleaseTrackGAUpdateCommandr   rP   r0   r-   <module>rc      sn    5 &  ' W / ( D #	
	( D%%(()XT X *Xr0   