
                             d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ d	d
dZ ej                  ej                  j                          G d dej"                               Zy)z)'vmware network-policies update' command.    )absolute_import)division)unicode_literals)NetworkPoliciesClient)base)flags)logz:
          Update a VMware Engine network policy.
        a  
          To update a network policy named `my-network-policy` so that it disables the external IP access service, run:

            $ {command} my-network-policy --location=us-west2 --project=my-project --no-external-ip-access

          Or:

            $ {command} my-network-policy --no-external-ip-access

          In the second example, the project and the location are taken from gcloud properties core/project and compute/regions respectively.
    )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)Updatez&Update a VMware Engine network policy.c                    t        j                  | d       t        j                  j	                  |        t        j                  j                  | d       | j                  j                  d       | j                  dd       | j                  dd       | j                  d	d
dd       | j                  dd
dd       y)z Register flags for this command.T)
positionalyamlz--descriptionz<        Updated description for the network policy.
        )helpz--edge-services-cidrzw        Updated IP address range to use for internet access and external IP access gateways, in CIDR notation.
        z--internet-access
store_trueNz        Enable or disable network service that allows VMware workloads to access the internet. Use `--no-internet-access` to disable.
        )actiondefaultr   z--external-ip-accessz        Enable or disable network service that allows external IP addresses to be assigned to VMware workloads. To enable this service, `internet-access` must also be enabled. Use `--no-external-ip-access` to disable.
        )	r   AddNetworkPolicyToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argument)parsers    -lib/surface/vmware/network_policies/update.pyArgszUpdate.Args3   s     
""6d;OO'OOvt,
!!&)
  
   
 	   	      c                    |j                   j                  j                         }t               }|j                  }|j                  ||j                  |j                  |j                  |j                        }|r#t        j                  |j                  dd       y |j                  |j                  |      dj                  |j!                                     }t        j                  |j!                         d       |S )NzVMware Engine network policyT)kindis_asyncz-waiting for network policy [{}] to be updated)operation_refmessage)r!   )CONCEPTSnetwork_policyParser   async_r   descriptionedge_services_cidrinternet_accessexternal_ip_accessr	   UpdatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr&   clientr"   	operationresources          r   Runz
Update.RunS   s    ]]11779N"$F{{Hnd.>.>"55t7K7K"557I 	
..=N&&,,Y7?FF'')
 ' H ##%,J Or   N)	__name__
__module____qualname____doc__DETAILED_HELPdetailed_helpstaticmethodr   r8    r   r   r   r   .   s!    .- >r   r   N)r<   
__future__r   r   r   -googlecloudsdk.api_lib.vmware.networkpoliciesr   googlecloudsdk.callioper   2googlecloudsdk.command_lib.vmware.network_policiesr   googlecloudsdk.corer	   r=   ReleaseTracksReleaseTrackGAUpdateCommandr   r@   r   r   <module>rJ      sj    0 &  ' O ( D #	
	( D%%(()9T 9 *9r   