Skip to content

Create Load Balancer (ALB or NLB)

POST
/api/v1/appliances/load-balancers/
curl --request POST \
--url 'https://api.e2enetworks.com/myaccount/api/v1/appliances/load-balancers/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \
--header 'Authorization: Bearer <API_TOKEN>' \
--header 'Content-Type: application/json' \
--data '{
"plan_name": "E2E-LB-2",
"lb_name": "LB-ALB-26321-6218",
"lb_type": "external",
"lb_mode": "BOTH",
"lb_port": "443",
"node_list_type": "D",
"connection_timeout": 60,
"client_timeout": 60,
"server_timeout": 60,
"http_keep_alive_timeout": 60,
"ssl_context": {
"ssl_certificate_id": null,
"redirect_to_https": false
},
"backends": [
{
"name": "backend-group-1",
"balance": "source",
"backend_mode": "http",
"backend_ssl": false,
"http_check": true,
"check_url": "/",
"domain_name": "localhost",
"websocket_timeout": 60,
"network_id": null,
"scaler_id": null,
"scaler_port": null,
"servers": [
{
"backend_name": "C3-8GB-853",
"backend_ip": "10.2.3.4",
"backend_port": 8080
}
]
}
],
"default_backend": "backend-group-1",
"acl_list": [],
"acl_map": [],
"tcp_backend": [
{
"backend_name": "backend-group-1",
"port": 12345,
"balance": "leastconn",
"timeout_connect": "5",
"timeout_client": "10",
"timeout_server": "10",
"servers": [
{
"backend_name": "C3-8GB-853",
"backend_ip": "10.8.54.7",
"backend_port": 32
}
]
}
],
"vpc_list": [
{
"network_id": "60806",
"vpc_name": "VPC-261",
"ipv4_cidr": "10.8.46.0/23",
"subnet_id": null
}
],
"lb_reserve_ip": "",
"is_ipv6_attached": false,
"enable_bitninja": false,
"security_group_id": 81526,
"isEncryptionEnabled": false,
"encryption_passphrase": "ApiAuto@24",
"cn_id": null,
"cn_status": null
}'

Provisions a load balancer appliance (HAProxy). A single endpoint creates both types - the request body shape is what distinguishes them:

  • Application Load Balancer (ALB) - Layer-7 (HTTP/HTTPS). Identified by one or more backends (and no tcp_backend). Supports host/path ACL routing, SSL termination, WebSocket timeouts, and node-based or auto-scaling-group backends. lb_mode is HTTP, HTTPS, or BOTH.

  • Network Load Balancer (NLB) - Layer-4 (TCP). Identified by a single tcp_backend entry (and no backends). lb_mode is TCP and the listening port comes from the tcp_backend entry. ACLs and SSL are not supported.

backends and tcp_backend are mutually exclusive. ACL rules (acl_list / acl_map) are always sent empty at create time and added later via the Update Load Balancer endpoint. On success the appliance is returned in Creating state - poll the Load Balancer Status endpoint until it becomes Running.

project_id
required
integer

Identifier of the project to scope the request to. Required integer project ID.

Example

<PROJECT_ID>
apikey
required
string

API key used to authenticate the create request

Example

<API_KEY>
location
required
string

Region in which the load balancer will be provisioned.

Example

<LOCATION>
Media typeapplication/json

Create payload for both load balancer types. Send backends for an ALB (Layer 7) or a single tcp_backend for an NLB (Layer 4) - the two are mutually exclusive and exactly one is required. ALB-only fields (ssl_context, acl_list/acl_map, per-backend http_check / websocket_timeout / backend_ssl) do not apply to an NLB.

object
plan_name
required

Plan SKU backing the load balancer appliance. Use the name of a plan returned by LB Plans (for example E2E-LB-2).

string

Example

E2E-LB-2
lb_name
required

Display name of the load balancer.

string

Example

LB-ALB-26321-6218
lb_type
required

Network scheme of the load balancer. external exposes a public IP; internal is reachable only inside the selected VPC(s) and requires vpc_list. (This is the “Scheme/Type” choice in the console; it does not distinguish ALB from NLB - the presence of backends is what makes this an ALB.)

string
Allowed values: external internal

Example

external
lb_mode
required

Frontend protocol. For an ALB: HTTP (port 80 only), HTTPS (443 only), or BOTH (HTTP redirects honour ssl_context.redirect_to_https). For an NLB: always TCP.

string
Allowed values: HTTP HTTPS BOTH TCP

Example

BOTH
lb_port
required

Primary listening port, sent as a string. The console sets 80 when lb_mode is HTTP and 443 otherwise.

string

Example

443
node_list_type
required

Backend node-list mode. Always D (dynamic) for load balancers created from the console.

string
Allowed values: D

Example

D
connection_timeout

HAProxy connection timeout, in seconds.

integer

Example

60
client_timeout

HAProxy client-side inactivity timeout, in seconds.

integer

Example

60
server_timeout

HAProxy server-side inactivity timeout, in seconds.

integer

Example

60
http_keep_alive_timeout

HAProxy HTTP keep-alive timeout, in seconds.

integer

Example

60
ssl_context

TLS configuration. Required when lb_mode is HTTPS or BOTH (an SSL certificate must be selected); not used for plain HTTP.

object
ssl_certificate_id

