
    7                         S r SSKJr  SSKJr  SSKJr  SSKJ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"                  5       " S S\	R$                  5      5       rg)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                   2    \ rS rSrSr\r\S 5       rS r	Sr
g)Update.   z3Update a Google Cloud VMware Engine logging-server.c                    [         R                  " U 5        [        R                  R	                  U 5        [        R                  R                  U S5        U R                  R                  S5        U R                  SSS9  U R                  SSS/S	S
9  U R                  S/ SQSS
9  U R                  S[        R                  " SS5      SS9  g)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ArgsUpdate.Args4   s     
%%f-OO'OOvt,
!!&)
       4   ##Au-      c                    UR                   R                  R                  5       n[        5       nUR	                  UUR
                  UR                  UR                  UR                  5      nUR                  nU(       a!  [        R                  " UR                  SSS9  g UR                  UR                  U5      SR                  UR!                  5       5      S9n[        R                  " UR!                  5       SS9  U$ )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%   Run
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____firstlineno____doc___DETAILED_HELPdetailed_helpstaticmethodr&   rA   __static_attributes__rC   r(   r%   r   r   .   s"    ; -" "Hr(   r   N)rH   
__future__r   r   r   ,googlecloudsdk.api_lib.vmware.loggingserversr   googlecloudsdk.callioper   r   !googlecloudsdk.command_lib.vmwarer	   googlecloudsdk.corer
   rI   ReleaseTracksReleaseTrackGAUpdateCommandr   rC   r(   r%   <module>rV      sn    - &  ' M / ( 3 #
	& D%%(()AT A *Ar(   