
    j                        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SKJr  SSKJr  SSKJr  SSKJr  SSKJr  SlS jrS rS rS\
R2                  4S jrS rS rS\
R2                  4S jrS rS r   SmS\
R2                  4S jjr S r!S r"S r#   SmS\
R2                  4S jjr$S  r%S! r&S" r'S# r(S$ r) SnS\
R2                  4S% jjr*S& r+S' r, SoS\
R2                  4S( jjr-S\
R2                  4S) jr.S\
R2                  4S* jr/S\
R2                  4S+ jr0S\
R2                  4S, jr1S\
R2                  4S- jr2S\
R2                  4S. jr3S\
R2                  4S/ jr4 SpS\
R2                  4S0 jjr5SpS1 jr6S2 r7SpS3 jr8S4 r9S5 r:S6 r;S7 r<SpS8 jr=S9 r>  SqS\
R2                  S:\?S;\R                  4S< jjrA SpS\
R2                  4S= jjrBSpS\
R2                  4S> jjrCSpS? jrDS@ rESpSA jrFSpSB jrG SpS\
R2                  4SC jjrHS\
R2                  4SD jrIS\
R2                  4SE jrJS\
R2                  4SF jrKSpSG jrLSpSH jrM SpS\
R2                  4SI jjrNS\
R2                  4SJ jrOSpSK jrPSL rQSM rRSN rSSpSO jrTSpSP jrUS\
R2                  4SQ jrV SpS\
R2                  4SR jjrW  SqS\
R2                  S;\R                  4SS jjrX SpST jrY SpS\
R2                  4SU jjrZ SpS\
R2                  4SV jjr[SpSW jr\SpSX jr] SpS\
R2                  4SY jjr^ SpS\
R2                  4SZ jjr_ SpS\
R2                  4S[ jjr`S\
R2                  4S\ jraS\
R2                  4S] jrbS\
R2                  4S^ jrcS\
R2                  4S_ jrd SpS` jreS\
R2                  4Sa jrfS\
R2                  4Sb jrgS\
R2                  4Sc jrhS\
R2                  4Sd jri SlSe\
R2                  S;\R                  4Sf jjrj  SrSg\
R2                  S;\R                  S:\?4Sh jjrkS\
R2                  4Si jrlS\
R2                  SjS4Sk jrmg)szEHelpers for flags in commands working with Anthos clusters on VMware.    )absolute_import)division)unicode_literalsN)arg_parsers)base)
exceptions)parser_arguments)concepts)deps)flags)concept_parsers)presentation_specs)
properties)	resourcesc                     SS0n[        X5      (       a!  U R                  U5      (       a  [        X5      $ UR                  X5      $ )a  Returns the value if it's set, otherwise returns None.

Args:
  args: An argparser Namespace class instance.
  flag_name: A string type flag name.
  default: The default value to return if not found in the argparser
    namespace.

Returns:
  The flag value if it is set by the user. If the flag is not added to the
  interface, or it is added by not specified by the user, returns the
  default value.
	page_sized   )hasattrIsSpecifiedgetattrget)args	flag_namedefaultdefault_valuess       8lib/googlecloudsdk/command_lib/container/vmware/flags.pyGetr   $   sI     3. T$"2"29"="=4##			I	//    c                 r    U R                  5        H#  n[        U[        5      (       a    gU(       d  M#    g   g)a  Returns True if any of the kwargs is set to not None value.

The added condition handles the case when user specified boolean False
for the given args, and it should return True, which does not work with
normal Python identity comparison.

Args:
  kwargs: dict, a mapping from proto field to its respective constructor
    function.

Returns:
  True if there exists a field that contains a user specified argument.
TF)values
isinstancebool)kwargsvalues     r   IsSetr%   :   s1     }}e%		 
 
r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nz'gkeonprem.projects.locations.operations	operation)resource_namelocationsId
projectsId)r
   ResourceSpecLocationAttributeConfig DEFAULT_PROJECT_ATTRIBUTE_CONFIG r   r   GetOperationResourceSpecr/   P   s*    			/)+::	
 r   parserc                     [         R                  R                  S[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for operation in VMware.

Args:
  parser: The argparse parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
operation_idzoperation {}.TrequiredN)r   ConceptParserForResourcer/   formatAddToParserr0   verbs     r   AddOperationResourceArgr;   Y   sC     ++ T"	 , 
 Kr   c                      [         R                  " SS[        R                  " [        R
                  R                  R                  5      /S9$ )z.Gets Google Cloud location resource attribute.location)Google Cloud location for the {resource}.)name	help_textfallthroughs)r
    ResourceParameterAttributeConfigr   PropertyFallthroughr   VALUEScontainer_vmwarer=   r.   r   r   r,   r,   h   s@    		2	2;

