Exports data from the cluster. Imperative only.
HTTP request
POST https://alloydb.googleapis.com/v1beta/{name=projects/*/locations/*/clusters/*}:export
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The resource name of the cluster. Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "database": string, // Union field |
Fields | |
---|---|
database |
Required. Name of the database where the query will be executed. Note - Value provided should be the same as expected from |
Union field destination . Oneof field to support other destinations in future. destination can be only one of the following: |
|
gcs |
Required. Option to export data to cloud storage. |
Union field export_options . Required field to specify export file type and options. export_options can be only one of the following: |
|
csv |
Options for exporting data in CSV format. Required field to be set for CSV file type. |
sql |
Options for exporting data in SQL format. Required field to be set for SQL file type. |
Response body
If successful, the response body contains an instance of Operation
.
Authorization scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the name
resource:
alloydb.googleapis.com/alloydb.clusters.export
For more information, see the IAM documentation.
GcsDestination
Destination for Export. Export will be done to cloud storage.
JSON representation |
---|
{ "uri": string } |
Fields | |
---|---|
uri |
Required. The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form |
CsvExportOptions
Options for exporting data in CSV format. For now, we only support a query to get the data that needs to be exported.
JSON representation |
---|
{ "selectQuery": string, "fieldDelimiter": string, "quoteCharacter": string, "escapeCharacter": string } |
Fields | |
---|---|
select |
Required. The selectQuery used to extract the data. |
field |
Optional. Specifies the character that separates columns within each row (line) of the file. The default is comma. The value of this argument has to be a character in Hex ASCII Code. |
quote |
Optional. Specifies the quoting character to be used when a data value is quoted. The default is double-quote. The value of this argument has to be a character in Hex ASCII Code. |
escape |
Optional. Specifies the character that should appear before a data character that needs to be escaped. The default is the same as quote character. The value of this argument has to be a character in Hex ASCII Code. |
SqlExportOptions
Options for exporting data in SQL format.
JSON representation |
---|
{ "tables": [ string ], "schemaOnly": boolean, "cleanTargetObjects": boolean, "ifExistTargetObjects": boolean } |
Fields | |
---|---|
tables[] |
Optional. Tables to export from. |
schema |
Optional. If true, only export the schema. |
clean |
Optional. If true, output commands to DROP all the dumped database objects prior to outputting the commands for creating them. |
if |
Optional. If true, use DROP ... IF EXISTS commands to check for the object's existence before dropping it in cleanTargetObjects mode. |