import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
gpu_virtual_interface_list = client.cloud.gpu_virtual_clusters.interfaces.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
)
print(gpu_virtual_interface_list.count){
"count": 1,
"results": [
{
"floating_ips": [
{
"created_at": "2023-11-07T05:31:56Z",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "<string>",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ip_assignments": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"mac_address": "00:16:3e:f2:87:16",
"network": {
"created_at": "2023-11-07T05:31:56Z",
"external": true,
"id": "<string>",
"mtu": 123,
"name": "<string>",
"port_security_enabled": true,
"segmentation_id": 9,
"shared": true,
"subnets": [
{
"available_ips": 250,
"cidr": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"enable_dhcp": true,
"gateway_ip": "192.168.13.1",
"has_router": true,
"host_routes": [],
"id": "<string>",
"ip_version": 4,
"name": "<string>",
"network_id": "<string>",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"total_ips": 253,
"updated_at": "2023-11-07T05:31:56Z"
}
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"port_security_enabled": true
}
]
}List all network interfaces for servers in a virtual GPU cluster.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
gpu_virtual_interface_list = client.cloud.gpu_virtual_clusters.interfaces.list(
cluster_id="1aaaab48-10d0-46d9-80cc-85209284ceb4",
project_id=1,
region_id=7,
)
print(gpu_virtual_interface_list.count){
"count": 1,
"results": [
{
"floating_ips": [
{
"created_at": "2023-11-07T05:31:56Z",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "<string>",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ip_assignments": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"mac_address": "00:16:3e:f2:87:16",
"network": {
"created_at": "2023-11-07T05:31:56Z",
"external": true,
"id": "<string>",
"mtu": 123,
"name": "<string>",
"port_security_enabled": true,
"segmentation_id": 9,
"shared": true,
"subnets": [
{
"available_ips": 250,
"cidr": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"enable_dhcp": true,
"gateway_ip": "192.168.13.1",
"has_router": true,
"host_routes": [],
"id": "<string>",
"ip_version": 4,
"name": "<string>",
"network_id": "<string>",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"total_ips": 253,
"updated_at": "2023-11-07T05:31:56Z"
}
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"port_security_enabled": true
}
]
}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
7
Cluster unique identifier
"1aaaab48-10d0-46d9-80cc-85209284ceb4"
Was this page helpful?