ID of an uploaded SSL certificate to terminate TLS with. Required when lb_mode is not HTTP; null otherwise.

integer
nullable

Example

null
redirect_to_https

When true, plain HTTP requests are redirected to HTTPS.

boolean

Example

false
backends

One or more backend groups the ALB routes traffic to. At least one backend is required for an ALB (this is what distinguishes it from an NLB). backends and tcp_backend are mutually exclusive.

Array<object>
object
name
required

Backend group name (also referenced by ACL maps and default_backend).

string

Example

backend-group-1
balance

Load-balancing (routing policy) algorithm. source provides IP stickiness, roundrobin distributes evenly, leastconn sends to the least-busy server.

string
Allowed values: source roundrobin leastconn

Example

source
backend_mode

Backend protocol. Mirrors backend_ssl - http or https.

string
Allowed values: http https

Example

http
backend_ssl

Whether the ALB connects to backend servers over HTTPS.

boolean

Example

false
http_check

Enables HTTP health checks against check_url.

boolean

Example

true
check_url

Path used for HTTP health checks.

string

Example

/
domain_name
required

Host header used for health checks. The console sends localhost.

string

Example

localhost
websocket_timeout

WebSocket idle timeout in seconds, or null to disable.

integer
nullable

Example

60
network_id

VPC network ID for the backend; null for public backends.

string
nullable

Example

null
scaler_id

Auto Scaling Group ID when the backend type is an auto-scaling group. null for node-based backends.

string
nullable

Example

null
scaler_port

Port on the auto-scaling group’s nodes. null for node-based backends.

string
nullable

Example

null
servers

Backend servers (nodes) for a node-based backend. Omitted/empty when the backend is an auto-scaling group.

Array<object>
object
backend_name
required

Name of the backend server.

string

Example

C3-8GB-853
backend_ip
required

Private/public IPv4 address of the backend server.

string

Example

10.2.3.4
backend_port
required

Port the backend server listens on.

integer

Example

8080
default_backend

Name of the backend that receives traffic not matched by any ACL. May only be set when backends is non-empty.

string

Example

backend-group-1
acl_list

Layer-7 routing rule definitions. Always sent empty at create time; add rules afterwards via Update Load Balancer.

Array
acl_map

Mapping of ACL rules to backends. Always sent empty at create time.

Array
tcp_backend

The single TCP backend group for an NLB. Provide exactly one entry for an NLB (and leave backends empty); leave this empty for an ALB. backends and tcp_backend are mutually exclusive.

Array<object>
object
backend_name

Backend group name.

string

Example

backend-group-1
port
required

Port the NLB listens on and forwards to the backend servers (also copied to top-level lb_port).

integer

Example

12345
balance

Load-balancing (routing policy) algorithm.

string
Allowed values: source roundrobin leastconn

Example

leastconn
timeout_connect

TCP connect timeout in seconds (as a string).

string

Example

5
timeout_client

TCP client-side timeout in seconds (as a string).

string

Example

10
timeout_server

TCP server-side timeout in seconds (as a string).

string

Example

10
servers
required

Backend servers (nodes) for the TCP backend.

Array<object>
object
backend_name
required
string

Example

C3-8GB-853
backend_ip
required
string

Example

10.8.54.7
backend_port
required
integer

Example

32
vpc_list

VPC(s) the load balancer attaches to. Required when lb_type is internal; optional otherwise.

Array<object>
object
network_id
required

VPC network ID.

string

Example

60806
vpc_name
required

VPC name.

string

Example

VPC-261
ipv4_cidr
required

IPv4 CIDR block of the VPC.

string

Example

10.8.46.0/23
subnet_id

Subnet ID, when attaching to a specific subnet.

string
nullable

Example

null
lb_reserve_ip

A previously reserved public IPv4 address to assign to the load balancer. Send an empty string to allocate a fresh IP. Not allowed for internal load balancers.

string

Example

is_ipv6_attached

Whether to attach a public IPv6 address at creation (external load balancers only).

boolean

Example

false
enable_bitninja

Whether to activate the BitNinja security add-on on the appliance.

boolean

Example

false
security_group_id

ID of the security group to attach to the load balancer. The console always sends the selected security group.

integer
nullable

Example

81526
isEncryptionEnabled

Enables disk encryption on the appliance. When true, encryption_passphrase is required.

boolean

Example

false
encryption_passphrase

Passphrase for disk encryption. Only used when isEncryptionEnabled is true.

string

Example

ApiAuto@24
cn_id

Committed (reserved) SKU ID, when creating the load balancer on a committed plan. null for standard hourly billing. Use a committed_sku_id from LB Plans.

integer
nullable

Example

null
cn_status

Committed-plan renewal status. null for standard hourly billing.

string
nullable

Example

null

Successful response

Media typeapplication/json
object
code
integer
data
object
appliance_id

ID of the newly created load balancer.

integer
id

Same as appliance_id.

integer
IP

Public IP assigned to the load balancer.

string
is_credit_sufficient

Whether the account had sufficient credit for the request.

boolean
resource_type
string
nullable
label_id
integer
nullable
errors
object
message
string

Example

{
"code": 200,
"data": {
"appliance_id": 1234,
"id": 1234,
"IP": "164.2.3.4",
"is_credit_sufficient": true,
"resource_type": null,
"label_id": null
},
"message": "Success"
}