
    
                     @   d Z ddlmZ ddlmZ ddlmZ ddl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  e
j                  e
j                   j"                  e
j                   j$                  e
j                   j&                         G d de
j(                               Zy)z!bigtable clusters update command.    )absolute_import)division)unicode_literalsN)clusters)util)base)	arguments)logc                   T    e Zd ZdZd ej
                  d      iZed        Zd Z	d Z
y)UpdateClusterz,Update a Bigtable cluster's number of nodes.EXAMPLESz          To update a cluster to `10` nodes, run:

            $ {command} my-cluster-id --instance=my-instance-id --num-nodes=10

          c                     t        j                  | d       t        j                  |       j                         j	                          y)z Register flags for this command.z	to updateN)r	   AddClusterResourceArgArgAdderAddAsyncAddScalingArgsForClusterUpdate)parsers    'lib/surface/bigtable/clusters/update.pyArgszUpdateCluster.Args-   s4     ##FK8((*IIK    c                 $    | j                  |      S )zThis is what gets called when the user runs this command.

    Args:
      args: an argparse namespace. All the arguments that were provided to this
        command invocation.

    Returns:
      None
    )_Run)selfargss     r   RunzUpdateCluster.Run3   s     99T?r   c           	         |j                   j                  j                         }t        j                  ||j
                  |j                  |j                  |j                  |j                  |j                        }|j                  sHt        j                  |      }t        j                  |dj                  |j!                                     S t#        j$                  |j!                         d|j                         y)z8Implements Run() with different possible features flags.)nodesautoscaling_minautoscaling_maxautoscaling_cpu_targetautoscaling_storage_targetdisable_autoscalingzUpdating bigtable cluster {0}cluster)kindis_asyncN)CONCEPTSr#   Parser   PartialUpdate	num_nodesautoscaling_min_nodesautoscaling_max_nodesr    r!   r"   async_r   GetOperationRefAwaitClusterformatNamer
   UpdatedResource)r   r   cluster_ref	operationoperation_refs        r   r   zUpdateCluster._Run?   s    --''--/K&&nn2222#::#'#B#B 446I ;;**95m

)
0
01A1A1C
DF F T[[Br   N)__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r   r    r   r   r   r      sF     5 
(//  - M M

r   r   )r8   
__future__r   r   r   r9   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler	   googlecloudsdk.corer
   ReleaseTracksReleaseTrackGABETAALPHAUpdateCommandr   r=   r   r   <module>rI      s~    ( &  '  4 0 ( 9 # D%%(($*;*;*@*@%%++-2D&& 2-2r   