
                         ^   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  \	R                  \	R                   " \	R"                  R$                  \	R"                  R&                  \	R"                  R(                  5       " S S\	R*                  5      5       5       rg)zImports data into a Cloud SQL instance from a BAK file.

Imports data into a Cloud SQL instance from a BAK backup file in Google Cloud
Storage.
    )absolute_import)division)unicode_literalsN)api_util)base)flags)import_util)
console_ioc                   x    \ rS rSrSr\R                  " S5      \R                  " S5      S.r\S 5       r	S r
Srg	)
Bak"   z6Import data into a Cloud SQL instance from a BAK file.ag            {command} imports data into a Cloud SQL instance from a BAK backup
          file in Google Cloud Storage. You should use a full backup file with a
          single backup set.

          For detailed help on importing data into Cloud SQL, refer to this
          guide: https://cloud.google.com/sql/docs/sqlserver/import-export/importing
          a            To import data from the BAK file `my-bucket/my-export.bak` into the
          database `my-database` in the Cloud SQL instance `my-instance`,
          run:

            $ {command} my-instance gs://my-bucket/my-export.bak --database=my-database

          To import data from the encrypted BAK file `my-bucket/my-export.bak` into the database
          `my-database` in the Cloud SQL instance `my-instance`, with the certificate
          `gs://my-bucket/my-cert.crt`, private key `gs://my-bucket/my-key.key` and prompting for the
          private key password,
          run:

            $ {command} my-instance gs://my-bucket/my-export.bak --database=my-database --cert-path=gs://my-bucket/my-cert.crt --pvk-path=gs://my-bucket/my-key.key --prompt-for-pvk-password
          )DESCRIPTIONEXAMPLESc                    [         R                  " U SSSS9  [        R                  " U [        R                  SS9  [        R
                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        R                  " U 5        [        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.
zBAK fileF)filetypegz_supporteduser_supportedT)requiredN)r	   AddBakImportFlagsr   AddDatabase#SQLSERVER_DATABASE_IMPORT_HELP_TEXTAddEncryptedBakFlagsAddBakImportStripedArgumentAddBakImportNoRecoveryArgument AddBakImportRecoveryOnlyArgumentAddBakImportBakTypeArgumentAddBakImportStopAtArgumentAddBakImportStopAtMarkArgument!AddBakImportKeepEncryptedArgument)parsers    lib/surface/sql/import/bak.pyArgsBak.ArgsD   s     !!% 
99DJ	v&	%%f-	((0	**62	%%f-	$$V,	((0	++F3    c                     UR                   (       a  [        R                  " S5      Ul        [        R
                  " [        R                  5      n[        R                  " X5      $ )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	   RunBakImportCommand)selfargsclients      r!   RunBak.RunZ   sF    ##$334LMd < <=F**488r$    N)__name__
__module____qualname____firstlineno____doc__textwrapdedentdetailed_helpstaticmethodr"   r/   __static_attributes__r1   r$   r!   r   r   "   sM     ? //   //  -8 4 4*9r$   r   )r6   
__future__r   r   r   r7   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   r	   googlecloudsdk.core.consoler
   DefaultUniverseOnlyReleaseTracksReleaseTrackGABETAALPHACommandr   r1   r$   r!   <module>rH      s    '  '  / ( 0 6 2 D%%(($*;*;*@*@%%++-;9$,, ;9- ;9r$   