
    7                         S r SSKJr  SSKJr  SSKJr  SSKJr   " S S\R                  5      r	 " S S\	5      r
 " S	 S
\	5      rg)z;Base class for gkemulticloud API clients for AWS resources.    )client)update_mask)flagsc                       \ rS rSrSrS rS rS rS rS r	S r
S	 rS
 rS rS rS rS rS rS rS rS rS rS rS rS rSrg)_AwsClientBase   z-Base class for AWS gkemulticloud API clients.c                 *   U R                   R                  nU R                  X#5      U R                  U5      [        R
                  " U5      U R                  U5      U R                  U5      [        R                  " U5      U R                  U5      [        R                  " U5      [        R                  " U5      UR                  U R                  U5      S.n[        UR!                  5       5      (       a  U R                   R                  " S0 UD6$ S $ )N)annotationsauthorization	awsRegionbinaryAuthorizationcontrolPlanedescriptionfleetloggingConfigmonitoringConfigname
networking )	_messages$GoogleCloudGkemulticloudV1AwsCluster_Annotations_Authorization	aws_flagsGetAwsRegion_BinaryAuthorization_ControlPlaner   GetDescription_Fleet
GetLoggingGetMonitoringConfigawsClustersId_ClusterNetworkinganyvalues)selfcluster_refargscluster_typekwargss        9lib/googlecloudsdk/api_lib/container/gkemulticloud/aws.py_Cluster_AwsClientBase._Cluster   s    >>FFL((<,,T2++D1#88>**40++D1T"))$/!55d;))--d3F v}} 	;;EfE     c                    U R                   R                  nU R                  X#5      U R                  U5      U R	                  U5      U R                  U5      U R                  U5      U R                  U5      UR                  [        R                  " U5      U R                  U5      [        R                  " U5      S.
n[        UR                  5       5      (       a  U R                   R                  " S0 UD6$ S $ )N)
r
   autoscalingconfigkubeletConfigmaxPodsConstraint
managementr   subnetIdupdateSettingsversionr   )r   %GoogleCloudGkemulticloudV1AwsNodePoolr   _NodePoolAutoscaling_NodeConfig_KubeletConfig_MaxPodsConstraint_NodeManagementawsNodePoolsIdr   GetSubnetID_UpdateSettingsGetNodeVersionr$   r%   )r&   node_pool_refr(   nodepool_typer*   s        r+   	_NodePool_AwsClientBase._NodePool0   s    NNHHM((=006""4(,,T2!44T:**40,,%%d+..t4''-F v}} 	<<FvF r.   c                 6   [         R                  " U5      [         R                  " U5      [        R                  " U5      [        R
                  " U5      S.n[        S UR                  5        5       5      (       a  U R                  R                  " S0 UD6$ S $ )N)podAddressCidrBlocksserviceAddressCidrBlocksvpcIdperNodePoolSgRulesDisabledc              3   (   #    U  H  oS Lv   M
     g 7f)Nr   ).0xs     r+   	<genexpr>4_AwsClientBase._ClusterNetworking.<locals>.<genexpr>O   s     6o}os   r   )
r   GetPodAddressCidrBlocksGetServiceAddressCidrBlocksr   GetVpcIdGetPerNodePoolSGRulesDisabledr$   r%   r   .GoogleCloudGkemulticloudV1AwsClusterNetworkingr&   r(   r*   s      r+   r#   !_AwsClientBase._ClusterNetworkingD   s     % = =d C$)$E$Ed$K##D)&/&M&M'
	F 6fmmo666 	EEOO r.   c                    U R                   R                  nU R                  U5      U R                  U5      U R	                  U5      [
        R                  " U5      U R                  U5      [
        R                  " U5      U R                  US5      U R                  U5      U R                  US5      [
        R                  " U5      U R                  U5      [
        R                  " U5      [        R                  " U5      U R!                  X5      S.n[#        UR%                  5       5      (       a  U R                   R                  " S0 UD6$ S $ )Nmainroot)awsServicesAuthenticationconfigEncryptiondatabaseEncryptioniamInstanceProfileinstancePlacementinstanceType
mainVolumeproxyConfig
rootVolumesecurityGroupIds	sshConfig	subnetIdsr7   tagsr   )r   )GoogleCloudGkemulticloudV1AwsControlPlane_ServicesAuthentication_ConfigEncryption_DatabaseEncryptionr   GetIamInstanceProfile_InstancePlacementGetInstanceType_VolumeTemplate_ProxyConfigGetSecurityGroupIds
_SshConfigGetSubnetIdsr   GetClusterVersion_Tagsr$   r%   )r&   r(   control_plane_typer*   s       r+   r   _AwsClientBase._ControlPlaneS   s   @@  &*%A%A$%G 2248"66t<'==dC!44T:!11$7**48((.**48%99$?__T*++D1**40

44F$ v}} 	@@J6J r.   c                    [         R                  " U5      n[         R                  " U5      nU(       d  U(       d  g 0 nU(       a-  U Vs/ s H  nU R                  R	                  US9PM     snUS'   U(       a-  U Vs/ s H  nU R                  R                  US9PM     snUS'   [        UR                  5       5      (       d  g U R                  R                  " S0 UD6$ s  snf s  snf )N)username
adminUsers)groupadminGroupsr   )	r   GetAdminUsersGetAdminGroupsr   (GoogleCloudGkemulticloudV1AwsClusterUser)GoogleCloudGkemulticloudV1AwsClusterGroupr$   r%   *GoogleCloudGkemulticloudV1AwsAuthorization)r&   r(   admin_usersadmin_groupsr*   ugs          r+   r   _AwsClientBase._Authorizationm   s    %%d+K''-L|F
 	 a ..
A
A B  	f\   a ..
B
B
B
Kf] v}}AA 	
	
s   	#C!=#C&c                     [         R                  " U5      [         R                  " U5      S.n[        UR	                  5       5      (       d  g U R
                  R                  " S0 UD6$ )N)roleArnroleSessionNamer   )r   
GetRoleArnGetRoleSessionNamer$   r%   r   3GoogleCloudGkemulticloudV1AwsServicesAuthenticationrU   s      r+   rh   &_AwsClientBase._ServicesAuthentication   sZ    ''-$77=F v}}>>MM 
 r.   c                     [         R                  " U5      [         R                  " U5      S.n[        UR	                  5       5      (       a  U R
                  R                  " S0 UD6$ S $ )N)	secretArnsecretVersionr   )r   GetProxySecretArnGetProxySecretVersionIdr$   r%   r   (GoogleCloudGkemulticloudV1AwsProxyConfigrU   s      r+   ro   _AwsClientBase._ProxyConfig   s^    006"::4@F v}} 	??I&I r.   c                    0 nUS:X  a~  [         R                  " U5      US'   [         R                  " U5      US'   [        R                  " U5      US'   [         R
                  " U5      US'   [         R                  " U5      US'   OUS:X  a}  [         R                  " U5      US'   [         R                  " U5      US'   [        R                  " U5      US'   [         R                  " U5      US'   [         R                  " U5      US'   [        UR                  5       5      (       a  U R                  R                  " S0 UD6$ S $ )	NrX   iops	kmsKeyArnsizeGib
volumeType
throughputrY   r   )r   GetMainVolumeIopsGetMainVolumeKmsKeyArnr   GetMainVolumeSizeGetMainVolumeTypeGetMainVolumeThroughputGetRootVolumeIopsGetRootVolumeKmsKeyArnGetRootVolumeSizeGetRootVolumeTypeGetRootVolumeThroughputr$   r%   r   +GoogleCloudGkemulticloudV1AwsVolumeTemplate)r&   r(   kindr*   s       r+   rn   _AwsClientBase._VolumeTemplate   s   Fv~ 2248fVn%<<TBf[11$7fY&88>f\&>>tDf\	 2248fVn%<<TBf[11$7fY&88>f\&>>tDf\ v}} 	BBLVL r.   c                     S[         R                  " U5      0n[        UR                  5       5      (       a  U R                  R
                  " S0 UD6$ S $ Nr   r   )r   GetDatabaseEncryptionKmsKeyArnr$   r%   r   /GoogleCloudGkemulticloudV1AwsDatabaseEncryptionrU   s      r+   rj   "_AwsClientBase._DatabaseEncryption   sP    9CCDIJF v}} 	FFPP r.   c                     S[         R                  " U5      0n[        UR                  5       5      (       a  U R                  R
                  " S0 UD6$ S $ r   )r   GetConfigEncryptionKmsKeyArnr$   r%   r   -GoogleCloudGkemulticloudV1AwsConfigEncryptionrU   s      r+   ri    _AwsClientBase._ConfigEncryption   sP    9AA$GHF v}} 	DDNvN r.   c                     S[         R                  " U5      0n[        UR                  5       5      (       a  U R                  R
                  " S0 UD6$ S $ )N
ec2KeyPairr   )r   GetSshEC2KeyPairr$   r%   r   &GoogleCloudGkemulticloudV1AwsSshConfigrU   s      r+   rq   _AwsClientBase._SshConfig   sP    I66t<=F v}} 	==GG r.   c                     S[         R                  " U5      0n[        UR                  5       5      (       a  U R                  R
                  " S0 UD6$ S $ )NinstanceTypesr   )r   GetSpotInstanceTypesr$   r%   r   $GoogleCloudGkemulticloudV1SpotConfigrU   s      r+   _SpotConfig_AwsClientBase._SpotConfig   sP    y==dCDF v}} 	;;EfE r.   c                     S[         R                  " U5      0n[        UR                  5       5      (       a  U R                  R
                  " S0 UD6$ S $ )Ntenancyr   )r   GetInstancePlacementr$   r%   r   .GoogleCloudGkemulticloudV1AwsInstancePlacementrU   s      r+   rl   !_AwsClientBase._InstancePlacement   sP    77=>F v}} 	EEOO r.   c                     [         R                  " U5      [         R                  " U5      S.n[        UR	                  5       5      (       d  g U R
                  R                  " S0 UD6$ )N)granularitymetricsr   )r    GetAutoscalingMetricsGranularityGetAutoscalingMetricsr$   r%   r   >GoogleCloudGkemulticloudV1AwsAutoscalingGroupMetricsCollectionrU   s      r+   _AutoScalingMetricsCollection,_AwsClientBase._AutoScalingMetricsCollection   sZ     AA$G2248F v}}>>XX 
 r.   c                     S[         R                  " U5      0n[        UR                  5       5      (       a  U R                  R
                  " S0 UD6$ S $ )N
autoRepairr   )r   GetAutoRepairr$   r%   r   +GoogleCloudGkemulticloudV1AwsNodeManagementrU   s      r+   r=   _AwsClientBase._NodeManagement   sR    e))$/F
 v}} 	BBLVL r.   c                     SU R                  U5      0n[        UR                  5       5      (       a  U R                  R                  " S0 UD6$ S $ )NsurgeSettingsr   )_SurgeSettingsr$   r%   r   (GoogleCloudGkemulticloudV1UpdateSettingsrU   s      r+   r@   _AwsClientBase._UpdateSettings   sR    ,,T2F
 v}} 	??I&I r.   c                     [         R                  " U5      [         R                  " U5      S.n[        UR	                  5       5      (       a  U R
                  R                  " S0 UD6$ S $ )N)maxSurgemaxUnavailabler   )r   GetMaxSurgeUpdateGetMaxUnavailableUpdater$   r%   r   'GoogleCloudGkemulticloudV1SurgeSettingsrU   s      r+   r   _AwsClientBase._SurgeSettings   s^    ++D177=F v}} 	>>HH r.   c                    U R                   R                  nU R                  U5      [        R                  " U5      [
        R                  " U5      U R                  U5      [        R                  " U5      U R                  U5      U R                  US5      [        R                  " U5      U R                  U5      U R                  U5      [
        R                  " U5      U R                  X5      U R!                  X5      U R#                  U5      S.n[%        UR'                  5       5      (       a  U R                   R                  " S0 UD6$ S $ )NrY   )r[   r]   	imageTyper^   r_   ra   rb   rc   
spotConfigrd   taintslabelsrf   autoscalingMetricsCollectionr   )r   'GoogleCloudGkemulticloudV1AwsNodeConfigri   r   rk   r   GetImageTyperl   rm   ro   rn   rp   r   rq   GetNodeTaints_Labelsrt   r   r$   r%   )r&   r(   node_config_typer*   s       r+   r:   _AwsClientBase._NodeConfig  s   ~~MM 2248'==dC''-!44T:!11$7((.**48%99$?&&t,__T*%%d+,,t6

42(,(J(J)
F( v}} 	>>HH r.   c                 (   [         R                  " U5      [         R                  " U5      [         R                  " U5      [         R                  " U5      S.n[        UR                  5       5      (       a  U R                  R                  " S0 UD6$ S $ )N)cpuManagerPolicycpuCfsQuotacpuCfsQuotaPeriodpodPidsLimitr   )	r    GetKubeletConfigCpuManagerPolicyGetKubeletConfigCpuCfsQuota!GetKubeletConfigCpuCfsQuotaPeriodGetKubeletConfigPodPidsLimitr$   r%   r   +GoogleCloudGkemulticloudV1NodeKubeletConfigrU   s      r+   r;   _AwsClientBase._KubeletConfig  sz    %FFtL <<TB&HHN!>>tD	F v}} 	BBLVL r.   c                     [         R                  " U5      [         R                  " U5      S.n[        UR	                  5       5      (       d  g U R
                  R                  " S0 UD6$ )N)minNodeCountmaxNodeCountr   )r   GetMinNodesGetMaxNodesr$   r%   r   0GoogleCloudGkemulticloudV1AwsNodePoolAutoscalingrU   s      r+   r9   #_AwsClientBase._NodePoolAutoscaling*  sZ    ))$/))$/F v}}>>JJ 
 r.   r   N)__name__
__module____qualname____firstlineno____doc__r,   rD   r#   r   r   rh   ro   rn   rj   ri   rq   r   rl   r   r=   r@   r   r:   r;   r9   __static_attributes__r   r.   r+   r   r      si    5*(44		(		4	r.   r   c                   >   ^  \ rS rSrSrU 4S jrS rS rS rSr	U =r
$ )ClustersClienti6  z1Client for AWS Clusters in the gkemulticloud API.c                 r   > [         [        U ]
  " S0 UD6  U R                  R                  U l        SU l        g )NawsClustersr   )superr   __init___clientprojects_locations_awsClusters_service_list_result_fieldr&   r*   	__class__s     r+   r  ClustersClient.__init__9  s.    	.$(262LL??DM+Dr.   c                    U R                   R                  UR                  U R                  X5      UR	                  5       R                  5       [        R                  " U5      S9nU R                  R                  U5      $ )z!Creates an Anthos cluster on AWS.)awsClusterId$googleCloudGkemulticloudV1AwsClusterparentvalidateOnly)
r   6GkemulticloudProjectsLocationsAwsClustersCreateRequestr"   r,   ParentRelativeNamer   GetValidateOnlyr  Creater&   r'   r(   reqs       r+   r  ClustersClient.Create>  sk    
..
O
O ..-1]];-M!!#002**40	 P C ==$$r.   c                     U R                   R                  UR                  5       S9nU R                  R	                  U5      $ )z7Generates an access token for an Anthos cluster on AWS.)
awsCluster)r   FGkemulticloudProjectsLocationsAwsClustersGenerateAwsAccessTokenRequestr  r  GenerateAwsAccessToken)r&   r'   r  s      r+   GenerateAccessToken"ClustersClient.GenerateAccessTokenH  s?    
..
_
_++- ` C ==//44r.   c                    U R                   R                  U R                  X5      UR                  5       [        R
                  " U[        R                  5      [        R                  " U5      S9nU R                  R                  U5      $ )z!Updates an Anthos cluster on AWS.)r  r   
updateMaskr  )r   5GkemulticloudProjectsLocationsAwsClustersPatchRequestr,   r  r   GetUpdateMask AWS_CLUSTER_ARGS_TO_UPDATE_MASKSr   r  r  Patchr  s       r+   UpdateClustersClient.UpdateO  st    
..
N
N-1]];-M%%',,+>>
 **40 O C ==s##r.   r  r  )r   r   r   r   r   r  r  r  r#  r   __classcell__r  s   @r+   r   r   6  s    9,
%5
$ 
$r.   r   c                   >   ^  \ rS rSrSrU 4S jrS rS rS rSr	U =r
$ )NodePoolsClienti\  z3Client for AWS node pools in the gkemulticloud API.c                 r   > [         [        U ]
  " S0 UD6  U R                  R                  U l        SU l        g )NawsNodePoolsr   )r  r)  r  r  +projects_locations_awsClusters_awsNodePoolsr  r  r  s     r+   r  NodePoolsClient.__init___  s.    	/4)3F3LLLLDM,Dr.   c                    U R                   R                  UR                  U R                  X5      UR	                  5       R                  5       [        R                  " U5      S9nU R                  R                  U5      $ )z1Creates an node pool in an Anthos cluster on AWS.)awsNodePoolId%googleCloudGkemulticloudV1AwsNodePoolr  r  )
r   BGkemulticloudProjectsLocationsAwsClustersAwsNodePoolsCreateRequestr>   rD   r  r  r   r  r  r  r&   rB   r(   r  s       r+   r  NodePoolsClient.Created  sp    
..
[
[#22.2nn/
 ##%224**40 \ C ==$$r.   c                    U R                   R                  U R                  X5      UR                  5       [        R
                  " U[        R                  5      [        R                  " U5      S9nU R                  R                  U5      $ )z0Updates a node pool in an Anthos cluster on AWS.)r0  r   r  r  )r   AGkemulticloudProjectsLocationsAwsClustersAwsNodePoolsPatchRequestrD   r  r   r   !AWS_NODEPOOL_ARGS_TO_UPDATE_MASKSr   r  r  r"  r2  s       r+   r#  NodePoolsClient.Updatep  sy    
..
Z
Z.2nn/
 ''),,+??
 **40 [ 	C ==s##r.   c                     U R                   R                  UR                  5       U R                   R                  [        R
                  " U5      S9S9nU R                  R                  U5      $ )z3Rolls back a node pool in an Anthos cluster on AWS.)
respectPdb)r   :googleCloudGkemulticloudV1RollbackAwsNodePoolUpdateRequest)r   DGkemulticloudProjectsLocationsAwsClustersAwsNodePoolsRollbackRequestr  :GoogleCloudGkemulticloudV1RollbackAwsNodePoolUpdateRequestr   GetRespectPodDisruptionBudgetr  Rollbackr2  s       r+   r>  NodePoolsClient.Rollback~  so    
..
]
]'')CG>>  DM  DM::4@ DM D
 ^ C ==!!#&&r.   r%  )r   r   r   r   r   r  r  r#  r>  r   r&  r'  s   @r+   r)  r)  \  s    ;-

%$' 'r.   r)  N)r   .googlecloudsdk.api_lib.container.gkemulticloudr   r   (googlecloudsdk.command_lib.container.awsr   r   2googlecloudsdk.command_lib.container.gkemulticloud
ClientBaser   r   r)  r   r.   r+   <module>rD     sH    B B F G D[V&& [|#$^ #$L*'n *'r.   