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,
    loadbalancer_id="30f4f55b-4a7c-48e0-9954-5cddfee216e7",
    name="my_listener",
    protocol="HTTP",
    protocol_port=80,
)
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

Examples:

1

region_id
integer
required

Region ID

Required range: x > 0
Examples:

1

Body

application/json
loadbalancer_id
string<uuid4>
required

Load balancer ID

Examples:

"30f4f55b-4a7c-48e0-9954-5cddfee216e7"

name
string
required

Load balancer listener name

Examples:

"my_listener"

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
Examples:

80

allowed_cidrs
string<ipvanynetwork>[] | null

Network CIDRs from which service will be accessible

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

Limit of the simultaneous connections

Required range: -1 <= x <= 1000000
Examples:

100000

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.

Examples:

false

secret_id

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

Allowed value: ""
Examples:

"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

Examples:
[
"f2e734d0-fa2b-42c2-ad33-4c6db5101e00",
"eb121225-7ded-4ff3-ae1f-599e145dd7cb"
]
timeout_client_data
integer | null

Frontend client inactivity timeout in milliseconds

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

50000

timeout_member_connect
integer | null

Backend member connection timeout in milliseconds

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

50000

timeout_member_data
integer | null

Backend member inactivity timeout in milliseconds

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

null

user_list
UserListItem · object[]

Load balancer listener list of username and encrypted password items

Examples:
[
{
"encrypted_password": "$5$isRr.HJ1IrQP38.m$oViu3DJOpUG2ZsjCBtbITV3mqpxxbZfyWJojLPNSPO5",
"username": "admin"
}
]

Response

200 - application/json

OK

tasks
string[]
required

List of task IDs

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