
                            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*                  j,                         G d de	j.                               Zy)z=Command to update an Anthos on bare metal standalone cluster.    )absolute_import)division)unicode_literals)
operations)standalone_clusters)base)parser_arguments)	constants)standalone_cluster_flags)flags)logz
To update a standalone 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)Updatez2Update an Anthos on bare metal standalone 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                  | d       t	        j                  | d       t	        j                   | d       t	        j"                  |        t	        j$                  |        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)verb
positional)	is_updateN)display_info	AddFormatbare_metal_constants%BARE_METAL_STANDALONE_CLUSTERS_FORMATr   AddStandaloneClusterResourceArgr   
ASYNC_FLAGAddToParserAddValidationOnly&AddAllowMissingUpdateStandaloneClusterAddControlPlaneConfig
AddVersionAddSecurityConfigAddMaintenanceConfigAddNetworkConfigAddLoadBalancerConfigAddDescriptionAddClusterOperationsConfigAddNodeAccessConfigAddUpdateAnnotationsr   AddBinauthzEvaluationMode)r   s    >lib/surface/container/bare_metal/standalone_clusters/update.pyArgszUpdate.Args,   s    !!BB <<[T 	OO'..v6CCFK226TJ''$?..vF11&DI--fE226TJ++F377?00811&9	##F+    c                    |j                   j                  j                         }t        j                         }|j                  |      }|j                  r&|j                  d      st        j                  |_
        |j                  r|S t        j                         }|j                  |      }|j                  s!t        j                   |d|j                         |S )af  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. If `--validate-only` is specified, it returns operation or any
      possible error.
    formatz'Anthos on bare metal standalone cluster)CONCEPTSstandalone_clusterParser   StandaloneClustersClientr   async_IsSpecifiedr
   OPERATIONS_FORMATr.   r   OperationsClientWaitvalidate_onlyr   UpdatedResource)selfargscluster_refcluster_client	operationoperation_clientoperation_responses          r*   Runz
Update.RunH   s     --2288:K(AACN%%d+I{{4++H5//dk{{!224)..y9	+C++' r,   N)__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr	   ArgumentInterceptorr+   rA    r,   r*   r   r   &   s4    :y)-,#77 , ,6r,   r   N)rE   
__future__r   r   r   *googlecloudsdk.api_lib.container.gkeonpremr   r   googlecloudsdk.callioper   r	   /googlecloudsdk.command_lib.container.bare_metalr
   r   r   .googlecloudsdk.command_lib.container.gkeonpremr   googlecloudsdk.corer   rF   ReleaseTracksReleaseTrackALPHAUpdateCommandr   rJ   r,   r*   <module>rU      sp    D &  ' A J ( 4 ] T D @ #	 D%%++,>T > ->r,   