
                  
       >   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  SS
KJr  S rS rS rS r\R.                  " S\R0                  " 5       R2                  R4                  S S9rSrSR;                  SR=                  \R>                   V s/ s H  n \" U 5      PM     sn 5      5      r Sr!\RD                  \RF                  /r$\RJ                  \RD                  \RF                  /r&\R.                  " S\R0                  " 5       RN                  RP                  S S9r)S r*S r+S r,S r-SS jr.S r/S r0S r1S  r2SS! jr3S" r4SS# jr5S$ r6SS% jr7S& r8S' r9S( r:SS) jr;S* r<S+ r=S, r>SS- jr?S. r@SS/ jrAS0 rBS1 rCS2 rDS3 rES4 rFS5 rGS6 rHS7 rIS8 rJSS9 jrKS: rLS; rMS< rNS= rOS> rPS? rQS@ rRSA rSSB rTSC rUSD rVSE rWSF rXSG rYSH rZSI r[SJ r\SK r]SL r^SM r_SN r`SO raSP rbSQ rcSR rdSS reST rfSU rgSV rhSW riSX rjSY rkSZ rlSS[ jrmS\ rnS] roS^ rpS_ rqS` rrSSa jrsSSb jrtSc ruSd rvSe rwSf rxSg rySh rzSi r{Sj r|Sk r}Sl r~Sm rSn rSSo jrSp rSq rSr r SSs jrSt rSu rSv rSw rSx rSy rSz rS{ rS| rS} rS~ rSS jrS rS rS rS rS rgs  sn f )z;Helpers for flags in commands working with GKE Multi-cloud.    )absolute_import)division)unicode_literalsN)util)arg_parsers)	constants)	arg_utils)
propertiesc                 T    U R                  S5      nSR                  S U 5       5      $ )z'Converts hyphen-case name to CamelCase.- c              3   @   #    U  H  oR                  5       v   M     g 7f)N)title).0xs     ?lib/googlecloudsdk/command_lib/container/gkemulticloud/flags.py	<genexpr>_ToCamelCase.<locals>.<genexpr>"   s     *EqEs   )splitjoinnamepartss     r   _ToCamelCaser      s$    
**S/%	*E*	**    c                 b    U R                  S5      nSR                  U5      R                  5       $ )z(Converts hyphen-case name to SNAKE_CASE.r   _)r   r   upperr   s     r   _ToSnakeCaseUpperr   %   &    
**S/%	%			  r   c                 b    U R                  S5      nSR                  U5      R                  5       $ )z#Converts SNAKE_CASE to hyphen-case.r   r   )r   r   lowerr   s     r   _ToHyphenCaser#   +   r    r   c                 N    [         R                  " SR                  XU5      5      $ )Nz&Invalid value [{}] for argument {}. {})r   ArgumentTypeErrorformat)valueflagdetails      r   _InvalidValueErrorr*   1   s%    		&	&.55e6J
 r   --node-taintsc                     SU ;  $ NUNSPECIFIED )effects    r   <lambda>r1   :   s	    -v"=r   )include_filterz)Node taint is of format key=value:effect.zEffect must be one of: {}.z, zIReplica placement is of format subnetid:zone, for example subnetid12345:1--binauthz-evaluation-modec                     SU ;  $ r-   r/   )modes    r   r1   r1   R   s	    T 9r   c                 &    U R                  SSSS9  g)z(Adds the --pod-address-cidr-blocks flag.z--pod-address-cidr-blocksTzQIP address range for the pods in this cluster in CIDR notation (e.g. 10.0.0.0/8).requiredhelpNadd_argumentparsers    r   AddPodAddressCidrBlocksr>   V   s     !(	  r   c                 4    [        U SS5      nU(       a  U/$ / $ )z1Gets the value of --pod-address-cidr-blocks flag.pod_address_cidr_blocksNgetattrargscidr_blockss     r   GetPodAddressCidrBlocksrF   b   s     7>+%+-2-r   c                 &    U R                  SSSS9  g)z+Add the --service-address-cidr-blocks flag.z--service-address-cidr-blocksTzIIP address range for the services IPs in CIDR notation (e.g. 10.0.0.0/8).r7   Nr:   r<   s    r   AddServiceAddressCidrBlocksrH   h   s     %	  r   c                 4    [        U SS5      nU(       a  U/$ / $ )z5Gets the value of --service-address-cidr-blocks flag.service_address_cidr_blocksNrA   rC   s     r   GetServiceAddressCidrBlocksrK   t   s     ;TB+%+-2-r   c                 D    U R                  SUSR                  U5      S9  g)zAdd the --subnet-id flag.z--subnet-idz,Subnet ID of an existing VNET to use for {}.r7   Nr;   r&   )r=   	help_textr8   s      r   AddSubnetIDrO   z   s)    9@@K  r   c                     [        U SS 5      $ )N	subnet_idrA   rD   s    r   GetSubnetIDrS          	{D	))r   c                 B    U R                  SSR                  U5      S9  g)zAdd an output file argument.

Args:
  parser: The argparse.parser to add the output file argument to.
  help_action: str, describes the action of what will be stored.
