
    7                         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 update command.    )absolute_import)division)unicode_literals)LoggingServersClient)arg_parsers)base)flags)logzc
        Update a Logging Server. Only source_type, hostname, protocol, port can be updated.
      a  
        To update a logging-server called `my-logging-server` in private cloud `my-private-cloud` and zone `us-west2-a` to change `ESXI` source_type, `192.168.20.15` hostname
        `UDP` protocol and `514` port, run:

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

          Or:

          $ {command} my-logging-server --private-cloud=my-private-cloud --source-type=ESXI --hostname=192.168.20.15 --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)Updatez3Update a Google Cloud VMware Engine logging-server.c                    t        j                  |        t        j                  j	                  |        t        j                  j                  | d       | j                  j                  d       | j                  dd       | j                  dddgd	
       | j                  dg dd
       | j                  dt        j                  dd      d       y)z Register flags for this command.Tyamlz
--hostnamez`            Fully-qualified domain name (FQDN) or IP Address of the logging server.
            )helpz--source-typeVCSAESXIz|            The type of component that produces logs that will be forwarded
            to this logging server.
            )choicesr   z
--protocol)UDPTCPTLSRELPSSLzf            Defines possible protocols used to send logs to
            a logging server.
            z--portr   i  zO            Port number at which the logging server receives logs.
            )typer   N)r	   AddLoggingServerArgToParserr   
ASYNC_FLAGAddToParser
SetDefaultdisplay_info	AddFormatadd_argumentr   
BoundedInt)parsers    ;lib/surface/vmware/private_clouds/logging_servers/update.pyArgszUpdate.Args4   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 updated)operation_refmessage)r(   )CONCEPTSlogging_serverParser   r   hostnamesource_typeprotocolportasync_r
   UpdatedResourcenameWaitForOperationGetOperationRefformatRelativeName)selfargsr-   client	operationr)   resources          r$   Runz
Update.RunY   s    ]]11779N!#F		I {{H	)../?$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"    ; -" "Hr&   r   N)rC   
__future__r   r   r   ,googlecloudsdk.api_lib.vmware.loggingserversr   googlecloudsdk.callioper   r   !googlecloudsdk.command_lib.vmwarer	   googlecloudsdk.corer
   rD   ReleaseTracksReleaseTrackGAUpdateCommandr   rG   r&   r$   <module>rQ      sp    - &  ' M / ( 3 #
	& D%%(()AT A *Ar&   