
                            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  SSKJr  \
R,                  " \
R.                  R0                  5       " S S\
R2                  5      5       r\
R,                  " \
R.                  R6                  5       " S S\5      5       r\
R,                  " \
R.                  R:                  5       " S S\5      5       rg)zBUpdate-from-file Compute Enging virtual machine instances command.    )absolute_import)division)unicode_literals)
exceptions)base_classes)base)flags)util)	arg_utils)
console_ioc                   `    \ rS rSrSrSrSSS.r\S 5       r\SS j5       r	\S	 5       r
S
 rSrg)UpdateFromFile   LUpdate a Compute Engine virtual machine instance using a configuration file.Fz          Update a Compute Engine virtual machine instance using a configuration
          file. For more information, see
          https://cloud.google.com/compute/docs/instances/update-instance-properties.
          z          A virtual machine instance can be updated by running:

            $ {command} my-instance --source=<path-to-file>
          )DESCRIPTIONEXAMPLESc                     U R                  5       [        R                   R                  :X  a  gU R                  5       [        R                   R                  :X  a  gg)z3Returns the API version based on the release track.alphabetav1)ReleaseTrackr   ALPHABETA)clss    1lib/surface/compute/instances/update_from_file.pyGetApiVersionUpdateFromFile.GetApiVersion2   sG     T..444				t0055	5    c                 L    [         R                  " SU R                  5       SUS9$ )z!Returns the resource schema path.computeInstancefor_help)export_utilGetSchemaPathr   )r   r#   s     r   r%   UpdateFromFile.GetSchemaPath;   s+     $$3$$&
XG Gr   c                    [         R                  R                  USS9  [        R                  " XR                  SS95        UR                  SSS9  UR                  SS	S9  U R                  (       a  UR                  S
SSS SS9  g g )Nupdate)operation_typeTr"   z --most-disruptive-allowed-actionzIf specified, Compute Engine returns an error if the update requires a higher action to be applied to the instance. If not specified, the default will be REFRESH.)helpz--minimal-actionzIf specified, this action or higher level action is performed on the instance irrespective of what action is required for the update to take effect. If not specified, then Compute Engine acts based on the minimum action required.z--clear-secure-tagclear_secure_tag
store_truezEIf specified, all secure tags bound to this instance will be removed.)destactiondefaultr*   )r	   INSTANCE_ARGAddArgumentr$   AddImportFlagsr%   add_argument_support_secure_tag)r   parsers     r   ArgsUpdateFromFile.ArgsA   s    	""6("Cv'8'8$'8'GH
*<  >
 4  6 
!   r   c           	      8   [         R                  " U R                  5       5      nUR                  nU R	                  SS9n[
        R                  " UR                  =(       d    SSS9n[        R                  " UR                  R                  UUS9nUR                  (       d/  [        R                  " SR                  UR                  5      5      e[         R"                  R%                  UUR&                  [(        R*                  " U5      S9n[,        R.                  " UR0                  UR                  R2                  R4                  5      n[,        R.                  " UR6                  UR                  R2                  R8                  5      n	UR                  R3                  UR:                  UR<                  UR>                  UU	US9n
U R@                  (       a  URB                  (       a  S	U
l"        URG                  URH                  RJ                  S
U
4/5        g )NFr"   -)binary)message_typestreamschema_pathz8"{}" is missing the instance's base64 fingerprint field.)scope_lister)instanceprojectzoneinstanceResourceminimalActionmostDisruptiveAllowedActionTUpdate)&r   ComputeApiHolderr   clientr%   r   ReadFromFileOrStdinsourcer$   Importmessagesr!   fingerprintr   InvalidUserInputErrorformatr	   r0   ResolveAsResource	resourcescompute_flagsGetDefaultScopeListerr   ChoiceToEnummost_disruptive_allowed_actionComputeInstancesUpdateRequest*MostDisruptiveAllowedActionValueValuesEnumminimal_actionMinimalActionValueValuesEnumnamer@   rA   r4   r+   clearSecureTagMakeRequestsapitools_client	instances)selfargsholderrG   r=   datar?   instance_refrT   rW   requests              r   RunUpdateFromFile.Run\   s   **4+<+<+>?F]]F $$e$4K))$++*<UKD!!__--!H ,,
E
L
Lkk 
 %%77"88@ 8 BL &/%;%;++55	3	3&5" ++V__JJ	%	%'N
 oo;;$$!$$B < DG D$9$9#g
&00::HgNOP
r    N)F)__name__
__module____qualname____firstlineno____doc__r4   detailed_helpclassmethodr   r%   r6   rd   __static_attributes__rf   r   r   r   r      s_    T-   G G
  4-r   r   c                       \ rS rSrSrSrSrg)UpdateFromFileBeta   r   Frf   Nrg   rh   ri   rj   rk   r4   rn   rf   r   r   rp   rp      s    Tr   rp   c                       \ rS rSrSrSrSrg)UpdateFromFileAlpha   r   Trf   Nrr   rf   r   r   rt   rt      s    Tr   rt   N)rk   
__future__r   r   r   apitools.base.pyr   googlecloudsdk.api_lib.computer   googlecloudsdk.callioper   "googlecloudsdk.command_lib.computer	   rQ   ,googlecloudsdk.command_lib.compute.instances!googlecloudsdk.command_lib.exportr
   r$   $googlecloudsdk.command_lib.util.apisr   googlecloudsdk.core.consoler   ReleaseTracksr   GACommandr   r   rp   r   rt   rf   r   r   <module>r      s    I &  ' ' 7 ( E > A : 2 D%%(()jT\\ j *jZ D%%**+  ,
 D%%++,.  -r   