HEX
Server: Apache/2.4.68 (Debian)
System: Linux as-cs-widget-demo-us-central1 6.1.0-44-cloud-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.164-1 (2026-03-09) x86_64
User: root (0)
PHP: 8.2.32
Disabled: NONE
Upload Files
File: //lib/google-cloud-sdk/lib/surface/compute/instances/__pycache__/start.cpython-312.pyc
�

�����4�dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddl
mZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZd�ZGd�dej4�ZGd�de
j8�Zd�Ze�e_y)z!Command for starting an instance.�)�absolute_import)�division)�unicode_literals)�base_classes)�
csek_utils)�poller)�waiter)�base)�flags)�GetExternalIPAddress)�GetInternalIPAddress)�
exceptions)�log)�	resources)�zipc��tjj|�tj|d��t
jj|�y)z*Add parser arguments common to all tracks.F)�flags_about_creationN)r�
INSTANCES_ARG�AddArgumentr�AddCsekKeyArgsr
�
ASYNC_FLAG�AddToParser��parsers �&lib/surface/compute/instances/start.py�_CommonArgsr$s8�����!�!�&�)����F��?��/�/���f�%�c��eZdZy)�FailedToFetchInstancesErrorN)�__name__�
__module__�__qualname__�rrrr+s��rrc�,�eZdZdZed��Zd�Zd�Zy)�Start�)Start a stopped virtual machine instance.c��t|�y�N)rrs r�Argsz
Start.Args2s
����rc�
�g}|D]j}|jj|j�|j|j��}|j|jjd|f��l|j|�}|S)z?Fetches instance objects corresponding to the given references.)�instance�zone�project�Get)	�messages�ComputeInstancesGetRequest�Namer,r-�append�apitools_client�	instances�MakeRequests)�self�client�refs�instance_get_requests�ref�request_protobufr4s       r�GetInstanceszStart.GetInstances6s����������C�C��8�8�:��x�x��+�+�D����"�"�F�$:�$:�$D�$D�e�$4�$6�7���#�#�$9�:�I��rc
�J	�tj|j��}|j}|j}g}t
jj||jtj|���}|r|j||�}n|D�cgc]}d��}}t||�D�]�\}	}
g}|r�|j�tjjtjjfv}tj j#||�}
|
j$D]�}tj&j)|j*�}tj,|
||j.�}|s�P|j1|j2j5||j*�����|ru|j2j7|��}|j.j8d|j2j;|	j=�||	j>|	j@��f}nW|j.j8d|j2jC|	j=�|	j>|	j@��f}|j1|����g}|jE||�}|rtGjH|��|D�cgc]'}|jj)|jJ���)}}|jLrd|D]>}tNjPjSdjU|jW����@tNjPjSd	�|StYjZ||j.j8|�}t]j^|tYj`|�d
jUdjcd�|D���d�
�}t||�D]�\}	}tNjPjSdjU|	��tNjPjSdjUte|���tg|d��s�ytNjPjSdjUtg|�����|Scc}wcc}w)N)�scope_lister)�diskEncryptionKey�source)�disks�StartWithEncryptionKey)r+�&instancesStartWithEncryptionKeyRequestr-r,r%)r+r-r,z$Start instance in progress for [{}].z]Use [gcloud compute operations describe URI] command to check the status of the operation(s).zStarting instance(s) {0}z, c3�<K�|]}|j����y�wr()r1)�.0�is  r�	<genexpr>zStart.Run.<locals>.<genexpr>�s����4-�+��A�F�F�H�m�s�)�max_wait_mszUpdated [{0}].zInstance internal IP is {0}T)�no_raisezInstance external IP is {0})4r�ComputeApiHolder�ReleaseTrackr7�
csek_key_filerr�ResolveAsResourcer�GetInstanceZoneScopeListerr<rr
�ALPHA�BETAr�CsekKeyStore�FromArgsrA�REGISTRY�Parser@�MaybeLookupKeyMessager3r2r/�"CustomerEncryptionKeyProtectedDisk�&InstancesStartWithEncryptionKeyRequestr4�-ComputeInstancesStartWithEncryptionKeyRequestr1r-r,�ComputeInstancesStartRequest�
AsyncRequestsr�
MultiError�selfLink�async_r�status�Print�format�SelfLinkr�BatchPollerr	�WaitFor�OperationBatch�joinr
r)r6�args�holderr7rL�request_list�
instance_refsr4�_�instance_refr+rA�allow_rsa_encrypted�	csek_keys�disk�
disk_resource�disk_key_or_none�encryption_req�request�errors_to_collect�	responses�r�operation_refs�
operation_ref�operation_poller�result�ress                           r�Runz	Start.RunDs��
�
*�
*�4�+<�+<�+>�
?�F�
�]�]�F��&�&�M��L��'�'�9�9��f����5�5�f�=�:�?�M���#�#�F�M�:�i�!.�/��A�4��i�/�"%�m�Y�"?���h��e�	�"�/�/�1�d�6G�6G�6M�6M�6:�6G�6G�6L�6L�6N�N���+�+�4�4�T�;N�O�	��N�N�D�#�,�,�2�2�4�;�;�?�-�'�=�=����(>�(>�@�
���L�L����K�K�"2��{�{�L�$�
%�#�
����O�O��P���
�"�"�,�,�$��O�O�I�I�%�*�*�,�7E�$�,�,�!�&�&�	
J�
(�)��
�"�"�,�,���O�O�8�8�%�*�*�,�$�,�,�!�&�&�
9�
(�)�����'�"�O#@�R���$�$�\�3D�E�I���!�!�"3�4�4�BK�L�)�Q�f�&�&�,�,�Q�Z�Z�8�)�N�L��{�{�)�-��
�
���?�F�F��"�"�$�&�	'�*�
�j�j���(�)����)�)���&�&�0�0�-�A���^�^�����n�-�"�)�)�$�)�)�4-�+�4-�+-�	.���F�!���7���c�	�j�j���'�.�.�|�<�=�	�j�j���4�;�;�
�s�
#�%�&�	�c�D�	1��
�
���6�=�=� ��%�'�	(�
8��M��[0��^Ms�	R�,R N)r r!r"�__doc__�staticmethodr)r<r{r#rrr%r%/s"��1������Yrr%c��dddd�}|S)z7Construct help text based on the command release track.r&z�
        *{command}* is used to start a stopped Compute Engine virtual
        machine. Only a stopped virtual machine can be started.
        z�
        To start a stopped instance named 'example-instance' in zone
        ``us-central1-a'', run:

          $ {command} example-instance --zone=us-central1-a
        )�brief�DESCRIPTION�EXAMPLESr#)�
detailed_helps r�DetailedHelpr��s ��;���
�-�
�rN) r|�
__future__rrr�googlecloudsdk.api_lib.computerr�)googlecloudsdk.api_lib.compute.operationsr�googlecloudsdk.api_lib.utilr	�googlecloudsdk.callioper
�,googlecloudsdk.command_lib.compute.instancesr�,googlecloudsdk.command_lib.compute.ssh_utilsrr
�googlecloudsdk.corerrr�	six.movesrr�Errorr�
SilentCommandr%r�r�r#rr�<module>r�st�� (�&��'�7�5�<�.�(�>�M�M�*�#�)��&��*�"2�"2��n�D���n�b�$#�n��r