
    `8                         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	\R                  5      r " S
 S\5      r " S S\5      rg)z;Base class for gkemulticloud API clients for AWS resources.    )absolute_import)division)unicode_literals)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._NodePool3   s    NNHHM((=006""4(,,T2!44T:**40,,%%d+..t4''-F v}} 	<<FvF r1   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>R   s     6o}os   r   )
r   GetPodAddressCidrBlocksGetServiceAddressCidrBlocksr   GetVpcIdGetPerNodePoolSGRulesDisabledr'   r(   r   .GoogleCloudGkemulticloudV1AwsClusterNetworkingr)   r+   r-   s      r.   r&   !_AwsClientBase._ClusterNetworkingG   s     % = =d C$)$E$Ed$K##D)&/&M&M'
	F 6fmmo666 	EEOO r1   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	subnetIdsr:   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._ControlPlaneV   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 r1   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._Authorizationp   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   3GoogleCloudGkemulticloudV1AwsServicesAuthenticationrX   s      r.   rk   &_AwsClientBase._ServicesAuthentication   sZ    ''-$77=F v}}>>MM 
 r1   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   (GoogleCloudGkemulticloudV1AwsProxyConfigrX   s      r.   rr   _AwsClientBase._ProxyConfig   s^    006"::4@F v}} 	??I&I r1   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 $ )	Nr[   iops	kmsKeyArnsizeGib
volumeType
throughputr\   r   )r   GetMainVolumeIopsGetMainVolumeKmsKeyArnr   GetMainVolumeSizeGetMainVolumeTypeGetMainVolumeThroughputGetRootVolumeIopsGetRootVolumeKmsKeyArnGetRootVolumeSizeGetRootVolumeTypeGetRootVolumeThroughputr'   r(   r   +GoogleCloudGkemulticloudV1AwsVolumeTemplate)r)   r+   kindr-   s       r.   rq   _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 r1   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   /GoogleCloudGkemulticloudV1AwsDatabaseEncryptionrX   s      r.   rm   "_AwsClientBase._DatabaseEncryption   sP    9CCDIJF v}} 	FFPP r1   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   -GoogleCloudGkemulticloudV1AwsConfigEncryptionrX   s      r.   rl    _AwsClientBase._ConfigEncryption   sP    9AA$GHF v}} 	DDNvN r1   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   &GoogleCloudGkemulticloudV1AwsSshConfigrX   s      r.   rt   _AwsClientBase._SshConfig   sP    I66t<=F v}} 	==GG r1   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   $GoogleCloudGkemulticloudV1SpotConfigrX   s      r.   _SpotConfig_AwsClientBase._SpotConfig   sP    y==dCDF v}} 	;;EfE r1   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   .GoogleCloudGkemulticloudV1AwsInstancePlacementrX   s      r.   ro   !_AwsClientBase._InstancePlacement   sP    77=>F v}} 	EEOO r1   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   >GoogleCloudGkemulticloudV1AwsAutoscalingGroupMetricsCollectionrX   s      r.   _AutoScalingMetricsCollection,_AwsClientBase._AutoScalingMetricsCollection   sZ     AA$G2248F v}}>>XX 
 r1   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   +GoogleCloudGkemulticloudV1AwsNodeManagementrX   s      r.   r@   _AwsClientBase._NodeManagement   sR    e))$/F
 v}} 	BBLVL r1   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   (GoogleCloudGkemulticloudV1UpdateSettingsrX   s      r.   rC   _AwsClientBase._UpdateSettings   sR    ,,T2F
 v}} 	??I&I r1   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   'GoogleCloudGkemulticloudV1SurgeSettingsrX   s      r.   r   _AwsClientBase._SurgeSettings   s^    ++D177=F v}} 	>>HH r1   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 $ )Nr\   )r^   r`   	imageTypera   rb   rd   re   rf   
spotConfigrg   taintslabelsri   autoscalingMetricsCollectionr   )r   'GoogleCloudGkemulticloudV1AwsNodeConfigrl   r   rn   r   GetImageTypero   rp   rr   rq   rs   r   rt   GetNodeTaints_Labelsrw   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 r1   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   +GoogleCloudGkemulticloudV1NodeKubeletConfigrX   s      r.   r>   _AwsClientBase._KubeletConfig   sz    %FFtL <<TB&HHN!>>tD	F v}} 	BBLVL r1   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   0GoogleCloudGkemulticloudV1AwsNodePoolAutoscalingrX   s      r.   r<   #_AwsClientBase._NodePoolAutoscaling-  sZ    ))$/))$/F v}}>>JJ 
 r1   r   N)__name__
__module____qualname____firstlineno____doc__r/   rG   r&   r    r   rk   rr   rq   rm   rl   rt   r   ro   r   r@   rC   r   r=   r>   r<   __static_attributes__r   r1   r.   r
   r
      si    5*(44		(		4	r1   r
   c                   >   ^  \ rS rSrSrU 4S jrS rS rS rSr	U =r
$ )ClustersClienti9  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__<  s.    	.$(262LL??DM+Dr1   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.CreateA  sk    
..
O
O ..-1]];-M!!#002**40	 P C ==$$r1   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.GenerateAccessTokenK  s?    
..
_
_++- ` C ==//44r1   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.UpdateR  st    
..
N
N-1]];-M%%',,+>>
 **40 O C ==s##r1   r	  r  )r   r   r   r   r   r  r  r  r&  r   __classcell__r  s   @r.   r  r  9  s    9,
%5
$ 
$r1   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__b  s.    	/4)3F3LLLLDM,Dr1   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   BGkemulticloudProjectsLocationsAwsClustersAwsNodePoolsCreateRequestrA   rG   r  r  r   r  r  r  r)   rE   r+   r  s       r.   r  NodePoolsClient.Createg  sp    
..
[
[#22.2nn/
 ##%224**40 \ C ==$$r1   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.)r3  r   r!  r  )r   AGkemulticloudProjectsLocationsAwsClustersAwsNodePoolsPatchRequestrG   r  r   r#  !AWS_NODEPOOL_ARGS_TO_UPDATE_MASKSr   r  r  r%  r5  s       r.   r&  NodePoolsClient.Updates  sy    
..
Z
Z.2nn/
 ''),,+??
 **40 [ 	C ==s##r1   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  Rollbackr5  s       r.   rA  NodePoolsClient.Rollback  so    
..
]
]'')CG>>  DM  DM::4@ DM D
 ^ C ==!!#&&r1   r(  )r   r   r   r   r   r  r  r&  rA  r   r)  r*  s   @r.   r,  r,  _  s    ;-

%$' 'r1   r,  N)r   
__future__r   r   r   .googlecloudsdk.api_lib.container.gkemulticloudr   r   (googlecloudsdk.command_lib.container.awsr   r   2googlecloudsdk.command_lib.container.gkemulticloud
ClientBaser
   r  r,  r   r1   r.   <module>rH     sN    B &  ' A F G D[V&& [|#$^ #$L*'n *'r1   