
    E                        S r SSKJr  SSKJr  SSKJr  SSKrSSK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  \R(                  " SSSS\R*                  R,                  SSSS9r\R(                  " SSSS\R*                  R0                  SSSS9rSrS rS rS rS rS rS  r SNS! jr!SNS" jr"S# r#SOS$ jr$SOS% jr%S& r&S' r'SPS( jr(S)S*/r)SPS+ jr*S, r+S- r,S. r-S/ r.S0 r/S1 r0S2 r1S3 r2S4 r3S5 r4S6 r5S7 r6S8 r7S9 r8S: r9S; r:S< r;S= r<S> r=SPS? jr>S@ r?SA r@ SPSB\	SC\ASDS4SE jjrBSF rCSB\R                  4SG jrESB\R                  4SH jrFSB\R                  4SI jrG " SJ SK5      rHSB\R                  4SL jrISM rJg)Qz7Flags for the compute instance groups managed commands.    )absolute_import)division)unicode_literalsN)Any)arg_parsers)base)
exceptions)parser_arguments)flags)	arg_utilsz
--templatezinstance templateTFzcompute.instanceTemplateszcompute.regionInstanceTemplatesz
    Specifies the instance template to use when creating new instances.
    An instance template is either a global or regional resource.
    )resource_namerequiredpluralscope_flags_usageglobal_collectionregional_collection
short_helpz--multi-migz	multi-MIGzcompute.regionMultiMigszr
    Specifies the name or URL of the multi-MIG that will be attached to selected
    managed instance group.
    )r   r   r   r   r   region_help_textregion_hiddenz    table(
      name,
      location():label=LOCATION,
      location_scope():label=SCOPE,
      baseInstanceName,
      size,
      targetSize,
      instanceTemplate.basename(),
      autoscaled
    )
