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}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/appliances/load-balancers/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "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": None, "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": None, "scaler_id": None, "scaler_port": None, "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": None, }, ], "lb_reserve_ip": "", "is_ipv6_attached": False, "enable_bitninja": False, "security_group_id": 81526, "isEncryptionEnabled": False, "encryption_passphrase": "ApiAuto@24", "cn_id": None, "cn_status": None, },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/appliances/load-balancers/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "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 }),});console.log(await response.json());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 notcp_backend). Supports host/path ACL routing, SSL termination, WebSocket timeouts, and node-based or auto-scaling-group backends.lb_modeisHTTP,HTTPS, orBOTH. -
Network Load Balancer (NLB) - Layer-4 (TCP). Identified by a single
tcp_backendentry (and nobackends).lb_modeisTCPand the listening port comes from thetcp_backendentry. 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.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Identifier of the project to scope the request to. Required integer project ID.
Example
<PROJECT_ID>API key used to authenticate the create request
Example
<API_KEY>Region in which the load balancer will be provisioned.
Example
<LOCATION>Request Body
Section titled “Request Body”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 SKU backing the load balancer appliance. Use the name of a plan returned by LB Plans (for example E2E-LB-2).
Example
E2E-LB-2Display name of the load balancer.
Example
LB-ALB-26321-6218Network 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.)
Example
externalFrontend 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.
Example
BOTHPrimary listening port, sent as a string. The console sets 80 when lb_mode is HTTP and 443 otherwise.
Example
443Backend node-list mode. Always D (dynamic) for load balancers created from the console.
Example
DHAProxy connection timeout, in seconds.
Example
60HAProxy client-side inactivity timeout, in seconds.
Example
60HAProxy server-side inactivity timeout, in seconds.
Example
60HAProxy HTTP keep-alive timeout, in seconds.
Example
60TLS configuration. Required when lb_mode is HTTPS or BOTH (an SSL certificate must be selected); not used for plain HTTP.
object
ID of an uploaded SSL certificate to terminate TLS with. Required when lb_mode is not HTTP; null otherwise.
Example
nullWhen true, plain HTTP requests are redirected to HTTPS.
Example
falseOne 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.
object
Backend group name (also referenced by ACL maps and default_backend).
Example
backend-group-1Load-balancing (routing policy) algorithm. source provides IP stickiness, roundrobin distributes evenly, leastconn sends to the least-busy server.
Example
sourceBackend protocol. Mirrors backend_ssl - http or https.
Example
httpWhether the ALB connects to backend servers over HTTPS.
Example
falseEnables HTTP health checks against check_url.
Example
truePath used for HTTP health checks.
Example
/Host header used for health checks. The console sends localhost.
Example
localhostWebSocket idle timeout in seconds, or null to disable.
Example
60VPC network ID for the backend; null for public backends.
Example
nullAuto Scaling Group ID when the backend type is an auto-scaling group. null for node-based backends.
Example
nullPort on the auto-scaling group’s nodes. null for node-based backends.
Example
nullBackend servers (nodes) for a node-based backend. Omitted/empty when the backend is an auto-scaling group.
object
Name of the backend server.
Example
C3-8GB-853Private/public IPv4 address of the backend server.
Example
10.2.3.4Port the backend server listens on.
Example
8080Name of the backend that receives traffic not matched by any ACL. May only be set when backends is non-empty.
Example
backend-group-1Layer-7 routing rule definitions. Always sent empty at create time; add rules afterwards via Update Load Balancer.
Mapping of ACL rules to backends. Always sent empty at create time.
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.
object
Backend group name.
Example
backend-group-1Port the NLB listens on and forwards to the backend servers (also copied to top-level lb_port).
Example
12345Load-balancing (routing policy) algorithm.
Example
leastconnTCP connect timeout in seconds (as a string).
Example
5TCP client-side timeout in seconds (as a string).
Example
10TCP server-side timeout in seconds (as a string).
Example
10Backend servers (nodes) for the TCP backend.
object
Example
C3-8GB-853Example
10.8.54.7Example
32VPC(s) the load balancer attaches to. Required when lb_type is internal; optional otherwise.
object
VPC network ID.
Example
60806VPC name.
Example
VPC-261IPv4 CIDR block of the VPC.
Example
10.8.46.0/23Subnet ID, when attaching to a specific subnet.
Example
nullA 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.
Example
Whether to attach a public IPv6 address at creation (external load balancers only).
Example
falseWhether to activate the BitNinja security add-on on the appliance.
Example
falseID of the security group to attach to the load balancer. The console always sends the selected security group.
Example
81526Enables disk encryption on the appliance. When true, encryption_passphrase is required.
Example
falsePassphrase for disk encryption. Only used when isEncryptionEnabled is true.
Example
ApiAuto@24Committed (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.
Example
nullCommitted-plan renewal status. null for standard hourly billing.
Example
nullResponses
Section titled “Responses”Successful response
object
object
ID of the newly created load balancer.
Same as appliance_id.
Public IP assigned to the load balancer.
Whether the account had sufficient credit for the request.
object
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"}