
    ơ                     (   S r SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ	r	  SSKJ
r
  SS	KJr  SS
KJr  SSKJr  SSKJr  S rS rS\R(                  4S jrS rS r SRS jrS rS r SRS jrS\R(                  4S jrS\R(                  4S jrS\R(                  4S jrS\R(                  4S jrS\R(                  4S jr S\R(                  4S jr!SSS\R(                  4S jjr" SSS jr#S  r$SSS! jr% SSS\R(                  4S" jjr&S# r'S$ r(S% r)S& r*SSS' jr+SSS( jr,S) r-S* r.S+ r/ SSS\R(                  4S, jjr0S- r1S. r2S/ r3S\R(                  4S0 jr4SSS1 jr5S2 r6S3 r7 SSS4 jr8 SSS5 jr9S6 r: SSS\R(                  4S7 jjr;S\R(                  4S8 jr<S\R(                  4S9 jr=SSS: jr>S; r? SSS\R(                  4S< jjr@S\R(                  4S= jrA SSS\R(                  4S> jjrBS? rCS@ rDS\R(                  4SA jrESSSB jrF SSS\R(                  4SC jjrGS\R(                  4SD jrHSE rIS\R(                  4SF jrJSG rKSH rLSI rMSJ rN STSK jrO SSS\R(                  4SL jjrPSM rQSN rRSO rSS\R(                  4SP jrTS\R(                  4SQ jrUg)Uz@Helpers for flags in commands for Anthos clusters on bare metal.    )absolute_import)division)unicode_literals)arg_parsers)parser_arguments)concepts)deps)flags)concept_parsers)presentation_specs)
propertiesc                      [         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_bare_metalr        Jlib/googlecloudsdk/command_lib/container/bare_metal/admin_cluster_flags.pyLocationAttributeConfigr      sC    		2	2;

"
"44==
 r   c                  \    [         R                  " SS[         R                  [        5       S9$ )z?Constructs and returns the Resource specification for Location.zgkeonprem.projects.locationsr   )resource_name
projectsIdlocationsId)r   ResourceSpec DEFAULT_PROJECT_ATTRIBUTE_CONFIGr   r   r   r   GetLocationResourceSpecr"   ,   s*    			$::)+	
 r   parserc                     [         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 {}.TrequiredN)r   ConceptParserForResourcer"   formatAddToParserr#   verbs     r   AddLocationResourceArgr.   6   sC     ++!((.	 , 
 Kr   c                  ,    [         R                  " SSS9$ )Nclustercluster of the {resource}.r   r   r   r   r   r   r   ClusterAttributeConfigr4   E   s    		2	2,
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )Nz.gkeonprem.projects.locations.bareMetalClustersr0   )r   bareMetalClustersIdr   r   )r   r    r4   r   r!   r   r   r   GetClusterResourceSpecr7   L   s0    			602)+::
 r   Nc                     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 Bare Metal.

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.
r0   	--clusterz
cluster {}r'   flag_name_overridesN)r   r(   r)   r7   r*   r+   r#   r-   
positionalr'   r;   r   s         r   AddClusterResourceArgr>   V   sO     !k$++
$- ,  Kr   c                  ,    [         R                  " SSS9$ )Nadmin_clusterr1   r2   r3   r   r   r   AdminClusterAttributeConfigrA   m   s    		2	2,
 r   c                  n    [         R                  " SS[        5       [        5       [         R                  S9$ )Nz3gkeonprem.projects.locations.bareMetalAdminClustersr@   )r   bareMetalAdminClustersIdr   r   )r   r    rA   r   r!   r   r   r   GetAdminClusterResourceSpecrD   t   s0    			;#:<)+::
 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 bare metal 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.
r@   --admin-clusterzadmin cluster {}r:   N)r   r(   r)   rD   r*   r+   r<   s         r   AddAdminClusterResourceArgrG   ~   sP     ',=$++
!#%- ,  Kr   c                 &    U R                  SSSS9  g)zAdds a flag for force cluster operation when there are existing node pools.

Args:
  parser: The argparse parser to add the flag to.
z--force
store_truezIf set, the operation will also apply to the child node pools. This flag is required if the cluster has any associated node pools.actionhelpNadd_argumentr#   s    r   AddForceClusterrP      s#     	L	  r   c                 &    U R                  SSSS9  g)zAdds a flag for the 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.
--allow-missingrI   zfIf set, and the Bare Metal cluster is not found, the request will succeed but no action will be taken.rJ   NrM   rO   s    r   AddAllowMissingClusterrS      s"     	2	  r   c                 &    U R                  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.
rR   rI   zIf set, and the Anthos cluster on bare metal is not found, the update request will try to create a new cluster with the provided configuration.rJ   NrM   rO   s    r   AddAllowMissingUpdateClusterrU      s"     		  r   c                 &    U R                  SSS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.
z--validate-onlyrI   zMIf set, only validate the request, but do not actually perform the operation.rJ   NrM   rO   s    r   AddValidationOnlyrW      s"     		  r   c                 x   U R                  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.
 Use cases for querying versions.Tmutexz6Create an Anthos on bare metal admin cluster use case.7Upgrade an Anthos on bare metal admin cluster use case.--admin-cluster-membershipz|Membership of the admin cluster to query versions for create. Membership can be the membership ID or the full resource name."--admin-cluster-membership-project#--admin-cluster-membership-locationprojectr   Fr;   r'   groupr9   z&Cluster to query versions for upgrade.r    )r'   r;   rc   z--cluster.locationr%   command_level_fallthroughsglobal)!admin_cluster_membership_locationN)
	add_groupr   r(   r   ResourcePresentationSpecr
   %GetAdminClusterMembershipResourceSpecr7   r+   set_defaults)r#   config_type_groupcreate_configupgrade_config
arg_parsers        r   AddConfigTyperq      s     &&( '  $-->- %..?. ,,

5
5*99;$
 BC# ! 
5
5$&6#-r"2"!4 "5*<  Ar   c                     U R                  SSS9nUR                  S5      n[        R                  " [        R                  " S[        5       SSS0S	US
9/SS/0S9nUR                  U 5        g)zrAdds flags to specify admin cluster version config type.

Args:
  parser: The argparse parser to add the flag to.
rY   TrZ   r\   rF   z,Admin cluster to query versions for upgrade.r   rd   Frb   z--admin-cluster.locationr%   re   N)ri   r   r(   r   rj   rD   r+   )r#   rm   ro   rp   s       r   AddAdminConfigTypers     s     &&( '  %..?. ,,

5
5)+<#-r"2"	 %|n"*  r   c                 4    U(       + nU R                  SUSS9  g)zAdds a flag to specify the Anthos cluster on bare metal version.

Args:
  parser: The argparse parser to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z	--versionzDAnthos cluster on bare metal version for the admin cluster resource.r'   rL   NrM   )r#   	is_updater'   s      r   
AddVersionrw   *  s'     ](
P	  r   c           	      \    U(       + nU R                  SSU[        R                  " SS9SS9  g)zAdds a flag to specify the IPv4 address ranges used in the services in the cluster.

Args:
  bare_metal_island_mode_cidr_config_group: The parent group to add the flag
    to.
  is_update: bool, whether the flag is for update command or not.
z)--island-mode-service-address-cidr-blocksSERVICE_ADDRESS   
min_lengthz3IPv4 address range for all services in the cluster.metavarr'   typerL   NrN   r   ArgList)(bare_metal_island_mode_cidr_config_grouprv   r'   s      r   _AddServiceAddressCIDRBlocksr   ;  s>     ](*771 A 8 r   c           	      N    U R                  SSS[        R                  " SS9SS9  g)	zAdds a flag to specify the IPv4 address ranges used in the pods in the cluster.

Args:
  bare_metal_island_mode_cidr_config_group: The parent group to add the flag
    to.
z%--island-mode-pod-address-cidr-blocksPOD_ADDRESSTrz   r{   z/IPv4 address range for all pods in the cluster.r}   Nr   )r   s    r   _AddPodAddressCIDRBlocksr   Q  s6     +77- = 8 r   c                     U(       + nU R                  SS9nU(       a  [        X15        [        U5        g[        X15        g)zAdds island mode CIDR config related flags.

Args:
  bare_metal_network_config_group: The parent group to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z'Island mode CIDR network configuration.rL   N)ri   r   r   )bare_metal_network_config_grouprv   r'   r   s       r   _AddIslandModeCIDRConfigr   c  sL     ](%//8 0  +
  0 EF 0r   c                 J    U(       + nU R                  SUSS9n[        X15        g)zAdds network config related flags.

Args:
  parser: The argparse parser to add the flag to.
  is_update: bool, whether the flag is for update command or not.
Tz$Populate one of the network configs.r[   r'   rL   N)ri   r   )r#   rv   r'   network_config_mutex_groups       r   AddNetworkConfigr   {  s5     ](%//1  0  
 5Ar   c           
          U R                  SSS9nSnUR                  SU[        R                  " 5       SS9  UR                  SSS	[        R                  " [
        [
        S
.S/S9S9  g)z{Adds flags to set the Metal LB node config.

Args:
  bare_metal_metal_lb_node_config: The parent group to add the flag to.
z+Populate MetalLB load balancer node config.T)rL   r[   a  
Path of the YAML/JSON file that contains the Metal LB node configs.

Examples:

  nodeConfigs:
  - nodeIP: 10.200.0.10
    labels:
      node1: label1
      node2: label2
  - nodeIP: 10.200.0.11
    labels:
      node3: label3
      node4: label4

List of supported fields in `nodeConfigs`

KEY           | VALUE                     | NOTE
--------------|---------------------------|---------------------------
nodeIP        | string                    | required, mutable
labels        | one or more key-val pairs | optional, mutable

z/--metal-lb-load-balancer-node-configs-from-filerL   r   hiddenz%--metal-lb-load-balancer-node-configsz)MetalLB load balancer node configuration.appendnode-iplabelsr   specrequired_keysrL   rK   r   Nri   rN   r   YAMLFileContentsArgDictstr)bare_metal_metal_lb_node_confignode_config_mutex_group)metal_lb_node_configs_from_file_help_texts      r   _AddMetalLBNodeConfigsr     s     <EE8 F /+. &&74'')	 '  &&-6 #	 ' r   c                 N    U R                  SS[        R                  " 5       SS9  g)zAdds a flag to assign labels to nodes in a MetalLB node pool.

Args:
  bare_metal_metal_lb_node_config: The parent group to add the flags to.
z$--metal-lb-load-balancer-node-labels	KEY=VALUEz0Labels assigned to nodes of a MetalLB node pool.r~   r   rL   NrN   r   r   r   s    r   _AddMetalLBNodeLabelsr     s,     ".., =	 / r   c                 N    U R                  SSS[        R                  " 5       S9  g)zAdds a flag to specify the node taint in the MetalLBnode pool.

Args:
 bare_metal_metal_lb_node_config: The parent group to add the flags to.
z$--metal-lb-load-balancer-node-taintsKEY=VALUE:EFFECTz8Node taint applied to every node in a MetalLB node pool.r~   rL   r   Nr   r   s    r   _AddMetalLBNodeTaintsr     s,     ".., E 	 / r   c                     U R                  SS9nUR                  SS9n[        U5        [        U5        [        U5        g)zAdds a command group to set the node pool config for MetalLB load balancer.

Args:
 metal_lb_config_group: The argparse parser to add the flag to.
zMAnthos on bare metal node pool configuration for MetalLB load balancer nodes.r   z MetalLB Node Pool configuration.N)ri   r   r   r   )metal_lb_config_group*bare_metal_metal_lb_node_pool_config_groupr   s      r   _AddMetalLBNodePoolConfigr     s[     0E/N/N 0O 0, 1::1 ;  " 897878r   c                 R   U(       + nU R                  SSUS9nSnUR                  SU[        R                  " 5       SS9  UR                  SSS[        R                  " [
        [        R                  " 5       [        R                  " 5       [        R                  " S	S
9S.SS/S9S9  g)zAdds flags for address pools used by Metal LB load balancer.

Args:
  metal_lb_config_group: The parent group to add the flags to.
  is_update: bool, whether the flag is for update command or not.
z$MetalLB address pools configuration.T)rL   r[   r'   a  
Path of the YAML/JSON file that contains the MetalLB address pools.

Examples:

  addressPools:
  - pool: pool-1
    addresses:
    - 10.200.0.14/32
    - 10.200.0.15/32
    avoidBuggyIPs: True
    manualAssign: True
  - pool: pool-2
    addresses:
    - 10.200.0.16/32
    avoidBuggyIPs: False
    manualAssign: False

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-address-pools-from-filer   z--metal-lb-address-poolsr   ;)custom_delim_char)poolzavoid-buggy-ipszmanual-assign	addressesr   r   r   r   N)ri   rN   r   r   r   r   
ArgBooleanr   )r   rv   r'   "metal_lb_address_pools_mutex_group*metal_lb_address_pools_from_file_help_texts        r   _AddMetalLBAddressPoolsr     s     ]('<'F'F1 (G ($
0,8 %11*5'')	 2  %11 1!,!7!7!9*557&..E	  -	 2 r   c                 R    U R                  S5      n[        X!5        [        U5        g)zAdds flags for metalLB load balancer.

Args:
  lb_config_mutex_group: The parent mutex group to add the flags to.
  is_update: bool, whether the flag is for update command or not.
zMetalLB ConfigurationN)ri   r   r   )lb_config_mutex_grouprv   r   s      r   _AddMetalLBConfigr   3  s,     099 /;12r   c                 F    U R                  SS9nUR                  SSSSS9  g)	zqAdds flags for manual load balancer.

Args:
  lb_config_mutex_group: The parent mutex group to add the flags to.
#Manual load balancer configuration.r   --enable-manual-lbTrI   ,ManualLB typed load balancers configuration.r'   rK   rL   Nri   rN   )r   manual_lb_config_groups     r   _AddManualLBConfigr   B  s>     1::0 ;  %%9	 & r   c                 h    U R                  SSS9nUR                  SSSS9  UR                  SSSS9  g	)
zAdds flags to set VIPs used by the load balancer.

Args:
  bare_metal_load_balancer_config_group: The parent group to add the flags to.
z  VIPs used by the load balancer.TrL   r'   --control-plane-vip+VIP for the Kubernetes API of this cluster.ru   z--ingress-vipz*VIP for ingress traffic into this cluster.Nr   )%bare_metal_load_balancer_config_groupbare_metal_vip_config_groups     r   _AddVIPConfigr   S  s^     !F O O- !P ! **8 + 
 **7 + r   c                 P    U R                  SSS9nUR                  SSS[        S9  g)zAdds flags to set port for load balancer.

Args:
  bare_metal_load_balancer_config_group: The parent group to add the flags to.
/Control plane load balancer port configuration.Tr   "--control-plane-load-balancer-portr'   rL   r   Nri   rN   int)r   -control_plane_load_balancer_port_config_groups     r   _AddLoadBalancerPortConfigr   i  sC     ,55@ 6  0 0<<*<	 = r   c                     U(       + nU R                  SUS9nUR                  SUSS9nU(       a-  [        U5        [        U5        [        XA5        [	        U5        g[        XA5        g)Adds a command group to set the load balancer config.

Args:
  parser: The argparse parser to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z9Anthos on bare metal cluster load balancer configuration.r   Tz#Populate one of the load balancers.r   N)ri   r   r   r   r   )r#   rv   r'   r   r   s        r   AddLoadBalancerConfigr   }  s|     ](*0*:*:F +; +'
 @II0 J  78DE+7,-+7r   c                 h    U R                  SSS9nUR                  SSSS9  UR                  SSSS9  g	)
zAdds flags to set LVP Share class and path used by the storage.

Args:
  bare_metal_lvp_share_config_group: The parent group to add the flags to.
z. LVP share class and path used by the storage.Tr   z--lvp-share-pathzPath for the LVP share class.ru   z--lvp-share-storage-classzStorage class for LVP share.Nr   )!bare_metal_lvp_share_config_group)bare_metal_storage_lvp_share_config_groups     r   _AddStorageLVPShareConfigr     s^     (11? 2  , ,88* 9 
 ,88!) 9 r   c                 Z    U R                  SSS9nUR                  SSS9  [        U5        g)zAdds flags to set LVP Share class and path used by the storage.

Args:
  bare_metal_storage_config_group: The parent group to add the flags to.
z LVP share configuration.Tr   z--shared-path-pv-countz.Number of subdirectories to create under path.r   N)ri   rN   r   )bare_metal_storage_config_groupr   s     r   _AddLVPShareConfigr     sH     'F&O&O& 'P '#
 $00; 1 
 =>r   c                 h    U R                  SSS9nUR                  SSSS9  UR                  SSSS9  g	)
zAdds flags to set LVP Node Mounts class and path used by the storage.

Args:
  bare_metal_storage_config_group: The parent group to add the flags to.
z4 LVP node mounts class and path used by the storage.Tr   z--lvp-node-mounts-config-pathz#Path for the LVP node mounts class.ru   z&--lvp-node-mounts-config-storage-classz"Storage class for LVP node mounts.Nr   )r    bare_metal_lvp_node_config_groups     r   _AddLVPNodeMountsConfigr     s^     &E%N%NA &O &" #//%0 0 
 #//./ 0 r   c                 P    U R                  SSS9n[        U5        [        U5        g)ziAdds a command group to set the storage config.

Args:
  parser: The argparse parser to add the flag to.
z3Anthos on bare metal cluster storage configuration.Tr   N)ri   r   r   )r#   r   s     r   AddStorageConfigr     s4     %+$4$4@ %5 %! 459:r   c           
          U(       + nU R                  SUSS9nSnUR                  SU[        R                  " 5       SS9  UR                  SSS	[        R                  " [
        [
        S
.S/S9S9  g)zAdds flags to set the control plane node config.

Args:
  bare_metal_node_config_group: The parent mutex group to add the flags to.
  is_update: bool, whether the flag is for update command or not.
z#Populate control plane node config.T)rL   r'   r[   a  
Path of the YAML/JSON file that contains the control plane node configs.

Examples:

  nodeConfigs:
  - nodeIP: 10.200.0.10
    labels:
      node1: label1
      node2: label2
  - nodeIP: 10.200.0.11
    labels:
      node3: label3
      node4: label4

List of supported fields in `nodeConfigs`

KEY           | VALUE                     | NOTE
--------------|---------------------------|---------------------------
nodeIP        | string                    | required, mutable
labels        | one or more key-val pairs | optional, mutable

z&--control-plane-node-configs-from-filer   z--control-plane-node-configsz!Control plane node configuration.r   r   r   r   r   Nr   )bare_metal_node_config_grouprv   r'   r   .control_plane_node_configs_from_file_help_texts        r   _AddControlPlaneNodeConfigsr     s     ](8BB084 C 40. &&.9'')	 '  &&$. #	 ' r   c                 N    U R                  SS[        R                  " 5       SS9  g)zAdds a flag to assign labels to nodes in a node pool.

Args:
  bare_metal_node_config_group: The parent group to add the flags to.
z--control-plane-node-labelsr   z(Labels assigned to nodes of a node pool.r   Nr   r   s    r   _AddControlPlaneNodeLabelsr      s,     ++# 5	 , r   c                 N    U R                  SSS[        R                  " 5       S9  g)zAdds a flag to specify the node taint in the node pool.

Args:
  bare_metal_node_config_group: The parent group to add the flags to.
z--control-plane-node-taintsr   z;Node taint applied to every Kubernetes node in a node pool.r   Nr   r   s    r   _AddControlPlaneNodeTaintsr   .  s,     ++# H 	 , r   c                     U(       + nU R                  SUS9nUR                  SUS9n[        XA5        [        U5        [        U5        g)zAdds a command group to set the node pool config.

Args:
  bare_metal_control_plane_node_pool_config_group: The argparse parser to add
    the flag to.
  is_update: bool, whether the flag is for update command or not.
zEAnthos on bare metal node pool configuration for control plane nodes.r   z@Anthos on bare metal node configuration for control plane nodes.N)ri   r   r   r   )/bare_metal_control_plane_node_pool_config_grouprv   r'   !bare_metal_node_pool_config_groupr   s        r   _AddNodePoolConfigr   <  si     ](&U&_&_  '` '# "C!L!LM "M "
 :F9:9:r   c                 H    U(       + nU R                  SUS9n[        X15        g)zAdds a command group to set the control plane node pool config.

Args:
  bare_metal_control_plane_config_group: The argparse parser to add the flag
    to.
  is_update: bool, whether the flag is for update command or not.
zCAnthos on bare metal cluster control plane node pool configuration.r   N)ri   r   )%bare_metal_control_plane_config_grouprv   r'   r   s       r   _AddControlPlaneNodePoolConfigr   X  s8     ](+55   6  2 DPr   c                 N    U R                  SSS[        R                  " 5       S9  g)zAdds a flag to specify the API server args.

Args:
  bare_metal_control_plane_config_group: The parent group to add the flags to.
z--api-server-argsr   z"API Server argument configuration.r   Nr   )r   s    r   _AddControlPlaneAPIServerArgsr   o  s,     (44/ 	 5 r   c                 ^    U(       + nU R                  SUS9n[        X15        [        U5        g)zAdds a command group to set the control plane config.

Args:
  parser: The argparse parser to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z9Anthos on bare metal cluster control plane configuration.r   N)ri   r   r   )r#   rv   r'   r   s       r   AddControlPlaneConfigr   }  s?     ](*0*:*:F +; +' !+   EFr   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   rL   NrN   r   rO   s    r   AddDescriptionr     s     	C&E  r   c                 N    U R                  SS[        R                  " 5       SS9  g)zeAdds a flag to specify cluster annotations.

Args:
  parser: The argparse parser to add the flag to.
z--annotationsr   z1Annotations on the Anthos on bare metal resource.r   Nr   rO   s    r   AddAnnotationsr     s,     	 >	  r   c                 >    U(       + nU R                  SU[        SS9  g)zAdds a flag to specify the address of the proxy server.

Args:
  bare_metal_proxy_config_group: The parent group to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z--urizAddress of the proxy server.)r'   r   rL   Nr   )bare_metal_proxy_config_grouprv   r'   s      r   _AddURIConfigr     s*     ](,,)	 - r   c                 N    U R                  SS[        R                  " 5       SS9  g)zAdds a flag to specify the address of the proxy server.

Args:
  bare_metal_proxy_config_group: The parent group to add the flag to.
z
--no-proxyNO_PROXYz?List of IPs, hostnames, and domains that should skip the proxy.r   Nr   )r   s    r   _AddNoProxyConfigr    s,      ,, L	 - r   c                 N    U R                  SS9n[        X!5        [        U5        g)zAdds a command group to set the proxy config.

Args:
  parser: The argparse parser to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z1Anthos on bare metal cluster proxy configuration.r   N)ri   r   r  )r#   rv   r   s      r   AddProxyConfigr    s1     #)"2"2> #3 # -912r   c                 D    U R                  SS9nUR                  SSSS9  g)ztAdds a command group to set the cluster operations config.

Args:
  parser: The argparse parser to add the flag to.
z6Anthos on bare metal cluster operations configuration.r   z--enable-application-logsrI   zfWhether collection of application logs/metrics should be enabled (in addition to system logs/metrics).rJ   Nr   )r#   *bare_metal_cluster_operations_config_groups     r   AddClusterOperationsConfigr    s>     06/?/?C 0@ 0, -99!/	 : r   c                 |    U(       + nU R                  SS9nUR                  S[        R                  " 5       SSUS9  g)zAdds a command group to set the maintenance config.

Args:
  parser: The argparse parser to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z7Anthos on bare metal cluster maintenance configuration.r   z!--maintenance-address-cidr-blocksMAINTENANCE_ADDRESS_CIDR_BLOCKSz2IPv4 addresses to be placed into maintenance mode.)r   r~   rL   r'   N)ri   rN   r   r   )r#   rv   r'   #bare_metal_maintenance_config_groups       r   AddMaintenanceConfigr
    sQ     ]((.(8(8D )9 )% &22) /? 3 r   c                 .    U R                  SS[        S9  g)zAdds flags to set maximum pods per node.

Args:
  bare_metal_workload_node_config_group: The parent group to add the flags to.
z--max-pods-per-nodez&Maximum number of pods a node can run.)rL   r   N)rN   r   %bare_metal_workload_node_config_groups    r   _AddMaxPodsPerNoder    s      (443 5 r   c                 $    U R                  SSS9  g)zAdds flags to set runtime for containers.

Args:
  bare_metal_workload_node_config_group: The parent group to add the flags to.
z--container-runtimezEContainer runtime which will be used in the bare metal admin cluster.r   NrM   r  s    r   _AddContainerRuntimer    s     (44 5 r   c                 N    U R                  SS9n[        U5        [        U5        g)oAdds a command group to set the workload node config.

Args:
  parser: The argparse parser to add the flag to.
z9Anthos on bare metal cluster workload node configuration.r   N)ri   r  r  r#   r  s     r   AddWorkloadNodeConfigr    s1     +1*:*:F +; +' :;<=r   c                 T    U(       + nU R                  SS9nUR                  SSSUS9  g)zAdds flags to specify applied and managed RBAC policy.

Args:
  bare_metal_security_config_group: The parent group to add the flags to.
  is_update: bool, whether the flag is for update command or not.
z*Admin cluster authorization configurationsr   z--admin-usersziUsers that will be granted the view role on the admin cluster, providing view only access to the cluster.r   )rL   rK   r'   Nr   ) bare_metal_security_config_grouprv   r'   authorization_groups       r   _AddAuthorizationr  -  sJ     ](8BB7 C  ""8  # r   c                 8    U R                  SS9n[        X!5        g)zAdds a command group to set the security config.

Args:
  parser: The argparse parser to add the flag to.
  is_update: bool, whether the flag is for update command or not.
z:Anthos on bare metal admin cluster security configuration.r   N)ri   r  )r#   rv   r  s      r   AddSecurityConfigr  C  s(     &,%5%5G &6 &" 4@r   c                 L    U R                  SS9nUR                  S[        SS9  g)zmAdds a command group to set the node access config.

Args:
  parser: The argparse parser to add the flag to.
zHAnthos on bare metal node access related settings for the admin cluster.r   z--login-userz'User name used to access node machines.r   N)ri   rN   r   )r#   #bare_metal_node_access_config_groups     r   AddNodeAccessConfigr  S  s=     )/(8(8 )9 )% &224 3 r   c                  \    [         R                  " SS[        5       [         R                  S9$ )Nz'gkeonprem.projects.locations.operations	operation)r   r   r   )r   r    r   r!   r   r   r   GetOperationResourceSpecr   g  s*    			/)+::	
 r   c                     [         R                  R                  S[        5       SR	                  U5      SS9R                  U 5        g)zAdds a resource argument for operation in bare metal.

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 {}.Tr&   N)r   r(   r)   r   r*   r+   r,   s     r   AddOperationResourceArgr#  p  sC     ++ T"	 , 
 K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. r2   r3   r   r   r   'AdminClusterMembershipIdAttributeConfigr&    s    		2	2%J
 r   c                  ,    [         R                  " SSS9$ )z:Gets admin cluster membership location resource attribute.r   r   r2   r3   r   r   r   -AdminClusterMembershipLocationAttributeConfigr(    s    		2	2;
 r   c                  ,    [         R                  " SSS9$ )z-Gets Google Cloud project resource attribute.ra   z(Google Cloud project for the {resource}.r2   r3   r   r   r   ,AdminClusterMembershipProjectAttributeConfigr*    s    		2	2:
 r   c                  b    [         R                  " SS[        5       [        5       [	        5       S9$ )Nz%gkehub.projects.locations.membershipsr%  )r   membershipsIdr   r   )r   r    r&  r(  r*  r   r   r   rk   rk     s-    			-.;=?A=?
 r   c           	          U(       a  SOSn[         R                  R                  U[        5       SUSSS.S9R	                  U 5        g)	zAdds a resource argument for a bare metal 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.
r%  r]   z_membership of the admin cluster. Membership can be the membership ID or the full resource name.r^   r_   r`   r:   N)r   r(   r)   rk   r+   )r#   r=   r'   r   s       r   $AddAdminClusterMembershipResourceArgr.    sW     %/ 4P  ++
+-( 9; ,  Kr   c                 t    U(       + nU R                  SUS9n[        U5        [        U5        [        U5        g)r   z?Anthos on bare metal admin cluster load balancer configuration.r   N)ri   _AddAdminVIPConfig_AddAdminLoadBalancerPortConfig_AddAdminManualLBConfig)r#   rv   r'   +bare_metal_admin_load_balancer_config_groups       r   AddAdminLoadBalancerConfigr4    sE     ](060@0@L 1A 1- @A!"MNEFr   c                 F    U R                  SSS9nUR                  SSSS9  g)zAdds flags to set VIPs used by the load balancer.

Args:
  bare_metal_admin_load_balancer_config_group: The parent group to add the
    flags to.
zVIPs used by the load balancer.Tr   r   r   ru   Nr   )r3  r   s     r   r0  r0    s@     2;;0 <   **8 + r   c                 P    U R                  SSS9nUR                  SSS[        S9  g)zAdds flags to set port for load balancer.

Args:
  bare_metal_admin_load_balancer_config_group: The parent group to add the
    flags to.
r   Tr   r   r   Nr   )r3  r   s     r   r1  r1    sC     2;;@ <  0 0<<*<	 = r   c                 F    U R                  SS9nUR                  SSSSS9  g)	zAdds flags for manual load balancer.