c                 L    U R                  SSSS.S[        R                  SS9  g )Nz--typeDo not proactively replace VMs. Create new VMs and delete old ones on resizes of the group and when you target specific VMs to be updated or recreated.zReplace instances proactively.opportunistic	proactiver   zDesired update type.)choicesdefaultcategoryhelp)add_argumentr   COMMONLY_USED_FLAGSparsers    Glib/googlecloudsdk/command_lib/compute/instance_groups/managed/flags.py
AddTypeArgr$   L   s8    , 8 ''!      c                 .    U R                  S[        SS9  g )Nz--max-surgea=  Maximum additional number of instances that can be created during the update process. This can be a fixed number (e.g. 5) or a percentage of size to the managed instance group (e.g. 10%). Defaults to 0 if the managed instance group has stateful configuration, or to the number of zones in which it operates otherwise.typer   r   strr!   s    r#   AddMaxSurgeArgr+   ]   s!    @	  r%   c                 .    U R                  S[        SS9  g )Nz--max-unavailablea  Maximum number of instances that can be unavailable during the update process. This can be a fixed number (e.g. 5) or a percentage of size to the managed instance group (e.g. 10%). Defaults to the number of zones in which the managed instance group operates.r'   r)   r!   s    r#   AddMaxUnavailableArgr-   m   s     :	  r%   c                 J    U R                  S[        R                  " SS9SS9  g )Nz--min-ready0slower_boundzMinimum time for which a newly created instance should be ready to be considered available. For example `10s` for 10 seconds. See $ gcloud topic datetimes for information on duration formats.r'   r   r   Durationr!   s    r#   AddMinReadyArgr4   |   s+    D1!	  	r%   c                 ,    U R                  SSSS.SS9  g )Nz--replacement-methodz9Delete old instances and create instances with new names.zjRecreate instances and preserve the instance names. The instance IDs and creation timestamps might change.
substituterecreatezType of replacement method. Specifies what action will be taken to update instances. Defaults to ``recreate`` if the managed instance group has stateful configuration, or to ``substitute`` otherwise.r   r   r   r!   s    r#   AddReplacementMethodFlagr;      s/     JGO  r%   c                 &    U R                  SSSS9  g )Nz--force
store_truezNIf set, accepts any original or new version configurations without validation.actionr   r:   r!   s    r#   AddForceArgr@      s     /	  r%   c           	      R    [         R                  " SSSSR                  U S94/5      $ )z;Return possible instance action choices without NONE value.)refreshzApply the new configuration without stopping VMs, if possible. For example, use ``refresh`` to apply changes that only affect metadata or additional disks.)restartzApply the new configuration without replacing VMs, if possible. For example, stopping VMs and starting them again is sufficient to apply changes to machine type.replacezHReplace old VMs according to the --{flag_prefix}replacement-method flag.flag_prefix)collectionsOrderedDictformatrE   s    r#    InstanceActionChoicesWithoutNonerJ      s?    		 	  8F{F+#" 
 r%   c                 0    [        SS0[        U 5      5      $ )z8Return possible instance action choices with NONE value.nonez	No action)_CombineOrderedChoicesrJ   rE   s    r#   InstanceActionChoicesWithNonerN      s    	{=kJ
 r%   c                     [         R                  " / 5      nUR                  U R                  5       5        UR                  UR                  5       5        U$ N)rG   rH   updateitems)choices1choices2mergeds      r#   rM   rM      s=    ""2&&-- !-- !	-r%   c                 ^    U(       a
  [        5       O	[        5       nU R                  SUUSS9  g )Nz--minimal-actiona  Use this flag to minimize disruption as much as possible or to
        apply a more disruptive action than is strictly necessary.
        The MIG performs at least this action on each instance while
        updating. If the update requires a more disruptive action than
        the one specified here, then the more disruptive action is
        performed. If you omit this flag, the update uses the
        ``minimal-action'' value from the MIG's update policy, unless it
        is not set in which case the default is ``replace''.r   r   r   rN   rJ   r   r"   choices_with_noner   r   s       r#   AddMinimalActionArgr[      s>     
 $%+- 

 	@	  r%   c                 ^    U(       a
  [        5       O	[        5       nU R                  SUUSS9  g )Nz --most-disruptive-allowed-actiona  Use this flag to prevent an update if it requires more disruption
        than you can afford. At most, the MIG performs the specified
        action on each instance while updating. If the update requires
        a more disruptive action than the one specified here, then
        the update fails and no changes are made. If you omit this flag,
        the update uses the ``most-disruptive-allowed-action'' value from
        the MIG's update policy, unless it is not set in which case
        the default is ``replace''.rW   rX   rY   s       r#   AddMostDisruptiveActionArgr]      s=     
 $%+- 

 	('	  r%   c                     U R                  SSS9nUR                  S[        R                  " SS9SSSS	9  UR                  S
SSSS9  [	        U SS5        [        U SS5        g)z*Add args for the update-instances command.T)r   mutexz--instances   
min_lengthINSTANCEFzNames of instances to update.)r(   metavarr   r   z--all-instancesr=   z"Update all instances in the group.)r   r?   r   rL   rD   N)	add_groupr   r   ArgListr[   r]   )r"   instance_selector_groups     r#   AddUpdateInstancesArgsrh      s    ",,d$,G&&!,* '  &&/	 '  fdF+VT95r%   c                 *    SnU R                  SSUS9  g )Na  Specifies whether the request should proceed even if the
    request includes instances that are not members of the group or that are
    already being deleted or abandoned. By default, if you omit this flag and
    such an instance is specified in the request, the operation fails. The
    operation always fails if the request contains a badly formatted instance
    name or a reference to an instance that exists in a zone or region other
    than the group's zone or region.z$--skip-instances-on-validation-errorr=   r>   r:   r"   	help_texts     r#   AddGracefulValidationArgrl     s'    () 	,  r%   c                     U (       a  gg)Nz
        table(project(),
              zone(),
              instanceName:label=INSTANCE,
              status,
              validationError:label=VALIDATION_ERROR)zp
        table(project(),
              zone(),
              instanceName:label=INSTANCE,
              status) )with_validation_errors    r#   'GetCommonPerInstanceCommandOutputFormatrp      s    9r%   NONE	PROACTIVEc                     U R                  SSSS9n[        U5        [        U5        [        U5        [	        U5        [        U5        [        U5        U(       a  [        U5        gg)z8Add flags required for setting update policy attributes.FzEParameters for setting update policy for this managed instance group.)r   r_   r   N)re   _AddUpdatePolicyTypeFlag"_AddUpdatePolicyMaxUnavailableFlag_AddUpdatePolicyMaxSurgeFlag!_AddUpdatePolicyMinimalActionFlag(_AddUpdatePolicyMostDisruptiveActionFlag%_AddUpdatePolicyReplacementMethodFlag_AddUpdatePolicyMinReadyFlag)r"   support_min_ready_flaggroups      r#   AddMigUpdatePolicyFlagsr}   3  sd    


	  % 5!$U+u%#E**51'. ' r%   c                 :    SnSSS.nU R                  SSS UUS9  g	)
z,Add --update-policy-type flag to the parser.a3  Specifies the type of update process. You can specify either ``proactive`` so that the managed instance group proactively executes actions in order to bring VMs to their target versions or ``opportunistic`` so that no action is proactively executed but the update will be performed as part of other actions.r   zReplace VMs proactively.r   z--update-policy-typeUPDATE_TYPEc                 "    U R                  5       $ rP   lowerxs    r#   <lambda>*_AddUpdatePolicyTypeFlag.<locals>.<lambda>\  
    QWWYr%   rd   r(   r   r   Nr:   )r|   rk   r   s      r#   rt   rt   G  sA     " .'   r%   c                 0    U R                  SS[        SS9  g )Nz--update-policy-max-unavailableMAX_UNAVAILABLEzMaximum number of VMs that can be unavailable during the update process. This can be a fixed number (e.g. 5) or a percentage of size to the managed instance group (e.g. 10%). Defaults to the number of zones in which the managed instance group operates.rd   r(   r   r)   r|   s    r#   ru   ru   b  s$    'J  
r%   c                 0    U R                  SS[        SS9  g )Nz--update-policy-max-surge	MAX_SURGEzMaximum additional number of VMs that can be created during the update process. This can be a fixed number (e.g. 5) or a percentage of size to the managed instance group (e.g. 10%).r   r)   r   s    r#   rv   rv   p  s#    !>  	r%   c                 L    U R                  SS[        R                  " SS9SS9  g )Nz--update-policy-min-ready	MIN_READYr/   r0   zMinimum time for which a newly created VM should be ready to be considered available. For example `10s` for 10 seconds. See $ gcloud topic datetimes for information on duration formats.r   r2   r   s    r#   rz   rz   }  s/    !D1J  	r%   c                 4    U R                  S[        SS9SS9  g )Nz--update-policy-minimal-actionupdate-policy-rE   a6  Use this flag to minimize disruption as much as possible or to apply a more disruptive action than is strictly necessary. The MIG performs at least this action on each VM while updating. If the update requires a more disruptive action than the one specified here, then the more disruptive action is performed. r9   r   rN   r   s    r#   rw   rw     s&    &+8HI	  r%   c                 4    U R                  S[        SS9SS9  g )Nz&--update-policy-most-disruptive-actionr   rE   a  Use this flag to prevent an update if it requires more disruption than you can afford. At most, the MIG performs the specified action on each VM while updating. If the update requires a more disruptive action than the one specified here, then the update fails and no changes are made.r9   r   r   s    r#   rx   rx     s&    .+8HI6	  
r%   c                 ,    U R                  SSSS.SS9  g )Nz"--update-policy-replacement-methodz-Delete old VMs and create VMs with new names.zXRecreate VMs and preserve the VM names. The VM IDs and creation timestamps might change.r6   zNType of replacement method. Specifies what action will be taken to update VMs.r9   r:   r   s    r#   ry   ry     s+    *GA  r%   c                 :    SnSSS.nU R                  SSS UUS9  g	)
z6Add --instance-redistribution-type flag to the parser.a        Specifies the type of the instance redistribution policy. An instance
      redistribution type lets you enable or disable automatic instance
      redistribution across zones to meet the group's target distribution shape.

      An instance redistribution type can be specified only for a non-autoscaled
      regional managed instance group. By default it is set to ``proactive''.
      zHThe managed instance group does not redistribute instances across zones.z_The managed instance group proactively redistributes instances to meet its target distribution.)rL   r   z--instance-redistribution-typeTYPEc                 "    U R                  5       $ rP   r   r   s    r#   r   6AddMigInstanceRedistributionTypeFlag.<locals>.<lambda>  r   r%   r   Nr:   r"   rk   r   s      r#   $AddMigInstanceRedistributionTypeFlagr     s>    
)*	' 	&  r%   c                 X    SnSSSSS.nU R                  SS[        R                  UUS	9  g
)z3Add --target-distribution-shape flag to the parser.z      Specifies how a regional managed instance group distributes its instances
      across zones within the region. The default shape is ``even''.
    a4  The group schedules VM instance creation and deletion to achieve and maintain an even number of managed instances across the selected zones. The distribution is even when the number of managed instances does not differ by more than 1 between any two zones. Recommended for highly available serving workloads.a.  The group prioritizes acquisition of resources, scheduling VMs in zones where resources are available while distributing VMs as evenly as possible across selected zones to minimize the impact of zonal failure. Recommended for highly available serving or batch workloads that do not require autoscaling.zThe group picks zones for creating VM instances to fulfill the requested number of VMs within present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads that do not require high availability.a_  The group schedules all instances within a single zone. The zone is chosen based on hardware support, current resources availability, and matching reservations. The group might not be able to create the requested number of VMs in case of zonal resource availability constraints. Recommended for workloads requiring extensive communication between VMs.)evenbalancedanyzany-single-zonez--target-distribution-shapeSHAPEr   Nr   r   EnumNameToChoicer   s      r#   'AddMigDistributionPolicyTargetShapeFlagr     sP    )@7C;-'> 	#%%  r%   c           	          SnSnU R                  U[        R                  " SS90 [        R                  SUS9  SnSnU R                  U[        R                  " SS90 [        R                  SUS9  g	)
