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.load_balancers.list(
project_id=1,
region_id=7,
)
page = page.results[0]
print(page.id){
"count": 1,
"results": [
{
"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>"
}
]
}
]
}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.load_balancers.list(
project_id=1,
region_id=7,
)
page = page.results[0]
print(page.id){
"count": 1,
"results": [
{
"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>"
}
]
}
]
}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
1
Region ID
7
With or without assigned floating IP
true
false
Limit of items on a single page
x <= 10001000
With or without logging enabled
Filter by name
"lb_name"
Offset in results list
x >= 00
Order by field and direction.
created_at.asc, created_at.desc, flavor.asc, flavor.desc, name.asc, name.desc, operating_status.asc, operating_status.desc, provisioning_status.asc, provisioning_status.desc, updated_at.asc, updated_at.desc, vip_address.asc, vip_address.desc, vip_ip_family.asc, vip_ip_family.desc "name.asc"
Show statistics
true
false
Optional. Filter by tag keys. ?tag_key=key1&tag_key=key2
Tag key. The maximum size for a key is 255 characters.
1 - 255["key1", "key2"]Optional. Filter by tag key-value pairs.
Show Advanced DDoS protection profile, if exists
true
false
Was this page helpful?