Imports data to the cluster. Imperative only.
HTTP request
POST https://alloydb.googleapis.com/v1beta/{name=projects/*/locations/*/clusters/*}:import
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 |
|---|
{ "gcsUri": string, "database": string, "user": string, // Union field |
| Fields | |
|---|---|
gcsUri |
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 |
database |
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 |
user |
Optional. Database user to be used for importing the data. Note - Value provided should be the same as expected from |
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 |
Options for importing data in SQL format. |
csvImportOptions |
Options for importing data in CSV format. |
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.import
For more information, see the IAM documentation.
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 |
Required. The database table to import CSV file into. |
columns[] |
Optional. The columns to which CSV data is imported. If not specified, all columns of the database table are loaded with CSV data. |
fieldDelimiter |
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 |
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 |
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. |