"
":#4#4#E#E#N#N
O
 r   c                  \    [         R                  " SS[         R                  [        5       S9$ )z?Constructs and returns the Resource specification for Location.zgkeonprem.projects.locationsr=   )r(   r*   r)   )r
   r+   r-   r,   r.   r   r   GetLocationResourceSpecrG   s   s,     
		$::)+	
 r   c                     [         R                  R                  S[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for Google Cloud location.

Args:
  parser: The argparse.parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.

--locationzGoogle Cloud location {}.Tr3   N)r   r5   r6   rG   r7   r8   r9   s     r   AddLocationResourceArgrJ   ~   sC     ++!((.	 , 
 Kr   c                  ,    [         R                  " SSS9$ )Nclustercluster of the {resource}.r?   r@   r
   rB   r.   r   r   ClusterAttributeConfigrP      s    		2	2,
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )Nz+gkeonprem.projects.locations.vmwareClustersrL   )r(   vmwareClustersIdr)   r*   )r
   r+   rP   r,   r-   r.   r   r   GetClusterResourceSpecrS      s0    			3-/)+::
 r   c                     U(       a  SOSn[         R                  R                  U[        5       SR	                  U5      UUS9R                  U 5        g)a  Adds a resource argument for an Anthos cluster on VMware.

Args:
  parser: The argparse parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, whether the argument is positional or not.
  required: bool, whether the argument is required or not.
  flag_name_overrides: {str: str}, dict of attribute names to the desired flag
    name.
rL   	--clusterz
cluster {}r4   flag_name_overridesN)r   r5   r6   rS   r7   r8   r0   r:   
positionalr4   rW   r?   s         r   AddClusterResourceArgrZ      sO    " !k$++
$- ,  Kr   c                     U nU R                  S5      (       a%  U R                  S5      nSR                  USS  5      n[        R                  R                  USS9$ )Nz///   0gkeonprem.projects.locations.vmwareAdminClusters
collection)
startswithsplitjoinr   REGISTRYParseRelativeName)admin_cluster_namerelative_namepartss      r   GetAdminClusterResourceri      s`    $-""4(($$S)EHHU12Y'M				-	-C 
. 
 r   c                  ,    [         R                  " SSS9$ )Nadmin_clusterrM   rN   rO   r.   r   r   AdminClusterAttributeConfigrl      s    		2	2,
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )Nr^   rk   )r(   vmwareAdminClustersIdr)   r*   )r
   r+   rl   r,   r-   r.   r   r   GetAdminClusterResourceSpecro      s0    			8#79)+::
 r   c                     U(       a  SOSn[         R                  R                  U[        5       SR	                  U5      UUS9R                  U 5        g)a  Adds a resource argument for an Anthos on VMware admin cluster.

Args:
  parser: The argparse parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, whether the argument is positional or not.
  required: bool, whether the argument is required or not.
  flag_name_overrides: {str: str}, dict of attribute names to the desired flag
    name.
rk   z--admin-clusterzadmin cluster {}rV   N)r   r5   r6   ro   r7   r8   rX   s         r   AddAdminClusterResourceArgrq      sP    " ',=$++
!#%- ,  Kr   c                 >    [         R                  R                  U SS9$ )N%gkehub.projects.locations.membershipsr_   )r   rd   re   )membership_names    r   !GetAdminClusterMembershipResourceru      s&    				-	-"I 
. 
 r   c                  ,    [         R                  " SSS9$ )Nadmin_cluster_membershipzwadmin cluster membership of the {resource}, in the form of projects/PROJECT/locations/LOCATION/memberships/MEMBERSHIP. rN   rO   r.   r   r   'AdminClusterMembershipIdAttributeConfigrx      s    		2	2%J
 r   c                  ,    [         R                  " SSS9$ )z:Gets admin cluster membership location resource attribute.r=   r>   rN   rO   r.   r   r   -AdminClusterMembershipLocationAttributeConfigrz     s    		2	2;
 r   c                  ,    [         R                  " SSS9$ )z-Gets Google Cloud project resource attribute.projectz(Google Cloud project for the {resource}.rN   rO   r.   r   r   ,AdminClusterMembershipProjectAttributeConfigr}   	  s    		2	2:
 r   c                  b    [         R                  " SS[        5       [        5       [	        5       S9$ )Nrs   rw   )r(   membershipsIdr)   r*   )r
   r+   rx   rz   r}   r.   r   r   %GetAdminClusterMembershipResourceSpecr     s-    			-.;=?A=?
 r   c           	          U(       a  SOSnSn[         R                  R                  U[        5       UUSSS.S9R	                  U 5        g)	zAdds a resource argument for a VMware admin cluster membership.

Args:
  parser: The argparse parser to add the resource arg to.
  positional: bool, whether the argument is positional or not.
  required: bool, whether the argument is required or not.
rw   --admin-cluster-membershipa  membership of the admin cluster. Membership name is the same as the admin cluster name.

Examples:

  $ {command}
        --admin-cluster-membership=projects/example-project-12345/locations/us-west1/memberships/example-admin-cluster-name

or

  $ {command}
        --admin-cluster-membership-project=example-project-12345
        --admin-cluster-membership-location=us-west1
        --admin-cluster-membership=example-admin-cluster-name

  "--admin-cluster-membership-project#--admin-cluster-membership-locationr|   r=   rV   N)r   r5   r6   r   r8   )r0   rY   r4   r?   "admin_cluster_membership_help_texts        r   $AddAdminClusterMembershipResourceArgr     s[     %/ 4P ($ ++
+-(9; , 	 Kr   c                  ,    [         R                  " SSS9$ )N	node_poolznode pool of the {resource}.rN   rO   r.   r   r   NodePoolAttributeConfigr   C  s    		2	2"@
 r   c            	          [         R                  " SS[        5       [        5       [	        5       [         R
                  S9$ )Nz;gkeonprem.projects.locations.vmwareClusters.vmwareNodePoolsr   )r(   vmwareNodePoolsIdrR   r)   r*   )r
   r+   r   rP   r,   r-   r.   r   r   GetNodePoolResourceSpecr   I  s6    			C/1-/)+::
 r   c                     U(       a  SOSn[         R                  R                  U[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for a VMware node pool.

Args:
  parser: The argparse parser to add the resource arg to.
  verb: str, the verb to describe the resource, such as 'to update'.
  positional: bool, whether the argument is positional or not.
r   z--node-poolznode pool {}Tr3   N)r   r5   r6   r   r7   r8   )r0   r:   rY   r?   s       r   AddNodePoolResourceArgr   T  sL     #$++
D!	 , 
 Kr   c                 &    U R                  SSSS9  g)zAdds a flag for force unenroll operation when there are existing node pools.

Args:
  parser: The argparse parser to add the flag to.
--force
store_truezyIf set, any child node pools will also be unenrolled. This flag is required if the cluster has any associated node pools.actionhelpNadd_argumentr0   s    r   AddForceUnenrollClusterr   g  s#     	D	  r   c                 &    U R                  SSSS9  g)zAdds a flag for force delete cluster operation when there are existing node pools.

Args:
  parser: The argparse parser to add the flag to.
r   r   zIf set, any node pools from the cluster will also be deleted. This flag is required if the cluster has any associated node pools.r   Nr   r   s    r   AddForceDeleteClusterr   w  s#     	L	  r   c                 &    U R                  SSSS9  g)zAdds a flag for delete node pool operation to return success and perform no action when there is no matching node pool.

Args:
  parser: The argparse parser to add the flag to.
--allow-missingr   dIf set, and the Vmware Node Pool is not found, the request will succeed but no action will be taken.r   Nr   r   s    r   AddAllowMissingDeleteNodePoolr     s"     	2	  r   c                 &    U R                  SSSS9  g)zAdds a flag for unenroll node pool operation to return success and perform no action when there is no matching node pool.

Args:
  parser: The argparse parser to add the flag to.
r   r   r   r   Nr   r   s    r   AddAllowMissingUnenrollNodePoolr     s"     	2	  r   c                 &    U R                  SSSS9  g)zAdds a flag for delete cluster operation to return success and perform no action when there is no matching cluster.

Args:
  parser: The argparse parser to add the flag to.
r   r   zlIf set, and the Anthos cluster on VMware is not found, the request will succeed but no action will be taken.r   Nr   r   s    r   AddAllowMissingDeleteClusterr     s"     	7	  r   c                 (    U R                  SSSSS9  g)aU  Adds a flag to enable allow missing in an update cluster request.

If set to true, and the cluster is not found, the request will
create a new cluster with the provided configuration. The user
must have both create and update permission to call Update with
allow_missing set to true.

Args:
  parser: The argparse parser to add the flag to.
r   r   TzIf set, and the Anthos cluster on VMware is not found, the update request will try to create a new cluster with the provided configuration.)r   hiddenr   Nr   r   s    r   AddAllowMissingUpdateClusterr     s%     	  	r   c                 &    U R                  SSSS9  g)a  Adds a flag to enable allow missing in an unenroll cluster request.

If set, and the Anthos on VMware cluster is not found, the request will
succeed but no action will be taken on the server and return a completed LRO.

Args:
  parser: The argparse parser to add the flag to.
r   r   zIf set, and the VMware Cluster is not found, the request will succeed but no action will be taken on the server and return a completed LRO.r   Nr   r   s    r   AddAllowMissingUnenrollClusterr     s"     		  r   c                 (    U R                  SSSUS9  g)zAdds a flag to only validate the request without performing the operation.

Args:
  parser: The argparse parser to add the flag to.
  hidden: Set to False when validate-only flag is implemented in the API.
z--validate-onlyr   zMIf set, only validate the request, but do not actually perform the operation.)r   r   r   Nr   )r0   r   s     r   AddValidationOnlyr     s'     	   r   c                 <    U(       a  SOSnU R                  SUSS9  g)zAdds a flag to specify the node pool image type.

Args:
  vmware_node_config_group: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTz--image-typez,OS image type to use on node pool instances.r4   r   Nr   )vmware_node_config_group
for_updater4   s      r   _AddImageTyper     s)     !Ud(''9 ( r   c                 .    U R                  S[        SS9  g)zAdds a flag to specify the number of replicas in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.

--replicasz1Number of replicas to use on node pool instances.typer   Nr   intr   s    r   _AddReplicasr   
  s      ''> ( r   c                     U(       a  U R                  SS9nUnOU nUR                  SSSSS9  U(       a  UR                  SSSSS9  g	g	)
zAdds a flag to enable load balancer in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Tmutexz--enable-load-balancerstore_constzCIf set, enable the use of load balancer on the node pool instances.)r   constr   z--disable-load-balancerzDIf set, disable the use of load balancer on the node pool instances.N	add_groupr   )r   r   enable_lb_mutex_groupsurfaces       r   _AddEnableLoadBalancerr     so     4>>T>J#G&G	
O   !   r   c                 .    U R                  SS[        S9  g)zAdds a flag to specify the number of cpus in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.
--cpusz.Number of CPUs for each node in the node pool.r   r   Nr   r   s    r   _AddCpusr   :  s      ''; ( r   c           	      L    U R                  SS[        R                  " SSS9S9  g)zAdds a flag to specify the memory in MB in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.
--memoryz4Size of memory for each node in the node pool in MB.MBdefault_unit	type_abbrr   Nr   r   
BinarySizer   s    r   _AddMemoryMbr   G  s-     ''A!!ttD ( r   c                 .    U R                  SS[        S9  g)z{Adds a flag to specify the image in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.
z--imagezOS image name in vCenter.r   Nr   strr   s    r   	_AddImager   T  s      ''& ( r   c           	      L    U R                  SS[        R                  " SSS9S9  g)zAdds a flag to specify the boot disk size in GB in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.
z--boot-disk-sizez5Size of VMware disk to be used during creation in GB.GBr   r   Nr   r   s    r   _AddBootDiskSizeGbr   a  s-     ''B!!ttD ( r   c                 l    SnSnU(       a  UOUnU R                  SSU[        R                  " 5       S9  g)zAdds a flag to specify the node taint in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
aZ  Applies the given kubernetes taints on all nodes in the new node pool, which can
be used with tolerations for pod scheduling.

Taint effect must be one of the following: `NoSchedule`, `PreferNoSchedule`, or `NoExecute`.

Examples:

  $ {command} node-pool-1 --cluster=example-cluster --node-taints=key1=val1:NoSchedule,key2=val2:PreferNoSchedule
al  Replaces all the user specified Kubernetes taints on all nodes in an existing
node pool, which can be used with tolerations for pod scheduling.

Taint effect must be one of the following: `NoSchedule`, `PreferNoSchedule`, or `NoExecute`.

Examples:

  $ {command} node-pool-1 --cluster=example-cluster --node-taints=key1=val1:NoSchedule,key2=val2:PreferNoSchedule
z--node-taintszKEY=VALUE:EFFECTmetavarr   r   Nr   r   ArgDict)r   r   node_pool_create_help_textnode_pool_update_help_textr@   s        r   _AddNodeTaintr   n  sL    	 	  %/ 4N  ''  	 ( r   c                 N    U R                  SSS[        R                  " 5       S9  g)z|Adds a flag to specify the labels in the node pool.

Args:
  vmware_node_config_group: The parent group to add the flag to.
z--node-labels	KEY=VALUEz?Kubernetes labels (key/value pairs) to be applied to each node.r   Nr   r   s    r   _AddNodeLabelsr     s,     ''L 	 ( r   r   release_trackc                 
   U R                  SU(       a  SOSS9n[        U5        [        U5        [        U5        [	        X1S9  [        U5        [        U5        [        U5        [        U5        [        UUUS9  [        X1S9  g)a  Adds flags to specify the configuration of the node pool.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
  release_track: The release track of this command.
zConfiguration of the node poolFTr   r4   r   )r   r   N)r   r   r   r   r   r   r   r   r   _AddVmwareVsphereConfigr   )r0   r   r   r   s       r   AddVmwareNodeConfigr     s     $--+"u .  #$'('((@$%-.())*!
 1Ir   c                     U(       a  SOSnU R                  S5      nUR                  SU[        SS9  UR                  SU[        SS9  g	)
zAdds a flag to specify the node pool autoscaling config.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTzNode pool autoscalingz--min-replicasz,Minimum number of replicas in the node pool.)r4   r   r   z--max-replicasz,Maximum number of replicas in the node pool.N)r   r   r   )r0   r   r4   groups       r   "AddVmwareNodePoolAutoscalingConfigr     s^     !Ud(


2
3%9	   9	  r   c                 &    U R                  SUSS9  g)zAdds a flag to specify the Anthos cluster on VMware version.

Args:
  parser: The argparse parser to add the flag to.
  required: bool, whether the argument is required or not.
	--versionz9Anthos Cluster on VMware version for the cluster resourcer   Nr   )r0   r4   s     r   
AddVersionr     s      	F  r   c                     U(       a  SOSnU(       a  gU R                  SS9nUR                  S[        USS9  UR                  S	[        US
S9  UR                  S[        SS9  g)zAdds flags for F5 Big IP load balancer.

Args:
  lb_config_mutex_group: The parent mutex group to add the flags to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTNzF5 Big IP Configurationr   z--f5-config-addressz F5 Big IP load balancer address.)r   r4   r   z--f5-config-partitionz"F5 Big IP load balancer partition.z--f5-config-snat-poolz0F5 Big IP load balancer pool name if using SNAT.r   r   r   r   )lb_config_mutex_groupr   r4   f5_config_groups       r   _AddF5Configr     s     !Ud(
)33$ 4 / -	   /	   =  r   c                 F   U R                  SSS9nSnUR                  SU[        R                  " 5       SS9  SnUR                  SUS	[        R                  " [
        [        R                  " 5       [        R                  " 5       [        R                  " S
S9S.SS/S9S9  g)zrAdds flags for MetalLB load balancer.

Args:
  lb_config_mutex_group: The parent mutex group to add the flags to.
zMetalLB ConfigurationTr   r   a  
Path of the YAML/JSON file that contains the MetalLB configurations.

Examples:

  metalLBConfig:
    addressPools:
    - pool: lb-test-ip
      addresses:
      - 10.251.133.79/32
      - 10.251.133.80/32
      avoidBuggyIPs: True
      manualAssign: False
    - pool: ingress-ip
      addresses:
      - 10.251.133.70/32
      avoidBuggyIPs: False
      manualAssign: True

List of supported fields in `metalLBConfig`

KEY           | VALUE                     | NOTE
--------------|---------------------------|------------------
addressPools  | one or more addressPools  | required, mutable

List of supported fields in `addressPools`

KEY           | VALUE                 | NOTE
--------------|-----------------------|---------------------------
pool          | string                | required, mutable
addresses     | one or more IP ranges | required, mutable
avoidBuggyIPs | bool                  | optional, mutable, defaults to False
manualAssign  | bool                  | optional, mutable, defaults to False

z--metal-lb-config-from-filer   r   r   a  
MetalLB load balancer configurations.

Examples:

To specify MetalLB load balancer configurations for two address pools `pool1` and `pool2`,

```
$ gcloud {command}
    --metal-lb-config-address-pools 'pool=pool1,avoid-buggy-ips=True,manual-assign=True,addresses=192.168.1.1/32;192.168.1.2-192.168.1.3'
    --metal-lb-config-address-pools 'pool=pool2,avoid-buggy-ips=False,manual-assign=False,addresses=192.168.2.1/32;192.168.2.2-192.168.2.3'
