
    N                     R   d Z ddlmZ ddlmZ ddlm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  e	j                  e	j                  j                  e	j                  j                   e	j                  j"                        e	j$                   G d
 de	j&                                      Zy)zImports data into a Cloud SQL instance from a SQL dump file.

Imports data into a Cloud SQL instance from a SQL dump file in Google Cloud
Storage.
    )absolute_import)division)unicode_literalsN)api_util)base)flags)import_utilc                   p    e Zd ZdZ ej
                  d       ej
                  d      dZed        Zd Z	y)Sqlz<Imports data into a Cloud SQL instance from a SQL dump file.a>            {command} imports data into a Cloud SQL instance from a SQL dump file
          in Google Cloud Storage.

          NOTE: Certain roles and permissions are required to import data into
          Google Cloud SQL. For more information on importing data into Google
          Cloud SQL see [Import a SQL dump file](https://cloud.google.com/sql/docs/mysql/import-export/import-export-sql#gcloud_1).

          For detailed help on importing data into Cloud SQL, refer to this
          guide: https://cloud.google.com/sql/docs/mysql/import-export/importing
          a            To import data from a SQL dump file into a database, `testdb`, on the
          specified Cloud SQL instance `test-instance-1`, run:

            $  gcloud sql import sql test-instance-1 gs://test-bucket/test-file.sql.gz --database=testdb
          )DESCRIPTIONEXAMPLESc                 *   t        j                  | d       t        j                  | t        j                         t        j
                  | d       t        j                  | d       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.
    z
MySQL dump)filetypeimport)	operationN)	r	   AddBaseImportFlagsr   AddDatabase!DEFAULT_DATABASE_IMPORT_HELP_TEXTAddParallelArgumentAddThreadsArgumentAddCleanImportArgumentAddIfExistsImportsArgument)parsers    lib/surface/sql/import/sql.pyArgszSql.Args=   sf     ""6LA	feEEF	f9	Vx8	  (	$$V,    c                 t    t        j                  t         j                        }t        j                  ||      S )z7Runs the command to import into the Cloud SQL instance.)r   	SqlClientAPI_VERSION_DEFAULTr	   RunSqlImportCommand)selfargsclients      r   RunzSql.RunM   s+     < <=F**488r   N)
__name__
__module____qualname____doc__textwrapdedentdetailed_helpstaticmethodr   r$    r   r   r   r   !   sR     E (// 
 
 (//  -, - -9r   r   )r(   
__future__r   r   r   r)   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   googlecloudsdk.command_lib.sqlr   r	   ReleaseTracksReleaseTrackGABETAALPHADefaultUniverseOnlyCommandr   r-   r   r   <module>r9      s    '  '  / ( 0 6 D%%(($*;*;*@*@%%++-,9$,, ,9 -,9r   