z--output-filezPath to the output file {}.r9   NrM   r=   help_actions     r   AddOutputFilerY      s(     	9@@M  r   c                 D    U R                  SSSR                  U5      S9  g)zAdd the --validate-only argument.

Args:
  parser: The argparse.parser to add the argument to.
  help_action: str, describes the action that will be validated.
z--validate-only
store_truez/Validate the {}, but don't actually perform it.actionr9   NrM   rW   s     r   AddValidateOnlyr^      s.     	<CC
  r   c                     [        U SS 5      $ )Nvalidate_onlyrA   rR   s    r   GetValidateOnlyra          		--r   c                 D    SnU(       a  US-  nU R                  SSS US9  g )NzzEnable node autorepair feature for a node pool. Use --no-enable-autorepair to disable.

  $ {command} --enable-autorepair
z)
Node autorepair is disabled by default.
z--enable-autorepairr[   r]   defaultr9   r:   r=   
for_createrN   s      r   AddEnableAutoRepairrh      s;    )
   I 	L$Y  r   c                     [        U SS 5      $ )Nenable_autorepairrA   rR   s    r   GetAutoRepairrk          	*D	11r   c                 &    U R                  SUSS9  g )Nz--cluster-versionz*Kubernetes version to use for the cluster.r7   r:   r=   r8   s     r   AddClusterVersionro      s    7  r   c                     [        U SS 5      $ )Ncluster_versionrA   rR   s    r   GetClusterVersionrr          	($	//r   c                 &    U R                  SUSS9  g )Nz--descriptionzDescription for the cluster.r7   r:   rn   s     r   AddDescriptionru      s    /M  r   c                     [        U SS 5      $ )NdescriptionrA   rR   s    r   GetDescriptionrx          	}d	++r   c                 (    U R                  SSSSS9  g)zaAdds the --clear-description flag.

Args:
  parser: The argparse.parser to add the arguments to.
z--clear-descriptionr[   Nz&Clear the description for the cluster.rd   r:   r<   s    r   AddClearDescriptionr{      s#     	3	  r   c                 P    U R                  SSS9n[        U5        [        U5        g)ziAdds description related flags for update.

Args:
  parser: The argparse.parser to add the arguments to.
DescriptionTmutexN)	add_groupru   r{   r=   groups     r   AddDescriptionForUpdater      s)     

=

5%er   c                 j    U R                  S[        R                  " SS9SSR                  U5      S9  g )Nz--annotations   
min_length
ANNOTATIONzAnnotations for the {}.typemetavarr9   )r;   r   ArgDictr&   r=   nouns     r   AddAnnotationsr      s7    !,$++D1	  r   c                 F    U R                  SSSSR                  U5      S9  g)zAdds flag for clearing the annotations.

Args:
  parser: The argparse.parser to add the arguments to.
  noun: The resource type to which the flag is applicable.
z--clear-annotationsr[   Nz!Clear the annotations for the {}.rd   rM   r   s     r   AddClearAnnotationsr      s.     	.55d;	  r   c                 .    [        U SS 5      =(       d    0 $ )NannotationsrA   rR   s    r   GetAnnotationsr         	}d	+	1r1r   c                 P    U R                  SSS9n[        X!5        [        X!5        g)zAdds annotations related flags for update.

Args:
  parser: The argparse.parser to add the arguments to.
  noun: The resource type to which the flag is applicable.
AnnotationsTr~   N)r   r   r   r=   r   r   s      r   AddAnnotationsForUpdater     s)     

=

5%e"r   c                 &    U R                  SUSS9  g )Nz--node-versionz,Kubernetes version to use for the node pool.r7   r:   rn   s     r   AddNodeVersionr     s    9  r   c                     [        U SS 5      $ )Nnode_versionrA   rR   s    r   GetNodeVersionr         	~t	,,r   c                 |    U R                  SUS9nUR                  SU[        SS9  UR                  SU[        SS9  g)	zAdds node pool autoscaling flags.

Args:
  parser: The argparse.parser to add the arguments to.
  required: bool, whether autoscaling flags are required.
zNode pool autoscaling)r8   z--min-nodesz)Minimum number of nodes in the node pool.)r8   r   r9   z--max-nodesz)Maximum number of nodes in the node pool.N)add_argument_groupr;   int)r=   r8   r   s      r   AddAutoscalingr     sZ     
#
#$;h
#
O%6	   6	  r   c                 @    SnSnU R                   nU R                  nX4$ )Nr   )	min_nodes	max_nodes)rD   r   r   s      r   GetAutoscalingParamsr   4  s'    ))nn)nn)
	r   c                     [        U SS 5      $ )Nr   rA   rR   s    r   GetMinNodesr   =  rT   r   c                     [        U SS 5      $ )Nr   rA   rR   s    r   GetMaxNodesr   A  rT   r   c                 0    U R                  S[        SSS9  g )Nz--max-pods-per-nodez Maximum number of pods per node.T)r   r9   r8   r;   r   r<   s    r   AddMaxPodsPerNoder   E  s!    -	  r   c                     [        U SS 5      $ )Nmax_pods_per_noderA   rR   s    r   GetMaxPodsPerNoder   N  rl   r   c                 $    U R                  SSS9  g )Nz--azure-availability-zonez<Azure availability zone where the node pool will be created.rV   r:   r<   s    r   AddAzureAvailabilityZoner   R  s    !I  r   c                     [        U SS 5      $ )Nazure_availability_zonerA   rR   s    r   GetAzureAvailabilityZoner   Y      	0$	77r   c                 $    U R                  SSS9  g )Nz	--vm-sizez1Azure Virtual Machine Size (e.g. Standard_DS1_v).rV   r:   r<   s    r   	AddVMSizer   ]  s    K  r   c                     [        U SS 5      $ )Nvm_sizerA   rR   s    r   	GetVMSizer   c      	y$	''r   c                 &    U R                  SUSS9  g )Nz--ssh-public-keyz)SSH public key to use for authentication.r7   r:   rn   s     r   AddSSHPublicKeyr   g  s    6  r   c                     [        U SS 5      $ )Nssh_public_keyrA   rR   s    r   GetSSHPublicKeyr   o  s    	'	..r   c                 P    U R                  S[        R                  " / SQSS9SS9  g )Nz--root-volume-sizeGBGiBTBTiBGisuggested_binary_size_scalesdefault_unitzSize of the root volume. The value must be a whole number followed by a size unit of `GB` for gigabyte, or `TB` for terabyte. If no size unit is specified, GB is assumed.r   r9   r;   r   