```

Use quote around the flag value to escape semicolon in the terminal.
z--metal-lb-config-address-poolsappend;)custom_delim_char)poolzavoid-buggy-ipszmanual-assign	addressesr   r   )specrequired_keysr   r   r   N)r   r   r   YAMLFileContentsr   r   
ArgBooleanArgList)r   metal_lb_config_mutex_group#metal_lb_config_from_file_help_text'metal_lb_config_address_pools_help_texts       r   _AddMetalLbConfigr    s     !6 ? ?" !@ !
")%F **#.'')	 + -) **'2!,!7!7!9*557&..E	  -	 + r   c                    U(       a  gU R                  [        R                  " S5      S9nUR                  SS[        S9  UR                  SS[        S9  UR                  S	S
[        S9  UR                  SS[        S9  g)zAdds flags for Manual load balancer.

Args:
  lb_config_mutex_group: The parent mutex group to add the flags to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
NaC          Manual load balancer configuration.

        With manual load balancing mode, DHCP is not supported. Specify static IP addresses for cluster nodes instead.
        For more details, see https://cloud.google.com/anthos/clusters/docs/on-prem/latest/how-to/manual-load-balance#setting_aside_node_ip_addresses.
        r   z--ingress-http-node-portz$NodePort for ingress service's http.r   z--ingress-https-node-portz%NodePort for ingress service's https.z--control-plane-node-portz#NodePort for control plane service.z--konnectivity-server-node-portzRNodePort for konnectivity service running as a sidecar in each kube-apiserver pod.)r   textwrapdedentr   r   )r   r   manual_lb_config_groups      r   _AddManualLbConfigr	  c  s     
0::??   ;  %% 1 & 
 %%!2 & 
 %%!0 & 
 %%'!  & r   c                     U(       a  SOSnU(       a  gU R                  SUS9nUR                  SUSS9  UR                  S	US
S9  g)zAdds flags to set VIPs used by the load balancer..

Args:
  vmware_load_balancer_config_group: The parent group to add the flags to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTNz VIPs used by the load balancerr   z--control-plane-vipz+VIP for the Kubernetes API of this cluster.r   z--ingress-vipz*VIP for ingress traffic into this cluster.r   )!vmware_load_balancer_config_groupr   r4   vmware_vip_config_groups       r   _AddVmwareVipConfigr    sl     !Ud(
=GG, H  &&8 ' 
 &&7 ' r   c                     U(       a  SOSnU R                  SUS9n[        X1S9  UR                  SSUS9n[        U5        [        XAS9  [	        XAS9  g)	zAdds a command group to set the load balancer config.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTz5Anthos on VMware cluster load balancer configurationsr   r   z#Populate one of the load balancers.)r   r   r4   N)r   r  r  r   r	  )r0   r   r4   r  r   s        r   AddVmwareLoadBalancerConfigr    sq     !Ud(&,&6&6B '7 '# 7O;EE0 F 
 )*$<*Br   c                 .    U R                  S[        SS9  g)zqAdds a flag to specify the description of the resource.

Args:
  parser: The argparse parser to add the flag to.
z--descriptionzDescription for the resource.r   Nr   r   s    r   AddDescriptionr    s     	C&E  r   c                 .    U R                  S[        SS9  g)zsAdds a flag to specify the display name of the node pool.

Args:
  parser: The argparse parser to add the flag to.
z--display-namezDisplay name for the resource.r   Nr   r   s    r   AddNodePoolDisplayNamer    s     	S'G  r   c                 N    U R                  SS[        R                  " 5       SS9  g)z-Adds a flag to specify node pool annotations.--annotationsr   zAnnotations on the node pool.r   r   r   Nr   r   s    r   AddNodePoolAnnotationsr    s*     *	  r   c           	      v    U(       a  SOSnU(       a  gU R                  SS[        R                  " SSS9USS	9  g)
a  Adds a flag to specify the IPv4 address ranges used in the services in the cluster.

Args:
  vmware_network_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTNz--service-address-cidr-blocksSERVICE_ADDRESS   
min_length
max_lengthz3IPv4 address range for all services in the cluster.r   r   r4   r   r   r   r   vmware_network_config_groupr   r4   s      r   _AddServiceAddressCidrBlocksr"    sH     !Ud(
**% @ + 	r   c           	      v    U(       a  SOSnU(       a  gU R                  SS[        R                  " SSS9USS	9  g)
a   Adds a flag to specify the IPv4 address ranges used in the pods in the cluster.

Args:
  vmware_network_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTNz--pod-address-cidr-blocksPOD_ADDRESSr  r  z/IPv4 address range for all pods in the cluster.r  r  r   s      r   _AddPodAddressCidrBlocksr%    sH     !Ud(
**! < + 	r   c                     U(       a  SOSnU R                  SUS9n[        X1S9  [        X1S9  [        X1S9  [	        X1S9  U(       d  [        U5        gg)zAdds network config related flags.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
FTz*VMware User Cluster network configurationsr   r   N)r   r"  r%  _AddIpConfiguration_AddVmwareHostConfig_AddVmwareControlPlaneV2Config)r0   r   r4   r!  s       r   AddVmwareNetworkConfigr*    sf     !Ud( & 0 07 !1 ! ! 6N1I2J 
"#>? 
r   c                 z   U R                  SSSS9nUR                  S5      nUR                  S5      n[        R                  " [        R                  " S[
        R                  " 5       SS	S
S.SUS9[        R                  " S[        5       SSSS0US9/SS/0S9nUR                  U 5        U R                  SS9  g)zdAdds flags to specify version config type.

Args:
  parser: The argparse parser to add the flag to.
z Use cases for querying versions.TF)r   r4   z1Create an Anthos on VMware user cluster use case.z2Upgrade an Anthos on VMware user cluster use case.r   z|Membership of the admin cluster to query versions for create. Membership can be the membership ID or the full resource name.r   r   r   )rW   r4   r   rU   z&Cluster to query versions for upgrade.r=    )r4   rW   r   z--cluster.locationrI   )command_level_fallthroughsglobal)!admin_cluster_membership_locationN)
r   r   r5   r   ResourcePresentationSpecr   r   rS   r8   set_defaults)r0   config_type_groupcreate_configupgrade_config
arg_parsers        r   AddConfigTyper6  .  s     &&(u '  $--9- %..:. ,,

5
5*99;$
 BC# ! 
5
5$&6#-r"2"!4 "5*<  Ar   c                 |    U(       a  gU R                  SS9nUR                  S[        R                  " S5      SS9  g)zAdds flags to specify DHCP configuration.

Args:
  ip_configuration_mutex_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
NzDHCP configuration group.r   z--enable-dhcpa          Enable DHCP IP allocation for VMware user clusters.

        While using DHCP, manual load balancing mode is not supported. For more details, see https://cloud.google.com/anthos/clusters/docs/on-prem/latest/how-to/manual-load-balance#setting_aside_node_ip_addresses.
        r   r   r   )r   r   r  r  )ip_configuration_mutex_groupr   dhcp_config_groups      r   _AddVmwareDhcpIpConfigr;  _  sQ     
2<<& =    ??  
  ! r   c                     SR                  U 5      nSU ;  a  U S4$ U R                  S5      n[        U5      S:w  a  [        R                  " SUS9eUS   US   4$ )	zParse the given value in IP block format.

Args:
  value: str, supports format of either IP, or 'IP hostname'.

Returns:
  tuple: of structure (IP, hostname).

Raises:
  exceptions.InvalidArgumentException: raise parsing error.
zMalformed IP block [{}].
Expect an individual IP address, or an individual IP address with an optional hostname.
Examples: --control-plane-ip-block 'netmask=255.255.255.0,gateway=10.0.0.0,ips=192.168.1.1;0.0.0.0 localhost'
 N   --control-plane-ip-blockmessager   r  r7   rb   lenr   InvalidArgumentExceptionr$   parsing_errorip_blocks      r   _ParseControlPlaneIpBlockrH  w  sr     F5M 
 	4={{3H
8}//
$m  qk8A;''r   c                     SR                  U 5      nSU ;  a  U S4$ U R                  S5      n[        U5      S:w  a  [        R                  " SUS9eUS   US   4$ )	zParse the given value in IP block format.

Args:
  value: str, supports either IP, IP hostname, or a CIDR range.

Returns:
  tuple: of structure (IP, hostname).

Raises:
  exceptions.InvalidArgumentException: raise parsing error.
zMalformed IP block [{}].
Expect an individual IP address, an individual IP address with an optional hostname, or a CIDR block.
Examples: ips=192.168.1.1;0.0.0.0 localhost;192.168.1.2/16
r=  Nr>  --static-ip-config-ip-blocksr@  r   r  rB  rE  s      r   _ParseStaticIpConfigIpBlockrK    sr     F5M 
 	4={{3H
8}//
(-  qk8A;''r   c                    SnU R                  SSS9nUR                  SU[        R                  " 5       SS9  SnUR                  SUS	[        R                  " [
        [
        [        R                  " [        S
S9S.S9S9  g)z{Adds flags to specify Static IP configuration.

Args:
  ip_configuration_mutex_group: The parent group to add the flag to.
a  
Path of the YAML/JSON file that contains the static IP configurations, used by Anthos on VMware user cluster node pools.

Examples:

    staticIPConfig:
      ipBlocks:
      - gateway: 10.251.31.254
        netmask: 255.255.252.0
        ips:
        - hostname: hostname-1
          ip: 1.1.1.1
        - hostname: hostname-2
          ip: 2.2.2.2
        - hostname: hostname-3
          ip: 3.3.3.3
        - hostname: hostname-4
          ip: 4.4.4.4

List of supported fields in `staticIPConfig`

KEY       | VALUE                 | NOTE
--------- | --------------------  | -----------------
ipBlocks  | one or more ipBlocks  | required, mutable

List of supported fields in `ipBlocks`

KEY     | VALUE           | NOTE
------- | --------------- | -------------------
gateway | IP address      | required, immutable
netmask | IP address      | required, immutable
ips     | one or more ips | required, mutable

List of supported fields in `ips`

KEY       | VALUE       | NOTE
--------- | ----------- | -------------------
hostname  | string      | optional, immutable
ip        | IP address  | required, immutable

New `ips` fields can be added, existing `ips` fields cannot be removed or updated.
zStatic IP configuration groupTr   z--static-ip-config-from-filer   a  
Static IP configurations.

Expect an individual IP address, an individual IP address with an optional hostname, or a CIDR block.

Example:

To specify two Static IP blocks,

```
$ gcloud {command}
    --static-ip-config-ip-blocks 'gateway=192.168.0.1,netmask=255.255.255.0,ips=192.168.1.1;0.0.0.0 localhost;192.168.1.2/16'
    --static-ip-config-ip-blocks 'gateway=192.168.1.1,netmask=255.255.0.0,ips=8.8.8.8;4.4.4.4'
