
    F                     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  \R                   " \R"                  R$                  \R"                  R&                  \R"                  R(                  5       " S S	\R*                  5      5       rS
SSS.\l        g)z?Command for deleting values overridden in all-instances config.    )absolute_import)division)unicode_literals)base_classes)base)flagsc                   :    \ rS rSrSr\S 5       rS rS rS r	Sr
g)	Update   z8Update all-instances-config of a managed instance group.c                 t    [         R                  " SS9R                  USS9  [        R                  " U5        g )NT)region_flagz*update the all instances configuration for)operation_type)instance_groups_flagsGetInstanceGroupManagerArgAddArgumentmanaged_instance_groups_flags#AddFlagsForUpdateAllInstancesConfig)clsparsers     Jlib/surface/compute/instance_groups/managed/all_instances_config/update.pyArgsUpdate.Args!   s7    44%+#O & Q!EEfM    c                    [         R                  " U R                  5       5      nUR                  nUR                  n[
        R                  R                  UU[        R                  " U5      S9nUR                  5       S;  a(  [        SR                  UR                  5       5      5      eU R                  X5      nU R                  X5U5      $ )N)scope_lister)compute.instanceGroupManagersz#compute.regionInstanceGroupManagerszUnknown reference type {0})r   ComputeApiHolderReleaseTrackclient	resourcesr   %MULTISCOPE_INSTANCE_GROUP_MANAGER_ARGResolveAsResourcecompute_flagsGetDefaultScopeLister
Collection
ValueErrorformat _CreateInstanceGroupManagerPatch_MakePatchRequest)selfargsholderr   r    igm_refpatch_instance_group_managers          r   Run
Update.Run(   s    **4+<+<+>?F]]F  I$JJ!! - C CF K "    $  3::



  ! ! $(#H#H$ !!&3OPPr   c                    UR                   R                  UR                   R                  UR                   R                  UR                   R                  R	                  UR
                  R                  5        VVs/ s H2  u  p4UR                   R                  R                  R                  X4S9PM4     snnS9UR                   R                  R                  UR                  R                  5        VVs/ s H2  u  p4UR                   R                  R                  R                  X4S9PM4     snnS9S9S9S9$ s  snnf s  snnf )zCreates IGM resource patch.)keyvalue)additionalProperties)metadatalabels)
properties)allInstancesConfig)
messagesInstanceGroupManager&InstanceGroupManagerAllInstancesConfigInstancePropertiesPatchMetadataValuer5   itemsAdditionalPropertyLabelsValuer6   )r*   r+   r   r2   r3   s        r   r(   'Update._CreateInstanceGroupManagerPatch>   s9   ??//!??	/	/>>@@NN +/--*=*=*?* +@JC ??MM+++AB*?* O  >>JJ +/++*;*;*=* +>JC ??KK+++AB*=* K  ?  
0 
 0  
**s   <9D;69Ec                    UR                  5       S:X  aU  UR                  R                  nUR                  R	                  UR                  5       UUR                  UR                  S9nOTUR                  R                  nUR                  R                  UR                  5       UUR                  UR                  S9nUR                  USU4/5      $ )Nr   )instanceGroupManagerinstanceGroupManagerResourceprojectzone)rC   rD   rE   regionPatch)r%   apitools_clientinstanceGroupManagersr9   (ComputeInstanceGroupManagersPatchRequestNamerE   rF   regionInstanceGroupManagers.ComputeRegionInstanceGroupManagersPatchRequestrG   MakeRequests)r*   r   r-   igm_updated_resourceservicerequests         r   r)   Update._MakePatchRequestQ   s    >>&&<<gHH&||~';//||	 I g &&BBgNN&||~';//	 O !g
 '7 ;<==r    N)__name__
__module____qualname____firstlineno____doc__classmethodr   r/   r(   r)   __static_attributes__rT   r   r   r
   r
      s,     AN NQ,&>r   r
   zCUpdate the all-instances configuration of a managed instance group.a)          *{command}* updates the group's all-instances configuration and applies
        it only to new instances that are added to the group.

        To apply a revised all-instances configuration to existing instances
        in the group, use one of the following methods:

        - Update instances using the `update-instances` command.
        - Recreate instances using the `recreate-instances` command.
        - Use the `rolling-action start-update` command.
        - Use the API to set the group's `updatePolicy.type` to `PROACTIVE`.
        au          To update an all-instances configuration in order to override the
        group's instance template for a label with the key `label-key`
        and metadata with the key `metadata-key` in group `my-group`, run:

          $ {command} my-group
            --metadata=metadata-key=metadata-override-value
            --labels=qlabel-key=label-override-value
        )briefDESCRIPTIONEXAMPLESN)rY   
__future__r   r   r   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer   r#   2googlecloudsdk.command_lib.compute.instance_groupsr   :googlecloudsdk.command_lib.compute.instance_groups.managedr   ReleaseTracksr   GABETAALPHAUpdateCommandr
   detailed_helprT   r   r   <module>rk      s    F &  ' 7 ( E ] m D%%(($*;*;*@*@%%++-B>T B>-B>N 	N		# r   