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
Region ID
Cluster unique identifier
OK
Number of objects
x >= 0Objects
Show child attributes
Bodies of floatingips that are NAT-ing ips of this port
Show child attributes
Datetime when the floating IP was created
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"
Router ID
"11005a33-c5ac-4c96-ab6f-8f2827cc7da6"
Floating IP status
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.
Datetime when the floating IP was last updated
MAC address of the virtual port
"00:16:3e:f2:87:16"
Body of the network this port is attached to
Show child attributes
Datetime when the network was created
True if the network router:external attribute
Network ID
MTU (maximum transmission unit)
Network name
Indicates port_security_enabled status of all newly created in the network ports.
Id of network segment
9
True when the network is shared with your project by external owner
List of subnetworks
Show child attributes
Number of available ips in subnet
250
CIDR
Datetime when the subnet was created
List IP addresses of a DNS resolver reachable from the network
["8.8.8.8", "8.8.4.4"]Indicates whether DHCP is enabled for this subnet. If true, IP addresses will be assigned automatically
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.
[]Subnet id.
IP version used by the subnet (IPv4 or IPv6)
4, 6 Subnet name
Network 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.
Total number of ips in subnet
253
Datetime when the subnet was last updated
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.
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
Was this page helpful?