BinarySizer<   s    r   AddRootVolumeSizer   s  1    !!'A
4  r   c                 H    [        U SS 5      nU(       d  g [        U5      S-	  $ )Nroot_volume_size   rB   r   rD   sizes     r   GetRootVolumeSizer     '    	)4	0$	 
Tbr   c                 P    U R                  S[        R                  " / SQSS9SS9  g )Nz--main-volume-sizer   r   r   zSize of the main volume. The value must be a whole number followed by a size unit of `GB` for gigabyte, or `TB` for terabyte. If no size unit is specified, GB is assumed.r   r   r<   s    r   AddMainVolumeSizer     r   r   c                 H    [        U SS 5      nU(       d  g [        U5      S-	  $ )Nmain_volume_sizer   r   r   s     r   GetMainVolumeSizer     r   r   c                     SR                  XR                  SS5      R                  5       5      nU R                  S[        R
                  " SS9SUS9  g )	Nzz  Applies the given tags (comma separated) on the {0}. Example:

    $ {{command}} EXAMPLE_{1} --tags=tag1=one,tag2=two
   r   --tagsr   r   TAGr   )r&   replacer   r;   r   r   )r=   r   rN   s      r   AddTagsr     sX     fT<<S)//12	  	!,	  r   c                 F    U R                  SSSSR                  U5      S9  g)zAdds flag for clearing the tags.

Args:
  parser: The argparse.parser to add the arguments to.
  noun: The resource type to which the flag is applicable.
z--clear-tagsr[   Nz/Clear any tags associated with the {}'s nodes. rd   rM   r   s     r   AddClearTagsr     s.     	<CCDI	  r   c                 P    U R                  SSS9n[        X!5        [        X!5        g)zAdds tags related flags for update.

Args:
  parser: The argparse.parser to add the arguments to.
  noun: The resource type to which the flags are applicable.
TagsTr~   N)r   r   r   r   s      r   AddTagsForUpdater     s)     

6

.%	%ur   c                 .    [        U SS 5      =(       d    0 $ )NtagsrA   rR   s    r   GetTagsr     s    	vt	$	**r   c                 $    U R                  SSS9  g)z^Adds database encryption flags.

Args:
  parser: The argparse.parser to add the arguments to.
z--database-encryption-key-idzbURL the of the Azure Key Vault key (with its version) to use to encrypt / decrypt cluster secrets.rV   Nr:   r<   s    r   AddDatabaseEncryptionr     s     	$9  r   c                     [        U SS 5      $ )Ndatabase_encryption_key_idrA   rR   s    r   GetDatabaseEncryptionKeyIdr     s    	3T	::r   c                 D    U R                  SSS9  U R                  SSS9  g)z\Adds config encryption flags.

Args:
  parser: The argparse.parser to add the arguments to.
z--config-encryption-key-idz^URL the of the Azure Key Vault key (with its version) to use to encrypt / decrypt config data.rV   z--config-encryption-public-keyzLRSA key of the Azure Key Vault public key to use for encrypting config data.Nr:   r<   s    r   AddConfigEncryptionr     s<     	"5   	&  r   c                     [        U SS 5      $ )Nconfig_encryption_key_idrA   rR   s    r   GetConfigEncryptionKeyIdr     s    	14	88r   c                     [        U SS 5      $ )Nconfig_encryption_public_keyrA   rR   s    r   GetConfigEncryptionPublicKeyr     s    	5t	<<r   c                 L    U R                  S[        R                  " SS9SSS9  g)zAdds the --node-labels flag.z--node-labelsr   r   
NODE_LABELz)Labels assigned to the node pool's nodes.r   Nr;   r   r   r<   s    r   AddNodeLabelsr     s,    !,6	  r   c                 .    [        U SS 5      =(       d    0 $ )Nnode_labelsrA   rR   s    r   GetNodeLabelsr     r   r   c                 (    U R                  SSSSS9  g)z"Adds the --clear-node-labels flag.z--clear-node-labelsr[   Nz3Clear the labels assigned to the node pool's nodes.rd   r:   r<   s    r   AddClearNodeLabelsr    s!    @	  r   c                 P    U R                  SSS9n[        U5        [        U5        g)z*Adds node labels related flags for update.zNode labelsTr~   N)r   r   r  r   s     r   AddNodeLabelsForUpdater    s'    


