GET
/
cloud
/
v1
/
subnets
/
{project_id}
/
{region_id}
/
{subnet_id}
Python
from gcore import Gcore

client = Gcore(
    api_key="My API Key",
)
subnet = client.cloud.networks.subnets.get(
    subnet_id="b39792c3-3160-4356-912e-ba396c95cdcf",
    project_id=1,
    region_id=1,
)
print(subnet.cidr)
{
  "available_ips": 250,
  "cidr": "192.168.13.0/24",
  "created_at": "2019-06-13T13:58:12+0000",
  "creator_task_id": "5cc890da-d031-4a23-ac31-625edfa22812",
  "dns_nameservers": [
    "8.8.8.8",
    "8.8.4.4"
  ],
  "enable_dhcp": true,
  "gateway_ip": "192.168.13.1",
  "has_router": false,
  "host_routes": [],
  "id": "b39792c3-3160-4356-912e-ba396c95cdcf",
  "ip_version": 4,
  "name": "subnet_3",
  "network_id": "b30d0de7-bca2-4c83-9c57-9e645bd2cc92",
  "project_id": 1337,
  "region": "Luxembourg 1",
  "region_id": 7,
  "tags": [
    {
      "key": "my-tag",
      "read_only": false,
      "value": "my-tag-value"
    }
  ],
  "task_id": null,
  "total_ips": 253,
  "updated_at": "2019-06-13T13:58:12+0000"
}

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

Examples:

1

region_id
integer
required

Region ID

Examples:

1

subnet_id
string<uuid4>
required

Subnet ID

Examples:

"b39792c3-3160-4356-912e-ba396c95cdcf"

Response

200 - application/json

OK

cidr
string<ipvanynetwork>
required

CIDR

Examples:

"192.168.13.0/24"

created_at
string<date-time>
required

Datetime when the subnet was created

Examples:

"2019-06-13T13:58:12+0000"

enable_dhcp
boolean
required

True if DHCP should be enabled

Examples:

true

ip_version
enum<integer>
required

IP version

Available options:
4,
6
name
string
required

Subnet name

Examples:

"subnet_3"

network_id
string<uuid4>
required

Network ID

Examples:

"b30d0de7-bca2-4c83-9c57-9e645bd2cc92"

project_id
integer
required

Project ID

Examples:

1337

region
string
required

Region name

Examples:

"Luxembourg 1"

region_id
integer
required

Region ID

Examples:

7

tags
TagSerializer · object[]
required

List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.

Examples:
[
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
]
updated_at
string<date-time>
required

Datetime when the subnet was last updated

Examples:

"2019-06-13T13:58:12+0000"

available_ips
integer | null

Number of available ips in subnet

Examples:

250

creator_task_id
string<uuid4> | null

Task that created this entity

Examples:

"5cc890da-d031-4a23-ac31-625edfa22812"

dns_nameservers
string<ipvanyaddress>[] | null

List IP addresses of a DNS resolver reachable from the network

Examples:
["8.8.8.8", "8.8.4.4"]
gateway_ip
string<ipvanyaddress> | null

Default GW IPv4 address, advertised in DHCP routes of this subnet. If null, no gateway is advertised by this subnet.

Examples:

"192.168.13.1"

has_router
boolean
default:false
deprecated

Deprecated. Always returns false.

Examples:

false

host_routes
RouteOutSerializer · object[] | null

List of custom static routes to advertise via DHCP.

Examples:
[]
id
string<uuid4> | null

Subnet id.

Examples:

"b39792c3-3160-4356-912e-ba396c95cdcf"

task_id
string<uuid4> | null

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.

Examples:

null

total_ips
integer | null

Total number of ips in subnet

Examples:

253