
    1                     >   S r SSKJr  SSKJr  SSKJ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  \
R                  \
R                  " \
R                   R"                  5       " S S\
R$                  5      5       5       r\
R                  \
R                  " \
R                   R(                  5       " S S\
R$                  5      5       5       r\
R                  \
R                  " \
R                   R,                  5       " S S\
R$                  5      5       5       rg)z%Command for spanner instances update.    )absolute_import)division)unicode_literalsN)instance_operations)	instances)base)flags)resource_argsc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	Update    Update a Cloud Spanner instance.EXAMPLES	          To update the display name of a Cloud Spanner instance, run:

          $ {command} my-instance-id --description=my-new-display-name

        To update the node count of a Cloud Spanner instance, run:

          $ {command} my-instance-id --nodes=1
        c           
         [         R                  " 5       R                  U 5        [         R                  " SS9R                  U 5        [        R
                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [         R                  " SU SSSSSS9  [         R                  " SS5      R                  U 5        [         R                  " SSSS	.S
9R                  U 5        g)`  Args is called by calliope to gather arguments for this command.

Please add arguments in alphabetical order except for no- or a clear-
pair for that argument which can follow the argument itself.
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.
FrequiredT)require_all_autoscaling_argsparseradd_asymmetric_option_flagasymmetric_options_group$add_asymmetric_total_cpu_target_flag(add_asymmetric_disable_autoscaling_flagsautoscaling_cpu_target_groupNNot specified.bNo default backup schedule is created automatically when a new database is created in an instance.  A default backup schedule is created automatically when a new database is created in an instance. You can edit or delete the default backup schedule once it's created. The default backup schedule creates a full backup every 24 hours. These full backups are retained for 7 days.(DEFAULT_BACKUP_SCHEDULE_TYPE_UNSPECIFIEDNONE	AUTOMATICchoicesr	   InstanceAddToParserDescriptionr   
ASYNC_FLAGr
   AddExpireBehaviorArgAddInstanceTypeArgAddCapacityArgsForInstanceEditionDefaultBackupScheduleTyper   s    'lib/surface/spanner/instances/update.pyArgsUpdate.Args/   s     
NN  (	u%11&9OO'&&v.$$V,	$$%*#'!%-115%) 
MM$))&1	##8H79
 k&    c                 f   [         R                  " U5      n[         R                  " U5      n[        R                  " UR
                  40 SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _S	UR                  _S
UR                  _SUR                   _SUR"                  _SU_SU_SUR$                  _SUR&                  _6nUR(                  (       a  U$ [*        R,                  " US5        g)This 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:
  Some value that we want to have printed later.
descriptionnodesprocessing_unitsautoscaling_min_nodesautoscaling_max_nodes autoscaling_min_processing_units autoscaling_max_processing_units$autoscaling_high_priority_cpu_targetautoscaling_total_cpu_targetautoscaling_storage_targetasymmetric_autoscaling_options$clear_asymmetric_autoscaling_optionsinstance_typeexpire_behavioreditiondefault_backup_schedule_typeUpdating instanceN)r
   GetInstanceTypeGetExpireBehaviorr   Patchinstancer6   r7   r8   r9   r:   r;   r<   r=   r>   r?   asymmetric_autoscaling_option#clear_asymmetric_autoscaling_optionrD   rE   async_r   AwaitselfargsrB   rC   ops        r0   Run
Update.RunY   sF    "11$7M#55d;O	
$$
 jj
 ..	

 #88
 #88
 *.)N)N
 *.)N)N
 .2-V-V
 &*%F%F
 $(#B#B
 (,'I'I
 .2-U-U
 $
 (
  !
" &*%F%F#
B& {{ib"56r3    N__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr1   rS   __static_attributes__rU   r3   r0   r   r      s=     ) (// # 
- ' 'R"7r3   r   c                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	
BetaUpdate~   r   r   r   c                    [         R                  " 5       R                  U 5        [         R                  " SS9R                  U 5        [        R
                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [         R                  " SU SSSSSSS9  [         R                  " SS5      R                  U 5        [         R                  " SSSS	.S
9R                  U 5        g)r   Fr   T)r   r   r   r   r   r   r   add_disable_downscaling_flagNr   r   r   r   r#   r%   r/   s    r0   r1   BetaUpdate.Args   s     
NN  (	u%11&9OO'&&v.$$V,	$$%*#'!%-115%)%)	 
MM$))&1	##8H79
 k&r3   c                    [         R                  " U5      n[         R                  " U5      n[        R                  " UR
                  40 SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _S	UR                  _S
UR                  _SUR                   _SUR"                  _SUR$                  _SU_SU_SUR&                  _SUR(                  _6nUR*                  (       a  U$ [,        R.                  " US5        g)r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   disable_downscalingrA   rB   rC   rD   rE   rF   N)r
   rG   rH   r   rI   rJ   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   rK   rh   rL   rD   rE   rM   r   rN   rO   s        r0   rS   BetaUpdate.Run   sV    "11$7M#55d;O	
$$
 jj
 ..	

 #88
 #88
 *.)N)N
 *.)N)N
 .2-V-V
 &*%F%F
 $(#B#B
 (,'I'I
 !44
 .2-U-U
 $
  (!
" #
$ &*%F%F%
B( {{ib"56r3   rU   NrV   rU   r3   r0   rb   rb   ~   s=     ) (// # 
- ( (T#7r3   rb   c                   n    \ rS rSrSrS\R                  " S5      0r\R                  r\	S 5       r
S rSrg)	AlphaUpdate   z4Update a Cloud Spanner instance with ALPHA features.r   r   c                 @   [         R                  " 5       R                  U 5        [         R                  " SS9R                  U 5        [        R
                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [         R                  " SU SSSSSSS9  [         R                  " 5       R                  U 5        [         R                  " SS5      R                  U 5        [         R                  " SSSS	.S
9R                  U 5        g)r   Fr   T)r   r   r   r   r   r   r   re   Nr   r   r   r   r#   )r	   r&   r'   r(   r   r)   r
   r*   r+   r,   SsdCacher-   r.   r/   s    r0   r1   AlphaUpdate.Args   s     
NN  (	u%11&9OO'&&v.$$V,	$$%*#'!%%)-115%)	 
NN  (	MM$))&1	##8H79
 k&r3   c                    [         R                  " U5      n[         R                  " U5      n[        R                  " UR
                  40 SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _SUR                  _S	UR                  _S
UR                  _SUR                   _SUR"                  _SUR$                  _SU_SU_SUR&                  _SUR(                  _SUR*                  _6nUR,                  (       a  U$ [.        R0                  " US5        g)r5   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   r@   rh   rA   rB   rC   ssd_cache_idrD   rE   rF   N)r
   rG   rH   r   rI   rJ   r6   r7   r8   r9   r:   r;   r<   r=   r>   r?   rK   rh   rL   	ssd_cacherD   rE   rM   r   rN   rO   s        r0   rS   AlphaUpdate.Run   sd    "11$7M#55d;O	
$$
 jj
 ..	

 #88
 #88
 *.)N)N
 *.)N)N
 .2-V-V
 &*%F%F
 $(#B#B
 (,'I'I
 !44
 .2-U-U
 $
  (!
" ^^#
$ %
& &*%F%F'
B* {{ib"56r3   rU   N)rW   rX   rY   rZ   r[   r\   r]   r^   r   r_   r1   rS   r`   rU   r3   r0   rk   rk      sF     = (// # 
- NN'* *X$7r3   rk   )r[   
__future__r   r   r   r\   googlecloudsdk.api_lib.spannerr   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.spannerr	   r
   DefaultUniverseOnlyReleaseTracksReleaseTrackGACommandr   BETArb   ALPHArk   rU   r3   r0   <module>r      s    , &  '  > 4 ( 4 < D%%(()[7T\\ [7 * [7| D%%**+]7 ]7 , ]7@ D%%++,b7$,, b7 - b7r3   