Imports data to 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/v1/{name=projects/*/locations/*/clusters/*}:import`

<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.import` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "gcsUri": string, "database": string, "user": string, // Union field `import_options` can be only one of the following: "sqlImportOptions": { object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.clusters/import#SqlImportOptions`) }, "csvImportOptions": { object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.clusters/import#CsvImportOptions`) } // End of list of possible types for union field `import_options`. } ``` |

| Fields ||
|---|---|
| `gcsUri` | `string` Required. The path to the file in Google Cloud Storage where the source file for import will be stored. The URI is in the form `gs://bucketName/fileName`. |
| `database` | `string` Optional. Name of the database to which the import will be done. For import from SQL file, this is required only if the file does not specify a database. Note - Value provided should be the same as expected from `SELECT current_database();` and NOT as a resource reference. |
| `user` | `string` Optional. Database user to be used for importing the data. Note - Value provided should be the same as expected from `SELECT current_user;` and NOT as a resource reference. |
| Union field `import_options`. oneof field to support various import formats like SQL and CSV. `import_options` can be only one of the following: ||
| `sqlImportOptions` | ``object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.clusters/import#SqlImportOptions`)`` Options for importing data in SQL format. |
| `csvImportOptions` | ``object (`https://docs.cloud.google.com/alloydb/docs/reference/rest/v1/projects.locations.clusters/import#CsvImportOptions`)`` Options for importing data in CSV format. |

### 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.import`

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

## SqlImportOptions

This type has no fields.
Options for importing data in SQL format.

## CsvImportOptions

Options for importing data in CSV format.

| JSON representation |
|---|
| ``` { "table": string, "columns": [ string ], "fieldDelimiter": string, "quoteCharacter": string, "escapeCharacter": string } ``` |

| Fields ||
|---|---|
| `table` | `string` Required. The database table to import CSV file into. |
| `columns[]` | `string` Optional. The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV 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 same as quote character. The value of this argument has to be a character in Hex ASCII Code. |