from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
connected_port_list = client.cloud.reserved_fixed_ips.vip.list_connected_ports(
port_id="port_id",
project_id=0,
region_id=0,
)
print(connected_port_list.count)
{
"count": 1,
"results": [
{
"instance_id": "bc688791-f1b0-44eb-97d4-07697294b1e1",
"instance_name": "Virtual Machine 1",
"ip_assignments": [
{
"ip_address": "192.168.123.20",
"subnet": {
"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"
},
"subnet_id": "b39792c3-3160-4356-912e-ba396c95cdcf"
}
],
"network": {
"created_at": "2019-06-18T11:56:16+0000",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"mtu": 1500,
"name": "public",
"port_security_enabled": true,
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"segmentation_id": 9,
"shared": false,
"subnets": [
"f00624ab-41bc-4d54-a723-1673ce32d997",
"41e0f698-4d39-483b-b77a-18eb070e4c09"
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
},
"port_id": "351b0dd7-ca09-431c-be53-935db3785067"
}
]
}
List all instance ports that share a VIP.
from gcore import Gcore
client = Gcore(
api_key="My API Key",
)
connected_port_list = client.cloud.reserved_fixed_ips.vip.list_connected_ports(
port_id="port_id",
project_id=0,
region_id=0,
)
print(connected_port_list.count)
{
"count": 1,
"results": [
{
"instance_id": "bc688791-f1b0-44eb-97d4-07697294b1e1",
"instance_name": "Virtual Machine 1",
"ip_assignments": [
{
"ip_address": "192.168.123.20",
"subnet": {
"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"
},
"subnet_id": "b39792c3-3160-4356-912e-ba396c95cdcf"
}
],
"network": {
"created_at": "2019-06-18T11:56:16+0000",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"mtu": 1500,
"name": "public",
"port_security_enabled": true,
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"segmentation_id": 9,
"shared": false,
"subnets": [
"f00624ab-41bc-4d54-a723-1673ce32d997",
"41e0f698-4d39-483b-b77a-18eb070e4c09"
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
},
"port_id": "351b0dd7-ca09-431c-be53-935db3785067"
}
]
}
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
Port ID
List of connected instances
The response is of type object
.
Was this page helpful?