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"
}
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"
}
API key for authentication. Make sure to include the word apikey
, followed by a single space and then your token.
Example: apikey 1234$abcdef
Project ID
1
Region ID
1
Subnet ID
"b39792c3-3160-4356-912e-ba396c95cdcf"
OK
The response is of type object
.
Was this page helpful?