Rename a table in a table bucket or move it to a different namespace.
Notes
-
You must specify at least one of the
--new-nameor--new-namespaceparameters. If you specify only--new-name, the table is renamed within its current namespace. If you specify only--new-namespace, the table is moved to the new namespace but retains its original name. If you specify both parameters, the table is renamed and moved to the new namespace. -
--version-tokenenables optimistic locking. You can get a table's currentversionTokenby using theget-tablecommand to prevent update conflicts during concurrent operations. If you do not specify this parameter, no version check is performed.
Syntax
ossutil tables-api rename-table --table-bucket-arn value --namespace value --name value [--new-name value] [--new-namespace value] [--version-token value] [flags]
|
Parameter |
Type |
Description |
|
--name |
string |
The current table name. Required. |
|
--namespace |
string |
The table's current namespace. Required. |
|
--new-name |
string |
The new name for the table. You must specify at least one of |
|
--new-namespace |
string |
The target namespace for the table. You must specify at least one of |
|
--table-bucket-arn |
string |
The Alibaba Cloud Resource Name (ARN) of the table bucket, in the format |
|
--version-token |
string |
The version token for optimistic locking. You can get the table's current |
-
The
rename-tablecommand maps to theRenameTableAPI. For more information about the API parameters, see RenameTable. -
For information about the supported global command-line options, see ossutil global options.
Examples
-
Rename a table from
old_tabletonew_tablewithin its current namespace.ossutil tables-api rename-table --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --namespace my_namespace --name old_table --new-name new_table -
Move the table
my_tablefrom themy_namespacenamespace totarget_namespace.ossutil tables-api rename-table --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --namespace my_namespace --name my_table --new-namespace target_namespace -
Rename a table and move it to a different namespace, using a version token for optimistic locking.
ossutil tables-api rename-table --table-bucket-arn acs:osstables:cn-hangzhou:1234567890:bucket/my-table-bucket --namespace my_namespace --name old_table --new-name new_table --new-namespace target_namespace --version-token abc123def456