
    i                     V   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  e	j                  e	j                  j                  e	j                  j                   e	j                  j"                        e	j$                   G d
 de	j&                                      Zy)zExports data from a Cloud SQL instance to a SQL file.

Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as
a SQL dump file.
    )absolute_import)division)unicode_literals)api_util)arg_parsers)base)export_util)flagsc                   &    e Zd ZdZed        Zd Zy)Sqla  Exports data from a Cloud SQL instance to a SQL file.

  Exports data from a Cloud SQL instance to a Google Cloud Storage
  bucket as a SQL dump file.

  NOTE: Certain roles and permissions are required to export data to Google
  Cloud Storage. For more information on exporting data from Google Cloud SQL
  see [Export from Cloud SQL to a SQL dump file](https://cloud.google.com/sql/docs/mysql/import-export/import-export-sql#gcloud).
  c                 ^   t        j                  |        t        j                  |        t        j                  | d       t        j
                  | d       t        j                  |        t        j                  |        | j                  ddt        j                  d      ddd	
       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.
    export)	operationz--tablez-t   )
min_lengthTABLEFzTables to export from the specified database. If you specify tables, specify one and only one database. For PostgreSQL instances, only one table can be exported at a time.)typemetavarrequiredhelpN)r	   AddBaseExportFlagsr
   AddOffloadArgumentAddParallelArgumentAddThreadsArgumentAddCleanExportArgumentAddIfExistsExportsArgumentadd_argumentr   ArgList)parsers    lib/surface/sql/export/sql.pyArgszSql.Args/   s     ""6*	V$	f9	Vx8	  (	$$V,
  A.4  5    c                 t    t        j                  t         j                        }t        j                  ||      S )z2Runs the command to export the Cloud SQL instance.)r   	SqlClientAPI_VERSION_DEFAULTr	   RunSqlExportCommand)selfargsclients      r    RunzSql.RunH   s+     < <=F**488r"   N)__name__
__module____qualname____doc__staticmethodr!   r*    r"   r    r   r       s     
 5 509r"   r   N)r.   
__future__r   r   r   googlecloudsdk.api_lib.sqlr   googlecloudsdk.callioper   r   googlecloudsdk.command_lib.sqlr	   r
   ReleaseTracksReleaseTrackGABETAALPHADefaultUniverseOnlyCommandr   r0   r"   r    <module>r<      s    '  ' / / ( 6 0 D%%(($*;*;*@*@%%++-(9$,, (9 -(9r"   