
                         N   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  \	R$                  " SSS9\	R&                  " \	R(                  R*                  \	R(                  R,                  5       " S S\	R.                  5      5       5       rg)zACommand for setting autohealing policy of managed instance group.    )absolute_import)division)unicode_literals)base_classes)managed_instance_groups_utils)base)flags)scope)auto_healing_utilsFz{This command is deprecated and will not be promoted to GA. Please use `gcloud beta instance-groups managed update` instead.)
is_removedwarningc                   .    \ rS rSrSr\S 5       rS rSrg)SetAutohealing   aR  Set autohealing policy for managed instance group.

  *{command}* updates the autohealing policy for an existing managed
instance group.

If health check is specified, the resulting autohealing policy will be
triggered by the health-check signal i.e. the autohealing action (RECREATE) on
an instance will be performed if the health-check signals that the instance is
UNHEALTHY. If no health check is specified, the resulting autohealing policy
will be triggered by instance's status i.e. the autohealing action (RECREATE)
on an instance will be performed if the instance.status is not RUNNING.
c                 n    [         R                  " U5        [        R                  R	                  U5        g )N)r   AddAutohealingArgsinstance_groups_flags%MULTISCOPE_INSTANCE_GROUP_MANAGER_ARGAddArgument)clsparsers     >lib/surface/compute/instance_groups/managed/set_autohealing.pyArgsSetAutohealing.Args2   s'    ))&1??KK    c                    [         R                  " U R                  5       5      nUR                  nUR                  n[
        R                  " UR                  U5      n[
        R                  " UR                  XQR                  5      n[
        R                  " U5        [        R                  n[        R                  R                  n[         R"                  " U5      n	UR%                  UUR                  UU	S9n
UR'                  US9nU
R)                  5       S:X  a#  UR*                  R,                  nUR.                  nO_U
R)                  5       S:X  a#  UR*                  R0                  nUR2                  nO([5        SR7                  U
R)                  5       5      5      eU" S0 U
R9                  5       D6nXl        UR=                  USU4/5      $ )N)default_scopescope_lister)autoHealingPolicieszcompute.instanceGroupManagersz#compute.regionInstanceGroupManagerszUnknown reference type {0}Patch )r   ComputeApiHolderReleaseTrackclientmessagesr   GetHealthCheckUri	resourcesCreateAutohealingPoliciesinitial_delayValidateAutohealingPoliciesr   r   compute_scope	ScopeEnumZONEr	   GetDefaultScopeListerResolveAsResourceInstanceGroupManager
Collectionapitools_clientinstanceGroupManagers(ComputeInstanceGroupManagersPatchRequestregionInstanceGroupManagers.ComputeRegionInstanceGroupManagersPatchRequest
ValueErrorformatAsDictinstanceGroupManagerResourceMakeRequests)selfargsholderr$   r%   health_checkauto_healing_policiesresource_argr   r   igm_refigm_resourceservicerequest_typerequests                  r   RunSetAutohealing.Run8   s   **4+<+<+>?F]]FH0BB$ L 	&??OO\+=+=	?  "== )NNL!++00M..v6L,,#!	 - #G
 001 1 3L >>&&<<gFFl				!F	F&&BBgLLl3::



  ! ! .W^^-.G+7('7 ;<==r   r!   N)	__name__
__module____qualname____firstlineno____doc__classmethodr   rG   __static_attributes__r!   r   r   r   r      s       
&>r   r   N)rM   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   r
   r+   2googlecloudsdk.command_lib.compute.instance_groupsr   :googlecloudsdk.command_lib.compute.managed_instance_groupsr   	DeprecateReleaseTracksr#   BETAALPHACommandr   r!   r   r   <module>r[      s    H &  ' 7 H ( 4 E ] Y P
 D%%**D,=,=,C,CD:>T\\ :> E:>r   