Exports data from the cluster. Imperative only.

### HTTP request

Choose a location:
<button value="global" default="">global</button> <button value="us-central2">us-central2</button> <button value="us-east7">us-east7</button> <button value="northamerica-northeast1">northamerica-northeast1</button> <button value="northamerica-northeast2">northamerica-northeast2</button> <button value="northamerica-south1">northamerica-south1</button> <button value="southamerica-east1">southamerica-east1</button> <button value="southamerica-west1">southamerica-west1</button> <button value="us-central1">us-central1</button> <button value="us-east1">us-east1</button> <button value="us-east4">us-east4</button> <button value="us-east5">us-east5</button> <button value="us-south1">us-south1</button> <button value="us-west1">us-west1</button> <button value="us-west2">us-west2</button> <button value="us-west3">us-west3</button> <button value="us-west4">us-west4</button> <button value="europe-central2">europe-central2</button> <button value="europe-southwest1">europe-southwest1</button> <button value="europe-north1">europe-north1</button> <button value="europe-north2">europe-north2</button> <button value="europe-west1">europe-west1</button> <button value="europe-west2">europe-west2</button> <button value="europe-west3">europe-west3</button> <button value="europe-west4">europe-west4</button> <button value="europe-west6">europe-west6</button> <button value="europe-west8">europe-west8</button> <button value="europe-west9">europe-west9</button> <button value="europe-west10">europe-west10</button> <button value="europe-west12">europe-west12</button> <button value="asia-east1">asia-east1</button> <button value="asia-east2">asia-east2</button> <button value="asia-northeast1">asia-northeast1</button> <button value="asia-northeast2">asia-northeast2</button> <button value="asia-northeast3">asia-northeast3</button> <button value="asia-south1">asia-south1</button> <button value="asia-south2">asia-south2</button> <button value="asia-southeast1">asia-southeast1</button> <button value="asia-southeast2">asia-southeast2</button> <button value="australia-southeast1">australia-southeast1</button> <button value="australia-southeast2">australia-southeast2</button> <button value="me-central1">me-central1</button> <button value="me-central2">me-central2</button> <button value="me-west1">me-west1</button> <button value="africa-south1">africa-south1</button>   
`POST https://alloydb.googleapis.com/v1beta/{name=projects/*/locations/*/clusters/*}:export`

<br />

The URLs use [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The resource name of the cluster. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `name`: - `alloydb.clusters.export` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "database": string, // Union field `destination` can be only one of the following: "gcsDestination": { object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1beta/projects.locations.clusters/export#GcsDestination`) } // End of list of possible types for union field `destination`. // Union field `export_options` can be only one of the following: "csvExportOptions": { object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1beta/projects.locations.clusters/export#CsvExportOptions`) }, "sqlExportOptions": { object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1beta/projects.locations.clusters/export#SqlExportOptions`) } // End of list of possible types for union field `export_options`. } ``` |

| Fields ||
|---|---|
| `database` | `string` Required. Name of the database where the export command will be executed. Note - Value provided should be the same as expected from `SELECT current_database();` and NOT as a resource reference. |
| Union field `destination`. Oneof field to support other destinations in future. `destination` can be only one of the following: ||
| `gcsDestination` | ``object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1beta/projects.locations.clusters/export#GcsDestination`)`` 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: ||
| `csvExportOptions` | ``object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1beta/projects.locations.clusters/export#CsvExportOptions`)`` Options for exporting data in CSV format. Required field to be set for CSV file type. |
| `sqlExportOptions` | ``object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1beta/projects.locations.clusters/export#SqlExportOptions`)`` 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 `https://docs.cloud.google.com/alloydb/docs/reference/rest/Shared.Types/ListOperationsResponse#Operation`.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/alloydb`
- `
  https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `name` resource:

- `alloydb.googleapis.com/alloydb.clusters.export`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## GcsDestination

Destination for Export. Export will be done to cloud storage.

| JSON representation |
|---|
| ``` { "uri": string } ``` |

| Fields ||
|---|---|
| `uri` | `string` Required. The path to the file in Google Cloud Storage where the export will be stored. The URI is in the form `gs://bucketName/fileName`. |

## CsvExportOptions

Options for exporting data in CSV format.

| JSON representation |
|---|
| ``` { "selectQuery": string, "fieldDelimiter": string, "quoteCharacter": string, "escapeCharacter": string } ``` |

| Fields ||
|---|---|
| `selectQuery` | `string` Required. The SELECT query used to extract the data. |
| `fieldDelimiter` | `string` 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. |
| `quoteCharacter` | `string` 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. |
| `escapeCharacter` | `string` 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[]` | `string` Optional. Tables to export from. |
| `schemaOnly` | `boolean` Optional. If true, only export the schema. |
| `cleanTargetObjects` | `boolean` Optional. If true, output commands to DROP all the dumped database objects prior to outputting the commands for creating them. |
| `ifExistTargetObjects` | `boolean` Optional. If true, use DROP ... IF EXISTS commands to check for the object's existence before dropping it in cleanTargetObjects mode. |