=

5%Ur   c                 |    U R                  S5      n[        U5      S:w  a  [        U S[        5      eUS   US   p2X#4$ )zValidates the node taint format.

Node taint is of format key=value:effect.

Args:
  taint: Node taint.

Returns:
  The node taint value and effect if the format is valid.

Raises:
  ArgumentError: If the node taint format is invalid.
:   r+   r   r   )r   lenr*   _TAINT_FORMAT_HELP)taintstrsr'   r0   s       r   _ValidateNodeTaintFormatr  "  sD     
S	$Y!^
UO5G
HHq'47	r   c                     [        U 5      u  p[        R                   Vs/ s H  n[        U5      PM     nnX$;  a  [	        US[
        5      eU $ s  snf )a  Validates the node taint.

Node taint is of format key=value:effect. Valid values for effect include
NoExecute, NoSchedule, PreferNoSchedule.

Args:
  taint: Node taint.

Returns:
  The node taint if it is valid.

Raises:
  ArgumentError: If the node taint is invalid.
r+   )r  _TAINT_EFFECT_ENUM_MAPPERchoicesr   r*   _TAINT_EFFECT_HELP)r
  unused_valuer0   eeffectss        r   _ValidateNodeTaintr  7  sR     2%8,&?&G&GH&G\!_&G'H
V_6H
II	, Is   Ac           	          U R                  S[        R                  " S[        S9SSR	                  [
        [        5      S9  g )Nr+   r   )r   
value_type
NODE_TAINTz0Taints assigned to nodes of the node pool. {} {}r   )r;   r   r   r  r&   r	  r  r<   s    r   AddNodeTaintsr  M  s@    !8JK
<
C
C "4  	r   c                 v   / n[         R                   Vs0 s H  n[        U5      U_M     nn[        U SS5      nU(       as  UR	                  5        H_  u  pV[        U5      u  pxX8   n[         R                  U5      n[        R                  " 5       R                  XWUS9n	UR                  U	5        Ma     U$ s  snf )zGets node taint objects from the arguments.

Args:
  args: Arguments parsed from the command.

Returns:
  The list of node taint objects.

Raises:
  ArgumentError: If the node taint format is invalid.
node_taintsN)keyr'   r0   )r  r  r   rB   itemsr  GetEnumForChoiceapi_utilGetMessagesModule#GoogleCloudGkemulticloudV1NodeTaintappend)
rD   taintsr  taint_effect_mapr  kvr'   r0   r
  s
             r   GetNodeTaintsr&  Z  s     &";"C"C"CQl1oq"C   mT2+!!#.q1me'f(99&Af((*NNV O e mmE $ 
-s   B6c                     U R                  S5      n[        U5      S:w  a  [        U S[        5      eUS   US   p2[        R
                  " 5       R                  X2S9$ )aB  Converts a colon-delimited string to a GoogleCloudGkemulticloudV1ReplicaPlacement instance.

Replica placement is of format subnetid:zone.

Args:
  replicaplacement: Replica placement.

Returns:
  A GoogleCloudGkemulticloudV1ReplicaPlacement instance.

Raises:
  ArgumentError: If the Replica placement format is invalid.
r  r  --replica-placementsr   r   )azureAvailabilityZonesubnetId)r   r  r*   _REPLICAPLACEMENT_FORMAT_HELPr  r  *GoogleCloudGkemulticloudV1ReplicaPlacement)replicaplacementr  subnetidzones       r   _ReplicaPlacementStrToObjectr0  w  sk     
			$$Y!^
02O  7DGD  "MM $ N r   c                 z    U R                  S[        R                  " [        S9SSR	                  [
        5      S9  g )Nr(  )element_typeREPLICA_PLACEMENTz1Placement info for the control plane replicas. {}r   )r;   r   ArgListr0  r&   r+  r<   s    r   AddReplicaPlacementsr5    s;    ,HI!
=
D
D+  	r   c                 2    [        U SS 5      nU(       a  U$ / $ )Nreplica_placementsrA   )rD   r7  s     r   GetReplicaPlacementsr8    s     t%94@1	9r9r   c                 &    U R                  SSSS9  g )Nz--auth-provider-cmd-pathTzAPath to the executable for the auth provider field in kubeconfig.)hiddenr9   r:   r<   s    r   AddAuthProviderCmdPathr;    s     N  r   c                 j    U R                  S5      nUR                  SSSS9  UR                  SSSS9  g)	z]Add proxy configuration flags.

