API: Load Balancers

REST API endpoints for load balancer management.

API: Load Balancers

Endpoints

MethodPathDescription
POST/v1/loadbalancersCreate a load balancer
GET/v1/loadbalancersList all load balancers
GET/v1/loadbalancers/{id}Get details
DELETE/v1/loadbalancers/{id}Delete
## Create Load Balancer
POST /v1/loadbalancers

Request Body

{
  "metadata": {"name": "web-lb"},
  "spec": {
    "type": "http",
    "vpc_id": "vpc-abc123",
    "listeners": [
      {"listen_port": 80, "target_port": 8080, "protocol": "http"},
      {"listen_port": 443, "target_port": 8080, "protocol": "https"}
    ],
    "health_check": {
      "path": "/healthz",
      "interval_seconds": 10,
      "timeout_seconds": 5,
      "healthy_threshold": 3,
      "unhealthy_threshold": 3
    }
  }
}

Response (201)

{
  "id": "lb-a1b2c3",
  "metadata": {"name": "web-lb", "created_at": "2025-01-15T10:30:00Z"},
  "spec": {
    "type": "http",
    "vpc_id": "vpc-abc123",
    "listeners": [
      {"listen_port": 80, "target_port": 8080, "protocol": "http"},
      {"listen_port": 443, "target_port": 8080, "protocol": "https"}
    ],
    "health_check": {
      "path": "/healthz",
      "interval_seconds": 10,
      "timeout_seconds": 5,
      "healthy_threshold": 3,
      "unhealthy_threshold": 3
    }
  },
  "status": {
    "state": "provisioning",
    "public_ip": "",
    "active_targets": 0
  },
  "operation_id": "op-lb-001"
}

LoadBalancerSpec Fields

FieldTypeRequiredDescription
typestringYeshttp (Layer 7) or tcp (Layer 4)
vpc_idstringYesVPC for the load balancer
listenersarrayYesListener configurations
health_checkobjectNoHealth check settings
### Listener Object
FieldTypeDescription
listen_portintPort the LB listens on
target_portintPort on target instances
protocolstringhttp, https, or tcp
### HealthCheck Object
FieldTypeDescription
pathstringHTTP path for health checks
interval_secondsintTime between checks
timeout_secondsintCheck timeout
healthy_thresholdintConsecutive successes to mark healthy
unhealthy_thresholdintConsecutive failures to mark unhealthy