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
List of network interfaces
Number of objects
x >= 0Objects
Show child attributes
Group of subnet masks and/or IP addresses that share the current IP as VIP
Bodies of floating IPs that are NAT-ing IPs of this port
Show child attributes
Datetime when the floating IP was created
Task that created this entity
"d1e1500b-e2be-40aa-9a4b-cc493fa1af30"
IP address of the port the floating IP is attached to
"192.168.10.15"
IP Address of the floating IP
"172.24.4.34"
Floating IP ID
Port ID the floating IP is attached to. The fixed_ip_address is the IP address of the port.
"ee2402d0-f0cd-4503-9b75-69be1d11c5f1"
Project ID
Region name
Region ID
Router ID
"11005a33-c5ac-4c96-ab6f-8f2827cc7da6"
Floating IP status. DOWN - unassigned (available). ACTIVE - attached to a port (in use). ERROR - error state.
ACTIVE, DOWN, ERROR "ACTIVE"
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.
Show child attributes
Tag key. The maximum size for a key is 255 characters.
If true, the tag is read-only and cannot be modified by the user
Tag value. The maximum size for a value is 255 characters.
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.
"a4eb4b29-048e-42f6-a5e1-2c18bc001c45"
Datetime when the floating IP was last updated
Body of the network this port is attached to
Show child attributes
Datetime when the network was created
Task that created this entity
"fd50fdd1-0482-4c9b-b847-fc9924665af6"
True if network has is_default attribute
true
True if the network router:external attribute
Network ID
MTU (maximum transmission unit). Default value is 1450
Network name
Indicates port_security_enabled status of all newly created in the network ports.
Project ID
1337
Region name
Region ID
Id of network segment
9
True when the network is shared with your project by external owner
List of subnets associated with the network
Show child attributes
CIDR
Datetime when the subnet was created
True if DHCP should be enabled
IP version
4, 6 Subnet name
Network ID
Project ID
Region name
Region ID
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.
Show child attributes
Tag key. The maximum size for a key is 255 characters.
If true, the tag is read-only and cannot be modified by the user
Tag value. The maximum size for a value is 255 characters.
Datetime when the subnet was last updated
Number of available ips in subnet
250
Task that created this entity
"5cc890da-d031-4a23-ac31-625edfa22812"
List IP addresses of a DNS resolver reachable from the network
["8.8.8.8", "8.8.4.4"]Default GW IPv4 address, advertised in DHCP routes of this subnet. If null, no gateway is advertised by this subnet.
"192.168.13.1"
Deprecated. Always returns false.
List of custom static routes to advertise via DHCP.
Show child attributes
[]Subnet id.
"b39792c3-3160-4356-912e-ba396c95cdcf"
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.
null
Total number of ips in subnet
253
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.
Show child attributes
Tag key. The maximum size for a key is 255 characters.
If true, the tag is read-only and cannot be modified by the user
Tag value. The maximum size for a value is 255 characters.
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.
null
Network type (vlan, vxlan)
Datetime when the network was last updated
ID of the network the port is attached to
ID of virtual ethernet port object
Port security status
body of ports that are included into trunk port
Show child attributes
Group of subnet masks and/or IP addresses that share the current IP as VIP
Bodies of floating IPs that are NAT-ing IPs of this port
Show child attributes
Datetime when the floating IP was created
Task that created this entity
"d1e1500b-e2be-40aa-9a4b-cc493fa1af30"
IP address of the port the floating IP is attached to
"192.168.10.15"
IP Address of the floating IP
"172.24.4.34"
Floating IP ID
Port ID the floating IP is attached to. The fixed_ip_address is the IP address of the port.
"ee2402d0-f0cd-4503-9b75-69be1d11c5f1"
Project ID
Region name
Region ID
Router ID
"11005a33-c5ac-4c96-ab6f-8f2827cc7da6"
Floating IP status. DOWN - unassigned (available). ACTIVE - attached to a port (in use). ERROR - error state.
ACTIVE, DOWN, ERROR "ACTIVE"
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.
Show child attributes
Tag key. The maximum size for a key is 255 characters.
If true, the tag is read-only and cannot be modified by the user
Tag value. The maximum size for a value is 255 characters.
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.
"a4eb4b29-048e-42f6-a5e1-2c18bc001c45"
Datetime when the floating IP was last updated
Body of the network this port is attached to
Show child attributes
Datetime when the network was created
Task that created this entity
"fd50fdd1-0482-4c9b-b847-fc9924665af6"
True if network has is_default attribute
true
True if the network router:external attribute
Network ID
MTU (maximum transmission unit). Default value is 1450
Network name
Indicates port_security_enabled status of all newly created in the network ports.
Project ID
1337
Region name
Region ID
Id of network segment
9
True when the network is shared with your project by external owner
List of subnets associated with the network
Show child attributes
CIDR
Datetime when the subnet was created
True if DHCP should be enabled
IP version
4, 6 Subnet name
Network ID
Project ID
Region name
Region ID
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.
Show child attributes
Tag key. The maximum size for a key is 255 characters.
If true, the tag is read-only and cannot be modified by the user
Tag value. The maximum size for a value is 255 characters.
Datetime when the subnet was last updated
Number of available ips in subnet
250
Task that created this entity
"5cc890da-d031-4a23-ac31-625edfa22812"
List IP addresses of a DNS resolver reachable from the network
["8.8.8.8", "8.8.4.4"]Default GW IPv4 address, advertised in DHCP routes of this subnet. If null, no gateway is advertised by this subnet.
"192.168.13.1"
Deprecated. Always returns false.
List of custom static routes to advertise via DHCP.
Show child attributes
CIDR of destination IPv4 subnet.
IPv4 address to forward traffic to if it's destination IP matches 'destination' CIDR.
[]Subnet id.
"b39792c3-3160-4356-912e-ba396c95cdcf"
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.
null
Total number of ips in subnet
253
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.
Show child attributes
Tag key. The maximum size for a key is 255 characters.
If true, the tag is read-only and cannot be modified by the user
Tag value. The maximum size for a value is 255 characters.
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.
null
Network type (vlan, vxlan)
Datetime when the network was last updated
ID of the network the port is attached to
ID of virtual ethernet port object
Port security status
id of network segment
type of network segment
Interface name
"my-interface"
MAC address of the virtual port
"00:16:3e:f2:87:16"
Interface name
"my-interface"
MAC address of the virtual port
"00:16:3e:f2:87:16"
Was this page helpful?