Args:
  parser: The argparse.parser to add the arguments to.
zProxy configz--proxy-resource-group-idTz?The ARM ID the of the resource group containing proxy keyvault.r7   z--proxy-secret-idz9The URL the of the proxy setting secret with its version.N)r   r;   r   s     r   AddProxyConfigr=    sN     
#
#N
3%!L  
 F  r   c                     [        U SS 5      $ )Nproxy_resource_group_idrA   rR   s    r   GetProxyResourceGroupIdr@    r   r   c                     [        U SS 5      $ )Nproxy_secret_idrA   rR   s    r   GetProxySecretIdrC    rs   r   c                 n    U R                  S[        R                  " [        R                  S5      SSS9  g )Nz--fleet-projectz=--fleet-project must be a valid project ID or project number.TzGID or number of the Fleet host project where the cluster is registered.)r   r8   r9   )r;   r   CustomFunctionValidatorproject_utilValidateProjectIdentifierr<   s    r   AddFleetProjectrH    s<    ..

0
0
I   r   c                     [        U SS5      nU(       d  gUR                  5       (       d%  SR                  [        R                  " U5      5      $ SR                  U5      $ )aL  Gets and parses the fleet project argument.

Project ID if specified is converted to project number. The parsed fleet
project has format projects/<project-number>.

Args:
  args: Arguments parsed from the command.

Returns:
  The fleet project in format projects/<project-number>
  or None if the fleet projectnot is not specified.
fleet_projectNzprojects/{})rB   isdigitr&   rF  GetProjectNumber)rD   ps     r   GetFleetProjectrN    sP     dOT*!	
	
 = =a @AA			a	  r   c                 (    U R                  SSSSS9  g )Nz--private-endpointFr[   z+If set, use private VPC for authentication.re   r]   r9   r:   r<   s    r   AddPrivateEndpointrQ    s!    8	  r   c                 (    U R                  SSSSS9  g )Nz--exec-credentialFr[   zBIf set, format access token as a Kubernetes execCredential object.rP  r:   r<   s    r   AddExecCredentialrS    s!    O	  r   c                 h    SnU(       a  US-  nU R                  S[        R                  " SS9SUS9  g )Nz=Users that can perform operations as a cluster administrator.z> If not specified, the value of property core/account is used.z--admin-usersr   r   USERr   r;   r   r4  )r=   createhelp_txts      r   AddAdminUsersrY    s?    L(PPH!,	  r   c                     [        U S5      (       d  g U R                  (       a  U R                  $ [        R                  R                  R
                  R                  5       /$ )Nadmin_users)hasattrr[  r
   VALUEScoreaccount	GetOrFailrR   s    r   GetAdminUsersra  
  sK    	}	%	%	



 
 
(
(
2
2
4	55r   c                 P    U R                  SSS9n[        U5        [        U5        g)zoAdds admin group configuration flags for update.

Args:
  parser: The argparse.parser to add the arguments to.
zAdmin groupsTr~   N)r   AddAdminGroupsAddClearAdminGroupsr   s     r   AddAdminGroupsForUpdatere    s)     

>

6%er   c                 T    SnU R                  S[        R                  " 5       SSUS9  g )NzI
Groups of users that can perform operations as a cluster administrator.
z--admin-groupsGROUPF)r   r   r8   r9   rV  )r=   rX  s     r   rc  rc    s6    ( 	   r   c                 (    U R                  SSSSS9  g)z]Adds the --clear-admin-groups.

Args:
  parser: The argparse.parser to add the arguments to.
z--clear-admin-groupsr[   Nz2Clear the admin groups associated with the clusterrd   r:   r<   s    r   rd  rd  -  s#     	?	  r   c                 b    [        U S5      (       d  g U R                  (       a  U R                  $ g )Nadmin_groups)r\  rj  rR   s    r   GetAdminGroupsrk  ;  s*    	~	&	&		r   c                     Sn/ nU(       a  [         nUS-  nO[        nU R                  S[        R                  " SUS9SUS9  g)	zAdds the --logging flag.z
Set the components that have logging enabled.

Examples:

  $ {command} --logging=SYSTEM
  $ {command} --logging=SYSTEM,WORKLOADz
  $ {command} --logging=NONE
	--loggingr   )r   r  	COMPONENTr   N)_ALLOW_DISABLE_LOGGING_CHOICES_LOGGING_CHOICESr;   r   r4  )r=   allow_disabledrN   logging_choicess       r   
AddLoggingrs  C  sZ    +) /4O  I 'O!_E	  r   c                 ,   [        U SS5      nU(       d  g[        R                  U;   aD  [        R                  U;   d  [        R                  U;   a  [        SR                  U5      SS5      e[        R                  " 5       nUR                  5       nUR                  n[        R                  U;   a2  U(       a  UR                  US9$ [        SR                  U5      SS5      e[        R                  U;  a  [        SR                  U5      SS5      e[        R                  U;   a%  UR                  R                  UR                  5        [        R                  U;   a%  UR                  R                  UR                  5        UR                  US9$ )	aG  Parses and validates the value of the --logging flag.

Args:
  args: Arguments parsed from the command.
  allow_disabled: If disabling logging is allowed for this cluster.

Returns:
  The logging config object as GoogleCloudGkemulticloudV1LoggingConfig.

Raises:
  ArgumentError: If the value of the --logging flag is invalid.
loggingN,rm  zFInvalid logging config. NONE is not supported with SYSTEM or WORKLOAD.)componentConfigz.Invalid logging config. NONE is not supported.z6Must include SYSTEM logging if any logging is enabled.)rB   r   NONESYSTEMWORKLOADr*   r   r  r  0GoogleCloudGkemulticloudV1LoggingComponentConfig(EnableComponentsValueListEntryValuesEnum'GoogleCloudGkemulticloudV1LoggingConfigenableComponentsr!  SYSTEM_COMPONENTS	WORKLOADS)rD   rq  ru  messagesconfigenums         r   
GetLoggingr  ^  sn    D)T*'	^^w'!Y%7%77%B
	  '')(DDF&		8	8$^^w==  >   
((7


:  W$
@ 
  
""4#9#9:7"
""4>>2		9	9 
: 
 r   c                 (    SnU R                  SUS9  g)zAdds the --image-type flag.z
Set the OS image type to use on node pool instances.

Examples:

  $ {command} --image-type=windows
  $ {command} --image-type=ubuntu
z--image-typerV   Nr:   r=   rN   s     r   AddImageTyper    s    ) 	n95r   c                     [        U SS 5      $ )N
image_typerA   rR   s    r   GetImageTyper    s    	|T	**r   c                 &    U R                  SSSS9  g )Nz--azure-regionTz_Azure location to deploy the cluster. Refer to your Azure subscription for available locations.r7   r:   r<   s    r   AddAzureRegionr    s!    F	  r   c                     [        U SS 5      $ )Nazure_regionrA   rR   s    r   GetAzureRegionr    r   r   c                 &    U R                  SSSS9  g )Nz--resource-group-idTz=ID of the Azure Resource Group to associate the cluster with.r7   r:   r<   s    r   AddResourceGroupIdr    s    J  r   c                     [        U SS 5      $ )Nresource_group_idrA   rR   s    r   GetResourceGroupIdr    rl   r   c                 &    U R                  SSSS9  g )Nz	--vnet-idTz>ID of the Azure Virtual Network to associate with the cluster.r7   r:   r<   s    r   	AddVnetIdr    s    K  r   c                     [        U SS 5      $ )Nvnet_idrA   rR   s    r   	GetVnetIdr    r   r   c                 $    U R                  SSS9  g )Nz!--service-load-balancer-subnet-idzARM ID of the subnet where Kubernetes private service type load balancers are deployed, when the Service lacks a subnet annotation.rV   r:   r<   s    r   AddServiceLoadBalancerSubnetIdr    s    )  r   c                     [        U SS 5      $ )Nservice_load_balancer_subnet_idrA   rR   s    r   GetServiceLoadBalancerSubnetIdr    s    	8$	??r   c                 $    U R                  SSS9  g )Nz--endpoint-subnet-idzARM ID of the subnet where the control plane load balancer is deployed. When unspecified, it defaults to the control plane subnet ID.rV   r:   r<   s    r   AddEndpointSubnetIdr    s      r   c                     [        U SS 5      $ )Nendpoint_subnet_idrA   rR   s    r   GetEndpointSubnetIdr    s    	+T	22r   c                     U R                  S5      nUR                  SUSS9  UR                  SUSS9  U(       d  [        U5        gg)z8Adds --azure-tenant-id and --azure-application-id flags.zAzure services authenticationz--azure-tenant-idz1ID of the Azure Tenant to manage Azure resources.r7   z--azure-application-idz6ID of the Azure Application to manage Azure resources.N)r   r;   AddClearClient)auth_config_grouprW  r   s      r   AddAzureServicesAuthenticationr    s_    

