Skip to main content
GET
/
cloud
/
v1
/
networks
/
{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
)
page = client.cloud.networks.list(
    project_id=1,
    region_id=1,
)
page = page.results[0]
print(page.id)
{
  "count": 1,
  "results": [
    {
      "created_at": "2023-11-07T05:31:56Z",
      "creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
      "default": true,
      "external": true,
      "id": "<string>",
      "mtu": 123,
      "name": "<string>",
      "port_security_enabled": true,
      "project_id": 1337,
      "region": "<string>",
      "region_id": 123,
      "segmentation_id": 9,
      "shared": true,
      "subnets": [
        "<string>"
      ],
      "tags": [
        {
          "key": "<string>",
          "read_only": true,
          "value": "<string>"
        }
      ],
      "task_id": null,
      "type": "<string>",
      "updated_at": "2023-11-07T05:31:56Z"
    }
  ]
}

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

Example:

1

region_id
integer
required

Region ID

Example:

1

Query Parameters

external
boolean

Filter by external network status

Example:

true

limit
integer
default:1000

Optional. Limit the number of returned items

Required range: x <= 1000
Example:

1000

name
string

Filter networks by name

Maximum string length: 61
Example:

"my-network"

network_type
enum<string>

Filter by network type (vlan or vxlan)

Available options:
vlan,
vxlan
Example:

"vlan"

offset
integer
default:0

Optional. Offset value is used to exclude the first set of records from the result

Required range: x >= 0
Example:

0

order_by
enum<string>
default:created_at.desc

Ordering networks list result by name, created_at or priority fields and directions (e.g. created_at.desc). Default is created_at.desc. Use priority.desc to sort by shared network priority (relevant when owned_by=any).

Available options:
created_at.asc,
created_at.desc,
name.asc,
name.desc,
priority.desc
Example:

"created_at.desc"

owned_by
enum<string>
default:project

Controls which networks are returned. 'project' (default) returns only networks owned by the project. 'any' returns all networks that the project can use, including shared networks from other projects.

Available options:
any,
project
Example:

"project"

tag_key
string[]

Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2

Tag key. Maximum 255 characters. Cannot contain spaces, tabs, newlines, empty string or '=' character.

Required string length: 1 - 255
Pattern: ^[^\s=]+$
Example:
["key1", "key2"]
tag_key_value
string

Optional. Filter by tag key-value pairs.

Example:
{ "key": "value" }

Response

200 - application/json

OK

count
integer
required

Number of objects

Required range: x >= 0
Example:

1

results
NetworkSerializer · object[]
required

Objects