Moving a route table to a different folder
You can move cloud resources between folders within a single cloud.
To move a route table to another folder:
- In the management console
, go to the folder where the route table is located. - In the list of services, select Virtual Private Cloud.
- In the left-hand panel, select
Routing tables. - Click
in the row of the table to be moved and select Move. - Select the destination folder from the drop-down list.
- Click Move.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
To move a route table to another folder:
-
View the description of the CLI move route table command:
yc vpc route-table move --help
-
Get the name or ID of the route table to move:
yc vpc route-table list
Result:
+----------------------+---------+-------------+----------------------+ | ID | NAME | DESCRIPTION | NETWORK-ID | +----------------------+---------+-------------+----------------------+ | enp8c7ia88i8******** | table-1 | | encb4ubvmief******** | +----------------------+---------+-------------+----------------------+
-
Get a list of available folders:
yc resource-manager folder list
Result:
+----------------------+------------------------+--------+--------+ | ID | NAME | LABELS | STATUS | +----------------------+------------------------+--------+--------+ | b1cs8ie21pk1******** | default | | ACTIVE | | b1chgf288nvg******** | my-folder-1 | | ACTIVE | | b1cu6g9ielh6******** | my-folder-2 | | ACTIVE | +----------------------+------------------------+--------+--------+
-
Move the route table by specifying the name or ID of the table and destination folder:
yc vpc route-table move <route_table_name_or_ID> \ --destination-folder-name <name_of_destination_folder> \ --destination-folder-id <ID_of_destination_folder>
Use either the
--destination-folder-name
parameter or the--destination-folder-id
parameter.If the route table is not in the current folder (default folder), specify the source folder using the
--folder-name
or--folder-id
option.Result:
id: enp8c7ia88i8******** folder_id: b1chgf288nvg******** created_at: "2022-10-10T05:55:39Z" name: table-1 network_id: encb4ubvmief********
For more information about the
yc vpc route-table move
command, see the CLI reference.
To move a route table to a different folder, use the move REST API method for the RouteTable resource or the RouteTableService/Move gRPC API call, and provide the following in the request:
-
ID of the route table to be moved, in the
routeTableId
parameter.To get the route table ID, use the list REST API method for the RouteTable resource or the RouteTableService/List gRPC API call and provide the current folder ID in the
folderId
request parameter. -
ID of the folder the route table will be moved to, in the
destinationFolderId
parameter.To learn how to find out the folder ID, see Getting the folder ID.
Examples
Route table in the current folder
Move a route table from the current folder by specifying the table name and destination folder name:
yc vpc route-table move table-1 \
--destination-folder-name my-folder-1