
                         l   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dlmZ dZ e
j,                  e
j.                  j0                  e
j.                  j2                  e
j.                  j4                         G d de
j6                               Zy)z.Command to update an Anthos cluster on VMware.    )absolute_import)division)unicode_literals)bare_metal_admin_clusters)
operations)base)parser_arguments)admin_cluster_flags)	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 bare metal admin cluster.EXAMPLESparserc                    | j                   j                  t        j                         t	        j
                  | dd       t        j                  j                  |        t	        j                  |        t	        j                  |        t	        j                  | d       t	        j                  | d       t	        j                  | d       t	        j                  |        t	        j                  | d       t	        j                   | d       t	        j"                  |        t	        j$                  |        t'        j(                  |        y)z|Gathers command line arguments for the update command.

    Args:
      parser: The argparse parser to add the flag to.
    z	to updateT)	is_updateN)display_info	AddFormatbare_metal_constants BARE_METAL_ADMIN_CLUSTERS_FORMATcluster_flagsAddAdminClusterResourceArgr   
ASYNC_FLAGAddToParserAddValidationOnlyAddDescription
AddVersionAddControlPlaneConfigAddProxyConfigAddClusterOperationsConfigAddMaintenanceConfigAddNetworkConfigAddAdminWorkloadNodeConfigAddNodeAccessConfigr   AddBinauthzEvaluationMode)r   s    9lib/surface/container/bare_metal/admin_clusters/update.pyArgszUpdate.Args.   s     !!==?,,V[$GOO'##F+  (Vt4''$?  48,,V4&&v>""6T:,,V4%%f-	##F+    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 bare metal 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.RunE   s     ----335K--/N%%d+I{{4++H5//dk{{	+'K++'#446+00;	+'K++'  r)   N)__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr	   ArgumentInterceptorr(   r>    r)   r'   r   r   &   s6     6y)-,#77 , ,, r)   r   N)rB   
__future__r   r   r   *googlecloudsdk.api_lib.container.gkeonpremr   r/   r   googlecloudsdk.callioper   r	   /googlecloudsdk.command_lib.container.bare_metalr
   r   r   r   .googlecloudsdk.command_lib.container.gkeonpremr   googlecloudsdk.corer   rC   ReleaseTracksReleaseTrackALPHABETAGAUpdateCommandr   rG   r)   r'   <module>rT      s    5 &  ' X A ( 4 ` ] D @ #	 T..33T5F5F5I5I8 T 8 8 r)   