import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
network_interface_list = client.cloud.gpu_baremetal_clusters.interfaces.list(
cluster_id="cluster_id",
project_id=0,
region_id=0,
)
print(network_interface_list.count){
"count": 1,
"results": [
{
"allowed_address_pairs": [
{
"ip_address": "<string>",
"mac_address": "<string>"
}
],
"floatingip_details": [
{
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "<string>",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ip_assignments": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"network_details": {
"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": [
{
"cidr": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"enable_dhcp": true,
"ip_version": 4,
"name": "<string>",
"network_id": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"available_ips": 250,
"creator_task_id": "5cc890da-d031-4a23-ac31-625edfa22812",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"gateway_ip": "192.168.13.1",
"has_router": false,
"host_routes": [],
"id": "b39792c3-3160-4356-912e-ba396c95cdcf",
"task_id": null,
"total_ips": 253
}
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"port_security_enabled": true,
"sub_ports": [
{
"allowed_address_pairs": [
{
"ip_address": "<string>",
"mac_address": "<string>"
}
],
"floatingip_details": [
{
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "<string>",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ip_assignments": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"network_details": {
"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": [
{
"cidr": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"enable_dhcp": true,
"ip_version": 4,
"name": "<string>",
"network_id": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"available_ips": 250,
"creator_task_id": "5cc890da-d031-4a23-ac31-625edfa22812",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"gateway_ip": "192.168.13.1",
"has_router": false,
"host_routes": [],
"id": "b39792c3-3160-4356-912e-ba396c95cdcf",
"task_id": null,
"total_ips": 253
}
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"port_security_enabled": true,
"segmentation_id": 123,
"segmentation_type": "<string>",
"interface_name": "my-interface",
"mac_address": "00:16:3e:f2:87:16"
}
],
"interface_name": "my-interface",
"mac_address": "00:16:3e:f2:87:16"
}
]
}Retrieve a list of network interfaces attached to the GPU cluster servers.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
network_interface_list = client.cloud.gpu_baremetal_clusters.interfaces.list(
cluster_id="cluster_id",
project_id=0,
region_id=0,
)
print(network_interface_list.count){
"count": 1,
"results": [
{
"allowed_address_pairs": [
{
"ip_address": "<string>",
"mac_address": "<string>"
}
],
"floatingip_details": [
{
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "<string>",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ip_assignments": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"network_details": {
"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": [
{
"cidr": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"enable_dhcp": true,
"ip_version": 4,
"name": "<string>",
"network_id": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"available_ips": 250,
"creator_task_id": "5cc890da-d031-4a23-ac31-625edfa22812",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"gateway_ip": "192.168.13.1",
"has_router": false,
"host_routes": [],
"id": "b39792c3-3160-4356-912e-ba396c95cdcf",
"task_id": null,
"total_ips": 253
}
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"port_security_enabled": true,
"sub_ports": [
{
"allowed_address_pairs": [
{
"ip_address": "<string>",
"mac_address": "<string>"
}
],
"floatingip_details": [
{
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "d1e1500b-e2be-40aa-9a4b-cc493fa1af30",
"fixed_ip_address": "192.168.10.15",
"floating_ip_address": "172.24.4.34",
"id": "<string>",
"port_id": "ee2402d0-f0cd-4503-9b75-69be1d11c5f1",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"router_id": "11005a33-c5ac-4c96-ab6f-8f2827cc7da6",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": "a4eb4b29-048e-42f6-a5e1-2c18bc001c45",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"ip_assignments": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"network_details": {
"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": [
{
"cidr": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"enable_dhcp": true,
"ip_version": 4,
"name": "<string>",
"network_id": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"available_ips": 250,
"creator_task_id": "5cc890da-d031-4a23-ac31-625edfa22812",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"gateway_ip": "192.168.13.1",
"has_router": false,
"host_routes": [],
"id": "b39792c3-3160-4356-912e-ba396c95cdcf",
"task_id": null,
"total_ips": 253
}
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"network_id": "<string>",
"port_id": "<string>",
"port_security_enabled": true,
"segmentation_id": 123,
"segmentation_type": "<string>",
"interface_name": "my-interface",
"mac_address": "00:16:3e:f2:87:16"
}
],
"interface_name": "my-interface",
"mac_address": "00:16:3e:f2:87:16"
}
]
}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
Region ID
Cluster ID
Was this page helpful?