
                              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	S
S.rSSSS.rSSS.rSSS.rS rS&S jrS rS rS rS rS rS rS rS rS  rS! rS" rS'S# jrS$ rg%)(z:Flags for the `compute sole-tenancy node-groups` commands.    )absolute_import)division)unicode_literals)arg_parsers)flags)	arg_utilszbVM instances on the host are live migrated to a new physical  server. This is the default setting.zVM instances on the host are terminated and then restarted on the same physical server after the maintenance event has completed.zVVM instances on the host are live migrated to another node within the same node group.)defaultrestart-in-placemigrate-within-node-groupr	   r
   r   )DEFAULTRESTART_IN_PLACEMIGRATE_WITHIN_NODE_GROUPz^ hosts are eligible to receive infrastructure and hypervisor updates as they become available.a0  hosts receive planned infrastructure and hypervisor updates on a periodic basis, but not more frequently than every 28 days. This minimizes the number of planned maintenance operations on individual hosts and reduces the frequency of disruptions, both live migrations and terminations, on individual VMs.)	as-needed	recurrentr   r   )	AS_NEEDED	RECURRENTc                  J    [         R                  " SS[         R                  S9$ )Nz
node groupzcompute.nodeGroups)resource_namezonal_collectionzone_explanation)compute_flagsResourceArgumentZONE_PROPERTY_EXPLANATION     Hlib/googlecloudsdk/command_lib/compute/sole_tenancy/node_groups/flags.pyMakeNodeGroupArgr   =   s&    		'	' +$>>
@ @r   c                 &    U R                  SUSS9  g )Nz--node-templatezEThe name of the node template resource to be set for this node group.)requiredhelpadd_argument)parserr   s     r   AddNoteTemplateFlagToParserr$   D   s       r   c                     U R                  SSS9  [        U 5        U R                  SS[        SS9  U R                  S[        S	 S
S9  g)z;Add flags for creating a node group to the argument parser.z--descriptionz)An optional description of this resource.r    z--target-sizeTz5The target initial number of nodes in the node group.)r   typer    --maintenance-policyc                 "    U R                  5       $ Nlowerpolicys    r   <lambda>'AddCreateArgsToParser.<locals>.<lambda>Z   
    &,,.r   zDetermines the maintenance behavior during host maintenance events. For more information, see https://cloud.google.com/compute/docs/nodes#maintenance_policies.choicesr'   r    N)r"   r$   int_MAINTENANCE_POLICY_CHOICESr#   s    r   AddCreateArgsToParserr7   L   sj    6  8 f%B	  D
 	)(N  Pr   c                     U R                  SS9nUR                  S[        SS9  UR                  SS[        R                  " 5       SS	9  [        U S
S9  g)z;Add flags for updating a node group to the argument parser.T)mutexz--add-nodesz-The number of nodes to add to the node group.r'   r    z--delete-nodesNODEz0The names of the nodes to remove from the group.metavarr'   r    F)r   N)	add_groupr"   r4   r   ArgListr$   )r#   update_node_count_groups     r   AddUpdateArgsToParserrA   a   sh    ",,4,8&&: ' < && =	 ' ?
 fu5r   c                 &    U R                  SSSS9  g)z@Add flag for adding maintenance window start time to node group.z--maintenance-window-start-time
START_TIMEzThe time (in GMT) when planned maintenance operations window begins. The possible values are 00:00, 04:00, 08:00, 12:00, 16:00, 20:00.)r=   r    Nr!   r6   s    r   AddMaintenanceWindowArgToParserrD   p   s     '  r   c                 &    U R                  SSSS9  g)zAdd --location-hint flag.z--location-hintTzCUsed by internal tools to control sub-zone location of node groups.)hiddenr    Nr!   r6   s    r   AddLocationHintArgToParserrG   z   s    
O	  	r   c                     U R                  SS9nUR                  SS/ SQSS9  UR                  S[        R                  " S	S
9SSS9  g)z4Add share setting configuration arguments to parser.z)Manage the properties of a shared settingr&   z--share-settingT)projectsorganizationlocalzp
Specify if this node group is shared; and if so, the type of sharing:
share with specific projects or folders.
r   r3   r    z--share-with   
min_lengthPROJECTzBA list of specific projects this node group should be shared with.)r'   r=   r    N)r>   r"   r   r?   )r#   groups     r   AddShareSettingArgToParserrR      sd    


 K