z3Adds args for all-instances' config update command.
--metadataz8Add metadata to the group's all instances configuration.r`   ra   	KEY=VALUE)r(   r   r?   rd   r   --labelsz6Add labels to the group's all instances configuration.N)r   r   ArgDictStoreOnceAction)r"   metadata_argument_namemetadata_help_textlabels_argument_names       r#   #AddFlagsForUpdateAllInstancesConfigr     s     (@  	!,((   $O!,((  r%   c                     SnU R                  US[        R                  " SS9SS9  SnU R                  US[        R                  " SS9SS9  g	)
z3Adds args for all-instances' config delete command.r   KEYr`   ra   zBRemove metadata keys from the group's all instances configuration.r   r   z@Remove labels keys from the group's all instances configuration.N)r   r   rf   )r"   r   r   s      r#   #AddFlagsForDeleteAllInstancesConfigr      sf     (!,O	   $!,M	  r%   c                     UR                  5       S:X  a  gU HC  nU R                  U5      (       d  M  U R                  U5      nSU-  n[        R                  " XES9e   g)aa  For zonal MIGs validate that user did not supply any RMIG-specific flags.

Can be safely called from GA track for all flags, unknowns are ignored.

Args:
  args: provided arguments.
  regional_flags_dests: list of RMIG-specific flag dests (names of the
    attributes used to store flag values in args).
  igm_ref: resource reference of the target IGM.
z#compute.regionInstanceGroupManagersNzCFlag %s may be specified for regional managed instance groups only.)parameter_namemessage)
CollectionIsKnownAndSpecifiedGetFlagr	   InvalidArgumentException)argsregional_flags_destsigm_refdest	flag_nameerror_messages         r#   ValidateRegionalMigFlagsUsager   4  sg     BB
"d%%,,t$i
O
m //"  #r%   c                 :    SnSSS.nU R                  SSS UUS9  g	)
z8Add --list-managed-instances-results flag to the parser.z      Pagination behavior for the group's listManagedInstances API method.
      This flag does not affect the group's gcloud or console list-instances
      behavior. By default it is set to ``pageless''.
    zPagination is disabled for the group's listManagedInstances API method. maxResults and pageToken query parameters are ignored and all instances are returned in a single response.zPagination is enabled for the group's listManagedInstances API method. maxResults and pageToken query parameters are respected.)pageless	paginatedz --list-managed-instances-resultsMODEc                 "    U R                  5       $ rP   r   r   s    r#   r   7AddMigListManagedInstancesResultsFlag.<locals>.<lambda>b  r   r%   r   Nr:   r   s      r#   %AddMigListManagedInstancesResultsFlagr   L  s?    )=
