POST
/
cloud
/
v1
/
loadbalancers
/
{project_id}
/
{region_id}
Python
import os
from gcore import Gcore

client = Gcore(
    api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
)
task_id_list = client.cloud.load_balancers.create(
    project_id=0,
    region_id=0,
)
print(task_id_list.tasks)
{
  "tasks": [
    "d478ae29-dedc-4869-82f0-96104425f565"
  ]
}

Authorizations

Authorization
string
header
required

API key for authentication. Make sure to include the word apikey, followed by a single space and then your token. Example: apikey 1234$abcdef

Path Parameters

project_id
integer
required

Project ID

region_id
integer
required

Region ID

Body

application/json
flavor
string

Load balancer flavor name

Examples:

"lb1-1-2"

"lb2-2-2"

floating_ip
object

Floating IP configuration for assignment

Examples:
{
"existing_floating_id": "c64e5db1-5f1f-43ec-a8d9-5090df85b82d",
"source": "existing"
}
listeners
CreateListenerSerializer · object[]

Load balancer listeners. Maximum 50 per LB (excluding Prometheus endpoint listener).

Maximum length: 51
logging
object

Logging configuration

name
string

Load balancer name

Examples:

"new_load_balancer"

name_template
string

Load balancer name which will be changed by template.

Examples:

"lb_name_template"

preferred_connectivity
enum<string>

Preferred option to establish connectivity between load balancer and its pools members. L2 provides best performance, L3 provides less IPs usage. It is taking effect only if instance_id + ip_address is provided, not subnet_id + ip_address, because we're considering this as intentional subnet_id specification.

Available options:
L2,
L3
tags
object

Key-value tags to associate 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.

vip_ip_family
enum<string>

IP family for load balancer subnet auto-selection if vip_network_id is specified

Available options:
dual,
ipv4,
ipv6
vip_network_id
string<uuid4>

Network ID for load balancer. If not specified, default external network will be used. Mutually exclusive with vip_port_id

Examples:

"ac307687-31a4-4a11-a949-6bea1b2878f5"

vip_port_id
string<uuid4>

Existing Reserved Fixed IP port ID for load balancer. Mutually exclusive with vip_network_id

Examples:

"ff83e13a-b256-4be2-ba5d-028d3f0ab450"

vip_subnet_id
string<uuid4>

Subnet ID for load balancer. If not specified, any subnet from vip_network_id will be selected. Ignored when vip_network_id is not specified.

Examples:

"4e7802d3-5023-44b8-b298-7726558fddf4"

Response

200 - application/json

List of created tasks

tasks
string[]
required

List of task IDs

Examples:
["d478ae29-dedc-4869-82f0-96104425f565"]