
    Z                         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  G d
 de	j                        Zy)z&Command for spanner SSD caches update.    )absolute_import)division)unicode_literalsN)
ssd_caches)base)flags)labels_utilc                   N    e Zd ZdZd ej
                  d      iZed        Zd Z	y)Updatez!Update a Cloud Spanner SSD cache.EXAMPLESaY          To update the size of a Cloud Spanner SSD cache to 2048 GiB, run:

          $ {command} my-cache-id --config=my-config-id --size-gib=2048

        To update display name of a Cloud Spanner SSD cache, run:

          $ {command} my-cache-id --config=my-config-id --display-name=new-display-name

        To modify the SSD Cache by adding label 'k0', with value 'value1' and label 'k1' with value 'value2' and removing labels with key 'k3', run:

         $ {command} my-cache-id --config=my-config-id --update-labels=k0=value1,k1=value2 --remove-labels=k3

        To clear all labels of a Cloud Spanner SSD cache, run:

          $ {command} my-cache-id --config=my-config-id --clear-labels

        To remove existing labels of a Cloud Spanner SSD cache, run:

          $ {command} my-cache-id --config=my-config-id --remove-labels=k0,k1
        c                 >   t        j                  ddd      j                  |        t        j                         j                  |        | j	                  dd      }|j                  dt        d       |j                  d	d
       t        j                  |       y)zArgs is called by calliope to gather arguments for this command.

    Args:
      parser: An argparse parser that you can use to add arguments that go on
        the command line after this command. Positional arguments are allowed.
    TF)
positionalrequiredhiddenz=SSD Cache attributes to be updated. At least one is required.)r   helpz
--size-gibz"The size of this SSD Cache in GiB.)typer   z--display-namez0The name of this SSD Cache as it appears in UIs.)r   N)	r   SsdCacheAddToParserConfig	add_groupadd_argumentintr	   AddUpdateLabelsFlags)parserupdate_groups     (lib/surface/spanner/ssd_caches/update.pyArgszUpdate.Args8   s     
NNdT%@LL 
LLNv&##L $ L
 3%I   ?  
 $$\2    c                 ,    t        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:
      SSD Cache update response.
    )r   Patch)selfargss     r   Runz
Update.RunU   s     D!!r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r#    r   r   r   r      s<    ) /(// # -0 3 38
"r   r   )r'   
__future__r   r   r   r(   googlecloudsdk.api_lib.spannerr   googlecloudsdk.callioper   "googlecloudsdk.command_lib.spannerr   $googlecloudsdk.command_lib.util.argsr	   Commandr   r,   r   r   <module>r3      s4    - &  '  5 ( 4 <B"T\\ B"r   