Skip to main content

Load balancers

Load Balancers

cmd style:

loadbalancer.create
loadbalancer.update
loadbalancer.delete
loadbalancer.get
loadbalancer.getall

REST style:

POST /loadbalancer/
PUT /loadbalancer/{id}
DELETE /loadbalancer/{id}
GET /loadbalancer/{id}
GET /loadbalancer/

{
  "id": __LBID__,
  "cmd": "loadbalancer.XXXXXXXX",
  "name": "Test GLB",
  "type": "GLB",
  "checkmode": "HTTP",
  "checkmethod": "GET",
  "checkurl": "/",
  "backend_hostname_force": "www.backendhostname.com",
  "aliases": [
    "glbtest1.frontendhostname.com",
    "glbtest2.frontendhostname.com"
  ],
  "backends": [
    {
      "hostname": "www.hostnameoriptoconnectto.com",
      "weight": 100,
      "port": 443,
      "tls": true
    }
  ]
}

 

Global Load Balancer GLB Relevant:

id:

Required for: update, delete, get
Integer: The ID of the load balancer instance, as returned by a create, update, get, getall operation

cmd:

Only required for cmd style, otherwise auto-determined via REST style

name:

String: Name, useful for customer to understand in GUI / billing

type:

String: GLB

hostname:

String: Hostname for customer to point their DNS to as a CNAME.  Effective immediately upon creation.

checkmode:

String: "TCP" ensures a TCP connection can be made to the backend else it is deemed offline.  "HTTP" performs HTTP healthcheck using checkmethod/checkurl/checkhost below.  "" means backend is always treated as online  (can cause delays if a backend is offline)

checkmethod:

String: GET or POST.  Defaults to GET

checkurl:

String: URI to use for healthchecks.  defaults to "/"

checkhost:

String: Host header to use for healthchecks.  defaults to HTTP/1.0 (No host header)

backend_hostname:  (Optional)

String: override Host header.  Defaults to off (http Host header pass-through)

aliases:  (Required)

Array of String:

String: hostname of frontend to use.  Domain base must exist in domain approvals.

backends:  (Required)

Array of backend:

hostname:
    String: hostname or IP address of the backend server to use
weight:
    Integer: Value 1-64 indicating the probability relative to all backend total weight that this backend will be used
port:
    Integer: TCP/UDP port number
tls:
    Boolean: true / false if TLS is meant to be used for the backend.  Defaults to SSL if port 443 is selected.
uuid:
    String: Optionally customer-supplied UUID that can be used for backend update commands
ttl:
    Integer: If a backend is not updated for ttl seconds, then it is automatically removed

 

TCP Load Balancer TCP Relevant:

id:

Required for: update, delete, get
Integer: The ID of the load balancer instance, as returned by a create, update, get, getall operation

cmd:

Only required for cmd style, otherwise auto-determined via REST style

name:

String: Name, useful for customer to understand in GUI / billing

type:

String: TCP

hostname:

String: Hostname for customer to point their DNS to as a CNAME.  Effective immediately upon creation.  Regional static global IPs are available for root domains (contact support).

checkmode:

String: "TCP" ensures a TCP connection can be made to the backend else it is deemed offline (Default).  "" assumes the backend is always online (can cause delays if a backend is offline)

backends:  (Required)

Array of backend:

hostname:
    String: hostname or IP address of the backend server to use
weight:
    Integer: Value 1-64 indicating the probability relative to all backend total weight that this backend will be used
port:
    Integer: TCP/UDP port number
tls:
    Boolean: true / false if TLS is meant to be used for the backend
uuid:
    String: Optionally customer-supplied UUID that can be used for backend update commands
ttl:
    Integer: If a backend is not updated for ttl seconds, then it is automatically removed


Backend Updating:

A lightweight API call can be used to update the backends using the UUID.  Using this, all other UUID's remain untouched, only if there is a matching UUID will that backend be updated.  If there is no matching UUID, then a new one is created.

Combine this function with backend TTLs to enable auto-registration / availability / removal of backends.

{
  "cmd": "loadbalancer.backend.update",
  "id": __LBID__,
  "backends": [
    {
      "hostname": "1.2.3.4",
      "port": 80,
      "weight": 100
      "tls": false,
      "ttl": 600,
      "uuid": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
    },
    {
      "hostname": "5.6.7.8",
      "port": 80,
      "weight": 100,
      "tls": "false"
      "ttl": 600,
      "uuid": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
    }
  ]
}