Class: Google::Apis::SqladminV1beta4::ExportContext

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/sqladmin_v1beta4/classes.rb,
generated/google/apis/sqladmin_v1beta4/representations.rb,
generated/google/apis/sqladmin_v1beta4/representations.rb

Overview

Database instance export context.

Defined Under Namespace

Classes: CsvExportOptions, SqlExportOptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ ExportContext

Returns a new instance of ExportContext



838
839
840
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 838

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#csv_export_optionsGoogle::Apis::SqladminV1beta4::ExportContext::CsvExportOptions

Options for exporting data as CSV. Exporting in CSV format using the Cloud SQL Admin API is not supported for PostgreSQL instances. Corresponds to the JSON property csvExportOptions



798
799
800
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 798

def csv_export_options
  @csv_export_options
end

#databasesArray<String>

Databases to be exported. MySQL instances: If fileType is SQL and no database is specified, all databases are exported, except for the mysql system database. If fileType is CSV, you can specify one database, either by using this property or by using the csvExportOptions.selectQuery property, which takes precedence over this property. PostgreSQL instances: If fileType is SQL, you must specify one database to be exported. A fileType of CSV is not supported for PostgreSQL instances. Corresponds to the JSON property databases

Returns:

  • (Array<String>)


810
811
812
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 810

def databases
  @databases
end

#file_typeString

The file type for the specified uri. SQL: The file contains SQL statements. CSV: The file contains CSV data. CSV is not supported for PostgreSQL instances. Corresponds to the JSON property fileType

Returns:

  • (String)


818
819
820
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 818

def file_type
  @file_type
end

#kindString

This is always sql#exportContext. Corresponds to the JSON property kind

Returns:

  • (String)


823
824
825
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 823

def kind
  @kind
end

#sql_export_optionsGoogle::Apis::SqladminV1beta4::ExportContext::SqlExportOptions

Options for exporting data as SQL statements. Corresponds to the JSON property sqlExportOptions



828
829
830
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 828

def sql_export_options
  @sql_export_options
end

#uriString

The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form gs://bucketName/fileName. If the file already exists, the requests succeeds, but the operation fails. If fileType is SQL and the filename ends with .gz, the contents are compressed. Corresponds to the JSON property uri

Returns:

  • (String)


836
837
838
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 836

def uri
  @uri
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



843
844
845
846
847
848
849
850
# File 'generated/google/apis/sqladmin_v1beta4/classes.rb', line 843

def update!(**args)
  @csv_export_options = args[:csv_export_options] if args.key?(:csv_export_options)
  @databases = args[:databases] if args.key?(:databases)
  @file_type = args[:file_type] if args.key?(:file_type)
  @kind = args[:kind] if args.key?(:kind)
  @sql_export_options = args[:sql_export_options] if args.key?(:sql_export_options)
  @uri = args[:uri] if args.key?(:uri)
end