
                             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	lmZ d
 Zg dZddZddZ	 	 ddZddZ	 ddZd Z	 ddZd Zd Zy)zFlags for IDS commands.    )absolute_import)division)unicode_literals)ids_api)arg_parsers)concepts)concept_parsers)presentation_specsc                 ,    | j                  ddd       y)zAdds --description flag.z--descriptionFzDescription of the endpoint.requiredhelpNadd_argument)parsers    +lib/googlecloudsdk/command_lib/ids/flags.pyAddDescriptionArgr      s    ,J  L    )INFORMATIONALLOWMEDIUMHIGHCRITICALNc                 B    |xs t         }| j                  d||d       y)zAdds --severity flag.z
--severityz)Minimum severity of threats to report on.)r   choicesr   N)DEFAULT_SEVERITIESr   )r   r   severity_levelsr   s       r   AddSeverityArgr   %   s,    11'6	  8r   c                 T    | j                  dt        j                         |dd       y )Nz--threat-exceptionszexc1,exc2,...zZList of threat IDs to be excepted from alerting. Passing empty list clears the exceptions.)typer   metavarr   )r   r   ArgList)r   r   s     r   AddThreatExceptionsArgr#   /   s/     2  r   c                 ,    | j                  d||       y)zAdds --network flag.z	--networkr   Nr   r   r   	help_texts      r   AddNetworkArgr'   :   s     	kH9Er   c                 .    | j                  d|d|       y )Nz--zone-)r   defaultr   r   r%   s      r   
AddZoneArgr+   A   s    h3YOr   c                 2    | j                  dddd|d       y )Nz--enable-traffic-logsenable_traffic_logsF
store_true)destr   r*   r   actionr   )r   r&   s     r   AddTrafficLogsArgr1   E   s)    
 	   r   c           
      &   d}t        j                  ddt        j                  dd      t        j                  ddd      t         j                        }t	        j
                  ||d	d
      }t        j                  |g      j                  |       S )zAdds Endpoint resource.endpointz ids.projects.locations.endpointsName of the {resource}zoneZone of the {resource}.
locationIdparameter_name)
endpointIdr7   	projectIdTz	endpoint.nameconcept_specr   
group_help)	r   ResourceSpec ResourceParameterAttributeConfig DEFAULT_PROJECT_ATTRIBUTE_CONFIGr
   ResourcePresentationSpecr	   ConceptParserAddToParserr   r=   resource_specpresentation_specs       r   AddEndpointResourcerI   S   s    	$''(::
.0::
+LJ99;- )AA 	
 
	&	&(9':	;	G	G	OOr   c           	      V    | j                  ddd||t        j                                y)zAdds --max-wait flag.z
--max-waitmax_waitF)r/   r   r*   r   r    N)r   r   Duration)r   default_max_waitr&   s      r   
AddMaxWaitrN   f   s2     	!  #r   c                       fdS )Nc                 H    t        j                        | j                  z   S )N)r   GetEffectiveApiEndpointr=   )xrelease_tracks    r   <lambda>z MakeGetUriFunc.<locals>.<lambda>w   s    722=AAFFJr    )rS   s   `r   MakeGetUriFuncrV   v   s	    	JJr   c           
      &   d}t        j                  ddt         j                  t        j                  ddd      t        j                  dd            }t	        j
                  ||d	d
      }t        j                  |g      j                  |       S )zAdds Operation resource.	operationz!ids.projects.locations.operationsr5   r6   locationsIdr8   r4   )
projectsIdrY   operationsIdTz
operation.r<   )	r   r@   rB   rA   r
   rC   r	   rD   rE   rF   s       r   AddOperationResourcer\   z   s    	$'')::;;
+MK<<
/12- )AA 	
 
	&	&(9':	;	G	G	OOr   )TN)F)Tz"Name of the VPC network to monitor)TzZone of the endpoint)zWhether to enable traffic logs on the endpoint. Enabling traffic logs can generate a large number of logs which can increase costs in Cloud Logging.)zTime to synchronously wait for the operation to complete, after which the operation continues asynchronously. Ignored if --no-async isn't specified. See $ gcloud topic datetimes for information on time formats.)__doc__
__future__r   r   r   googlecloudsdk.api_lib.idsr   googlecloudsdk.callioper    googlecloudsdk.calliope.conceptsr   (googlecloudsdk.command_lib.util.conceptsr	   r
   r   r   r   r#   r'   r+   r1   rI   rN   rV   r\   rU   r   r   <module>rc      sv     &  ' . / 5 D GL L 8  @FP'P*O# KPr   