
    
                     t   d 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	 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 ddlmZ dZ e	j&                  e	j(                  j*                         G d de	j,                               Z e	j&                  e	j(                  j0                         G d de             Zy)z:Command to update a node pool in an Anthos cluster on AWS.    )absolute_import)division)unicode_literals)aws)base)flags)resource_args)command_util)	constants)endpoint_utilz
To update a node pool named ``my-node-pool'' in a cluster named ``my-cluster''
managed in location ``us-west1'', run:

$ {command} my-node-pool --cluster=my-cluster --location=us-west1 --node-version=NODE_VERSION
c                   .    e Zd ZdZdeiZed        Zd Zy)Update/Update a node pool in an Anthos cluster on AWS.EXAMPLESc                 V   t        j                  | d       t        j                  | d       t        j                  | d       t        j
                  | d       t        j                  | d       t        j                  | d       t        j                  |        t        j                  |        t        j                  | d       t        j                  |        t        j                  |        t        j                  | d       t        j                  |        t        j                   |        t        j"                  |        t        j$                  |        t        j&                  | d       t        j(                  | d       t        j*                  | d       t        j,                  | dd       t        j.                  |        t        j0                  | d       t2        j4                  j7                  |        | j8                  j;                  t<        j>                         y )Nz	to updateF)requiredznode pool to updatez	node pool)kindr   )r   ) r	   AddAwsNodePoolResourceArgr   AddNodeVersionAddValidateOnlyAddAutoscalingAddAnnotationsForUpdateAddTagsForUpdateAddRootVolumeSizeAddNodeLabelsForUpdateAddEnableAutoRepairAddMaxSurgeUpdateAddMaxUnavailableUpdate	aws_flagsAddSecurityGroupFlagsForUpdateAddRootVolumeKmsKeyArnAddRootVolumeTypeAddRootVolumeIopsAddRootVolumeThroughputAddConfigEncryptionKmsKeyArnAddProxyConfigForUpdateAddSshEC2KeyPairForUpdateAddIamInstanceProfile(AddAutoScalingMetricsCollectionForUpdateAddInstanceTyper   
ASYNC_FLAGAddToParserdisplay_info	AddFormatr   AWS_NODEPOOLS_FORMAT)parsers    .lib/surface/container/aws/node_pools/update.pyArgszUpdate.Args-   s   ++FK@	%0	&"78	%0	!!&+6	6;/	F#	  (	fe,	F#	!!&),,V[A$$V,''%%f-**6EB%%fk:''<##FuM66v>f;7OO'
!!)"@"@A    c                    t        j                  |      j                  }t        j                  |      5  t        j                  |      }t        j                         }t        j                  |j                  d|j                        }t        j                  ||||t        j                        cddd       S # 1 sw Y   yxY w)zRuns the update command.Updating)actioncluster)resource_refresource_clientargsmessager   N)r	   ParseAwsNodePoolResourceArglocationsIdr   GkemulticloudEndpointOverrideapi_utilNodePoolsClientr
   NodePoolMessageawsNodePoolsIdawsClustersIdr   r   AWS_NODEPOOL_KIND)selfr:   locationnode_pool_refnode_pool_clientr;   s         r1   Runz
Update.RunI   s    88>JJH		4	4X	>#??Em!113,,

&
&--g
   $*** 
?	>	>s   A=B<<CN)	__name__
__module____qualname____doc__	_EXAMPLESdetailed_helpstaticmethodr2   rI    r3   r1   r   r   '   s(    7y)-B B6r3   r   c                   L    e Zd ZdZeej                  j                  fd       Zy)UpdateAlphar   c                 .    t         j                  |        y)z-Registers alpha track flags for this command.N)r   r2   )r0   tracks     r1   r2   zUpdateAlpha.Argsa   s     KKr3   N)	rJ   rK   rL   rM   rP   r   ReleaseTrackALPHAr2   rQ   r3   r1   rS   rS   ]   s&    7**00  r3   rS   N)rM   
__future__r   r   r   .googlecloudsdk.api_lib.container.gkemulticloudr   r?   googlecloudsdk.callioper   (googlecloudsdk.command_lib.container.awsr   r   r	   2googlecloudsdk.command_lib.container.gkemulticloudr
   r   r   rN   ReleaseTracksrV   GAUpdateCommandr   rW   rS   rQ   r3   r1   <module>r`      s    A &  ' J ( G B K H L D	 D%%(()2T 2 *2j D%%++,&  -r3   