.
./N
O%>  
 C  
 
5 
r   c                 (    U R                  SSSSS9  g)z\Adds the --clear-client flag.

Args:
  parser: The argparse.parser to add the arguments to.
z--clear-clientr[   NzClear the Azure client. This flag is required when updating to use Azure workload identity federation from Azure client to manage  Azure resources.rd   r:   r<   s    r   r  r    s%     	  	r   c                     [        U SS 5      $ )Nazure_tenant_idrA   rR   s    r   GetAzureTenantIDr    rs   r   c                     [        U SS 5      $ )Nazure_application_idrA   rR   s    r   GetAzureApplicationIDr    s    	-t	44r   c                    SnSnSnU(       aO  U R                  SSSUS9  U(       a5  U R                  SS	S
9nUR                  SSSUS9  UR                  SSSUS9  ggU R                  SS	S
9nUR                  SSSSS9  UR                  SSSSS9  U(       a5  U R                  SS	S
9nUR                  SSSSS9  UR                  SSSSS9  gg)z'Adds monitoring config flags to parser.aL  
  Enables managed collection for Managed Service for Prometheus in the cluster.

  See https://cloud.google.com/stackdriver/docs/managed-prometheus/setup-managed#enable-mgdcoll-gke
  for more info.

  Managed Prometheus is enabled by default for cluster versions 1.27 or greater,
  use --no-enable-managed-prometheus to disable.
  z
  Enables managed collection for Cloud Monitoring in the cluster.

  Cloud Monitoring is enabled by default for all clusters. Beginning with
  cluster version 1.31, use --disable-cloud-monitoring to disable.
  z
  Disables managed collection for Cloud Monitoring in the cluster.

  Cloud Monitoring is enabled by default for all clusters. Beginning with
  cluster version 1.31, use --disable-cloud-monitoring to disable.
  z--enable-managed-prometheusr[   Nrd   zCloud Monitoring ConfigTr~   z--disable-cloud-monitoringz--enable-cloud-monitoringzMonitoring Configz--disable-managed-prometheusz>Disable managed collection for Managed Service for Prometheus.z=Enable managed collection for Managed Service for Prometheus.z0Disable managed collection for Cloud Monitoring.z/Enable managed collection for Cloud Monitoring.)r;   r   )r=   rg   cloud_monitoring_optionprometheus_enable_help_text!cloud_monitoring_enable_help_text"cloud_monitoring_disable_help_textr   s          r   AddMonitoringConfigr    sV   !'#($ 
%(	   8Ee
&1	   
%0	    0=E	&M	   
%L	   8Ee
&@   
%@	   r   c                    [        U SS5      n[        U SS5      n[        R                  " 5       nUR                  5       nU(       a  SUl        OU(       a  SUl        OSn[        U SS5      n[        U SS5      n[        R                  " 5       nUR                  5       nU(       a  SUl        OU(       a  SUl        OSnUc  Uc  gUR                  UUS9$ )	a5  Parses and validates the value of the managed prometheus and cloud monitoring config flags.

Args:
  args: Arguments parsed from the command.

Returns:
  The monitoring config object as GoogleCloudGkemulticloudV1MonitoringConfig.
  None if both enable_managed_prometheus and enable_cloud_monitoring are None.
enable_managed_prometheusNdisable_managed_prometheusTFenable_cloud_monitoringdisable_cloud_monitoring)managedPrometheusConfigcloudMonitoringConfig)rB   r  r  1GoogleCloudGkemulticloudV1ManagedPrometheusConfigenabled/GoogleCloudGkemulticloudV1CloudMonitoringConfig*GoogleCloudGkemulticloudV1MonitoringConfig)rD   enabled_prometheusdisabled_prometheusr  prometheus_configenabled_cloud_monitoringdisabled_cloud_monitoringcloud_monitoring_configs           r   GetMonitoringConfigr  g  s     t%@$G&BDI'')(@@B   $ %$T+DdK%d,FM'')(>>@  &*# &+#"#:#B		<	</3 
= 
 r   c                 D    SnU R                  SSUR                  US9S9  g )NzsAllow idempotent deletion of {resource}.
  The request will still succeed in case the {resource} does not exist.
  z--allow-missingr[   )resourcer\   rM   )r=   r  rX  s      r   AddAllowMissingr    s2    ( 	??H?-  r   c                     [        U SS 5      $ )Nallow_missingrA   rR   s    r   GetAllowMissingr    rb   r   c           	      D    SnU R                  SSUR                  X!S9S9  g )NzForce delete an {platform} {resource}.
  Deletion of the {platform} {resource} will succeed even if errors occur
  during deleting in-{resource} resources. Using this parameter may
  result in orphaned resources in the {resource}.
  z--ignore-errorsr[   )r  platformr\   rM   )r=   r  r  rX  s       r   AddIgnoreErrorsr    s2    (
 	??H?@  r   c                     [        U SS 5      $ )Nignore_errorsrA   rR   s    r   GetIgnoreErrorsr    rb   r   c           	          U R                  S[        R                   Vs/ s H  n[        U5      PM     snSSS9  gs  snf )z/Adds --binauthz-evaluation-mode flag to parser.r3   Nz:Set Binary Authorization evaluation mode for this cluster.)r  re   r9   )r;   _BINAUTHZ_EVAL_MODE_ENUM_MAPPERr  r   )r=   cs     r   AddBinauthzEvaluationModer    sI    "(G(O(O(O1
