import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.cloud.floating_ips.list(
project_id=1,
region_id=1,
)
page = page.results[0]
print(page.id){
"count": 1,
"results": [
{
"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>",
"instance": {
"addresses": {},
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "<string>",
"flavor": {
"flavor_id": "<string>",
"flavor_name": "<string>",
"ram": 123,
"vcpus": 123
},
"id": "<string>",
"instance_description": "Instance description",
"name": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"security_groups": [
{
"name": "<string>"
}
],
"ssh_key_name": "my-ssh-key",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"task_state": null,
"vm_state": "active",
"volumes": [
{
"delete_on_termination": true,
"id": "<string>"
}
]
},
"loadbalancer": {
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"operating_status": "DEGRADED",
"project_id": 123,
"provisioning_status": "ACTIVE",
"region": "<string>",
"region_id": 123,
"tags_v2": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"additional_vips": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"creator_task_id": "9f3ec11e-bcd4-4fe6-924a-a4439a56ad22",
"ddos_profile": {
"fields": [
{
"base_field": 10,
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_name": "ARK Ports",
"field_type": null,
"field_value": "<unknown>",
"id": 123,
"name": "<string>",
"required": true,
"validation_schema": "<unknown>",
"value": null
}
],
"id": 123,
"options": {
"active": true,
"bgp": true
},
"profile_template": {
"description": "description",
"fields": [
{
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"id": 123,
"name": "<string>",
"required": true,
"validation_schema": "<unknown>"
}
],
"id": 123,
"name": "<string>"
},
"profile_template_description": "ARK server ports. Valid port values are in range 1000-65535",
"protocols": [
{
"port": "80",
"protocols": [
"TCP",
"HTTP"
]
},
{
"port": "53",
"protocols": [
"UDP"
]
}
],
"site": "ED",
"status": {
"error_description": "",
"status": "Updated"
}
},
"flavor": {
"flavor_id": "1d276f53-2834-4855-9859-aa922f073055",
"flavor_name": "lb1-1-2",
"ram": 2048,
"vcpus": 1
},
"floating_ips": [
{
"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"
}
],
"listeners": [
{
"id": "<string>"
}
],
"logging": {
"destination_region_id": 1,
"enabled": true,
"retention_policy": {
"period": 45
},
"topic_name": "my-log-name"
},
"preferred_connectivity": "L2",
"stats": {
"active_connections": 0,
"bytes_in": 34942398609,
"bytes_out": 304777113641,
"request_errors": 4,
"total_connections": 21095970
},
"task_id": "<string>",
"updated_at": "2019-06-18T11:57:00+0000",
"vip_address": "5.5.5.5",
"vip_ip_family": "ipv4",
"vip_port_id": "4177d1ef-f1c2-4e45-a531-3e05dfa6d848",
"vrrp_ips": [
{
"ip_address": "<string>",
"role": "BACKUP",
"subnet_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"
}
]
}import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.cloud.floating_ips.list(
project_id=1,
region_id=1,
)
page = page.results[0]
print(page.id){
"count": 1,
"results": [
{
"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>",
"instance": {
"addresses": {},
"created_at": "2023-11-07T05:31:56Z",
"creator_task_id": "<string>",
"flavor": {
"flavor_id": "<string>",
"flavor_name": "<string>",
"ram": 123,
"vcpus": 123
},
"id": "<string>",
"instance_description": "Instance description",
"name": "<string>",
"project_id": 123,
"region": "<string>",
"region_id": 123,
"security_groups": [
{
"name": "<string>"
}
],
"ssh_key_name": "my-ssh-key",
"status": "ACTIVE",
"tags": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"task_id": null,
"task_state": null,
"vm_state": "active",
"volumes": [
{
"delete_on_termination": true,
"id": "<string>"
}
]
},
"loadbalancer": {
"created_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"operating_status": "DEGRADED",
"project_id": 123,
"provisioning_status": "ACTIVE",
"region": "<string>",
"region_id": 123,
"tags_v2": [
{
"key": "<string>",
"read_only": true,
"value": "<string>"
}
],
"additional_vips": [
{
"ip_address": "<string>",
"subnet_id": "<string>"
}
],
"creator_task_id": "9f3ec11e-bcd4-4fe6-924a-a4439a56ad22",
"ddos_profile": {
"fields": [
{
"base_field": 10,
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_name": "ARK Ports",
"field_type": null,
"field_value": "<unknown>",
"id": 123,
"name": "<string>",
"required": true,
"validation_schema": "<unknown>",
"value": null
}
],
"id": 123,
"options": {
"active": true,
"bgp": true
},
"profile_template": {
"description": "description",
"fields": [
{
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"id": 123,
"name": "<string>",
"required": true,
"validation_schema": "<unknown>"
}
],
"id": 123,
"name": "<string>"
},
"profile_template_description": "ARK server ports. Valid port values are in range 1000-65535",
"protocols": [
{
"port": "80",
"protocols": [
"TCP",
"HTTP"
]
},
{
"port": "53",
"protocols": [
"UDP"
]
}
],
"site": "ED",
"status": {
"error_description": "",
"status": "Updated"
}
},
"flavor": {
"flavor_id": "1d276f53-2834-4855-9859-aa922f073055",
"flavor_name": "lb1-1-2",
"ram": 2048,
"vcpus": 1
},
"floating_ips": [
{
"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"
}
],
"listeners": [
{
"id": "<string>"
}
],
"logging": {
"destination_region_id": 1,
"enabled": true,
"retention_policy": {
"period": 45
},
"topic_name": "my-log-name"
},
"preferred_connectivity": "L2",
"stats": {
"active_connections": 0,
"bytes_in": 34942398609,
"bytes_out": 304777113641,
"request_errors": 4,
"total_connections": 21095970
},
"task_id": "<string>",
"updated_at": "2019-06-18T11:57:00+0000",
"vip_address": "5.5.5.5",
"vip_ip_family": "ipv4",
"vip_port_id": "4177d1ef-f1c2-4e45-a531-3e05dfa6d848",
"vrrp_ips": [
{
"ip_address": "<string>",
"role": "BACKUP",
"subnet_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"
}
]
}API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Optional. Limit the number of returned items
x <= 1000Optional. Offset value is used to exclude the first set of records from the result
x >= 0Filter by floating IP status. DOWN - unassigned (available). ACTIVE - attached to a port (in use). ERROR - error state.
ACTIVE, DOWN, ERROR Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
Tag key. The maximum size for a key is 255 characters.
1 - 255Optional. Filter by tag key-value pairs.
OK
Number of objects
x >= 0Objects
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
Instance the floating IP is attached to
Show child attributes
Map of network_name to list of addresses in that network
Show child attributes
Datetime when instance was created
Task that created this entity
Flavor
Show child attributes
Flavor ID is the same as name
Flavor name
RAM size in MiB
Virtual CPU count. For bare metal flavors, it's a physical CPU count
Instance ID
Instance description
"Instance description"
Instance name
Project ID
Region name
Region ID
SSH key name assigned to instance
"my-ssh-key"
Instance status
ACTIVE, BUILD, DELETED, ERROR, HARD_REBOOT, MIGRATING, PASSWORD, PAUSED, REBOOT, REBUILD, RESCUE, RESIZE, REVERT_RESIZE, SHELVED, SHELVED_OFFLOADED, SHUTOFF, SOFT_DELETED, SUSPENDED, UNKNOWN, VERIFY_RESIZE 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
Task state
null
Virtual machine state (active)
active, building, deleted, error, paused, rescued, resized, shelved, shelved_offloaded, soft-deleted, stopped, suspended Load balancer the floating IP is attached to
Show child attributes
Datetime when the load balancer was created
Load balancer ID
Load balancer name
Load balancer operating status
DEGRADED, DRAINING, ERROR, NO_MONITOR, OFFLINE, ONLINE Project ID
Load balancer lifecycle status
ACTIVE, DELETED, ERROR, PENDING_CREATE, PENDING_DELETE, PENDING_UPDATE 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.
Task that created this entity
"9f3ec11e-bcd4-4fe6-924a-a4439a56ad22"
Loadbalancer advanced DDoS protection profile.
Show child attributes
List of configured field values for the protection profile
Show child attributes
ID of DDoS profile field
10
Predefined default value for the field if not specified
100null
Detailed description explaining the field's purpose and usage guidelines
255"ARK server ports. Valid port values are in range 1000-65535"
Name of DDoS profile field
"ARK Ports"
Data type classification of the field (e.g., string, integer, array)
null
Complex value. Only one of 'value' or 'field_value' must be specified.
Unique identifier for the DDoS protection field
Human-readable name of the protection field
30Indicates whether this field must be provided when creating a protection profile
true
JSON schema defining validation rules and constraints for the field value
Basic type value. Only one of 'value' or 'field_value' must be specified.
null
Unique identifier for the DDoS protection profile
Configuration options controlling profile activation and BGP routing
Show child attributes
Complete template configuration data used for this profile
Show child attributes
Detailed description explaining the template's purpose and use cases
"description"
List of configurable fields that define the template's protection parameters
Show child attributes
Predefined default value for the field if not specified
100null
Detailed description explaining the field's purpose and usage guidelines
255"ARK server ports. Valid port values are in range 1000-65535"
Data type classification of the field (e.g., string, integer, array)
null
Unique identifier for the DDoS protection field
Human-readable name of the protection field
30Indicates whether this field must be provided when creating a protection profile
true
JSON schema defining validation rules and constraints for the field value
Unique identifier for the DDoS protection template
Human-readable name of the protection template
100Detailed description of the protection template used for this profile
"ARK server ports. Valid port values are in range 1000-65535"
List of network protocols and ports configured for protection
[
{
"port": "80",
"protocols": ["TCP", "HTTP"]
},
{ "port": "53", "protocols": ["UDP"] }
]Geographic site identifier where the protection is deployed
50"ED"
Current operational status and any error information for the profile
Show child attributes
{
"error_description": "",
"status": "Updated"
}Load balancer flavor (if not default)
Show child attributes
Flavor ID is the same as name
Flavor name
RAM size in MiB
Virtual CPU count. For bare metal flavors, it's a physical CPU count
{
"flavor_id": "1d276f53-2834-4855-9859-aa922f073055",
"flavor_name": "lb1-1-2",
"ram": 2048,
"vcpus": 1
}List of assigned floating IPs
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
Logging configuration
Show child attributes
ID of the region in which the logs will be stored
1
Indicates if log streaming is enabled or disabled
The topic name to stream logs to
"my-log-name"
Logs retention policy
Show child attributes
Duration of days for which logs must be kept.
0 < x <= 182545
{ "period": 45 }{
"destination_region_id": 1,
"enabled": true,
"retention_policy": { "period": 45 },
"topic_name": "my-log-name"
}Preferred option to establish connectivity between load balancer and its pools members
L2, L3 Statistics of load balancer.
Show child attributes
Currently active connections
Total bytes received
Total bytes sent
Total requests that were unable to be fulfilled
Total connections handled
{
"active_connections": 0,
"bytes_in": 34942398609,
"bytes_out": 304777113641,
"request_errors": 4,
"total_connections": 21095970
}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.
Datetime when the load balancer was last updated
"2019-06-18T11:57:00+0000"
Load balancer IP address
"5.5.5.5"
Load balancer IP family
dual, ipv4, ipv6 "ipv4"
The ID of the Virtual IP (VIP) port.
"4177d1ef-f1c2-4e45-a531-3e05dfa6d848"
List of VRRP IP addresses
Show child attributes
IP address
LoadBalancer instance role to which VRRP IP belong
BACKUP, MASTER, STANDALONE Subnet UUID
Port ID
"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.
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
Was this page helpful?