Skip to main content
GET
/
cloud
/
v1
/
routers
/
{project_id}
/
{region_id}
/
{router_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
)
router = client.cloud.networks.routers.get(
    router_id="router_id",
    project_id=0,
    region_id=0,
)
print(router.id)
{
  "created_at": "2023-11-07T05:31:56Z",
  "distributed": true,
  "id": "<string>",
  "interfaces": [
    {
      "ip_assignments": [
        {
          "ip_address": "<string>",
          "subnet_id": "<string>"
        }
      ],
      "network_id": "<string>",
      "port_id": "<string>",
      "mac_address": "00:16:3e:f2:87:16"
    }
  ],
  "name": "<string>",
  "project_id": 123,
  "region": "<string>",
  "region_id": 123,
  "routes": [
    {
      "destination": "<string>",
      "nexthop": "<string>"
    }
  ],
  "status": "<string>",
  "task_id": "<string>",
  "updated_at": "2023-11-07T05:31:56Z",
  "creator_task_id": "<string>",
  "external_gateway_info": {
    "enable_snat": true,
    "external_fixed_ips": [
      {
        "ip_address": "<string>",
        "subnet_id": "<string>"
      }
    ],
    "network_id": "<string>"
  }
}

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

router_id
string
required

Router ID

Response

200 - application/json

Router details

created_at
string<date-time>
required

Datetime when the router was created

distributed
boolean
required

Whether the router is distributed or centralized.

id
string<uuid4>
required

Router ID

interfaces
PortSerializer · object[]
required

List of router interfaces.

name
string
required

Router name

project_id
integer
required

Project ID

region
string
required

Region name

region_id
integer
required

Region ID

routes
RouteOutSerializer · object[]
required

List of custom routes.

status
string
required

Status of the router.

task_id
string<uuid4> | null
required

The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.

updated_at
string<date-time>
required

Datetime when the router was last updated

creator_task_id
string<uuid4> | null

Task that created this entity

external_gateway_info
ExternalGatewaySerializer · object

State of this router's external gateway.