
                         :   S 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
  \R                  \R                  " \R                  R                  \R                  R                  \R                  R                   5       " S S	\R"                  5      5       5       rg)
zExport TDE certificate from a Cloud SQL for SQL Server instance.

Export data from a Cloud SQL instance to a Google Cloud Storage bucket as
a BAK backup file.
    N)api_util)base)export_util)flags)
console_ioc                   V    \ rS rSrSrS\R                  " S5      0r\S 5       r	S r
Srg)	Tde   zExport a TDE certificate from a Cloud SQL for SQL Server instance.

Exports a TDE certificate from a Cloud SQL instance to a Google Cloud Storage
bucket. This is only supported for SQL Server.
EXAMPLESa            To export a TDE certificate with the name `foo` and private key password `my-pvk-password` in the Cloud SQL
          instance `my-instance` to certificate path `my-bucket/my-cert.cert` and private key path `my-bucket/my-key.pvk`,
          run:

            $ {command} my-instance --certificate=foo --cert-path=gs://my-bucket/my-cert.cert --pvk-path=gs://my-bucket/my-key.pvk --pvk-password=my-pvk-password

          To export a TDE certificate with the name `foo` and private key password `my-pvk-password` in the Cloud SQL
          instance `my-instance` and prompting for the private key password,
          run:

            $ {command} my-instance --certificate=foo --cert-path=gs://my-bucket/my-cert.cert --pvk-path=gs://my-bucket/my-key.pvk --prompt-for-pvk-password

          c                     [         R                  R                  U 5        [        R                  " U 5        [        R
                  " U 5        g)zArgs is called by calliope to gather arguments for this command.

Args:
  parser: An argparse parser that you can use to add arguments that go on
    the command line after this command. Positional arguments are allowed.
N)r   
ASYNC_FLAGAddToParserr   AddInstanceArgumentAddTdeFlags)parsers    lib/surface/sql/export/tde.pyArgsTde.Args;   s2     	OO'	f%	f    c                     UR                   (       a  [        R                  " S5      Ul        [        R
                  " [        R                  5      n[        R                  " X5      $ )z2Runs the command to export the Cloud SQL instance.zPrivate Key Password: )	prompt_for_pvk_passwordr   PromptPasswordpvk_passwordr   	SqlClientAPI_VERSION_DEFAULTr   RunTdeExportCommand)selfargsclients      r   RunTde.RunG   sF    ##$334LMd < <=F**488r    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr   r    __static_attributes__r"   r   r   r	   r	      s=     
//  -$ 	 	9r   r	   )r'   r(   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   r   googlecloudsdk.core.consoler   DefaultUniverseOnlyReleaseTracksReleaseTrackGABETAALPHACommandr	   r"   r   r   <module>r8      s     / ( 6 0 2 D%%(($*;*;*@*@%%++-+9$,, +9- +9r   