forked from docs/virtual-private-cloud
VPC Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com> Reviewed-by: Hajba, László Antal <laszlo-antal.hajba@t-systems.com> Co-authored-by: proposalbot <proposalbot@otc-service.com> Co-committed-by: proposalbot <proposalbot@otc-service.com>
27 KiB
27 KiB
- original_name
vpc_apiroutetab_0003.html
Creating a Route Table
Function
This API is used to create a route table.
Notes and Constraints
- The destination CIDR block of a custom route table cannot be included in the CIDR blocks of the local route.
- Each destination CIDR block of a route in the same route table must be unique.
- No more than five routes can be created at a time.
URI
POST /v1/{project_id}/routetables
Table 1 <vpc_apiroutetab_0003__table1211341604611>
describes the parameters.
Name | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Specifies the project ID. |
Request Parameters
Name | Mandatory | Type | Description |
---|---|---|---|
routetable | Yes | routetable <vpc_apiroutetab_0003__table18269181620462> object |
Specifies the route table. For details, see Table 3 <vpc_apiroutetab_0003__table18269181620462> . |
Name | Mandatory | Type | Description |
---|---|---|---|
name | No | String |
|
routes | No | Array of route <vpc_apiroutetab_0003__table1539412169467> objects |
|
vpc_id | Yes | String |
|
description | No | String |
|
Name | Mandatory | Type | Description |
---|---|---|---|
type | Yes | String |
|
destination | Yes | String |
|
nexthop | Yes | String |
|
description | No | String |
|
Example Request
Create a route table named routetable-1234 for the VPC whose ID is 60c809cb-6731-45d0-ace8-3bf5626421a9 and create a route with next hop type of ECS.
POST https://{Endpoint}/v1/6fbe9263116a4b68818cf1edce16bc4f/routetables { "routetable": { "name": "routetable-1234", "vpc_id": "60c809cb-6731-45d0-ace8-3bf5626421a9", "routes":[ { "type": "ecs", "destination": "10.10.10.0/24", "nexthop":"7c50463d-d36c-4417-aa85-cc11fa10f341" } ], "description":"abc" } }
Response Parameters
Name | Type | Description |
---|---|---|
routetable | routetable <vpc_apiroutetab_0003__table884119412392> object |
Specifies the route table. For details, see Table 6 <vpc_apiroutetab_0003__table884119412392> . |
Name | Type | Description |
---|---|---|
id | String |
|
name | String |
|
default | Boolean |
|
routes | Array of route <vpc_apiroutetab_0002__table1687317463915> objects |
|
subnets | Array of subnet <vpc_apiroutetab_0002__table17950204203919> objects |
|
tenant_id | String |
|
vpc_id | String |
|
description | String |
|
created_at | String |
|
updated_at | String |
|
Name | Type | Description |
---|---|---|
type | String |
|
destination | String |
|
nexthop | String |
|
description | String |
|
Name | 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",
"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"
}
}
Status Code
See Status Codes <vpc_api_0002>
.
Error Code
See Error Codes <vpc_api_0003>
.