File: //lib/google-cloud-sdk/lib/surface/spanner/backups/__pycache__/create.cpython-312.pyc
�
��= � � � d Z ddlmZ ddlmZ ddlmZ ddlZddlmZ ddlmZ ddl m
Z
dd lmZ dd
l
mZ G d� de
j � Zy)
z"Command for spanner backup create.� )�absolute_import)�division)�unicode_literalsN)�backup_operations)�backups)�base)�
resource_args)�logc �N � e Zd ZdZd ej
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 � � t j | d� | j ddd�� | j dd�� }|j dd� � |j d
d� � | j dd
d�� t j
j
| � | j � }t j |� t j |d� y)z Register flags for this command.z to createz
--databaseTz9ID of the database from which the backup will be created.)�required�help)�mutexr z--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.)r z--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.)�metavarr z"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.Args1 s� � � �&�&�v�{�;�
�����
H� � J�
�,�,�4�$�,�G�L�����K� � L�
����:� � ;� ������ � � �O�O����'�$�7�7�9���2�2�3J�K��&�&�'>�'K�M� c � � |j j j � }t j |� }t j
|� }t
j ||||� }|j rEt j j dj |j |j � � |S t j |dj |j � � }|j �t j"