
    5                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ dd
lmZ dd	lmZ e
j"                   e
j$                  e
j&                  j(                  e
j&                  j*                  e
j&                  j,                         G d de
j.                                      Zdddde_        y)zACommand for resuming instances owned by a managed instance group.    )absolute_import)division)unicode_literals)base_classes)instance_groups_utils)arg_parsers)base)flags)scopec                   &    e Zd ZdZed        Zd Zy)ResumeInstancesz3Resume instances owned by a managed instance group.c                     | j                   j                  d       | j                  dt        j                  d      ddd       t
        j                  j                  |        y )	Nzp
        table(project(),
              zone(),
              instanceName:label=INSTANCE,
              status)z--instances   )
min_lengthINSTANCETzNames of instances to resume.)typemetavarrequiredhelp)display_info	AddFormatadd_argumentr   ArgListinstance_groups_flags%MULTISCOPE_INSTANCE_GROUP_MANAGER_ARGAddArgument)parsers    ?lib/surface/compute/instance_groups/managed/resume_instances.pyArgszResumeInstances.Args%   sb    
!! # 
 (00A> *!%<	  >
 ??KK    c                 z   t        j                  | j                               }|j                  }t        j
                  }t        j                  j                  }t        j                  |      }|j                  ||j                  ||      }|j                         dk(  r^d}|j                  j                  |j!                         |j                  j#                  g       |j$                  |j&                        }	n|j                         dk(  r^d}|j                  j)                  |j!                         |j                  j+                  g       |j$                  |j,                        }	n(t/        d	j1                  |j                                     t3        j4                  |d
|	|||j6                        S )N)default_scopescope_listerzcompute.instanceGroupManagers+instanceGroupManagersResumeInstancesRequest)	instances)instanceGroupManagerr$   projectzonez#compute.regionInstanceGroupManagers1regionInstanceGroupManagersResumeInstancesRequest)r&   r)   r'   regionzUnknown reference type {0}r   )
api_holdermethod_namerequest_templateinstances_holder_fieldigm_refr%   )r   ComputeApiHolderReleaseTrackclientr   r   compute_scope	ScopeEnumZONEr
   GetDefaultScopeListerResolveAsResource	resources
Collectionmessages2ComputeInstanceGroupManagersResumeInstancesRequestName+InstanceGroupManagersResumeInstancesRequestr'   r(   8ComputeRegionInstanceGroupManagersResumeInstancesRequest1RegionInstanceGroupManagersResumeInstancesRequestr*   
ValueErrorformatr   *SendInstancesRequestsAndPostProcessOutputsr%   )
selfargsholderr2   resource_argr"   r#   r/   r.   requests
             r   RunzResumeInstances.Run4   s   **4+<+<+>?F]]F(NNL!++00M..v6L,,#!	 - #G >>LRR&||~6<oo666D//|| S g 
			!F	FRXX&||~<BOO<<r<J// Y g 3::



  ! ! !KK% 5.." "r    N)__name__
__module____qualname____doc__staticmethodr   rH    r    r   r   r      s    
 < ("r    r   z;Resume the suspended instances in a managed instance group.a  
        *{command}* resumes one or more instances from a managed instance group,
thereby increasing the targetSize and reducing the targetSuspendedSize of the
group.

The command returns the operation status per instance, which might be ``FAIL'',
``SUCCESS'', or ``MEMBER_NOT_FOUND''. ``MEMBER_NOT_FOUND'' is returned only for
regional groups when the gcloud command-line tool wasn't able to resolve the
zone from the instance name.
z      To resume an instance from a managed instance group in the us-central1-a
      zone, run:

              $ {command} example-managed-instance-group --zone=us-central1-a \
              --instances=example-instance
    )briefDESCRIPTIONEXAMPLESN)rL   
__future__r   r   r   googlecloudsdk.api_lib.computer   r   googlecloudsdk.callioper   r	   "googlecloudsdk.command_lib.computer
   r   r3   2googlecloudsdk.command_lib.compute.instance_groupsr   UniverseCompatibleReleaseTracksr1   ALPHABETAGACommandr   detailed_helprN   r    r   <module>r^      s    H &  ' 7 @ / ( 4 E ] T..33T5F5F5I5I:"dll :" :"| K	! r    