Skip to content

Routers API Reference

Reference · Updated Sep 2026

Coming from another cloud?

▸AWS·Amazon Virtual Private Cloud

Amazon Virtual Private Cloudhigh

  • AWS VPC is regional with CIDR /16-/28.
  • OpenStack Networks project-scoped L2 with flexible CIDR.
  • AWS requires IGW for public.
  • OpenStack provider nets or floating IPs.
AWS docs ↗
▸Azure·Virtual Network (VNet)

Virtual Network (VNet)high

  • Azure VNets are strictly regional Layer 3 overlays scoped to one subscription with no L2 VLAN support ().
  • VNets and subnets creation free, but subnets min /29 with Azure reserving 5 IPs per subnet ().
  • Managed via ARM REST APIs/PowerShell/CLI vs Neutron REST API.
  • Isolated per subscription; peering for cross-VNet connectivity vs OpenStack project networks connected via routers.
Azure docs ↗
▸DigitalOcean·API

DigitalOcean APIhigh

  • Uses REST API over HTTPS with Bearer token authentication via personal access tokens, not OpenStack's Keystone token-based auth.
  • Base URL https://api.digitalocean.com/v2, incompatible with OpenStack APIs like Nova/Neutron.
  • Scoped permissions tied to granular API scopes based on team roles, unlike OpenStack role/project assignments.
  • Rate limits: 5000/hour, 250/minute.
DigitalOcean docs ↗
▸Google Cloud·VPC Network

VPC Networkhigh

  • GCP VPC is global (spans all regions) whereas OpenStack Neutron networks are project-scoped and region-local.
  • GCP uses shared VPC for cross-project networking (requires org-level config); OpenStack uses shared networks via admin.
  • Subnets in GCP are regional, auto-mode creates one per region automatically; OpenStack requires explicit subnet creation.
  • GCP VPC Flow Logs per-subnet; OpenStack has no native equivalent without external tools.
Google Cloud docs ↗
▸Hetzner·Cloud API

Cloud APIhigh

  • Proprietary REST API over HTTPS with Bearer token auth, not OpenStack Identity API (keystone) endpoints or mechanisms.
  • Base URL https://api.hetzner.cloud/v1/ with resource-specific endpoints (e.g., /servers) vs OpenStack service endpoints (nova, cinder).
  • No multi-project handling in single auth; separate per-project tokens vs keystone scopes/projects.
  • Missing identity/catalog endpoints; no service discovery via API.
Hetzner docs ↗

Routers API reference

See https://docs.openstack.org/api-ref/network/.

In these methods, {router_id} is the ID of the router, "router_name" is the name of the router, "external_network_id" is the ID of the external network to be used as the router's gateway, "subnet_id" is the ID of the subnet to be added as an interface to the router, and "port_id" is the ID of the port to be added as an interface to the router. These methods allow you to list existing routers, show details of a specific router, create a new router, update an existing router, delete a router, add or remove interfaces to or from a router, and set or clear the external gateway for a router in the Network service.

List routers#

bash
GET /v2.0/routers

Returns 200 OK. The response wraps the list under a routers key.

Show router details#

bash
GET /v2.0/routers/{router_id}

Returns 200 OK. The response wraps the router under a router key.

Create a router#

bash
POST /v2.0/routers

Request body

JSON
{
 "router": {
   "name": "router_name",
   "admin_state_up": true,
   "external_gateway_info": {
     "network_id": "external_network_id"
   }
 }
}

Returns 201 Created. The response wraps the new router under a router key.

Update a router#

bash
PUT /v2.0/routers/{router_id}

Request body

JSON
{
 "router": {
   "name": "new_router_name",
   "admin_state_up": false
 }
}

Returns 200 OK. The response wraps the updated router under a router key.

Delete a router#

bash
DELETE /v2.0/routers/{router_id}

Returns 204 No Content with an empty body.

Add interface to router#

bash
PUT /v2.0/routers/{router_id}/add_router_interface

Request body (using a subnet ID)

JSON
{
 "subnet_id": "subnet_id"
}

Request body (using a port ID)

JSON
{
 "port_id": "port_id"
}

Returns 200 OK. The response body is flat: the service does not wrap it under a router key. When you pass port_id, the service resolves subnet_id from that port.

JSON
{
  "id": "ROUTER_ID",
  "tenant_id": "PROJECT_ID",
  "port_id": "PORT_ID",
  "network_id": "NETWORK_ID",
  "subnet_id": "SUBNET_ID",
  "subnet_ids": ["SUBNET_ID"]
}

Remove interface from router#

bash
PUT /v2.0/routers/{router_id}/remove_router_interface

Request body (using a subnet ID)

JSON
{
 "subnet_id": "subnet_id"
}

Request body (using a port ID)

JSON
{
 "port_id": "port_id"
}

Returns 200 OK. The response body is flat, matching the shape that add_router_interface returns.

JSON
{
  "id": "ROUTER_ID",
  "tenant_id": "PROJECT_ID",
  "port_id": "PORT_ID",
  "network_id": "NETWORK_ID",
  "subnet_id": "SUBNET_ID",
  "subnet_ids": ["SUBNET_ID"]
}

External gateway for router#

bash
PUT /v2.0/routers/{router_id}

Request body

JSON
{
 "router": {
 "external_gateway_info": {
     "network_id": "external_network_id"
   }
 }
}

Returns 200 OK. The response wraps the router under a router key.

Clear external gateway from router#

bash
PUT /v2.0/routers/{router_id}

Request body

JSON
{
 "router": {
   "external_gateway_info": null
 }
}

Returns 200 OK. The response wraps the router under a router key.

Was this page helpful?