Logo
OpenScaler
API Documentation/Load Balancers

Create a Load Balancer

Create a new load balancer. The load balancer will be provisioned in the specified region and VPC. The creation is asynchronous — progress events are streamed back as Server-Sent Events (SSE).

POST
/v1/lbs

Authorization

AuthorizationRequiredBearer <token>

OAuth Authentication

OpenScaler API uses OAuth, a standard for secure authorization. To access the API, obtain a token via the OpenScaler Platform.

Use the access_token in the Authorization header for requests:

Authorization: Bearer <token>

Always keep your token secure and do not share it with anyone.

In: header

Request Body

application/jsonRequired
nameRequiredstring

Name for the load balancer.

descriptionstring

Optional description.

project_idRequiredstring

A globally unique identifier for a project (where resource is placed) - or "default" for your default project. Projects are used as workspaces to organize things and separate resources for different independent purposes.

regionRequiredstring

Region where the load balancer will be provisioned.

vpc_idRequiredinteger

ID of the VPC to attach the load balancer to.

sizeRequiredstring

Load balancer size/flavor (not VM size).

visibilityRequiredstring

Whether the load balancer is publicly accessible or private.

Value in: "public" | "private"
curl -X POST "https://api.alpha.openscaler.net/v1/lbs" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-lb",
    "description": "Production load balancer",
    "project_id": "default",
    "region": "eu-west-1",
    "vpc_id": 5,
    "size": "small",
    "visibility": "public"
  }'

Load balancer creation started. Progress is streamed as SSE events.

{
  "id": "42",
  "name": "my-lb",
  "description": "Production load balancer",
  "user_id": "usr_abc123",
  "project_id": "default",
  "size": "small",
  "region": "eu-west-1",
  "visibility": "public",
  "status": "ready",
  "state": "running",
  "network": {},
  "created_at": "2024-06-01T12:00:00Z",
  "updated_at": "2024-06-15T08:30:00Z"
}