Logo
OpenScaler
API Documentation/Load Balancer Backends

Update a Backend

Update (replace) an existing backend configuration on the given load balancer.

PUT
/v1/lbs/{lb_id}/backends/{backend_name}

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

Unique name for this backend.

modeRequiredstring

Protocol mode.

Value in: "http" | "tcp"
balancing_methodRequiredstring

Load balancing algorithm.

Value in: "roundrobin" | "leastconn" | "first"
portRequiredinteger | string

Port that backend servers listen on.

serversRequiredobject | object
optionsobject

Optional backend-level settings.

Path Parameters

lb_idRequiredstring

A unique identifier for a load balancer instance.

backend_nameRequiredstring

The name of a backend on a load balancer.

curl -X PUT "https://api.alpha.openscaler.net/v1/lbs/42/backends/my-backend" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "api-backend",
    "mode": "http",
    "balancing_method": "roundrobin",
    "port": 8080,
    "servers": {
      "type": "computer",
      "computer_ids": [
        "23",
        "24"
      ]
    },
    "options": {
      "tls": false,
      "tls_verify": false,
      "forward_for": true,
      "proxy_protocol": "v2",
      "sticky_session": {
        "type": "cookie",
        "cookie": "SERVERID",
        "ttl": "5m"
      },
      "health_check": {
        "type": "http",
        "path": "/health",
        "method": "GET",
        "port": 80,
        "expected_code": "200",
        "host_header": "example.com"
      }
    }
  }'

Backend updated successfully.

{
  "name": "api-backend",
  "mode": "http",
  "balancing_method": "roundrobin",
  "port": 8080,
  "servers": {
    "type": "computer",
    "computer_ids": [
      "23",
      "24"
    ]
  },
  "options": {
    "tls": false,
    "tls_verify": false,
    "forward_for": true,
    "proxy_protocol": "v2",
    "sticky_session": {
      "type": "cookie",
      "cookie": "SERVERID",
      "ttl": "5m"
    },
    "health_check": {
      "type": "http",
      "path": "/health",
      "method": "GET",
      "port": 80,
      "expected_code": "200",
      "host_header": "example.com"
    }
  }
}