M
' 	(  r%   c                 F    SnU R                  S[        R                  US9  g)z1Adding force update on repair flag to the parser.a  
      Specifies whether to apply the group's latest configuration when
      repairing a VM. If you updated the group's instance template or
      per-instance configurations after the VM was created, then these changes
      are applied when VM is repaired. If this flag is disabled with
      ``-no-force-update-on-repair'', then updates are applied in accordance
      with the group's update policy type. By default, this flag is disabled.
    z--force-update-on-repairr>   N)r   r   StoreTrueFalseActionrj   s     r#   AddMigForceUpdateOnRepairFlagsr   h  s-    ) 	 --  r%   c                     U[         R                  R                  :X  a  [        U 5        g U[         R                  R                  :X  a  [        U 5        g [        U 5        g rP   )r   ReleaseTrackALPHA#AddMigDefaultActionOnVmFailureAlphaBETA"AddMigDefaultActionOnVmFailureBeta AddMigDefaultActionOnVmFailureGA)r"   release_tracks     r#   AddMigDefaultActionOnVmFailurer   y  sB    d''---'/))...&v.$V,r%   c                 T    SnSSS.nU R                  SS[        R                  UUS9  g)	/Add default action on VM failure to the parser.z      Specifies the action that a MIG performs on a failed or an unhealthy VM.
      A VM is marked as unhealthy when the application running on that VM
      fails a health check.
      By default, the value of the flag is set to ``repair''.z6MIG automatically repairs a failed or an unhealthy VM.z0MIG does not repair a failed or an unhealthy VM.)repair
