
                             S r SSKrSSKJr  SSKJr  SSKJr  SSKJr  SSK	J
r
  S r\R                  \R                  " \R                  R                  5       " S	 S
\R                   5      5       5       rg)z%Bigtable memory layer update command.    N)memory_layers)util)base)	arguments)logc                     UR                   (       a  [        R                  " U 5      $ UR                  R	                  S5      nUR                  R	                  S5      n[        R
                  " U UUS9$ )a  Updates a cluster memory layer with the given arguments.

Args:
  cluster_ref: A resource reference of the cluster to update.
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Long running operation.
zstorage-size-gibzmax-request-units-per-second)storage_size_gibmax_request_units_per_second)disabler   Disablefixed_capacitygetUpdate)cluster_refargsr	   r
   s       ,lib/surface/bigtable/memory_layers/update.py_UpdateMemoryLayerr      sl     
\\  --**../AB#'#6#6#:#:&$  )%A     c                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	UpdateMemoryLayer4   zUpdate a Bigtable memory layer.EXAMPLESa>            To enable or resize a memory layer, run:

            $ {command} my-cluster-id --instance=my-instance-id --fixed-capacity=storage-size-gib=16,max-request-units-per-second=200000

          To disable a memory layer, run:

            $ {command} my-cluster-id --instance=my-instance-id --disable

          c                 (   [         R                  " U S5        U R                  SS9n[         R                  " U5      R	                  5         [         R                  " U5      R                  5         [         R                  " U 5      R                  5         g)z Register flags for this command.zof the memory layer to updateT)requiredN)r   AddClusterResourceArgadd_mutually_exclusive_groupArgAdderAddMemoryLayerFixedCapacityAddMemoryLayerDisableAddAsync)parserupdate_groups     r   ArgsUpdateMemoryLayer.ArgsF   so     ##F,KL 666EL|$@@B|$::<v'')r   c                 f   A UR                   R                  R                  5       n[        X!5      nUR                  (       d?  [
        R                  " U5      n[
        R                  " USUR                  5        S35      $ [        R                  " UR                  5       S-   SUR                  S9  g)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:
  Updated resource.
z#Updating memory layer for cluster []z/memoryLayerzmemory layer)kindis_asyncN)CONCEPTSclusterParser   async_r   GetOperationRefAwaitMemoryLayerNamer   UpdatedResourceRelativeName)selfr   r   	operationoperation_refs        r   RunUpdateMemoryLayer.RunR   s     	--''--/K";5I;;**95m""
/0@0@0B/C1
E 
   "^3
 r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr#   r5   __static_attributes__r7   r   r   r   r   4   s<     ( (// 	# 	- 	* 	*r   r   )r<   r=   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler   googlecloudsdk.corer   r   UniverseCompatibleReleaseTracksReleaseTrackALPHAUpdateCommandr   r7   r   r   <module>rK      sg    ,  9 0 ( 9 #4 D%%++,5** 5 - 5r   