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__/move.cpython-312.pyc
�

������dZddlmZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZej(d
dd��ej*Gd�dej,���Zdddd�e_y)zCommand for moving instances.�)�absolute_import)�division)�unicode_literals)�base_classes)�poller)�waiter)�base)�
completers)�flags)�log)�	resourcesTz�This command is deprecated. Please see https://cloud.google.com/compute/docs/instances/moving-instance-across-zones for an alternative method.z�This command has been removed. Please see https://cloud.google.com/compute/docs/instances/moving-instance-across-zones for an alternative method.)�
is_removed�warning�errorc�&�eZdZdZed��Zd�Zy)�Move�AMove an instance and its attached persistent disks between zones.c���tjj|�|jdtj
dd��tjj|�y)Nz--destination-zonez!The zone to move the instance to.T)�	completer�help�required)	r�INSTANCE_ARG�AddArgument�add_argumentr
�ZonesCompleterr	�
ASYNC_FLAG�AddToParser)�parsers �%lib/surface/compute/instances/move.py�Argsz	Move.Args0sO��	���"�"�6�*�
�����+�+�
0��	��	�O�O����'�c��tj|j��}tjj||jtj|j���}|jj|jd|jid��}|jj}|jj}|j|j|j!�|j!���|j��}|j"j%|�}tj&j|j(d|jid��}	|j*r8t-j.|	dj1|j3��d	d
��|S|jj|j3�d|j|j3�d
���}
t5j6|j8|
�}t;j<||	dj1|j3���S)N)�scope_lister�projectz
compute.zones)�params�
collection)�destinationZone�targetInstance)�instanceMoveRequestr$zcompute.globalOperationszgce instance {0}TzWUse [gcloud compute operations describe] command to check the status of this operation.)�kind�is_async�detailszcompute.instances)r$�zone)r&r%zMoving gce instance {0})r�ComputeApiHolder�ReleaseTrackrr�ResolveAsResourcer
�GetInstanceZoneScopeLister�client�Parse�destination_zoner$�apitools_client�messages�"ComputeProjectsMoveInstanceRequest�InstanceMoveRequest�SelfLink�projects�MoveInstance�REGISTRY�name�async_r�UpdatedResource�format�Namer�Poller�	instancesr�WaitFor)�self�args�holder�target_instancer4r2r6�request�result�
operation_ref�destination_instance_ref�operation_pollers            r�RunzMove.Run=s
��
�
*�
*�4�+<�+<�+>�
?�F��(�(�:�:������5�5�f�m�m�D�;��O�
�'�'�-�-�����?�2�2�3�"�.����]�]�
*�
*�F��}�}�%�%�H��9�9�$�8�8�,�5�5�7�*�3�3�5�9�
� �'�'�:��G��_�_�
)�
)�'�
2�F��&�&�,�,�����?�2�2�3�-�-��M��{�{�	���
�!�(�(��)=�)=�)?�@��7���m�%�/�/�5�5�����&�&�.�.�$�)�)�+�
� 6� ���}�}�V�%5�%5�7O�P���>�>���!�(�(��)=�)=�)?�@��r!N)�__name__�
__module__�__qualname__�__doc__�staticmethodr rN�r!rrrs��J��
(��
(�9r!rra\
        *{command}* moves a Compute Engine virtual machine
        from one zone to another. Moving a virtual machine might incur downtime
        if the guest OS must be shut down in order to quiesce disk volumes
        prior to snapshotting.

        For example, running the following command moves the instance
        called `example-instance-1` with its attached persistent disks,
        currently running in `us-central1-b`, to `us-central1-f`.

           $ gcloud compute instances move example-instance-1 --zone=us-central1-b --destination-zone=us-central1-f

        Note: Moving VMs or disks by using the `{command}` command might
        cause unexpected behavior. For more information, see https://cloud.google.com/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior.

        Please note that gcloud compute instances move does not yet support
        instances which have regional persistent disks attached. Please see
        https://cloud.google.com/compute/docs/disks/regional-persistent-disk for
        more details.
    z�
    To move `instance-1` from `us-central-a` to `europe-west1-d`, run:

      $ {command} instance-1 --zone=us-central1-a --destination-zone=europe-west1-d
    )�brief�DESCRIPTION�EXAMPLESN)rR�
__future__rrr�googlecloudsdk.api_lib.computer�)googlecloudsdk.api_lib.compute.operationsr�googlecloudsdk.api_lib.utilr�googlecloudsdk.callioper	�"googlecloudsdk.command_lib.computer
�,googlecloudsdk.command_lib.compute.instancesr�googlecloudsdk.corerr
�	Deprecate�DefaultUniverseOnly�
SilentCommandr�
detailed_helprTr!r�<module>rds���$�&��'�7�<�.�(�9�>�#�)������	&�
	&�����I�4���I���I�\	L��(�1��r!