L%3	   !,O	  Qr   c                 &    U R                  SSSS9  g)zAdd --share-setting flag.z--share-settings
store_truez0If provided, shows details for the share setting)actionr    Nr!   r6   s    r   "AddListingShareSettingsArgToParserrV      s    =  ?r   c                 N    U R                  SS[        R                  " 5       SS9  g)Add --nodes flag.--nodesr;   z5The names of the nodes to simulate maintenance event.r<   Nr"   r   r?   r6   s    r   +AddSimulateMaintenanceEventNodesArgToParserr[      s+     B	  Dr   c           	      N    U R                  SSS[        R                  " SS9SS9  g)	rX   rY   Tr;   rM   rN   z1The names of the nodes to perform maintenance on.)r   r=   r'   r    NrZ   r6   s    r   %AddPerformMaintenanceNodesArgToParserr]      s0    !,>  @r   c                 X    U R                  SS[        R                  R                  SS9  g)zAdd --start-time flag.z--start-timerC   zfThe requested time for the maintenance window to start. The timestamp must be an RFC3339 valid string.r<   N)r"   r   DatetimeParser6   s    r   )AddPerformMaintenanceStartTimeArgToParserra      s/    %%8  	r   c                 ^    [         R                  " SU R                  R                  [        S9$ )Nr(   custom_mappings)r   ChoiceEnumMapper	NodeGroup MaintenancePolicyValueValuesEnum_MAINTENANCE_POLICY_MAPPINGSmessagess    r   GetMaintenancePolicyEnumMapperrk      s*    		#	#992
 r   c                 ^    [         R                  " SU R                  R                  [        S9$ )N--maintenance-intervalrc   )r   re   rf   "MaintenanceIntervalValueValuesEnum_MAINTENANCE_INTERVAL_MAPPINGSri   s    r    GetMaintenanceIntervalEnumMapperrp      s*    		#	#;;4
 r   c                     U R                  SS9nUR                  SUSSSS.SS	9  UR                  S
[        SS9  UR                  S[        SS9  g)z3Add autoscaling configuration  arguments to parser.z#Autoscaling policy for node groups.r&   z--autoscaler-modez*to permit autoscaling to scale in and out.z3to permit autoscaling to scale only out and not in.zto turn off autoscaling.)onzonly-scale-outoffz/Set the mode of an autoscaler for a node group.rL   z--min-nodeszw
The minimum size of the node group. Default is 0 and must be an integer value
smaller than or equal to `--max-nodes`.
r:   z--max-nodesz
The maximum size of the node group. Must be smaller or equal to 100 and larger
than or equal to `--min-nodes`. Must be specified if `--autoscaler-mode` is not
``off''.
N)r>   r"   r4   )r#   required_moderQ   s      r   AddAutoscalingPolicyArgToParserru      s     

 E

F%(+  L,> :	 L  	M ]   ]  r   c                 2    U R                  S[        S SS9  g)z7Add flag for adding maintenance interval to node group.rm   c                 "    U R                  5       $ r*   r+   r-   s    r   r/   3AddMaintenanceIntervalArgToParser.<locals>.<lambda>   r1   r   z6Specifies the frequency of planned maintenance events.r2   N)r"   _MAINTENANCE_INTERVAL_CHOICESr6   s    r   !AddMaintenanceIntervalArgToParserrz      s!    +(C	  r   N)T)F)__doc__
__future__r   r   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r   $googlecloudsdk.command_lib.util.apisr   r5   rh   ry   ro   r   r$   r7   rA   rD   rG   rR   rV   r[   r]   ra   rk   rp   ru   rz   r   r   r   <module>r      s    A &  ' / E :7;"O  *!<  	%	0!  " @P*6	Q$?D@		:r   