
    L                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ ddlmZ dd	lmZ dd
lmZ  e	j(                  e	j*                  j,                         G d de	j.                               Z e	j(                  e	j*                  j2                         G d de             Z e	j(                  e	j*                  j6                         G d de             Zy)z;Reverts a Cloud NetApp Volume back to a specified Snapshot.    )absolute_import)division)unicode_literals)client)base)flags)concept_parsers)log)
console_ioc                   \    e Zd ZdZej
                  j                  ZdddZe	d        Z
d Zy)Revert:Revert a Cloud NetApp Volume back to a specified Snapshot.zU          Revert a Cloud NetApp Volume back to a specified source Snapshot
          z          The following command reverts a Volume named NAME in the given location and snapshot

              $ {command} NAME --location=us-central1 --snapshot="snapshot1"
          )DESCRIPTIONEXAMPLESc                     t        j                  t        j                  d      g      j	                  |        t        j                  |        t        j                  |        y )NzThe Volume to revert.)r	   ConceptParserr   GetVolumePresentationSpecAddToParservolumes_flagsAddVolumeRevertSnapshotArgAddResourceAsyncFlag)parsers    $lib/surface/netapp/volumes/revert.pyArgszRevert.Args/   sK    !!5#B#B$! #" ##.;v#6,,V4	v&    c                 $   |j                   j                  j                         }t        j                  | j
                        }dj                  |j                         |j                        }t        j                  |      sy|j                  ||j                  |j                        }|j                  rWdj                  | j                         j                        }t        j                   j#                  dj                  |             |S )zRun the revert command.)release_trackzDYou are about to revert Volume {} back to Snapshot {}.
Are you sure?)messageNzgcloud {} netapp volumes listzJCheck the status of the volume being reverted by listing all volumes:
$ {})CONCEPTSvolumeParsevolumes_clientVolumesClient_RELEASE_TRACKformatRelativeNamesnapshotr   PromptContinueRevertVolumeasync_ReleaseTrackprefixr
   statusPrint)selfargs
volume_refr   revert_warningresultcommands          r   Runz
Revert.Run6   s    %%++-J))8K8KLF	z668$--H  $$^<  T]]DKKHF{{/66




$
$g 
jj"F7O Mr   N)__name__
__module____qualname____doc__r   r+   GAr$   detailed_helpstaticmethodr   r5    r   r   r   r      s@    B$$''.		- ' 'r   r   c                   <    e Zd ZdZej
                  j                  Zy)
RevertBetar   N)r6   r7   r8   r9   r   r+   BETAr$   r=   r   r   r?   r?   L   s    B$$)).r   r?   c                   <    e Zd ZdZej
                  j                  Zy)RevertAlphar   N)r6   r7   r8   r9   r   r+   ALPHAr$   r=   r   r   rB   rB   S   s    B$$**.r   rB   N)r9   
__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   ReleaseTracksr+   r:   Commandr   r@   r?   rC   rB   r=   r   r   <module>rN      s    B &  ' J ( 3 L D # 2 D%%(()*T\\ * **Z D%%**+* * ,* D%%++,+* + -+r   