
                         2   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  ej"                  dd       ej$                  ej&                  j(                         G d dej*                                      Zddde_        y)zGCommand for setting minimum CPU platform for virtual machine instances.    )absolute_import)division)unicode_literals)base_classes)poller)waiter)base)flags)logFzgThis command is deprecated. Use $ gcloud alpha compute instances update --set-min-cpu-platform instead.)
is_removedwarningc                   &    e Zd ZdZed        Zd Zy)SetMinCpuPlatformzESet minimum CPU platform for Compute Engine virtual machine instance.c                     t         j                  j                  |        t        j                  | t        j
                  j                  d       t        j                  j                  |        y )NT)required)	r
   INSTANCE_ARGAddArgumentAddMinCpuPlatformArgsr	   ReleaseTrackALPHA
ASYNC_FLAGAddToParser)parsers    5lib/surface/compute/instances/set_min_cpu_platform.pyArgszSetMinCpuPlatform.Args'   sI    	""6*	!!''$8OO'    c                    t        j                  | j                               }|j                  }t        j
                  j                  ||j                  t	        j                  |            }|j                  j                  |j                  xs d       }|j                  j                  |j                  |j                  ||j                        }|j                   j"                  j%                  |      }|j                  j'                  |j(                  d      }|j*                  r8t-        j.                  |dj1                  |j3                               dd	       |S t5        j6                  |j                   j"                        }	t9        j:                  |	|d
j1                  |j3                                     S )N)scope_lister)minCpuPlatform)instanceproject!instancesSetMinCpuPlatformRequestzonezcompute.zoneOperations)
collectionzgce instance [{0}]TzWUse [gcloud compute operations describe] command to check the status of this operation.)kindis_asyncdetailsz/Changing minimum CPU platform of instance [{0}])r   ComputeApiHolderr   clientr
   r   ResolveAsResource	resourcesGetInstanceZoneScopeListermessages!InstancesSetMinCpuPlatformRequestmin_cpu_platform(ComputeInstancesSetMinCpuPlatformRequestr    r!   r#   apitools_client	instancesr   ParseselfLinkasync_r   UpdatedResourceformatNamer   Pollerr   WaitFor)
selfargsholderr)   instance_refembedded_requestrequest	operationoperation_refoperation_pollers
             r   RunzSetMinCpuPlatform.Run.   s   **4+<+<+>?F]]F%%7755f= 8 ?L
 HH,,4 I 6ooFF&&$$*:	 G  G &&00BB7KI$$**'? + AM {{	
#**<+<+<+>?;	 }}V%;%;%E%EF>>-9@@	!" "r   N)__name__
__module____qualname____doc__staticmethodr   rD    r   r   r   r      s!     N ( ($"r   r   z<Set minimum CPU platform for Compute Engine virtual machinesa          `{command}` changes the minimum CPU platform of a virtual
        machine with the *TERMINATED* status (a virtual machine  instance that
        has been stopped).

        For example, running the command on example-instance virtual machine
        which has a status of TERMINATED

          $ {command} example-instance --zone us-central1-a        --min-cpu-platform "Intel Broadwell"

        will set the minimum CPU platform to `Intel Broadwell`. When
        you start `example-instance` later, it will be provisioned using at
        least `Intel Broadwell` CPU platform.

        To get a list of available CPU platforms in us-central1-a zone, run:

          $ gcloud alpha compute zones describe us-central1-a        --format="value(availableCpuPlatforms)"
        )briefDESCRIPTIONN)rH   
__future__r   r   r   googlecloudsdk.api_lib.computer   )googlecloudsdk.api_lib.compute.operationsr   googlecloudsdk.api_lib.utilr   googlecloudsdk.callioper	   ,googlecloudsdk.command_lib.compute.instancesr
   googlecloudsdk.corer   	DeprecateReleaseTracksr   r   UpdateCommandr   detailed_helprJ   r   r   <module>rX      s    N &  ' 7 < . ( > # NO D%%++,0"** 0" -	O
0"h		#  r   