Args:
  bare_metal_admin_load_balancer_config_group: The parent group to add the
    flags to.
r   r   r   TrI   r   r   Nr   )r3  r   s     r   r2  r2    s@     2;;4 <  
 %%9	 & r   c                 8    U R                  SS9n[        U5        g)r  z?Anthos on bare metal admin cluster workload node configuration.r   N)ri   r  r  s     r   AddAdminWorkloadNodeConfigr9    s(     +1*:*:L +; +' :;r   c                 &    U R                  SSSS9  g)z^Adds a flag for ignore_errors field.

Args:
  parser: The argparse parser to add the flag to.
z--ignore-errorszvIf set, the unenrollment of a bare metal admin cluster resource will succeed even if errors occur during unenrollment.rI   )rL   rK   NrM   rO   s    r   AddIgnoreErrorsr;    s%     	M   r   )TTN)F)TT)V__doc__
__future__r   r   r   googlecloudsdk.callioper   r    googlecloudsdk.calliope.conceptsr   r	   .googlecloudsdk.command_lib.container.gkeonpremr
   (googlecloudsdk.command_lib.util.conceptsr   r   googlecloudsdk.corer   r   r"   ArgumentInterceptorr.   r4   r7   r>   rA   rD   rG   rP   rS   rU   rW   rq   rs   rw   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&  r(  r*  rk   r.  r4  r0  r1  r2  r9  r;  r   r   r   <module>rD     s(   G &  ' / 4 5 1 @ D G *
#3#G#G  GK. GK.,@@  #3#G#G  )9)M)M ,.BB  .B*>> .Bb!/CC !<';; $ 9>,$2 =BB00B$1h9.<~3",* =B8008<0?&,;-AA ;3l @E;: 6;Q. =BG00G(+?? +??   =B3003 '7'K'K * =B00.
>"2"F"F >. =BA00A  0 D D ($4$H$H  '+: =BG00G&(.(
<'7'K'K 
<,@@ r   