
                         :   d Z ddl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                  ej                  j                  ej                  j                  ej                  j                          G d d	ej"                                      Zy)
zImports data into a Cloud SQL instance from a TDE file.

Imports data into a Cloud SQL instance from a TDE backup file in Google Cloud
Storage.
    N)api_util)base)flags)import_util)
console_ioc                   p    e Zd ZdZ ej
                  d       ej
                  d      dZed        Zd Z	y)Tdez@Import TDE certificate into a Cloud SQL for SQL Server instance.a/            {command} imports a TDE certificate into a Cloud SQL instance from a certificate file
          in Google Cloud Storage.

          For detailed help on importing data into Cloud SQL, refer to this
          guide: https://cloud.google.com/sql/docs/sqlserver/import-export/importing
          ah            To import a TDE certificate with the name `foo` and certificate path `my-bucket/my-cert.cert`
          and private key path `my-bucket/my-key.pvk` and pvk password `my-pvk-password` into
          the Cloud SQL instance `my-instance`,
          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 import a TDE certificate with the name `foo` and certificate path `my-bucket/my-cert.cert`
          and private key path `my-bucket/my-key.pvk` into
          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
          )DESCRIPTIONEXAMPLESc                     t         j                  j                  |        t        j                  |        t        j
                  |        y)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/import/tde.pyArgszTde.ArgsA   s2     	OO'	f%	f    c                     |j                   rt        j                  d      |_        t	        j
                  t        j                        }t        j                  ||      S )z7Runs the command to import into the Cloud SQL instance.zPrivate Key Password: )	prompt_for_pvk_passwordr   PromptPasswordpvk_passwordr   	SqlClientAPI_VERSION_DEFAULTr   RunTdeImportCommand)selfargsclients      r   RunzTde.RunM   sH    ##$334LMd < <=F**488r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r    r   r   r	   r	      sR     I (//   (//  -8 	 	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>r4      s     / ( 0 6 2 D%%(($*;*;*@*@%%++-19$,, 19- 19r   