Updating a Route Table
Function
This API is used to update a route table.
URI
PUT /v1/{project_id}/routetables/{routetable_id}
Table 1 describes the parameters.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Specifies the project ID. For details about how to obtain a project ID, see Obtaining a Project ID. |
routetable_id |
Yes |
String |
Specifies the route table ID that uniquely identifies a route table. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
routetable |
Yes |
routetable object |
Specifies the route table. For details, see Table 3. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
No |
String |
|
description |
No |
String |
|
routes |
No |
RouteTableRouteAction object |
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
add |
No |
Array of AddRouteTableRoute objects |
Adds a route. For details, see Table 5. Parameters type, destination, and nexthop are mandatory. |
mod |
No |
Array of ModRouteTableRoute objects |
Modifies a route. For details, see Table 6. Parameters type, destination, and nexthop are mandatory. |
del |
No |
Array of DelRouteTableRoute objects |
Deletes a route. For details, see Table 7. Parameter destination is mandatory. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
|
destination |
Yes |
String |
|
nexthop |
Yes |
String |
|
description |
No |
String |
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
|
destination |
Yes |
String |
|
nexthop |
Yes |
String |
|
description |
No |
String |
|
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
No |
String |
|
destination |
Yes |
String |
|
nexthop |
No |
String |
|
description |
No |
String |
|
Example Request
- Change the route table whose ID is 3d42a0d4-a980-4613-ae76-a2cddecff054, add a route with next hop type of ECS, modify the route with next hop type of ECS, and delete the route whose destination is 20.20.10.0/24.
PUT https://{Endpoint}/v1/6fbe9263116a4b68818cf1edce16bc4f/routetables/3d42a0d4-a980-4613-ae76-a2cddecff054 { "routetable": { "name": "routertable-789", "description": "abc", "routes": { "add": [ { "type": "ecs", "destination": "10.10.10.0/24", "nexthop": "7c50463d-d36c-4417-aa85-cc11fa10f341", "description": "abc" } ], "mod": [ { "type": "ecs", "destination": "20.10.10.0/24", "nexthop": "7c50463d-d36c-4417-aa85-cc11fa10f341", "description": "abc" } ], "del": [ { "destination": "20.20.10.0/24" } ] } } }
Response Parameters
Parameter |
Type |
Description |
---|---|---|
routetable |
routetable object |
Specifies the route table. For details, see Table 9. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
|
name |
String |
|
default |
Boolean |
|
routes |
Array of route objects |
|
subnets |
Array of subnet objects |
|
tenant_id |
String |
|
vpc_id |
String |
|
description |
String |
|
created_at |
String |
|
updated_at |
String |
|
Parameter |
Type |
Description |
---|---|---|
type |
String |
|
destination |
String |
|
nexthop |
String |
|
description |
String |
|
Parameter |
Type |
Description |
---|---|---|
id |
String |
Specifies the ID of the subnet associated with the route table. |
Example Response
{ "routetable": { "id": "3d42a0d4-a980-4613-ae76-a2cddecff054", "vpc_id": "ab78be2d-782f-42a5-aa72-35879f6890ff", "description": "abc", "default": false, "routes": [ { "type": "ecs", "destination": "10.10.10.0/24", "nexthop": "7c50463d-d36c-4417-aa85-cc11fa10f341", "description": "abc" } ], "subnets": [ { "id": "8d4ce32f-d68a-4c4c-9f18-c68d8a5c7f2f" } ], "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f", "created_at": "2022-12-15T02:56:40", "updated_at": "2022-12-15T03:03:42" } }
Status Code
See Status Codes.
Error Code
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.