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: //usr/lib/google-cloud-sdk/lib/surface/compute/snapshots/__pycache__/create.cpython-312.pyc
�

���'��f�dZddlmZddlmZddlmZddlmZddlmZddlmZddl	m
Z
dd	lmZdd
l
mZddlmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZd�Zd�Zd�Z ejBejDjF�ejHGd�dejJ���Z&ejBejDjN�Gd�de&��Z(ejBejDjR�Gd�de&��Z*dddd�e&_+y) zCommand for creating snapshots.�)�absolute_import)�division)�unicode_literals)�base_classes)�
csek_utils)�	kms_utils)�poller)�waiter)�base)�flags)�scope)�
resource_args)�labels_util)�log)�
properties)�	resourcesc��|jdd��tj|�tj|�t	j
|dd��t	j|d�tj|�tj|d��tjj|�|jd	d
��tjj|�tj |�tj"j|�tj$j|�tj&|�y)z Set Args based on Release Track.�namezThe name of the snapshot.)�help�snapshotz�
  Create an application-consistent snapshot by informing the OS
  to prepare for the snapshot process. Currently only supported
  for creating snapshots of disks attached to Windows instances.
  )�custom_helpF)�flags_about_creationz
--descriptionz"Text to describe the new snapshot.N)�add_argument�
snap_flags�AddChainArg�AddSourceDiskCsekKeyr�AddGuestFlushFlag�AddStorageLocationFlagr�AddCreateLabelsFlagsr�AddCsekKeyArgsr�
ASYNC_FLAG�AddToParser�SOURCE_DISK_ARG�AddArgument�AddSnapshotType�'SOURCE_DISK_FOR_RECOVERY_CHECKPOINT_ARG�SOURCE_INSTANT_SNAPSHOT_ARG�AddSourceInstantSnapshotCsekKey��parsers �'lib/surface/compute/snapshots/create.py�_GAArgsr,%s��	���f�#>��?����� ��!�!�&�)�����������v�z�2�
�"�"�6�*����F��?��/�/���f�%�����@���
���(�(��0����V�$��4�4�@�@��H��(�(�4�4�V�<��,�,�V�4�c�t�t|�tj|�tj|dd��y�NrT)�region_fallthrough)r,r�AddScopeArg�kms_resource_args�AddKmsKeyResourceArgr)s r+�	_BetaArgsr4Cs,��	�&�/����� ��(�(��j�T�r-c��t|�tj|�tj|�t	j
|dd��yr/)r,r�AddMaxRetentionDaysr1r2r3r)s r+�
_AlphaArgsr7Ks:��	�&�/�� � ��(����� ��(�(��j�T�r-c�4�eZdZdZed��Zd�Z			dd�Zy)�Createz;Create snapshots of Google Compute Engine persistent disks.c��t|�y�N)r,r)s r+�ArgszCreate.ArgsYs	���F�Or-c�$�|j|�Sr;��_Run��self�argss  r+�Runz
Create.Run]s���9�9�T�?�r-c��
�tj|j��}|jj}|jj
}|r�|jr�|jj|jtjjjj|jd�d��}|j|j!�|j"|j��}	n�|jj|jdtjjjjid��}|j|j!�|j"��}	|j�t$jj&t$jj(fv}
|j*r�t,j.j1||jt3j4|j���}|j7�|	_|j:rHt<j>jA|j:|
�}t=jB|||�}
|
|	_"|jFrYt,jHj1||jtJjLjN�	�}|j7�|	_(|jRr>t<j>jU||
�}t=jB|||�}||	_+|r6|jXr*t[j\|||	jV�}|r||	_+t_|d
�r@|jad
�r/tcjd||jjf�|	_4|jjr|jjg|	_6|jnrd|	_8|jrr|jr|	_:|jvr�t,jxj1||jt3j4|j���}|j7�|	_=|j|rHt<j>jA|j||
�}t=jB|||�}||	_?|jad�r |	j�|j��|	_B|r+|jad
�rt�|j��|	_E|r�|jr�|j�|	|j|j��}|j�j�|�}tj�j|j|j|jd�d��}np|j�|	|j��}|j�j�|�}tj�j|jd|jid��}|j�r8t�j�|dj�|j!��dd��|S|r-|jr!t�j�|j�|�}n t�j�|j�|�}t�j�||dj�|j!���S)N)�project�regionzcompute.regionSnapshots)�params�
collection)r�descriptionrFrEzcompute.snapshots)rrI)�scope_lister)�
default_scope�labelsT�
snapshot_type�max_retention_days)rrErFzcompute.regionOperations)rrEzcompute.globalOperationszgce snapshot {0}zWUse [gcloud compute operations describe] command to check the status of this operation.)�kind�is_async�detailszCreating gce snapshot {0})Tr�ComputeApiHolder�ReleaseTrack�client�apitools_client�messagesrFr�Parserr�VALUES�corerE�	GetOrFail�Snapshot�NamerIr�ALPHA�BETA�source_diskrr#�ResolveAsResourcer�GetDefaultScopeLister�SelfLink�
sourceDisk�source_disk_key_filer�CsekKeyStore�FromFile�MaybeLookupKeyMessage�sourceDiskEncryptionKey�#source_disk_for_recovery_checkpointr&�
compute_scope�	ScopeEnum�REGION�sourceDiskForRecoveryCheckpoint�
csek_key_file�FromArgs�snapshotEncryptionKey�kms_keyr�MaybeGetKmsKey�hasattr�IsSpecifiedr�ParseCreateArgs�LabelsValuerL�storage_location�storageLocations�guest_flush�
guestFlush�
chain_name�	chainName�source_instant_snapshotr'�sourceInstantSnapshot� source_instant_snapshot_key_file�"sourceInstantSnapshotEncryptionKey�SnapshotTypeValueValuesEnumrM�snapshotType�intrN�maxRetentionDays�#ComputeRegionSnapshotsInsertRequest�regionSnapshots�Insert�REGISTRY�ComputeSnapshotsInsertRequest�	snapshots�async_r�UpdatedResource�formatr	�Pollerr
�WaitFor)rArB�support_max_retention_days�support_scope_arg�support_kms�holderrTrV�snap_ref�snapshot_message�allow_rsa_encrypted�disk_ref�source_keys�disk_key_or_none�'source_disk_for_recovery_checkpoint_ref�	csek_keys�snap_key_or_none�kms_key_or_none�iss_ref�instant_snapshot_key_or_none�request�result�
operation_ref�operation_pollers                        r+r?zCreate._Run`s����
*�
*�4�+<�+<�+>�
?�F�
�]�]�
*�
*�F��}�}�%�%�H��T�[�[��!�!�'�'�
�)�)�#�*�*�/�/�7�7�A�A�����/�
(��h�"�*�*��}�}���&�&����+����!�!�'�'�
�)�)���*�*�/�/�7�7�A�A��)�(��h�"�*�*��}�}���&�&�+����+�+�-�����������2�������+�+�=�=�
�
�
�
��2�2�6�=�=�A�>��h�
%-�$5�$5�$7��!�	
�	"�	"� �-�-�6�6��%�%�':�
��&�;�;���6�
��4D��0��/�/�
�
<�
<�
N�
N�����)�3�3�:�:�O��.�2�
:�
:�
<��6�����)�)�2�2�4�9L�M�i�#�9�9�
�X�v���0@��,��t�|�|�!�0�0�
��*�@�@��o�
�1@��.��t�X��4�#3�#3�H�#=� +� ;� ;�
��!�!�-�-�!������+/�+@�+@�*A��'����$(��!����#'�?�?�� ��#�#��6�6�H�H�
�
�
�
��2�2�6�=�=�A�I��g�
07�/?�/?�/A��,�	
�	.�	.� �-�-�6�6��1�1�3F�
��(2�'G�'G���&�(
�$�
)�	�;�����(�
�
6�
6�t�7I�7I�
J��#�"�d�&6�&6�7K�&L�*-�d�.E�.E�*F��'��T�[�[��<�<�#��"�"����=��g�
�%�%�,�,�W�5�f��(�(�.�.�
�+�+�!�)�)� ����0�
/��m��6�6�#��"�"�7��g����&�&�w�/�f��(�(�.�.�
�+�+��X�-�-�.�/�/��m�
�{�{�	���
�!�(�(�����9��7���m��T�[�[����v�'=�'=�x�H�����v�'7�'7��B���>�>���#�*�*�8�=�=�?�;��r-N)FFF)�__name__�
__module__�__qualname__�__doc__�staticmethodr<rCr?�r-r+r9r9Ts0��D������"'���br-r9c�"�eZdZed��Zd�Zy)�
CreateBetac��t|�yr;)r4r)s r+r<zCreateBeta.Argss
��
�f�r-c�*�|j|dd��S)NT)r�r�r>r@s  r+rCzCreateBeta.Runs!���9�9������r-N�r�r�r�r�r<rCr�r-r+r�r�s������r-r�c�"�eZdZed��Zd�Zy)�CreateAlphac��t|�yr;)r7r)s r+r<zCreateAlpha.Argss
���v�r-c�,�|j|ddd��S)NT)r�r�r�r>r@s  r+rCzCreateAlpha.Runs$���9�9��#'���	��r-Nr�r�r-r+r�r�s������r-r�zCreate Compute Engine snapshotsz�    *{command}* creates snapshot of persistent disk. Snapshots are useful for
    backing up persistent disk data and for creating custom images.
    For more information, see https://cloud.google.com/compute/docs/disks/create-snapshots.
    z�    To create a snapshot 'my-snap' from a disk 'my-disk' in zone 'us-east1-a', run:

        $ {command} my-snap --source-disk=my-disk --source-disk-zone=us-east1-a
    )�brief�DESCRIPTION�EXAMPLESN),r��
__future__rrr�googlecloudsdk.api_lib.computerrr�)googlecloudsdk.api_lib.compute.operationsr	�googlecloudsdk.api_lib.utilr
�googlecloudsdk.callioper�"googlecloudsdk.command_lib.computerr
rj�,googlecloudsdk.command_lib.compute.snapshotsr�googlecloudsdk.command_lib.kmsrr2�$googlecloudsdk.command_lib.util.argsr�googlecloudsdk.corerrrr,r4r7�
ReleaseTracksrS�GA�UniverseCompatible�
CreateCommandr9r^r�r]r��
detailed_helpr�r-r+�<module>r�s��&�&��'�7�5�4�<�.�(�4�E�L�M�<�#�*�)�5�<������D�%�%�(�(�)����l�T�
�
�l��*�l�^����D�%�%�*�*�+����,������D�%�%�+�+�,��&��-�� /��
���r-