import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
connected_port_list = client.cloud.reserved_fixed_ips.vip.update_connected_ports(
port_id="port_id",
project_id=0,
region_id=0,
)
print(connected_port_list.count){
"count": 1,
"results": [
{
"instance_id": "<string>",
"instance_name": "<string>",
"ip_assignments": [
{
"ip_address": "<string>",
"subnet": {
"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
},
"subnet_id": "<string>"
}
],
"network": {
"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": [
"<string>"
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"port_id": "<string>"
}
]
}Add instance ports to share a VIP.
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
connected_port_list = client.cloud.reserved_fixed_ips.vip.update_connected_ports(
port_id="port_id",
project_id=0,
region_id=0,
)
print(connected_port_list.count){
"count": 1,
"results": [
{
"instance_id": "<string>",
"instance_name": "<string>",
"ip_assignments": [
{
"ip_address": "<string>",
"subnet": {
"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
},
"subnet_id": "<string>"
}
],
"network": {
"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": [
"<string>"
],
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"type": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"port_id": "<string>"
}
]
}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 port IDs that will share one VIP
Updated list of connected instances
Number of objects
x >= 0Objects
Show child attributes
ID of the instance that owns the port
Name of the instance that owns the port
IP addresses assigned to this port
Show child attributes
IP address
Subnet details
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
ID of the subnet that allocated the IP
Network details
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 subnetworks
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
Port ID that shares VIP
Was this page helpful?