POST
/
cloud
/
v1
/
routers
/
{project_id}
/
{region_id}
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
task_id_list = client.cloud.networks.routers.create(
    project_id=0,
    region_id=0,
    name="my_wonderful_router",
)
print(task_id_list.tasks)
{
  "tasks": [
    "d478ae29-dedc-4869-82f0-96104425f565"
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

region_id
integer
required

Region ID

Body

application/json
name
string
required

name of router

Examples:

"my_wonderful_router"

external_gateway_info
object | null
Examples:
{ "enable_snat": true, "type": "default" }
interfaces
CreateRouterInterfaceSubnetSerializer · object[] | null

List of interfaces to attach to router immediately after creation.

Examples:
[
{
"subnet_id": "3ed9e2ce-f906-47fb-ba32-c25a3f63df4f",
"type": "subnet"
}
]
routes
RouteInSerializer · object[] | null

List of custom routes.

Examples:
[
{
"destination": "10.0.3.0/24",
"nexthop": "10.0.0.13"
}
]

Response

200 - application/json

List of created tasks

tasks
string[]
required

List of task IDs

Examples:
["d478ae29-dedc-4869-82f0-96104425f565"]