diff --git a/TOC-tidb-cloud.md b/TOC-tidb-cloud.md index 57e5f0be0bed0..cc1cc3719030e 100644 --- a/TOC-tidb-cloud.md +++ b/TOC-tidb-cloud.md @@ -642,10 +642,7 @@ - [cancel](/tidb-cloud/ticloud-import-cancel.md) - [describe](/tidb-cloud/ticloud-import-describe.md) - [list](/tidb-cloud/ticloud-import-list.md) - - start - - [local](/tidb-cloud/ticloud-import-start-local.md) - - [s3](/tidb-cloud/ticloud-import-start-s3.md) - - [mysql](/tidb-cloud/ticloud-import-start-mysql.md) + - [start](/tidb-cloud/ticloud-import-start.md) - export - [create](/tidb-cloud/ticloud-serverless-export-create.md) - [describe](/tidb-cloud/ticloud-serverless-export-describe.md) diff --git a/tidb-cloud/ticloud-import-cancel.md b/tidb-cloud/ticloud-import-cancel.md index 35110b76ba5d1..8ce763008620d 100644 --- a/tidb-cloud/ticloud-import-cancel.md +++ b/tidb-cloud/ticloud-import-cancel.md @@ -22,20 +22,19 @@ ticloud serverless import cancel Cancel an import task in non-interactive mode: ```shell -ticloud serverless import cancel --project-id --cluster-id --import-id +ticloud serverless import cancel --cluster-id --import-id ``` ## Flags In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. -| Flag | Description | Required | Note | -|-------------------------|---------------------------------------------------------------|----------|------------------------------------------------------| -| -c, --cluster-id string | Specifies the ID of the cluster. | Yes | Only works in non-interactive mode. | -| --force | Cancels the import task without confirmation. | No | Works in both non-interactive and interactive modes. | -| -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | -| --import-id string | Specifies the ID of the import task. | Yes | Only works in non-interactive mode. | -| -p, --project-id string | Specifies the ID of the project. | Yes | Only works in non-interactive mode. | +| Flag | Description | Required | Note | +|-------------------------|----------------------------------------------|----------|------------------------------------------------------| +| -c, --cluster-id string | Specifies the ID of the cluster. | Yes | Only works in non-interactive mode. | +| --force | Cancels an import task without confirmation. | No | Works in both non-interactive and interactive modes. | +| -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | +| --import-id string | Specifies the ID of the import task. | Yes | Only works in non-interactive mode. | ## Inherited flags diff --git a/tidb-cloud/ticloud-import-describe.md b/tidb-cloud/ticloud-import-describe.md index 1e6de71df1f92..bcbf64fcdb025 100644 --- a/tidb-cloud/ticloud-import-describe.md +++ b/tidb-cloud/ticloud-import-describe.md @@ -5,7 +5,7 @@ summary: The reference of `ticloud serverless import describe`. # ticloud serverless import describe -Get the import details of a data import task: +Describe a data import task: ```shell ticloud serverless import describe [flags] @@ -28,7 +28,7 @@ ticloud serverless import describe Describe an import task in non-interactive mode: ```shell -ticloud serverless import describe --project-id --cluster-id --import-id +ticloud serverless import describe --cluster-id --import-id ``` ## Flags @@ -40,7 +40,6 @@ In non-interactive mode, you need to manually enter the required flags. In inter | -c, --cluster-id string | Specifies the ID of the cluster. | Yes | Only works in non-interactive mode. | | -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | | --import-id string | Specifies the ID of the import task. | Yes | Only works in non-interactive mode. | -| -p, --project-id string | Specifies the ID of the project. | Yes | Only works in non-interactive mode. | ## Inherited flags diff --git a/tidb-cloud/ticloud-import-list.md b/tidb-cloud/ticloud-import-list.md index 3fc5ca08657d8..55cd733c718d8 100644 --- a/tidb-cloud/ticloud-import-list.md +++ b/tidb-cloud/ticloud-import-list.md @@ -28,13 +28,13 @@ ticloud serverless import list List import tasks in non-interactive mode: ```shell -ticloud serverless import list --project-id --cluster-id +ticloud serverless import list --cluster-id ``` List import tasks for a specified cluster in the JSON format: ```shell -ticloud serverless import list --project-id --cluster-id --output json +ticloud serverless import list --cluster-id --output json ``` ## Flags @@ -46,7 +46,6 @@ In non-interactive mode, you need to manually enter the required flags. In inter | -c, --cluster-id string | Specifies the ID of the cluster. | Yes | Only works in non-interactive mode. | | -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | | -o, --output string | Specifies the output format (`human` by default). Valid values are `human` or `json`. To get a complete result, use the `json` format. | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Specifies the ID of the project. | Yes | Only works in non-interactive mode. | ## Inherited flags diff --git a/tidb-cloud/ticloud-import-start-local.md b/tidb-cloud/ticloud-import-start-local.md deleted file mode 100644 index e4db9a5f1bcdc..0000000000000 --- a/tidb-cloud/ticloud-import-start-local.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: ticloud serverless import start local -summary: The reference of `ticloud serverless import start local`. ---- - -# ticloud serverless import start local - -Import a local file to a [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#tidb-serverless) cluster: - -```shell -ticloud serverless import start local [flags] -``` - -> **Note:** -> -> Currently, you can only import one CSV file for one import task. - -## Examples - -Start an import task in interactive mode: - -```shell -ticloud serverless import start local -``` - -Start an import task in non-interactive mode: - -```shell -ticloud serverless import start local --project-id --cluster-id --data-format --target-database --target-table -``` - -Start an import task with a custom CSV format: - -```shell -ticloud serverless import start local --project-id --cluster-id --data-format CSV --target-database --target-table --separator \" --delimiter \' --backslash-escape=false --trim-last-separator=true -``` - -## Flags - -In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. - -| Flag | Description | Required | Note | -|--------------------------|-------------------------------------------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| -| --backslash-escape | Whether to parse backslashes inside fields as escape characters for CSV files. The default value is `true`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | -| --data-format string | Specifies the data format. Currently, only `CSV` is supported. | Yes | Only works in non-interactive mode. | -| --delimiter string | Specifies the delimiter used for quoting for CSV files. The default value is `"`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Specifies the project ID. | Yes | Only works in non-interactive mode. | -| --separator string | Specifies the field separator for CSV files. The default value is `,`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| --target-database string | Specifies the target database to import data to. | Yes | Only works in non-interactive mode. | -| --target-table string | Specifies the target table to import data to. | Yes | Only works in non-interactive mode. | -| --trim-last-separator | Whether to treat separators as line terminators and trim all trailing separators for CSV files. The default value is `false`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | - -## Inherited flags - -| Flag | Description | Required | Note | -|----------------------|------------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| -| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | -| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | -| -D, --debug | Enables debug mode. | No | Works in both non-interactive and interactive modes. | - -## Feedback - -If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an [issue](https://github.com/tidbcloud/tidbcloud-cli/issues/new/choose). Also, we welcome any contributions. diff --git a/tidb-cloud/ticloud-import-start-mysql.md b/tidb-cloud/ticloud-import-start-mysql.md deleted file mode 100644 index 6a6a3000a7e9f..0000000000000 --- a/tidb-cloud/ticloud-import-start-mysql.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: ticloud serverless import start mysql -summary: The reference of `ticloud serverless import start mysql`. ---- - -# ticloud serverless import start mysql - -Import a table from a MySQL-compatible database to a [TiDB Serverless](/tidb-cloud/select-cluster-tier.md#tidb-serverless) cluster: - -```shell -ticloud serverless import start mysql [flags] -``` - -> **Note:** -> -> - Before running this command, make sure that you have installed the MySQL command-line tool first. For more details, see [Installation](/tidb-cloud/get-started-with-cli.md#installation). -> - If the target table already exists in the target database, to use this command for table import, make sure that the target table name is the same as the source table name and add the `skip-create-table` flag in the command. -> - If the target table does not exist in the target database, executing this command automatically creates a table with the same name as the source table in the target database. - -## Examples - -- Start an import task in interactive mode: - - ```shell - ticloud serverless import start mysql - ``` - -- Start an import task in non-interactive mode (using the TiDB Serverless cluster default user `.root`): - - ```shell - ticloud serverless import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password - ``` - -- Start an import task in non-interactive mode (using a specific user): - - ```shell - ticloud serverless import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --target-user - ``` - -- Start an import task that skips creating the target table if it already exists in the target database: - - ```shell - ticloud serverless import start mysql --project-id --cluster-id --source-host --source-port --source-user --source-password --source-database --source-table --target-database --target-password --skip-create-table - ``` - -> **Note:** -> -> MySQL 8.0 uses `utf8mb4_0900_ai_ci` as the default collation, which is currently not supported by TiDB. If your source table uses the `utf8mb4_0900_ai_ci` collation, before the import, you need to either alter the source table collation to a [supported collation of TiDB](/character-set-and-collation.md#character-sets-and-collations-supported-by-tidb) or manually create the target table in TiDB. - -## Flags - -In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. - -| Flag | Description | Required | Note | -|--------------------------|------------------------------------------------------------------------------|----------|------------------------------------------------------| -| -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | -| -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Specifies the project ID. | Yes | Only works in non-interactive mode. | -| --skip-create-table | Skips creating the target table if it already exists in the target database. | No | Only works in non-interactive mode. | -| --source-database string | Specifies the name of the source MySQL database. | Yes | Only works in non-interactive mode. | -| --source-host string | Specifies the host of the source MySQL instance. | Yes | Only works in non-interactive mode. | -| --source-password string | Specifies the password for the source MySQL instance. | Yes | Only works in non-interactive mode. | -| --source-port int | Specifies the port of the source MySQL instance. | Yes | Only works in non-interactive mode. | -| --source-table string | Specifies the source table name in the source MySQL database. | Yes | Only works in non-interactive mode. | -| --source-user string | Specifies the user to log in to the source MySQL instance. | Yes | Only works in non-interactive mode. | -| --target-database string | Specifies the target database name in the TiDB Serverless cluster. | Yes | Only works in non-interactive mode. | -| --target-password string | Specifies the password for the target TiDB Serverless cluster. | Yes | Only works in non-interactive mode. | -| --target-user string | Specifies the user to log in to the target TiDB Serverless cluster. | No | Only works in non-interactive mode. | - -## Inherited flags - -| Flag | Description | Required | Note | -|----------------------|------------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| -| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | -| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | -| -D, --debug | Enables debug mode. | No | Works in both non-interactive and interactive modes. | - -## Feedback - -If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an [issue](https://github.com/tidbcloud/tidbcloud-cli/issues/new/choose). Also, we welcome any contributions. diff --git a/tidb-cloud/ticloud-import-start-s3.md b/tidb-cloud/ticloud-import-start-s3.md deleted file mode 100644 index c38e8da6ed194..0000000000000 --- a/tidb-cloud/ticloud-import-start-s3.md +++ /dev/null @@ -1,65 +0,0 @@ ---- -title: ticloud serverless import start s3 -summary: The reference of `ticloud serverless import start s3`. ---- - -# ticloud serverless import start s3 - -Import files from Amazon S3 into TiDB Serverless clusters. - -```shell -ticloud serverless import start s3 [flags] -``` - -> **Note:** -> -> Before importing files from Amazon S3 into TiDB Cloud, you need to configure the Amazon S3 bucket access for TiDB Cloud and get the Role ARN. For more information, see [Configure Amazon S3 access](/tidb-cloud/config-s3-and-gcs-access.md#configure-amazon-s3-access). - -## Examples - -Start an import task in interactive mode: - -```shell -ticloud serverless import start s3 -``` - -Start an import task in non-interactive mode: - -```shell -ticloud serverless import start s3 --project-id --cluster-id --aws-role-arn --data-format --source-url -``` - -Start an import task with a custom CSV format: - -```shell -ticloud serverless import start s3 --project-id --cluster-id --aws-role-arn --data-format CSV --source-url --separator \" --delimiter \' --backslash-escape=false --trim-last-separator=true -``` - -## Flags - -In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. - -| Flag | Description | Required | Note | -|-------------------------|-------------------------------------------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| -| --aws-role-arn string | Specifies the AWS role ARN that is used to access the Amazon S3 data source. | Yes | Only works in non-interactive mode. | -| --backslash-escape | Controls whether to parse backslashes inside fields as escape characters for CSV files. The default value is `true`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -c, --cluster-id string | Specifies the ID the cluster. | Yes | Only works in non-interactive mode. | -| --data-format string | Specifies the data format. Valid values are `CSV`, `SqlFile`, `Parquet`, or `AuroraSnapshot`. | Yes | Only works in non-interactive mode. | -| --delimiter string | Specifies the delimiter used for quoting for CSV files. The default value is `"`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | -| -p, --project-id string | Specifies the project ID. | Yes | Only works in non-interactive mode. | -| --separator string | Specifies the field separator for CSV files. The default value is `,`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | -| --source-url string | Specifies the S3 path where the source data files are stored. | Yes | Only works in non-interactive mode. | -| --trim-last-separator | Controls whether to treat separators as line terminators and trim all trailing separators for CSV files. The default value is `false`. | No | Only works in non-interactive mode when `--data-format CSV` is specified. | - -## Inherited flags - -| Flag | Description | Required | Note | -|----------------------|------------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| -| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | -| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | -| -D, --debug | Enables debug mode. | No | Works in both non-interactive and interactive modes. | - -## Feedback - -If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an [issue](https://github.com/tidbcloud/tidbcloud-cli/issues/new/choose). Also, we welcome any contributions. diff --git a/tidb-cloud/ticloud-import-start.md b/tidb-cloud/ticloud-import-start.md new file mode 100644 index 0000000000000..4f282c8b785ab --- /dev/null +++ b/tidb-cloud/ticloud-import-start.md @@ -0,0 +1,80 @@ +--- +title: ticloud serverless import start +summary: The reference of `ticloud serverless import start`. +--- + +# ticloud serverless import start local + +Start a data import task: + +```shell +ticloud serverless import start [flags] +``` + +Or use the following alias command: + +```shell +ticloud serverless import create [flags] +``` + +> **Note:** +> +> Currently, you can only import one CSV file for one import task. + +## Examples + +Start an import task in interactive mode: + +```shell +ticloud serverless import start +``` + +Start a local import task in non-interactive mode: + +```shell +ticloud serverless import start --local.file-path --cluster-id --file-type --local.target-database --local.target-table +``` + +Start a local import task with custom upload concurrency: + +```shell +ticloud serverless import start --local.file-path --cluster-id --file-type --local.target-database --local.target-table --local.concurrency 10 +``` + +Start an local import task with custom CSV format: + +```shell +ticloud serverless import start --local.file-path --cluster-id --file-type CSV --local.target-database --local.target-table --csv.separator \" --csv.delimiter \' --csv.backslash-escape=false --csv.trim-last-separator=true +``` + +## Flags + +In non-interactive mode, you need to manually enter the required flags. In interactive mode, you can just follow CLI prompts to fill them in. + +| Flag | Description | Required | Note | +|--------------------------------|-------------------------------------------------------------------------------------------------------------------------------|----------|---------------------------------------------------------------------------| +| -c, --cluster-id string | Specifies the cluster ID. | Yes | Only works in non-interactive mode. | +| --source-type string | The import source type, one of ["LOCAL"]. (default "LOCAL") | No | Only works in non-interactive mode. | +| --local.concurrency int | The concurrency for uploading file. (default 5) | No | Only works in non-interactive mode. | +| --local.file-path string | The local file path to import. | No | Only works in non-interactive mode. | +| --local.target-database string | Target database to which import data. | No | Only works in non-interactive mode. | +| --local.target-table string | Target table to which import data. | No | Only works in non-interactive mode. | +| --local.file-path string | The local file path to import. | No | Only works in non-interactive mode. | +| --file-type string | The import file type, one of ["CSV"]. | Yes | Only works in non-interactive mode. | +| --csv.backslash-escape | In CSV file whether to parse backslash inside fields as escape characters. (default true) | No | Only works in non-interactive mode. | +| --csv.delimiter string | The delimiter used for quoting of CSV file. (default "\"") | No | Only works in non-interactive mode. | +| --csv.separator string | The field separator of CSV file. (default ",") | No | Only works in non-interactive mode. | +| --csv.trim-last-separator | In CSV file whether to treat separator as the line terminator and trim all trailing separators. | No | Only works in non-interactive mode. | +| -h, --help | Shows help information for this command. | No | Works in both non-interactive and interactive modes. | + +## Inherited flags + +| Flag | Description | Required | Note | +|----------------------|------------------------------------------------------------------------------------------------------|----------|------------------------------------------------------------------------------------------------------------------| +| --no-color | Disables color in output. | No | Only works in non-interactive mode. In interactive mode, disabling color might not work with some UI components. | +| -P, --profile string | Specifies the active [user profile](/tidb-cloud/cli-reference.md#user-profile) used in this command. | No | Works in both non-interactive and interactive modes. | +| -D, --debug | Enables debug mode. | No | Works in both non-interactive and interactive modes. | + +## Feedback + +If you have any questions or suggestions on the TiDB Cloud CLI, feel free to create an [issue](https://github.com/tidbcloud/tidbcloud-cli/issues/new/choose). Also, we welcome any contributions.