Requires authorization
Exports data from a Cloud SQL instance to a Google Cloud Storage bucket as a MySQL dump file. Try it now .
To export a MySQL dump file, you need write access to the Google Cloud Storage bucket where the dump file will be stored.
Request
HTTP request
POST https://www.googleapis.com/sql/v1beta3/projects/project/instances/instance/export
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
instance
|
string
|
Cloud SQL instance ID. This does not include the project ID. |
project
|
string
|
Project ID of the project that contains the instance to be exported. |
Authorization
This request requires authorization with the following scope ( read more about authentication and authorization ).
Scope |
---|
https://www.googleapis.com/auth/cloud-platform
|
Request body
In the request body, supply data with the following structure:
{ "exportContext": { "kind": "sql#exportContext", "uri": string, "database": [ string ], "table": [ string ] } }
Property name | Value | Description | Notes |
---|---|---|---|
exportContext
|
nested object
|
Contains details about the export operation. | |
exportContext.
kind
|
string
|
This is always
sql#exportContext
.
|
|
exportContext.
uri
|
string
|
The path to the file in Google Cloud Storage where the export will be stored, or where it was already stored. The URI is in the form
gs://bucketName/fileName
. If the file already exists, the operation fails. If the filename ends with .gz, the contents are compressed.
|
|
exportContext.
database[]
|
list
|
Databases (for example,
guestbook
) from which the export is made. If unspecified, all databases are exported.
|
|
exportContext.
table[]
|
list
|
Tables to export, or that were exported, from the specified database. If you specify tables, specify one and only one database. |
Response
If successful, this method returns a response body with the following structure:
{ "kind": "sql#instancesExport", "operation": string }
Property name | Value | Description | Notes |
---|---|---|---|
kind
|
string
|
This is always
sql#instancesExport
.
|
|
operation
|
string
|
An identifier that uniquely identifies the operation. You can use this identifier to retrieve the Operations resource that has information about the operation. |
Try it!
Use the APIs Explorer below to call this method on live data and see the response.