
                            S 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K
Jr  SSKJr  SSKJr  SS	KJr  SS
KJr  \	R(                  \	R*                  " \	R,                  R.                  5       " S S\	R0                  5      5       5       r\	R*                  " \	R,                  R4                  5       " S S\5      5       r\	R*                  " \	R,                  R8                  5       " S S\5      5       rg)z<Restores selected files from a backup to a specified Volume.    )absolute_import)division)unicode_literals)client)base)flags)concept_parsers)log)
console_ioc                   d    \ rS rSrSr\R                  R                  rSSS.r	\
S 5       rS rSrg	)
RestoreBackupFiles   1Restore specific files from a backup to a Volume.zE          Restore specific files from a backup to a Volume
          aL            The following command restores file1.txt and file2.txt from the given backup to a Volume named NAME to the directory /path/to/destination/directory.

              $ {command} NAME --location=us-central1 --backup=backup-1 --file-list=file1.txt,file2.txt --restore-destination-path=/path/to/destination/directory
          )DESCRIPTIONEXAMPLESc                 (   [         R                  " [        R                  " S5      /5      R	                  U 5        [
        R                  " U 5        [
        R                  " U 5        [
        R                  " U 5        [        R                  " U 5        g )NzThe Volume to restore into.)
r	   ConceptParserr   GetVolumePresentationSpecAddToParservolumes_flagsAddVolumeRestoreFromBackupArg"AddVolumeRestoreDestinationPathArgAddVolumeRestoreFileListArgAddResourceAsyncFlag)parsers    2lib/surface/netapp/volumes/restore_backup_files.pyArgsRestoreBackupFiles.Args0   sd    !!		(	()F	GHk&//744V<--f5	v&    c                 F   UR                   R                  R                  5       n[        R                  " U R
                  S9nSR                  UR                  5       5      n[        R                  " US9(       d  gUR                  UUR                  UR                  UR                  UR                  5      nUR                  (       aW  SR                  U R                  5       R                   5      n["        R$                  R'                  SR                  U5      5        U$ )zRun the restore command.)release_trackzHYou are about to restore files from a backup to Volume {}.
Are you sure?)messageNzgcloud {} netapp volumes listzJCheck the status of the volume being restored by listing all volumes:
$ {})CONCEPTSvolumeParsevolumes_clientVolumesClient_RELEASE_TRACKformatRelativeNamer   PromptContinueRestoreVolumebackup	file_listrestore_destination_pathasync_ReleaseTrackprefixr
   statusPrint)selfargs
volume_refr   revert_warningresultcommands          r   RunRestoreBackupFiles.Run:   s    %%++-J))8K8KLF	z6689  $$^<!!%%F {{/66




$
$g 
jj"F7O Mr    N)__name__
__module____qualname____firstlineno____doc__r   r1   ALPHAr(   detailed_helpstaticmethodr   r;   __static_attributes__r=   r   r   r   r      sB     :$$**.		- ' 'r   r   c                   D    \ rS rSrSr\R                  R                  rSr	g)RestoreBackupFilesBetaV   r   r=   N)
r>   r?   r@   rA   rB   r   r1   BETAr(   rF   r=   r   r   rH   rH   V   s    9$$)).r   rH   c                   D    \ rS rSrSr\R                  R                  rSr	g)RestoreBackupFilesGA]   r   r=   N)
r>   r?   r@   rA   rB   r   r1   GAr(   rF   r=   r   r   rL   rL   ]   s    9$$''.r   rL   N)rB   
__future__r   r   r   %googlecloudsdk.api_lib.netapp.volumesr   r&   googlecloudsdk.callioper   !googlecloudsdk.command_lib.netappr   )googlecloudsdk.command_lib.netapp.volumesr   (googlecloudsdk.command_lib.util.conceptsr	   googlecloudsdk.corer
   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksr1   rC   Commandr   rJ   rH   rN   rL   r=   r   r   <module>rZ      s    C &  ' J ( 3 L D # 2 D%%++,3 3 - 3l D%%**+*/ * ,* D%%(()(- ( *(r   