A
(O G  s   <
c                 `    [        U SS 5      nUc  g [        R                  [        U5      5      $ )Nbinauthz_evaluation_mode)rB   r  r  r#   )rD   evaluation_modes     r   GetBinauthzEvaluationModer    s5    D"<dC/	(	9	9O$
 r   c           	      V    U R                  SSS/SS[        R                  " S5      S9  g)z6Adds --workload-vulnerability-scanning flag to parser.z!--workload-vulnerability-scanningdisabled
enterpriseNTaS        Sets the mode of the Kubernetes security posture API's workload vulnerability scanning.
      To enable Advanced vulnerability insights mode explicitly set the flag to --workload-vulnerability-scanning=enterprise.

      To disable in an existing cluster, explicitly set the flag to --workload-vulnerability-scanning=disabled.
      )r  re   r:  r9   )r;   textwrapdedentr<   s    r    AddWorkloadVulnerabilityScanningr    s7    )<(?? 
   r   c                     [        U SS 5      nUc  g [        R                  " 5       R                  R                  nUR
                  UR                  S.nX1   $ )Nworkload_vulnerability_scanning)r  r  )rB   r  r  /GoogleCloudGkemulticloudV1SecurityPostureConfig VulnerabilityModeValueValuesEnumVULNERABILITY_DISABLEDVULNERABILITY_ENTERPRISE)rD   vulnerability_mode	enum_typemappings       r    GetWorkloadVulnerabilityScanningr    s^    t%FM  "RRss  2266' 
	$$r   c                 4    SnU R                  S[        SUS9  g)z'Adds --max-surge-update flag to parser.aY  Maximum number of extra (surge) nodes to be created beyond the current size of
the node pool during its update process. Use --max-unavailable-update as well,
if needed, to control the overall surge settings.

To create an extra node each time the node pool is rolling updated, run:

  $ {command} --max-surge-update=1 --max-unavailable-update=0
z--max-surge-updateNr   re   r9   r   r  s     r   AddMaxSurgeUpdater    s'    ) 	d  r   c                     [        U SS 5      $ )Nmax_surge_updaterA   rR   s    r   GetMaxSurgeUpdater    s    	)4	00r   c                 H    U(       a  SnOSnU R                  S[        SUS9  g)z-Adds --max-unavailable-update flag to parser.a  Maximum number of nodes that can be simultaneously unavailable during this node
pool's update process. Use --max-surge-update as well, if needed, to control the
overall surge settings.

To update 3 nodes in parallel (1 + 2), but keep at least 4 nodes (6 - 2)
available each time the node pool is rolling updated, run:

  $ {command} --min-nodes=6 --max-surge-update=1 --max-unavailable-update=2
a  Maximum number of nodes that can be simultaneously unavailable during this node
pool's update process. Use --max-surge-update as well, if needed, to control the
overall surge settings.

To modify a node pool with 6 nodes such that, 3 nodes are updated in parallel
(1 + 2), but keep at least 4 nodes (6 - 2) available each time this
node pool is rolling updated, run:

  $ {command} --max-surge-update=1 --max-unavailable-update=2
z--max-unavailable-updateNr  r   rf   s      r   AddMaxUnavailableUpdater    s1    	I
I 	 sDy  r   c                     [        U SS 5      $ )Nmax_unavailable_updaterA   rR   s    r   GetMaxUnavailableUpdater    s    	/	66r   c                 ,    SnU R                  SSSUS9  g)z"Adds --respect-pdb flag to parser.zOIndicates whether the node pool rollback should respect pod disruption budget.
z--respect-pdbFr[   rP  Nr:   r  s     r   AddRespectPodDisruptionBudgetr    s*    ) 		  r   c                     [        U SS 5      $ )Nrespect_pdbrA   rR   s    r   GetRespectPodDisruptionBudgetr  .  ry   r   c                 P    SnU R                  S[        R                  " SS9SUS9  g)zZAdds --tags flag to parser.

Args:
  parser: The argparse.parser to add the arguments to.
a$  Tag keys/values directly bound to this resource.

The short name of a tag key or value can have a maximum length of 256
characters. The permitted character set for the short name includes UTF-8
encoded Unicode characters except single quotes, double quotes,
backslashes, and forward slashes.
r   r   r   r   r   Nr   r  s     r   AddResourceManagerTagsr  2  s5    ) 	!,	  r   c                 .    [        U SS5      =(       d    0 $ )zParses and validates the value of the --tags flag.

Args:
  args: Arguments parsed from the command.

Returns:
  The tags object as a dictionary.
r   NrA   rR   s    r   GetResourceManagerTagsr  H  s     
vt	$	**r   )T)F)cluster)FF)__doc__
__future__r   r   r   r  .googlecloudsdk.api_lib.container.gkemulticloudr   r  googlecloudsdk.callioper   2googlecloudsdk.command_lib.container.gkemulticloudr   #googlecloudsdk.command_lib.projectsrF  $googlecloudsdk.command_lib.util.apisr	   googlecloudsdk.corer
   r   r   r#   r*   ChoiceEnumMapperr  r   EffectValueValuesEnumr  r	  r&   r   r  r  r+  ry  rz  rp  rx  ro  -GoogleCloudGkemulticloudV1BinaryAuthorizationEvaluationModeValueValuesEnumr  r>   rF   rH   rK   rO   rS   rY   r^   ra   rh   rk   ro   rr   ru   rx   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r&  r0  r5  r8  r;  r=  r@  rC  rH  rN  rQ  rS  rY  ra  re  rc  rd  rk  rs  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )r  s   0r   <module>r     sZ   B &  '  K / H D : *+!! &66 DDZZ=  A 188II(A(I(IJ(I1|A(IJK 
 P  $$i&8&89  NN"  #,"<"<  NNll9# 	.	.*	 .20,2	#-. **28(/ 	+;,9=2*,
:6
:
(80!*	6	67t
6+-2(@3"$05
 7<K\,^.
.	 % 1<7,,	+Q( Ks   %J