
    i                         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
ddZ e	j                  e	j                   j"                         G d de	j$                               Zy)z&'vmware logging-server create command.    )absolute_import)division)unicode_literals)LoggingServersClient)arg_parsers)base)flags)logzl
        Create a logging-server in a VMware Engine private cloud to forward VCSA or ESXI logs to it.
      a  
        To create a logging-server called `my-logging-server` in private cloud `my-private-cloud`, with source type `ESXI`, host name `192.168.0.30`, protocol `UDP` and port `514`, run:

          $ {command} my-logging-server --location=us-west2-a --project=my-project --private-cloud=my-private-cloud --source-type=ESXI --hostname=192.168.0.30 --protocol=UDP --port=514

          Or:

          $ {command} my-logging-server --private-cloud=my-private-cloud --source-type=ESXI --hostname=192.168.0.30 --protocol=UDP --port=514

          In the second example, the project and location are taken from gcloud properties core/project and compute/zone.
  )DESCRIPTIONEXAMPLESc                   *    e Zd ZdZeZed        Zd Zy)Createz3Create a Google Cloud VMware Engine logging-server.c                    t        j                  |        t        j                  j	                  |        t        j                  j                  | d       | j                  j                  d       | j                  ddd       | j                  ddddgd	
       | j                  dg ddd       | j                  ddt        j                  dd      d       y)z Register flags for this command.Tyamlz
--hostnamezX        Fully-qualified domain name (FQDN) or IP Address of the logging server.
        )requiredhelpz--source-typeVCSAESXIz|            The type of component that produces logs that will be forwarded
            to this logging server.
            )r   choicesr   z
--protocol)UDPTCPTLSSSLRELPzf            Defines possible protocols used to send logs to
            a logging server.
            )r   r   r   z--portr   i  zG        Port number at which the logging server receives logs.
        )r   typer   N)r	   AddLoggingServerArgToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argumentr   
BoundedInt)parsers    ;lib/surface/vmware/private_clouds/logging_servers/create.pyArgszCreate.Args3   s     
%%f-OO'OOvt,
!!&)
    	   4	   ##Au-	      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logging-serverT)kindis_asyncz-waiting for logging-server [{}] to be created)operation_refmessage)r)   )CONCEPTSlogging_serverParser   async_r   hostnamesource_typeprotocolportr
   CreatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr.   clientr*   	operationresources          r%   Runz
Create.Run\   s    ]]11779N!#F{{H		I 	)../?$O&&,,Y7?FF'')
 ' H 335<LMOr'   N)	__name__
__module____qualname____doc___DETAILED_HELPdetailed_helpstaticmethodr&   r@    r'   r%   r   r   -   s"    ; -& &Pr'   r   N)rD   
__future__r   r   r   ,googlecloudsdk.api_lib.vmware.loggingserversr   googlecloudsdk.callioper   r   !googlecloudsdk.command_lib.vmwarer	   googlecloudsdk.corer
   rE   ReleaseTracksReleaseTrackGACreateCommandr   rH   r'   r%   <module>rR      sp    - &  ' M / ( 3 #

	$ D%%(()DT D *Dr'   