ByCloud Docs
GuidesCLIAPISDK

JavaScript SDK

Load Balancers

Load balancers, listeners, pools, and health monitors

25 methods

GET

listHealthMonitors()

List health monitors

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

tags

string

- Filter by tags (comma-separated)

pool_id

string

- Filter by pool ID

type

string

- Filter by health monitor type

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.listHealthMonitors();
console.log(result);
POST

createHealthMonitor()

Create health monitor

Parameters

name

string

pool_id

string

required
type

string

required
delay

integer

required
timeout

integer

required
max_retries

integer

required
max_retries_down

integer

http_method

string

url_path

string

expected_codes

string

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.createHealthMonitor({
pool_id: "550e8400-e29b-41d4-a716-446655440000",
type: "HTTP",
delay: 10,
timeout: 10,
max_retries: 10
});
console.log(result);
GET

getHealthMonitor()

Get health monitor

Parameters

health_monitor_id

string

required

- Health Monitor ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.getHealthMonitor({
health_monitor_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
PATCH

updateHealthMonitor()

Update health monitor

Parameters

health_monitor_id

string

required

- Health Monitor ID

name

string

delay

integer

timeout

integer

max_retries

integer

max_retries_down

integer

http_method

string

url_path

string

expected_codes

string

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.updateHealthMonitor({
health_monitor_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
DELETE

deleteHealthMonitor()

Delete health monitor

Parameters

health_monitor_id

string

required

- Health Monitor ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.deleteHealthMonitor({
health_monitor_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
GET

listListeners()

List listeners

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

tags

string

- Filter by tags (comma-separated)

load_balancer_id

string

- Filter by load balancer ID

protocol

string

- Filter by protocol

protocol_port

integer

- Filter by protocol port

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.listListeners();
console.log(result);
POST

createListener()

Create listener

Parameters

name

string

description

string

load_balancer_id

string

required
protocol

string

required
protocol_port

integer

required
connection_limit

integer

default_pool_id

string

default_tls_container_ref

string

sni_container_refs

array

insert_headers

object

timeout_client_data

integer

timeout_member_connect

integer

timeout_member_data

integer

timeout_tcp_inspect

integer

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.createListener({
load_balancer_id: "550e8400-e29b-41d4-a716-446655440000",
protocol: "HTTP",
protocol_port: 10
});
console.log(result);
GET

getListener()

Get listener

Parameters

listener_id

string

required

- Listener ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.getListener({
listener_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
PATCH

updateListener()

Update listener

Parameters

listener_id

string

required

- Listener ID

name

string

description

string

connection_limit

integer

default_pool_id

string

default_tls_container_ref

string

sni_container_refs

array

insert_headers

object

timeout_client_data

integer

timeout_member_connect

integer

timeout_member_data

integer

timeout_tcp_inspect

integer

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.updateListener({
listener_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
DELETE

deleteListener()

Delete listener

Parameters

listener_id

string

required

- Listener ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.deleteListener({
listener_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
GET

listLoadBalancers()

List load balancers

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

tags

string

- Filter by tags (comma-separated)

vip_subnet_id

string

- Filter by VIP subnet ID

vip_address

string

- Filter by VIP address

provisioning_status

string

- Filter by provisioning status

operating_status

string

- Filter by operating status

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.listLoadBalancers();
console.log(result);
POST

createLoadBalancer()

Create load balancer

Parameters

name

string

required
description

string

vip_address

string

- VIP address (auto-assigned if omitted)

vip_subnet_id

string

required
vip_network_id

string

provider

string

flavor_id

string

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.createLoadBalancer({
name: "web-lb",
vip_subnet_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
GET

getLoadBalancer()

Get load balancer

Parameters

load_balancer_id

string

required

- Load Balancer ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.getLoadBalancer({
load_balancer_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
PATCH

updateLoadBalancer()

Update load balancer

Parameters

load_balancer_id

string

required

- Load Balancer ID

name

string

description

string

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.updateLoadBalancer({
load_balancer_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
DELETE

deleteLoadBalancer()

Delete load balancer

Parameters

load_balancer_id

string

required

- Load Balancer ID

cascade

boolean

- Delete all child resources (listeners, pools, etc.)

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.deleteLoadBalancer({
load_balancer_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
GET

listPools()

List pools

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

tags

string

- Filter by tags (comma-separated)

load_balancer_id

string

- Filter by load balancer ID

protocol

string

- Filter by protocol

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.listPools();
console.log(result);
POST

createPool()

Create pool

Parameters

name

string

description

string

load_balancer_id

string

required
listener_id

string

- Listener to attach (optional)

protocol

string

required
lb_algorithm

string

required
session_persistence

object

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.createPool({
load_balancer_id: "550e8400-e29b-41d4-a716-446655440000",
protocol: "HTTP",
lb_algorithm: "ROUND_ROBIN"
});
console.log(result);
GET

getPool()

Get pool

Parameters

pool_id

string

required

- Pool ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.getPool({
pool_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
PATCH

updatePool()

Update pool

Parameters

pool_id

string

required

- Pool ID

name

string

description

string

lb_algorithm

string

session_persistence

object

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.updatePool({
pool_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
DELETE

deletePool()

Delete pool

Parameters

pool_id

string

required

- Pool ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.deletePool({
pool_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
GET

listPoolMembers()

List pool members

Parameters

pool_id

string

required

- Pool ID

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.listPoolMembers({
pool_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
POST

createPoolMember()

Create pool member

Parameters

pool_id

string

required

- Pool ID

name

string

address

string

required
protocol_port

integer

required
weight

integer

subnet_id

string

monitor_address

string

monitor_port

integer

backup

boolean

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.createPoolMember({
pool_id: "550e8400-e29b-41d4-a716-446655440000",
address: "example-string",
protocol_port: 10
});
console.log(result);
GET

getPoolMember()

Get pool member

Parameters

pool_id

string

required

- Pool ID

member_id

string

required

- Pool Member ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.getPoolMember({
pool_id: "550e8400-e29b-41d4-a716-446655440000",
member_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
PATCH

updatePoolMember()

Update pool member

Parameters

pool_id

string

required

- Pool ID

member_id

string

required

- Pool Member ID

name

string

weight

integer

monitor_address

string

monitor_port

integer

backup

boolean

tags

array

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.updatePoolMember({
pool_id: "550e8400-e29b-41d4-a716-446655440000",
member_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);
DELETE

deletePoolMember()

Delete pool member

Parameters

pool_id

string

required

- Pool ID

member_id

string

required

- Pool Member ID

Example

import { ByCloud } from "@bycoded/bycloud-sdk";
const client = new ByCloud({
token: "YOUR_ACCESS_TOKEN",
});
const result = await client.loadBalancers.deletePoolMember({
pool_id: "550e8400-e29b-41d4-a716-446655440000",
member_id: "550e8400-e29b-41d4-a716-446655440000"
});
console.log(result);