do-nothing--default-action-on-vm-failureACTION_ON_VM_FAILUREr   Nr   r   s      r#   r   r     sD    A) IF'
 	&$%%  r%   c                 z    Sn[         R                  " SS/5      nU R                  SS[        R                  UUS9  g)r   (        Specifies the action that a MIG performs on a failed VM. If the value of
      the onFailedHealthCheck field is `DEFAULT_ACTION`, then the same action
      also applies to the VMs on which your application fails a health check.
      By default, the value of the flag is set to ``repair''.r   zA(Default) MIG automatically repairs a failed VM by recreating it.r   z MIG does not repair a failed VM.r   r   r   NrG   rH   r   r   r   r   s      r#   r   r     sU    A)
 ## 9% ' 	&$%%  r%   c                 z    Sn[         R                  " / SQ5      nU R                  SS[        R                  UUS9  g)r   r   )r   r   )deletezNMIG deletes a failed VM. Deleting the VM decreases the target size of the MIG.r   r   r   Nr   r   s      r#   r   r     sK    A)
 ## % ' 	&$%%  r%   c                 z    Sn[         R                  " / SQ5      nU R                  SS[        R                  UUS9  g)z3Add action on VM failed health check to the parser.z      Specifies the action that a MIG performs on an unhealthy VM.
      A VM is marked as unhealthy when the application running on that VM fails
      a health check. By default, the value of the flag is set to ``default-action''.))zdefault-actionzS(Default) MIG uses the same action configured for the defaultActionOnFailure field.)r   z$MIG does not repair an unhealthy VM.)r   z;MIG automatically repairs an unhealthy VM by recreating it.z"--action-on-vm-failed-health-checkACTION_ON_FAILED_HEALTH_CHECKr   Nr   r   s      r#   !AddMigActionOnVmFailedHealthCheckr     sK    Y) ## 
