Skip to main content
POST
/
cloud
/
v1
/
lblisteners
/
{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.listeners.create(
    project_id=1,
    region_id=1,
    load_balancer_id="30f4f55b-4a7c-48e0-9954-5cddfee216e7",
    name="my_listener",
    protocol="HTTP",
    protocol_port=80,
)
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
load_balancer_id
string<uuid4>
required

Load balancer ID

name
string
required

Load balancer listener name

protocol
enum<string>
required

Load balancer listener protocol

Available options:
HTTP,
HTTPS,
PROMETHEUS,
TCP,
TERMINATED_HTTPS,
UDP
protocol_port
integer
required

Protocol port

Required range: 1 <= x <= 65535
allowed_cidrs
string<ipvanynetwork>[] | null

Network CIDRs from which service will be accessible

Example:
["10.0.0.0/8"]
connection_limit
integer
default:100000

Limit of the simultaneous connections. If -1 is provided, it is translated to the default value 100000.

Required range: -1 <= x <= 1000000
insert_x_forwarded
boolean

Add headers X-Forwarded-For, X-Forwarded-Port, X-Forwarded-Proto to requests. Only used with HTTP or TERMINATED_HTTPS protocols.

secret_id

ID of the secret where PKCS12 file is stored for TERMINATED_HTTPS or PROMETHEUS listener

Allowed value: ""
Example:

"f2e734d0-fa2b-42c2-ad33-4c6db5101e00"

sni_secret_id
string<uuid4>[]

List of secrets IDs containing PKCS12 format certificate/key bundles for TERMINATED_HTTPS or PROMETHEUS listeners

timeout_client_data
integer | null

Frontend client inactivity timeout in milliseconds

Required range: 0 <= x <= 86400000
Example:

50000

timeout_member_connect
integer | null

Backend member connection timeout in milliseconds

Required range: 0 <= x <= 86400000
Example:

50000

timeout_member_data
integer | null

Backend member inactivity timeout in milliseconds

Required range: 0 <= x <= 86400000
Example:

null

user_list
UserListItem · object[]

Load balancer listener list of username and encrypted password items

Response

200 - application/json

OK

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.