Skip to main content
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": [
    "<string>"
  ]
}

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

floating_ip
New floating IP · object

Floating IP configuration for assignment

  • New floating IP
  • Existing floating IP
Example:
{
"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 array length: 51
logging
LoadbalancerLoggingSerializer · object

Logging configuration

name
string

Load balancer name. Either name or name_template should be specified.

name_template
string

Load balancer name which will be changed by template. Either name or name_template should be specified.

preferred_connectivity
enum<string>
default:L2

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
CreateTagsSerializer · 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. Both tag keys and values have a maximum length of 255 characters. 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

vip_port_id
string<uuid4>

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

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.

Response

200 - application/json

List of created tasks

tasks
string[]
required

List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:

  • GET /v1/tasks/{task_id} - Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.