
    c                     6   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.                  e
j0                  j2                         G d de
j4                                      Zy)zLCommand to update a node pool in an Anthos standalone cluster on bare metal.    )absolute_import)division)unicode_literals)
operations)standalone_node_pools)base)parser_arguments)	constants)node_pool_flags)standalone_node_pool_flags)logz
To update a node pool named ``my-node-pool'' in a cluster named
``my-cluster'' managed in location ``us-west1'', run:

$ {command} my-node-pool --cluster=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)UpdatezAUpdate a node pool in an Anthos standalone cluster on bare metal.EXAMPLESparserc                 l   | j                   j                  t        j                         t	        j
                  | d       t        j                  |        t	        j                  |        t        j                  j                  |        t	        j                  | d       t	        j                  |        y)z{Gathers commandline 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_NODE_POOLS_FORMATflagsAddNodePoolResourceArgr   AddValidationOnlyAddAllowMissingUpdateNodePoolr   
ASYNC_FLAGAddToParserAddNodePoolConfigAddNodePoolDisplayName)r   s    @lib/surface/container/bare_metal/standalone_node_pools/update.pyArgszUpdate.Args.   s}     !!99;	  5%%f-	''/OO'	Fd3	  (    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 )aa  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 None or any
      possible error.
    formatz4Node pool in Anthos standalone cluster on bare metal)CONCEPTS	node_poolParseapisStandaloneNodePoolsClientr   async_IsSpecifiedr
   OPERATIONS_FORMATr$   r   OperationsClientWaitvalidate_onlyr   UpdatedResource)selfargsnode_pool_refclient	operationoperation_clientoperation_responses          r    Runz
Update.Run>   s     MM++113M++-Fd#I{{4++H5//dk{{!224)..y9	

@
++
 r"   N)__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr	   ArgumentInterceptorr!   r8    r"   r    r   r   '   s7     Jy)-)#77 ) )r"   r   N)r<   
__future__r   r   r   *googlecloudsdk.api_lib.container.gkeonpremr   r   r(   googlecloudsdk.callioper   r	   /googlecloudsdk.command_lib.container.bare_metalr
   r   r   r   r   .googlecloudsdk.command_lib.container.gkeonpremgooglecloudsdk.corer   r=   HiddenReleaseTracksReleaseTrackALPHAUpdateCommandr   rA   r"   r    <module>rM      s|    S &  ' A T ( 4 ] K _ D #	 D%%++,4T 4 - 4r"   