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/spanner/backups/__pycache__/create.cpython-312.pyc
�

��=���dZddlmZddlmZddlmZddlZddlmZddlmZddl	m
Z
dd	lmZdd
l
mZGd�de
j�Zy)
z"Command for spanner backup create.�)�absolute_import)�division)�unicode_literalsN)�backup_operations)�backups)�base)�
resource_args)�logc�N�eZdZdZdej
d�iZed��Zd�Z	y)�CreatezaCreates a backup of a Cloud Spanner database.

  Creates a backup of a Cloud Spanner database.
  �EXAMPLESaI        To create a backup asynchronously, run:

          $ {command} BACKUP_ID --instance=INSTANCE_NAME --database=DATABASE --expiration-date=2020-03-29T10:49:41Z --async

        To create a backup synchronously, run:

          $ {command} BACKUP_ID --instance=INSTANCE_NAME --database=DATABASE --retention-period=2w
        c��tj|d�|jddd��|jdd��}|jdd�	�|jd
d�	�|jdd
d��tj
j
|�|j�}tj|�tj|d�y)z Register flags for this command.z	to createz
--databaseTz9ID of the database from which the backup will be created.)�required�help)�mutexrz--expiration-datez�Expiration time of the backup, must be at least 6 hours and at most 30 days from the time the request is received. See `$ gcloud topic datetimes` for information on date/time formats.)rz--retention-periodz�Retention period of the backup relative from now, must be at least 6 hours and at most 30 days. See `$ gcloud topic datetimes` for information on duration formats.z--version-time�	TIMESTAMPz�The backup will contain an externally consistent copy of the database at the timestamp specified by `--version-time`. If `--version-time` is not specified, the system will use the creation time of the backup.)�metavarrz"to create the Cloud Spanner backupN)	r	�AddBackupResourceArg�add_argument�add_argument_groupr�
ASYNC_FLAG�AddToParser� AddCreateBackupEncryptionTypeArg�AddKmsKeyResourceArg)�parser�group_parser�encryption_group_parsers   �%lib/surface/spanner/backups/create.py�ArgszCreate.Args1s����&�&�v�{�;�
�����
H��J�
�,�,�4�$�,�G�L�����K��L�
����:��;���������	�O�O����'�$�7�7�9���2�2�3J�K��&�&�'>�'K�M�c��|jjj�}tj|�}tj
|�}t
j||||�}|jrEtjjdj|j|j��|Stj|dj|j��}|j �tj"|�|S)z9This is what gets called when the user runs this command.z@Create request issued for: [{}]
Check operation [{}] for status.z&Waiting for operation [{}] to complete)�CONCEPTS�backup�Parser	�GetCreateBackupEncryptionType�GetAndValidateKmsKeyNamer�CreateBackup�async_r
�status�Print�format�namer�Await�error�CreatedResource)�self�args�
backup_ref�encryption_type�kms_key�op�	op_results       r�Runz
Create.RunUs������%�%�+�+�-�J�#�A�A�$�G�O��4�4�T�:�G�	�	�	�j�$���	I�B��{�{�	�j�j���:�:@�&��;�;����;1�2��i�!�'�'�
�4�;�;�B�G�G�D�F�I�	�x�x��	���)�$��r N)
�__name__�
__module__�__qualname__�__doc__�textwrap�dedent�
detailed_help�staticmethodrr7�r rrrsB����
�(�/�/��
��-��!M��!M�Fr r)r;�
__future__rrrr<�googlecloudsdk.api_lib.spannerrr�googlecloudsdk.callioper�"googlecloudsdk.command_lib.spannerr	�googlecloudsdk.corer
�
CreateCommandrr@r r�<module>rGs9��)�&��'��<�2�(�<�#�H�T�
�
�Hr