
    s                     ~   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	lmZ dd
lmZ ddlmZ dZ e
j(                  e
j*                  j,                  e
j*                  j.                  e
j*                  j0                        e
j2                   G d de
j4                                      Zy)z.Command to update an Anthos cluster on VMware.    )absolute_import)division)unicode_literals)
operations)vmware_admin_clusters)base)parser_arguments)	constants)flags)logz}
To update a cluster named ``my-cluster'' managed in location ``us-west1'', run:

$ {command} my-cluster --location=us-west1
c                   H    e Zd ZdZdeiZedej                  fd       Z	d Z
y)Updatez)Update an Anthos on VMware admin cluster.EXAMPLESparserc                    | j                   j                  t        j                         t	        j
                  | dd       t	        j                  |        t	        j                  |        t        j                  j                  |        y)z|Gathers command line arguments for the update command.

    Args:
      parser: The argparse parser to add the flag to.
    z	to updateTN)display_info	AddFormatvmware_constantsVMWARE_ADMIN_CLUSTERS_FORMATr   AddAdminClusterResourceArgAddRequiredPlatformVersion
AddVersionr   
ASYNC_FLAGAddToParser)r   s    5lib/surface/container/vmware/admin_clusters/update.pyArgszUpdate.Args.   s_     !!"2"O"OP	$$V[$?	$$V,	VOO'    c                    |j                   j                  j                         }t        j                         }|j                  |      }|j                  r&|j                  d      st        j                  |_
        |j                  r#t        j                  |d|j                         |S t        j                         }|j                  |      }t        j                  |d|j                         |S )a  Runs the update command.

    Args:
      args: The arguments received from command line.

    Returns:
      The return value depends on the command arguments. If `--async` is
      specified, it returns an operation; otherwise, it returns the updated
      resource.
    formatzAnthos on VMware Admin Cluster)CONCEPTSadmin_clusterParseapisAdminClustersClientr   async_IsSpecifiedr
   OPERATIONS_FORMATr   r   UpdatedResourcer   OperationsClientWait)selfargscluster_refcluster_client	operationoperation_clientoperation_responses          r   Runz
Update.Run;   s     ----335K--/N%%d+I{{4++H5//dk{{	+:++' #446+00;	+:++'  r   N)__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr	   ArgumentInterceptorr   r2    r   r   r   r   %   s6    
 2y)-
(#77 
( 
( r   r   N)r6   
__future__r   r   r   *googlecloudsdk.api_lib.container.gkeonpremr   r   r#   googlecloudsdk.callioper   r	   .googlecloudsdk.command_lib.container.gkeonpremr
   +googlecloudsdk.command_lib.container.vmwarer   r   googlecloudsdk.corer   r7   ReleaseTracksReleaseTrackALPHABETAGADefaultUniverseOnlyUpdateCommandr   r;   r   r   <module>rI      s    5 &  ' A T ( 4 D U = #	 T..33T5F5F5I5I 0 T 0  0 r   