
                          (   S 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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SKJr  SSKJr  SSKJr  SSKJr  Sr\R6                  " \R8                  R:                  5       " S S\R<                  5      5       r\R6                  " \R8                  R@                  5       " S S\R<                  5      5       r!\R6                  " \R8                  RD                  5       " S S\R<                  5      5       r#g)z2Command to update an Anthos cluster on bare metal.    )absolute_import)division)unicode_literals)Optional)bare_metal_clusters)
operations)base)parser_arguments)cluster_flags)	constants)flags)log)gkeonprem_v1_messagesz}
To update a cluster named ``my-cluster'' managed in location ``us-west1'', run:

$ {command} my-cluster --location=us-west1
c                   V    \ rS rSrSrS\0r\S\R                  SS4S j5       r
S rS	rg)
Update)   'Update an Anthos cluster on bare metal.EXAMPLESparserreturnNc                    U R                   R                  [        R                  5        [        R
                  " U SSS9  [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                   " U SS9  [        R"                  " U 5        [        R$                  " U 5        [        R&                  " U 5        [        R(                  " U 5        [*        R,                  " U 5        gzpGathers command line arguments for the update command.

Args:
  parser: The argparse parser to add the flag to.
z	to updateT)verb
positional)	is_updateNdisplay_info	AddFormatbare_metal_constantsBARE_METAL_CLUSTERS_FORMATr   AddClusterResourceArgr	   
ASYNC_FLAGAddToParserAddValidationOnlyAddAllowMissingUpdateClusterAddLoadBalancerConfigAddControlPlaneConfig
AddVersionAddSecurityConfigAddMaintenanceConfigAddNetworkConfigAddDescriptionAddClusterOperationsConfigAddNodeAccessConfigAddUpdateAnnotationscommon_flagsAddBinauthzEvaluationModer   s    3lib/surface/container/bare_metal/clusters/update.pyArgsUpdate.Args/   s	    !!77 
[TJOO'	F#	&&v.	$7	$7	Vt,	Fd3	v6	6T2	 	$$V,	f%	v&**62    c                    UR                   R                  R                  5       n[        R                  " 5       nUR                  U5      nUR                  (       a+  UR                  S5      (       d  [        R                  Ul
        UR                  (       a  U$ [        R                  " 5       nUR                  U5      nUR                  (       d"  [        R                   " USUR                  5        U$ aF  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 operation or any
  possible error.
formatzAnthos cluster on bare metalCONCEPTSclusterParseapisClustersClientr   async_IsSpecifiedr   OPERATIONS_FORMATr9   r   OperationsClientWaitvalidate_onlyr   UpdatedResourceselfargscluster_refcluster_client	operationoperation_clientoperation_responses          r3   Run
Update.RunI   s     --''--/K((*N%%d+I{{4++H55//dk{{!224)..y9	
5t{{ r6    __name__
__module____qualname____firstlineno____doc__	_EXAMPLESdetailed_helpstaticmethodr
   ArgumentInterceptorr4   rO   __static_attributes__rQ   r6   r3   r   r   )   s;    /y)-3#77 3D 3 32r6   r   c                   V    \ rS rSrSrS\0r\S\R                  SS4S j5       r
S rS	rg)

UpdateBetai   r   r   r   r   Nc                    U R                   R                  [        R                  5        [        R
                  " U SSS9  [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                   " U SS9  [        R"                  " U 5        [        R$                  " U 5        [        R&                  " U 5        [        R(                  " U 5        [*        R,                  " U 5        gr   r   r2   s    r3   r4   UpdateBeta.Argso   s    !!779	[TJOO'	F#	&&v.	$7	$7	Vt,	Fd3	v6	6T2	 	$$V,	f%	v&**62r6   c                    UR                   R                  R                  5       n[        R                  " 5       nUR                  U5      nUR                  (       a+  UR                  S5      (       d  [        R                  Ul
        UR                  (       a  U$ [        R                  " 5       nUR                  U5      nUR                  (       d"  [        R                   " USUR                  5        U$ r8   r:   rG   s          r3   rO   UpdateBeta.Run        --''--/K((*N%%d+I{{4++H55//dk{{!224)..y9	+'E++'r6   rQ   rR   rQ   r6   r3   r^   r^   i   s;    /y)-3#77 3D 3 30r6   r^   c                   x    \ rS rSrSrS\0r\S\R                  SS4S j5       r
S\\R                     4S jrS	rg)
UpdateAlpha   r   r   r   r   Nc                    U R                   R                  [        R                  5        [        R
                  " U SSS9  [        R                  R                  U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                  " U SS9  [        R                   " U SS9  [        R"                  " U 5        [        R$                  " U 5        [        R&                  " U 5        [        R(                  " U 5        [*        R,                  " U 5        [        R.                  " U 5        gr   )r   r   r   r    r   r!   r	   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   AddUpgradePolicyr2   s    r3   r4   UpdateAlpha.Args   s    !!779	[TJOO'	F#	&&v.	$7	$7	Vt,	Fd3	v6	6T2	 	$$V,	f%	v&**62	6"r6   c                    UR                   R                  R                  5       n[        R                  " 5       nUR                  U5      nUR                  (       a+  UR                  S5      (       d  [        R                  Ul
        UR                  (       a  U$ [        R                  " 5       nUR                  U5      nUR                  (       d"  [        R                   " USUR                  5        U$ r8   r:   rG   s          r3   rO   UpdateAlpha.Run   rd   r6   rQ   )rS   rT   rU   rV   rW   rX   rY   rZ   r
   r[   r4   r   messages	OperationrO   r\   rQ   r6   r3   rf   rf      sM    /y)-##77 #D # #2("4"45 r6   rf   N)$rW   
__future__r   r   r   typingr   *googlecloudsdk.api_lib.container.gkeonpremr   r>   r   googlecloudsdk.callioper	   r
   /googlecloudsdk.command_lib.container.bare_metalr   r   r   r   .googlecloudsdk.command_lib.container.gkeonpremr0   googlecloudsdk.corer   2googlecloudsdk.generated_clients.apis.gkeonprem.v1r   rm   rX   ReleaseTracksReleaseTrackGAUpdateCommandr   BETAr^   ALPHArf   rQ   r6   r3   <module>r}      s    9 &  '  R A ( 4 R ] D P # `	 D%%(()<T < *<~ D%%**+:## : ,:z D%%++,;$$$ ; -;r6   