```

Use quote around the flag value to escape semicolon in the terminal.
  rJ  r   r   element_typer   gatewaynetmaskipsr   r   N)r   r   r   r   r   r   r   rK  )r9  $static_ip_config_from_file_help_textstatic_ip_config_mutex_group$static_ip_config_ip_blocks_help_texts       r   _AddVmwareStaticIpConfigrW    s    )*&T ">!G!G* "H " ++$/'')	 , *&$ ++$/ ((:$'		 , r   c                 L    U R                  SSS9n[        X!S9  [        U5        g)zAdds flags to specify IP configuration used by the VMware User Cluster.

Args:
  vmware_network_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Tz0IP configuration used by the VMware User Cluster)r   r   r   N)r   r;  rW  )r!  r   r9  s      r   r'  r'    s5     "=!F!F= "G " 5M78r   c                 .   U(       a  gU R                  SS9nUR                  SS[        R                  " [        5      SS9  UR                  SS	[        R                  " [        5      S
S9  UR                  S[        R                  " [        5      SSS9  g)a	  Adds flags to specify common parameters for all hosts irrespective of their IP address.

Args:
  vmware_network_config_group: The parent group to add the flags to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Nz@Common parameters for all hosts irrespective of their IP addressr   z--dns-serversDNS_SERVERSzDNS server IP address.r  z--ntp-serversNTP_SERVERSzNTP server IP address.z--dns-search-domainsDNS_SEARCH_DOMAINSzDNS search domains.)r   r   r   )r   r   r   r   r   )r!  r   vmware_host_config_groups      r   r(  r(  !  s     
8BBM C  ''s##	 (  ''s##	 (  ''s#" 	 ( r   c                 .    U R                  S[        SS9  g)zjAdds flags to specify required platform version.

Args:
  parser: The argparse parser to add the flag to.
z--required-platform-versiona  Platform version required for upgrading an admin cluster or a user cluster. If the current platform version is lower than the required version, the platform version will be updated to the required version. If it is not installed in the platform, download the required version bundle.r   Nr   r   s    r   AddRequiredPlatformVersionr_  D  s"     	#2	  
r   c                     U(       a  U R                  SS9nUnOU nUR                  SS[        R                  " 5       SS9  U(       a  UR                  SSS	S
9  gg)zAdds a flag to specify cluster annotations.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Tr   r  r   z'Annotations on the VMware user cluster.r  --clear-annotationsr   z-Clear annotations on the VMware user cluster.r   N)r   r   r   r   )r0   r   annotation_mutex_groupr   s       r   AddClusterAnnotationsrc  W  ss     #--D-9$GG	 4	   <   r   c                     U R                  SS9nUR                  S[        SS9  UR                  S[        R                  " SSS9S	S9  U(       d  UR                  S
[        SS9  [        X1S9  [        X2S9  g)aE  Adds flags to specify VMware user cluster control plane node configurations.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
  release_track: base.ReleaseTrack, determine the flag scope based on release
    tracks.
z!Control plane node configurationsr   r   zwNumber of CPUs for each admin cluster node that serve as control planes for this VMware user cluster. (default: 4 CPUs)r   r   r   r   zMegabytes of memory for each admin cluster node that serves as a control plane for this VMware User Cluster (default: 8192 MB memory).r   zQNumber of control plane nodes for this VMware user cluster. (default: 1 replica).r   )r   N)r   r   r   r   r   _AddVmwareAutoResizeConfig#_AddVmwareControlPlaneVsphereConfig)r0   r   r   &vmware_control_plane_node_config_groups       r   AddVmwareControlPlaneNodeConfigrh  u  s     ,2+;+;. ,< ,( )55D	 6  )55!!ttD	 6  
*77%	 8  , &,r   c                     U R                  SS9nU(       a  UR                  SS9nUnOUnUR                  SSSS9  U(       a  UR                  S	SS
S9  gg)zAdds flags to specify control plane auto resizing configurations.

Args:
  vmware_control_plane_node_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
zAuto resize configurationsr   Tr   z--enable-auto-resizer   z'Enable controle plane node auto resize.r   z--disable-auto-resizez(Disable controle plane node auto resize.Nr   )rg  r   vmware_auto_resize_config_groupenable_auto_resize_mutex_groupr   s        r   re  re    s     -66+ 7  "
 %D%N%N &O &" -G-G	4   7   r   c                     U R                  SS9nU(       a  UR                  SS9nUnOUnUR                  SSSS9  U(       a  UR                  S	SS
S9  gg)zAdds flags to specify VMware user cluster node pool anti-affinity group configurations.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
z"Anti-affinity group configurationsr   Tr   z--disable-aag-configr   znIf set, spread nodes across at least three physical hosts (requires at least three hosts). Enabled by default.r   z--enable-aag-configz*If set, enable anti-affinity group config.Nr   )r0   r   vmware_aag_config_groupenable_aag_config_mutex_groupr   s        r   AddVmwareAAGConfigro    s     #,,/ -  $;$E$E %F %! ,G%G	8	   9   r   c                     U R                  SS9nU(       a  UR                  SS9nUnOUnUR                  SSSS9  U(       a  UR                  S	SS
S9  gg)zAdds flags to specify VMware storage configurations.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
zStorage configurationsr   Tr   z--disable-vsphere-csir   z_If set, vSphere CSI components are not deployed in the VMware User Cluster. Enabled by default.r   z--enable-vsphere-csizGIf set, vSphere CSI components are deployed in the VMware User Cluster.Nr   )r0   r   vmware_storage_groupdisable_vsphere_csi_mutex_groupr   s        r   AddVmwareStorageConfigrs    s      ))/G)H&:&D&D4&D&P#-G"G	*	   	   r   c                 6    U(       a  gU R                  SSSS9  g)zAdds flags to specify enable_dataplane_v2.

Args:
  vmware_dataplane_v2_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Nz--enable-dataplane-v2r   zIf set, enables Dataplane V2.r   r    vmware_dataplane_v2_config_groupr   s     r   _AddEnableDataplaneV2rw    s&     
"//* 0 r   c                 6    U(       a  gU R                  SSSS9  g)zAdds flags to specify advanced networking.

Args:
  vmware_dataplane_v2_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Nz--enable-advanced-networkingr   zQIf set, enable advanced networking. Requires dataplane_v2_enabled to be set true.r   r   ru  s     r   _AddAdvancedNetworkingry  *  s(     
"//$	 0 r   c                 V    U(       a  gU R                  SS9n[        X!S9  [        X!S9  g)a  Adds flags to specify configurations for Dataplane V2, which is optimized dataplane for Kubernetes networking.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
NzDataplane V2 configurationsr   r   )r   rw  ry  )r0   r   rv  s      r   AddVmwareDataplaneV2Configr{  ?  s9     
%+%5%5( &6 &" 8P&r   c                 6    U(       a  gU R                  SSSS9  g)zAdds flags to specify vmware tracking configurations.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Nz--enable-vm-trackingr   zIf set, enable VM tracking.r   r   )r0   r   s     r   AddEnableVmwareTrackingr}  T  s&     
(  r   c                     U R                  SS9nU(       a  UR                  SS9nUnOUnUR                  SSSS9  U(       a  UR                  S	SS
S9  gg)zAdds flags to specify auto-repair configurations.

Args:
  parser: The argparse parser to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
zAuto-repair configurationsr   Tr   z--enable-auto-repairr   z-If set, deploy the cluster-health-controller.r   z--disable-auto-repairzIf set, disables auto repair.Nr   )r0   r   vmware_auto_repair_config_groupenable_auto_repair_mutex_groupr   s        r   AddVmwareAutoRepairConfigr  h  s     %+$4$4' %5 %! %D%N%N &O &" -G-G	:  
 ,   r   c                 H    U R                  SS9nSnUR                  SUSS9  g)zpAdds flags to specify applied and managed RBAC policy.

Args:
  parser: The argparse parser to add the flag to.
zMUser cluster authorization configurations to bootstrap onto the admin clusterr   a  Users that will be granted the cluster-admin role on the cluster, providing full access to the cluster.

To add multiple users, specify one in each flag. When updating, the update command overwrites the whole grant list. Specify all existing and new users that you want to be cluster administrators.

Examples:

  $ {command}
      --admin-users alice@example.com
      --admin-users bob@example.com
z--admin-usersr   r8  Nr   )r0   authorization_groupflag_help_texts      r   AddAuthorizationr    sD     (( ) 
. "" # r   c                 &   U R                  SS9nUR                  SSS[        R                  " 5       S9  UR                  SSS	[        R                  " 5       S9  UR                  S
SSSS9  UR                  SSS[        R                  " 5       SS9  g)z[Adds flags to update annotations.

Args:
  parser: The argparse parser to add the flag to.
Tr   z--add-annotationszKEY1=VALUE1,KEY2=VALUE2zhAdd the given key-value pairs to the current annotations, or update its value if the key already exists.r   z--remove-annotationsz	KEY1,KEY2z%Remove annotations of the given keys.ra  r   z!Clear all the current annotations)r   r   r   z--set-annotationsz#Replace all the current annotations)r   r   r   r   N)r   r   r   r   r   )r0   annotations_mutex_groups     r   AddUpdateAnnotationsr    s     #,,4,8&&'2   '  &&2 	 '  &&.	 '  &&' 0 ' r   c                 &    U R                  SSSS9  g)^Adds a flag for ignore_errors field.

Args:
  parser: The argparse parser to add the flag to.
--ignore-errorsziIf set, the deletion of a VMware user cluster resource will succeed even if errors occur during deletion.r   r8  Nr   r   s    r   AddIgnoreErrorsr    $     	3   r   c                 &    U R                  SSSS9  g)r  r  znIf set, the unenrollment of a VMware admin cluster resource will succeed even if errors occur during deletion.r   r8  Nr   r   s    r   AddIgnoreErrorsAdminClusterr    s$     	;   r   c                     U(       a  gU R                  SS9nSnUR                  SU[        R                  " [        [        [        R
                  " [        SS9S.S	9S
9  g)zAdds a flag for control_plane_v2_config message.

Args:
  vmware_network_config_group: The parent group to add the flag to.
  for_update: bool, True to add flags for update command, False to add flags
    for create command.
Nz%Control plane v2 mode configurations.r   a\  
Static IP addresses for the control plane nodes. The number of IP addresses should match the number of replicas for the control plane nodes, specified by `--replicas`.

To specify the control plane IP block,

```
$ gcloud {command}
    --control-plane-ip-block 'gateway=192.168.0.1,netmask=255.255.255.0,ips=192.168.1.1;0.0.0.0 localhost;'