% 
' 	*-%%  r%   c           
      l    U R                  SU[        R                  " S[        R                  SS9SS9  g)zAdd --size flag to the parser.z--sizer   T)	unlimitedz=Target number of running instances in managed instance group.)r   r(   r   N)r   r   
BoundedIntsysmaxsize)r"   r   s     r#   AddMigSizeFlagr     s4    !!!S[[DAJ	  r%   c                     SSS.nU R                  S[        USS9  U R                  S[        SS	9  U R                  S
[        SS	9  U R                  S[        SS	9  g)z.Add flags required for setting standby policy.z]MIG does not automatically resume or start VMs in the standby pool when the group scales out.zMIG automatically resumes or starts VMs in the standby pool when the group scales out, and replenishes the standby pool afterwards.)manualzscale-out-poolz--standby-policy-modez          Defines how a MIG resumes or starts VMs from a standby pool when the          group scales out. The default mode is ``manual''.
      )r(   r   r   z--standby-policy-initial-delayzSpecifies the number of seconds that the MIG should wait before suspending or stopping a VM. The initial delay gives the initialization script the time to prepare your VM for a quick scale out.r'   z--suspended-sizez8Specifies the target size of suspended VMs in the group.z--stopped-sizez6Specifies the target size of stopped VMs in the group.N)r   r*   int)r"   standby_policy_mode_choicess     r#   AddStandbyPolicyFlagsr     s    (L	! 	)
	   	&	  	 	E  
 	C  r%   c                 l    U R                  S[        R                  " 5       S[        R                  SS9  g)z(Adds resource manager tag related flags.z--resource-manager-tagsr   zSpecifies a list of resource manager tags to apply to the managed instance group. A resource manager tag is a key-value pair. You can attach exactly one value to a MIG for a given key. A MIG can have a maximum of 50 key-value pairs attached.)r(   rd   r?   r   N)r   r   r   UpdateActionr!   s    r#   AddMigResourceManagerTagsFlagsr     s5     %%<  r%   r"   	is_updatereturnc                 &   U R                  S[        R                  " 5       SSS9  U R                  SSS[        5       [        R                  " 5       S9  U(       a7  U R                  S	S
SS9  U R                  S[        R                  " 5       SSS9  gg)z&Adds instance flexibility policy args.z"--instance-selection-machine-typesMACHINE_TYPEzMachine types that are used to create VMs in the managed instance group. If not provided, the machine type specified in the instance template is used.r(   rd   r   z--instance-selectionzNamed selection of machine types with an optional rank. For example, `--instance-selection="name=instance-selection-1,machine-type=e2-standard-8,machine-type=t2d-standard-8,rank=0"`zNname=NAME,machine-type=MACHINE_TYPE[,machine-type=MACHINE_TYPE...][,rank=RANK])r   rd   r(   r?   z --remove-instance-selections-allr=   zDRemove all instance selections from the instance flexibility policy.r>   z--remove-instance-selectionsINSTANCE_SELECTION_NAMEzIRemove specific instance selections from the instance flexibility policy.N)r   r   rf   ArgMultiValueDictFlattenAction)r"   r   s     r#    AddInstanceFlexibilityPolicyArgsr   )  s    
 	*   	 	~ _&&(  
 
*	   &  ")   r%   c                 T    SnSSS.nU R                  SS[        R                  UUS9  g)	z*Add target size policy mode to the parser.z=Specifies the mode in which the MIG creates VMs in the group.z(Default) MIG creates VMs individually. If the MIG cannot create any VM to meet the specified ``size``, then the MIG creates the VMs for which resources are available. The MIG then attempts to create the remaining VMs until the resources become available.zMIG creates VMs all at once. If the MIG cannot create any VM to meet the specified ``size``, then the MIG waits until the resources become available to create all VMs.)
individualbulkz--target-size-policy-modeTARGET_SIZE_POLICY_MODEr   Nr   r   s      r#   AddTargetSizePolicyModeFlagr   W  sC    M)A1' 	!'%%  r%   c                 0    U R                  S[        SSS9  g)zAdd workload policy flag.z--workload-policyWORKLOAD_POLICYzSpecifies the workload policy for the managed instance group. It can be a full or partial URL to a resource policy containing the workload policy.r   Nr)   r!   s    r#   AddWorkloadPolicyFlagr   q  s#    !  	r%   c                 &    U R                  SSSS9  g)z Add remove workload policy flag.z--remove-workload-policyr=   z=Detaches the workload policy from the managed instance group.r>   Nr:   r!   s    r#   AddRemoveWorkloadPolicyFlagr    s     
I	  r%   c                 N    U R                  SS9n[        U5        [        U5        g)z'Add flags for managing workload policy.T)r_   N)re   r   r  )r"   workload_policy_groups     r#   AddWorkloadPolicyFlagsr    s(     ***6-.34r%   c                   $    \ rS rSrSrS rS rSrg)r   i  zConverts argument values into multi-valued mappings.

Values for repeated keys are collected in a list. Ensures all values are
key-value pairs and handles invalid cases.
c                 z    SnSR                  US9n[        R                  " U[        R                  5      U l        g )N=z([^\s{ops}]+)\s*{ops}\s*(.*))ops)rI   recompileDOTALL_key_op_value)selfr	  key_op_value_patterns      r#   __init__ArgMultiValueDict.__init__  s3    
C:AAcAJ$8"))DDr%   c                    UR                  S5       Vs/ s H  o"R                  5       PM     nn[        R                  " 5       nU GH2  nSU;  a%  [        R
                  " SR                  U5      5      eU R                  R                  U5      nU(       d%  [        R
                  " SR                  U5      5      eUR                  S5      R                  5       UR                  S5      R                  5       pU(       a  U(       d%  [        R
                  " SR                  U5      5      eSU;   a%  [        R
                  " SR                  U5      5      eUR                  U/ 5      R                  U5        GM5     U$ s  snf )N,r  zInvalid flag value [{0}]r`      )splitstriprG   rH   r   ArgumentTypeErrorrI   r  matchr|   
setdefaultappend)	r  	arg_valueitemarg_listarg_dictargr  keyvalues	            r#   __call__ArgMultiValueDict.__call__  sE   )2)=>)=

)=H>&&(H	C++&--c2
 	
   &&s+e++&--c2
 	
 ;;q>'')5;;q>+?+?+A5++&--c2
 	
 
++&--c2
 	
 #r"))%0+ . O3 ?s   E?)r  N)__name__
__module____qualname____firstlineno____doc__r  r"  __static_attributes__rn   r%   r#   r   r     s    E
r%   r   c                 P    SSS.nU R                  SS[        R                  USS9  g)	z"Add on repair flags to the parser.z8(Default) MIG cannot change a VM's zone during a repair.z;MIG can select a different zone for the VM during a repair.)noyesz--on-repair-allow-changing-zoneON_REPAIR_ALLOW_CHANGING_ZONEzASpecifies whether the MIG can change a VM's zone during a repair.r   Nr   )r"   allow_changing_zone_choicess     r#   AddOnRepairFlagsr/    s=     GJ! 	'-%%)N  r%   c                 p    U R                  SS9nUR                  SSSSS9  [        R                  U5        g)z#Adds Multi-MIG flags to the parser.T)hiddenz--clear-multi-migr=   NzR      Removes this managed instance group from the Multi-MIG it belongs to.
      )r?   r   r   )add_mutually_exclusive_groupr   MULTI_MIG_ARGAddArgument)r"   multi_mig_groups     r#   AddMultiMigFlagsr6    sF    77t7D/
	   O,r%   ) )TN)F)Kr(  
__future__r   r   r   rG   r
  r   typingr   googlecloudsdk.callioper   r   r	   r
   "googlecloudsdk.command_lib.computer   compute_flags$googlecloudsdk.command_lib.util.apisr   ResourceArgumentScopeFlagsUsageDONT_USE_SCOPE_FLAGSINSTANCE_TEMPLATE_ARGUSE_EXISTING_SCOPE_FLAGSr3  DEFAULT_CREATE_OR_LIST_FORMATr$   r+   r-   r4   r;   r@   rJ   rN   rM   r[   r]   rh   rl   rp   INSTANCE_REDISTRIBUTION_TYPESr}   rt   ru   rv   rz   rw   rx   ry   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   boolr   r   ArgumentInterceptorr   r  r  r   r/  r6  rn   r%   r#   <module>rG     s   > &  '  	 
  / ( . 4 E : &66%#33HH19  ..#33LL1 ! " 
(:**6(  "( 5 ((6

"<+\8(08"-*046(V$ +++ 
+\4"2"F"F (8(L(L 5#3#G#G 5& &R-AA -r%   