
    #                     L   S r SSKJr  SSKJr  SSKJr  SSK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"                  \	R                   R$                  \	R                   R&                  5       " S S\	R(                  5      5       r\\l        g)zCreate endpoint command.    )absolute_import)division)unicode_literalsN)ids_api)base)flags)labels_utilaF  
          Create an endpoint for the specified VPC network. Successful creation
          of an endpoint results in an endpoint in READY state. Check the
          progress of endpoint creation by using `gcloud alpha ids endpoints
          list`.

          For more examples, refer to the EXAMPLES section below.


        a{  
            To create an endpoint called `my-endpoint` for VPC network
            `my-net`, in zone `us-central1-a`, alerting on LOW threats or
            higher, run:

            $ {command} my-endpoint --network=my-net --zone=us-central1-a --project=my-project --severity=LOW

            To create an endpoint called `my-endpoint` for VPC network
            `my-net`, in zone `us-central1-a`, alerting on LOW threats or
            higher, excluding threat IDs 1000 and 2000, run:

            $ {command} my-endpoint --network=my-net --zone=us-central1-a --project=my-project --severity=LOW --threat-exceptions=1000,2000

    )DESCRIPTIONEXAMPLESc                   .    \ rS rSrSr\S 5       rS rSrg)Create9   zCreate a Cloud IDS endpoint.c                    [         R                  " U 5        [         R                  " U 5        [         R                  " U 5        [         R                  " U 5        [         R
                  " U SS9  [         R                  " U 5        [         R                  " U S5        [        R                  R                  U 5        [        R                  R                  U S5        [        R                  " U 5        g )NF)required60mT)r   AddEndpointResourceAddNetworkArgAddDescriptionArgAddSeverityArgAddThreatExceptionsArgAddTrafficLogsArg
AddMaxWaitr   
ASYNC_FLAGAddToParser
SetDefaultr	   AddCreateLabelsFlags)parsers    #lib/surface/ids/endpoints/create.pyArgsCreate.Args>   s    	f%		F#	 	  %8	F#	VU#OO'OOvt,$$V,    c                     [         R                  " U R                  5       5      nUR                  R                  R                  5       nUR                  nUR                  nUR                  nU(       d  / nUR                  nUR                  n[        R                  " UUR                  R                  R                  5      n	UR                   n
["        R$                  " UR&                  S9nUR)                  UR+                  5       UR-                  5       R/                  5       UUUUUU	S9nU
(       a  UR1                  S5      (       d  SUl        U$ UR5                  UR7                  U5      SR3                  UR/                  5       5      US9$ )N)seconds)nameparentnetworkseveritythreat_exceptionsdescriptionenable_traffic_logslabelsformatdefaultz'waiting for endpoint [{}] to be created)operation_refmessagemax_wait)r   ClientReleaseTrackCONCEPTSendpointParser&   r'   r(   r)   r*   r	   ParseCreateArgsmessagesEndpointLabelsValueasync_datetime	timedeltar0   CreateEndpointNameParentRelativeNameIsSpecifiedr,   WaitForOperationGetOperationRef)selfargsclientr4   r&   r'   r(   r)   r*   r+   is_asyncr0   	operations                r   Run
Create.RunK   s]   ^^D--/0F}}%%++-HllG}}H..""K22(()/)A)A)M)MOF{{H!!$--8H%%]]_ --/+/ & I  h''"",,Y79@@!!#%	 #  r!    N)	__name__
__module____qualname____firstlineno____doc__staticmethodr   rI   __static_attributes__rK   r!   r   r   r   9   s     %
- 
-$r!   r   )rP   
__future__r   r   r   r;   googlecloudsdk.api_lib.idsr   googlecloudsdk.callioper   googlecloudsdk.command_lib.idsr   $googlecloudsdk.command_lib.util.argsr	   DETAILED_HELPReleaseTracksr2   ALPHABETAGACreateCommandr   detailed_helprK   r!   r   <module>r_      s     &  '  . ( 0 <			< D%%++T->->-C-C%%((*4T 4*4n % r!   