
                             S r SSKJr  SSKJr  SSKJr  SSKrSSKJr  SSKJr  SSK	J
r
  SS	KJr  SS
KJr   " S S\
R                  5      rg)zbigtable backups copy command.    )absolute_import)division)unicode_literalsN)backups)util)base)	arguments)logc                   x    \ rS rSrSr\R                  " S5      \R                  " S5      S.r\S 5       r	S r
Srg	)
Copy   z-Copy a Cloud Bigtable backup to a new backup.zM
          This command creates a copy of a Cloud Bigtable backup.
          a6          To copy a backup within the same project, run:

          $ {command} --source-instance=SOURCE_INSTANCE --source-cluster=SOURCE_CLUSTER  --source-backup=SOURCE_BACKUP --destination-instance=DESTINATION_INSTANCE --destination-cluster=DESTINATION_CLUSTER --destination-backup=DESTINATION_BACKUP --expiration-date=2023-09-01T10:49:41Z

        To copy a backup to a different project, run:

          $ {command} --source-backup=projects/SOURCE_PROJECT/instances/SOURCE_INSTANCE/clusters/SOURCE_CLUSTER/backups/SOURCE_BACKUP --destination-backup=projects/DESTINATION_PROJECT/instances/DESTINATION_INSTANCE/clusters/DESTINATION_CLUSTER/backups/DESTINATION_BACKUP --expiration-date=2022-08-01T10:49:41Z

        To set retention period and run asyncronously, run:

          $ {command} --source-backup=projects/SOURCE_PROJECT/instances/SOURCE_INSTANCE/clusters/SOURCE_CLUSTER/backups/SOURCE_BACKUP --destination-backup=projects/DESTINATION_PROJECT/instances/DESTINATION_INSTANCE/clusters/DESTINATION_CLUSTER/backups/DESTINATION_BACKUP --retention-period=2w --async

        )DESCRIPTIONEXAMPLESc                     [         R                  " U 5        U R                  SSS9nUR                  SSS9  UR                  SSS9  [        R
                  R                  U 5        g)	z Register flags for this command.T)mutexrequiredz--expiration-datezExpiration time of the backup, must be at least 6 hours and at most 30 days from the time the source backup is created. See `$ gcloud topic datetimes` for information on date/time formats.)helpz--retention-periodzRetention period of the backup relative from now, must be at least 6 hours and at most 30 days from the time the source backup is created. See `$ gcloud topic datetimes` for information on duration formats.N)r	   AddCopyBackupResourceArgsadd_argument_groupadd_argumentr   
ASYNC_FLAGAddToParser)parsergroup_parsers     $lib/surface/bigtable/backups/copy.pyArgs	Copy.Args4   st     ''/,,4$,GLO   !   	OO'    c                 h   UR                   R                  R                  5       nUR                   R                  R                  5       n[        R
                  " X#U5      n[        R                  " U5      nUR                  (       aX  [        R                  R                  SR                  UR                  5       UR                  5       UR                  5      5        U$ [        R                  " USR                  UR                  5      5      nUR                   c  [        R"                  " U5        U$ )zThis is what gets called when the user runs this command.

Args:
  args: an argparse namespace. All the arguments that were provided to this
    command invocation.

Returns:
  Some value that we want to have printed later.
zFCopy request issued from [{}] to [{}]
Check operation [{}] for status.z&Waiting for operation [{}] to complete)CONCEPTSsourceParsedestinationr   
CopyBackupr   GetOperationRefasync_r
   statusPrintformatRelativeNamenameAwaitBackuperrorCreatedResource)selfargssource_backup_refdestination_backup_refopoperation_ref	op_results          r   RunCopy.RunM   s     ,,224!]]66<<>			-t	LB((,M{{	jj ::@&,99;1>>@"'';KL i  ?FFrwwOQI	xx	)$r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r6   __static_attributes__r8   r   r   r   r      sI    5__ &  // # 	-( ( (0r   r   )r=   
__future__r   r   r   r>   googlecloudsdk.api_lib.bigtabler   r   googlecloudsdk.callioper   #googlecloudsdk.command_lib.bigtabler	   googlecloudsdk.corer
   Commandr   r8   r   r   <module>rI      s7    % &  '  3 0 ( 9 #I4<< Ir   