```

  r?  r   rM  rO  rS  r   )r   r   r   r   r   r   rH  )r!  r   $vmware_control_plane_v2_config_groupr@   s       r   r)  r)    ss     
)D)N)N2 *O *&
) '33  ((8$'	 4 r   c                 &    U R                  SSSS9  g)r  r  zfIf set, the deletion of a VMware node pool resource will succeed even if errors occur during deletion.r   r8  Nr   r   s    r   AddNodePoolIgnoreErrorsr    r  r   c                 f    U R                  SS9nUR                  SSSS9  UR                  SSSS9  g	)
zjAdds a flag for enabling_control_plane_v2 field.

Args:
  parser: The argparse parser to add the flag to.
Tr   z--enable-control-plane-v2z If set, enable control plane v2.r   r8  z--disable-control-plane-v2z!If set, disable control plane v2.Nr   )r0   control_plane_v2_mutex_groups     r   AddEnableControlPlaneV2r  +  sY     "(!1!1 "2 " ++!- , 
 ++". , r   c                 &    U R                  SSSS9  g)z`Adds a flag for on_prem_version field.

Args:
  parser: The argparse parser to add the flag to.
r   zGAnthos version for the node pool. Defaults to the user cluster version.T)r   r   Nr   r   s    r   AddNodePoolVersionr  @  s$     	   r   c                 (    SnU R                  SUS9  g)z[Adds a flag for local_name field.

Args:
  parser: The argparse parser to add the flag to.
a  The object name of the VMware OnPremUserCluster custom resource on the
associated admin cluster. This field is used to support conflicting
resource names when enrolling existing clusters to the API. When not
provided, this field will resolve to the vmware_cluster_id. Otherwise, it
must match the object name of the VMware OnPremUserCluster custom resource.
It is not modifiable outside / beyond the  enrollment operation.
z--local-namer   Nr   )r0   local_name_help_texts     r   AddUserClusterLocalNamer  P  s%     	  r   rg  c                     U(       aP  U[         R                  R                  :X  a1  U R                  SSSS[        R
                  " [        [        S.S9S9  ggg)	z8Adds a flag for VmwareControlPlaneVsphereConfig message.z--control-plane-vsphere-configz Vsphere-specific configurations.T;datastore=DATASTORE,storage-policy-name=STORAGE_POLICY_NAME	datastorezstorage-policy-namerS  )r   r   r   r   N)r   ReleaseTrackALPHAr   r   r   r   )rg  r   s     r   rf  rf  e  sZ    
 }(9(9(?(??*77(/M   '*
 8  @]r   r   c           
          U(       a  gUb  U[         R                  R                  :w  a  g[        R                  " S5      nU R                  SUS[        R                  " [        [        S.S9SS9  g)	z$Adds a flag for VmwareVsphereConfig.Nz    vSphere configurations for the node pool.

    DATASTORE is the name of the vCenter datastore.

    STORAGE_POLICY_NAME is the name of the vCenter storage policy.
    z--vsphere-configTr  rS  r  )r   r   r   r   )	r   r  r  r  r  r   r   r   r   )r   r   r   vmware_vsphere_config_help_texts       r   r   r   y  sy     
 mt/@/@/F/FF
$,OO 5 %	! ''*%( L ( r   c                     U R                  SS9nUR                  S[        R                  " S[        R                  " 5       0S9[
        R                  " S5      S9  g )NzUpgrade policy for the cluster.r   z--upgrade-policyzcontrol-plane-onlyrS  a        If not specified, control-plane-only is set to False. In the next upgrade operation, all worker node pools will be upgraded together with the control plane.

      Example:

        To upgrade the control plane only and keep worker node pools version unchanged, first specify the policy:

          ```shell
          $ {command} CLUSTER --upgrade-policy control-plane-only=True
          ```

        Then to start the upgrade operation using the specified policy, run:

          ```shell
          $ {parent_command} upgrade CLUSTER --version=VERSION
          ```

        After upgrading only the cluster control plane, to upgrade an individual node pool, run:

          ```shell
          $ {grandparent_command} node-pools update NODE_POOL --version=VERSION
          ```

      Example:

        Alternatively, to upgrade both the control plane and all worker node pools, first specify the policy:

          ```shell
          $ {command} CLUSTER --upgrade-policy control-plane-only=False
          ```

        Then to start the upgrade operation using the specified policy, run:

          ```shell
          $ {parent_command} upgrade CLUSTER --version=VERSION
          ```
      r   )r   r   r   r   r   r  r  )r0   upgrade_policy_groups     r   AddUpgradePolicyr    sg    )), *  ##"K$:$:$<
 ?? $
 $ $ ,r   returnc                 H   U R                  SS9nUR                  S[        SS9  UR                  S[        SS9  UR                  S[        S	S9  UR                  S
[        SS9  UR                  S[        SS9  UR                  S[        SS9  UR                  S[        SS9  g)zAdds vCenterConfig flags.zavCenter configurations for the cluster. If not specified, it is inherited from the admin cluster.r   z--vcenter-resource-poolz7Name of the vCenter resource pool for the user cluster.r   z--vcenter-datastorez3Name of the vCenter datastore for the user cluster.z--vcenter-datacenterz4Name of the vCenter datacenter for the user cluster.z--vcenter-clusterz1Name of the vCenter cluster for the user cluster.z--vcenter-folderz0Name of the vCenter folder for the user cluster.z--vcenter-ca-cert-datazCName of the vCenter CA certificate public key for SSL verification.z--vcenter-storage-policy-namez8Name of the vCenter storage policy for the user cluster.Nr   )r0   vcenter_config_groups     r   AddVCenterConfigr    s    ))/ *  ##D $ 
 ##@ $ 
 ##A $ 
 ##> $ 
 ##= $ 
 ##
O	 $  ##%E $ r   )N)TTN)TT)T)F)FN)NF)n__doc__
__future__r   r   r   r  googlecloudsdk.callioper   r   r   r	    googlecloudsdk.calliope.conceptsr
   r   .googlecloudsdk.command_lib.container.gkeonpremr   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.corer   r   r   r%   r/   ArgumentInterceptorr;   r,   rG   rJ   rP   rS   rZ   ri   rl   ro   rq   ru   rx   rz   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*  r6  r;  rH  rK  rW  r'  r(  r_  rc  rh  re  ro  rs  rw  ry  r{  r}  r  r  r  r  r  r)  r  r  r  r  rf  r   r  r  r.   r   r   <module>r     s6   L &  '  / ( . 4 5 1 @ D G * )0,,$4$H$H #3#G#G  006	 006 MQ%00%P DH00&$4$H$H  "2"F"F  *:*N*N  00$)9)M)M  )9)M)M .00. :?00( 
 F



%P  '+J00JJ $$JD >C004';; DQh(V: >CC00C6+?? #3#G#G #3#G#G .0 >C@00@6.B*>> .Bb0(<(<[|9  F'7'K'K ( >C00@ '+0000 $$0h 8="L >C#00#N >C"00"J$, >C00, >C00* >C 00 F-AA >"!1!E!E "J,@@  (8(L(L " -2)X$4$H$H  $4$H$H */CC  $4$H$H . (,,<,P,P$$, (, .BB $$   F1-AA 1h--AA -d -r   