Load Balancers
Prerequisites
The {config} API parameter is discussed here.
Load balancer administration is discussed here. The discussion below assumes familiarity with it.
Special considerations when using the API
Multi-regional configuration
As explained here, when a Link11 load balancer supports a multi-regional planet, admins can (if desired) configure traffic routing.
The API provides additional granularity beyond the configuration available in the web console:
In the UI, the load balancer is treated as a single instance. However, this "one" load balancer is conceptual: it represents multiple physical instances, running simultaneously in different cities. The API provides the ability to configure each city separately, if desired.
In the UI, the Preferred datacenter control displays a list of datacenters where Link11 WAAP has been deployed. In the API, this list is provided in the
upstream_regionsparameter, which is returned when calling GET /api/v4.3/conf/{config}/load-balancers/regions.In the UI, one Preferred datacenter can be selected, which will be applied to all cities. In the API, different datacenters can be specified for different cities, by calling POST /api/v4.3/conf/{config}/load-balancers/regions.
API overview
To retrieve information about all load balancers
GET .../load-balancers
To add a certificate
PUT .../{entry_name}/certificates/{certificate_id}
To remove a certificate
DELETE .../{entry_name}/certificates
To get the list of Link11 WAAP datacenters, and each city's current preference
GET .../regions
To set preferred datacenters for each city
POST .../regions
Operations
Get all Load Balancers in a configuration
Load Balancers retrieved successfully
1Input Error
Internal Server Error
GET /api/v4.3/conf/{config}/load-balancers HTTP/1.1
Accept: */*
{
"total": 1,
"items": [
{
"certificates": [
"text"
],
"default_certificate": "text",
"dns_name": "text",
"listener_name": "text",
"listener_port": 1,
"load_balancer_type": "classic",
"max_certificates": 1,
"name": "text",
"provider": "aws",
"region": "text"
}
]
}Add a certificate to a Load Balancer
An enumeration.
falsetrueSuccessfully added certificate to Load Balancer
No content
Validation Error
Internal Server Error
PUT /api/v4.3/conf/{config}/load-balancers/{entry_name}/certificates/{certificate_id}?provider=aws®ion=text&listener=text&listener-port=1 HTTP/1.1
Accept: */*
No content
Detach a non-default certificate from the Load Balancer
trueSuccessfully detached certificate from Load Balancer
No content
Validation Error
Internal Server Error
DELETE /api/v4.3/conf/{config}/load-balancers/{entry_name}/certificates?provider=text®ion=text HTTP/1.1
Accept: */*
No content
Get regions with available datacenters for each Load Balancer.
Load Balancers retrieved successfully
{"ams":"Amsterdam","ash":"Ashburn","ffm":"Frankfurt","hkg":"Hong Kong","lax":"Los Angeles","lon":"London","sgp":"Singapore","stl":"Saint Louis"}Input Error
Internal Server Error
GET /api/v4.3/conf/{config}/load-balancers/regions HTTP/1.1
Accept: */*
{
"city_codes": "{\"ams\":\"Amsterdam\",\"ash\":\"Ashburn\",\"ffm\":\"Frankfurt\",\"hkg\":\"Hong Kong\",\"lax\":\"Los Angeles\",\"lon\":\"London\",\"sgp\":\"Singapore\",\"stl\":\"Saint Louis\"}\n",
"lbs": "[{\"id\":\"<id>\",\"name\":\"<name>\",\"regions\":{\"ams\":\"automatic\",\"ash\":\"automatic\",\"ffm\":\"automatic\",\"hkg\":\"automatic\",\"lax\":\"automatic\",\"lon\":\"automatic\",\"sgp\":\"automatic\",\"stl\":\"automatic\"},\"upstream_regions\":[\"ffm\",\"lax\"]}]\n"
}Set preferred datacenters for each Load Balancer. "automatic" will choose the best route depending on the load balancer location.
[{"id":"<id>","regions":{"ash":"ffm","ffm":"ffm","hkg":"ffm","lax":"ffm","lon":"ffm","sgp":"ffm","stl":"automatic"}}]Load Balancers retrieved successfully
Successfully set Load Balancer regionsInput Error
Internal Server Error
POST /api/v4.3/conf/{config}/load-balancers/regions HTTP/1.1
Content-Type: application/json
Accept: */*
Content-Length: 163
{
"lbs": "[{\"id\":\"<id>\",\"regions\":{\"ash\":\"ffm\",\"ffm\":\"ffm\",\"hkg\":\"ffm\",\"lax\":\"ffm\",\"lon\":\"ffm\",\"sgp\":\"ffm\",\"stl\":\"automatic\"}}]\n"
}{
"message": "Successfully set Load Balancer regions"
}Last updated
Was this helpful?