
                         L   d Z ddlmZ ddlmZ ddlmZ ddl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$                  e	j"                  j&                  e	j"                  j(                         G d de	j*                               Zee_        y)zUpdate endpoint command.    )absolute_import)division)unicode_literalsN)ids_api)base)flags)
exceptionsz
          Update the endpoint for the specified VPC network. Check the
          progress of endpoint update by using `gcloud alpha ids endpoints
          list`.

          For more examples, refer to the EXAMPLES section below.


        a]  
            To update an endpoint called `my-endpoint`, excluding threat IDs
            1000 and 2000, run:

            $ {command} my-endpoint --threat-exceptions=1000,2000

            To update an endpoint called `my-endpoint`, clearing the excluded
            threat list, run:

            $ {command} my-endpoint --threat-exceptions=

    )DESCRIPTIONEXAMPLESc                   &    e Zd ZdZed        Zd Zy)UpdateAlphaz&Update an existing Cloud IDS endpoint.c                    t        j                  |        t        j                  | d       t        j                  | d       t        j
                  j                  |        t        j
                  j                  | d       y )NF)required60mT)r   AddEndpointResourceAddThreatExceptionsArg
AddMaxWaitr   
ASYNC_FLAGAddToParser
SetDefault)parsers    #lib/surface/ids/endpoints/update.pyArgszUpdateAlpha.Args<   sV    	f%	  %8	VU#OO'OOvt,    c                 p   t        j                  | j                               }|j                  j                  j                         }g }|j                  d      r|j                  }|j                  d       nt        j                  d      |j                  }t        j                  |j                        }|j                  |j!                         ||      }|r|j                  d      sd|_        |S |j%                  |j'                  |      dj#                  |j!                               |      S )	Nthreat_exceptionszMissing --threat-exceptions.)seconds)r   update_maskformatdefaultz'waiting for endpoint [{}] to be updated)operation_refmessagemax_wait)r   ClientReleaseTrackCONCEPTSendpointParseIsSpecifiedr   appendcore_exceptionsErrorasync_datetime	timedeltar#   UpdateEndpointRelativeNamer   WaitForOperationGetOperationRef)	selfargsclientr'   r   r   is_asyncr#   	operations	            r   RunzUpdateAlpha.RunD   s   ^^D--/0F}}%%++-HK+,00,-!!"@AA{{H!!$--8H%%+ & !I
  h'"",,Y79@@!!#%	 #  r   N)__name__
__module____qualname____doc__staticmethodr   r9    r   r   r   r   7   s     /- -r   r   )r=   
__future__r   r   r   r.   googlecloudsdk.api_lib.idsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.idsr   googlecloudsdk.corer	   r+   DETAILED_HELPReleaseTracksr%   ALPHABETAGAUpdateCommandr   detailed_helpr?   r   r   <module>rL      s     &  '  . ( 0 =		6 D%%++T->->-C-C%%((*($$$ (*(V * r   