curl --request POST \
--url https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"algorithm": "<string>",
"dst_port": 123,
"health_check_protocol": "<string>",
"private_subnet_id": "<string>",
"src_port": 123,
"stack": "<string>",
"health_check_endpoint": "<string>",
"cert_enabled": true
}
'import requests
url = "https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}"
payload = {
"algorithm": "<string>",
"dst_port": 123,
"health_check_protocol": "<string>",
"private_subnet_id": "<string>",
"src_port": 123,
"stack": "<string>",
"health_check_endpoint": "<string>",
"cert_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
algorithm: '<string>',
dst_port: 123,
health_check_protocol: '<string>',
private_subnet_id: '<string>',
src_port: 123,
stack: '<string>',
health_check_endpoint: '<string>',
cert_enabled: true
})
};
fetch('https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'algorithm' => '<string>',
'dst_port' => 123,
'health_check_protocol' => '<string>',
'private_subnet_id' => '<string>',
'src_port' => 123,
'stack' => '<string>',
'health_check_endpoint' => '<string>',
'cert_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}"
payload := strings.NewReader("{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_protocol\": \"<string>\",\n \"private_subnet_id\": \"<string>\",\n \"src_port\": 123,\n \"stack\": \"<string>\",\n \"health_check_endpoint\": \"<string>\",\n \"cert_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_protocol\": \"<string>\",\n \"private_subnet_id\": \"<string>\",\n \"src_port\": 123,\n \"stack\": \"<string>\",\n \"health_check_endpoint\": \"<string>\",\n \"cert_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_protocol\": \"<string>\",\n \"private_subnet_id\": \"<string>\",\n \"src_port\": 123,\n \"stack\": \"<string>\",\n \"health_check_endpoint\": \"<string>\",\n \"cert_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"algorithm": "<string>",
"dst_port": 123,
"health_check_endpoint": "<string>",
"health_check_protocol": "<string>",
"hostname": "<string>",
"id": "1bhw8r4pn73t1m5f7rn7a5pej2",
"location": "<string>",
"name": "<string>",
"src_port": 123,
"subnet": "<string>",
"vms": [
{
"boot_image": "<string>",
"id": "vmhfy8gff8c67hasb0eez2k1pd",
"ip4": "127.0.0.1",
"ip4_enabled": true,
"ip6": "2606:4700:3108::ac42:2835",
"location": "eu-central-h1",
"name": "my-vm-name",
"size": "<string>",
"state": "<string>",
"storage_size_gib": 123,
"unix_user": "<string>"
}
],
"stack": "<string>",
"cert_enabled": true
}{
"error": {
"code": 401,
"message": "There was an error logging in",
"type": "InvalidCredentials",
"details": {}
}
}Create a new load balancer
curl --request POST \
--url https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"algorithm": "<string>",
"dst_port": 123,
"health_check_protocol": "<string>",
"private_subnet_id": "<string>",
"src_port": 123,
"stack": "<string>",
"health_check_endpoint": "<string>",
"cert_enabled": true
}
'import requests
url = "https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}"
payload = {
"algorithm": "<string>",
"dst_port": 123,
"health_check_protocol": "<string>",
"private_subnet_id": "<string>",
"src_port": 123,
"stack": "<string>",
"health_check_endpoint": "<string>",
"cert_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
algorithm: '<string>',
dst_port: 123,
health_check_protocol: '<string>',
private_subnet_id: '<string>',
src_port: 123,
stack: '<string>',
health_check_endpoint: '<string>',
cert_enabled: true
})
};
fetch('https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'algorithm' => '<string>',
'dst_port' => 123,
'health_check_protocol' => '<string>',
'private_subnet_id' => '<string>',
'src_port' => 123,
'stack' => '<string>',
'health_check_endpoint' => '<string>',
'cert_enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}"
payload := strings.NewReader("{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_protocol\": \"<string>\",\n \"private_subnet_id\": \"<string>\",\n \"src_port\": 123,\n \"stack\": \"<string>\",\n \"health_check_endpoint\": \"<string>\",\n \"cert_enabled\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_protocol\": \"<string>\",\n \"private_subnet_id\": \"<string>\",\n \"src_port\": 123,\n \"stack\": \"<string>\",\n \"health_check_endpoint\": \"<string>\",\n \"cert_enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ubicloud.com/project/{project_id}/location/{location}/load-balancer/{load_balancer_reference}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_protocol\": \"<string>\",\n \"private_subnet_id\": \"<string>\",\n \"src_port\": 123,\n \"stack\": \"<string>\",\n \"health_check_endpoint\": \"<string>\",\n \"cert_enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"algorithm": "<string>",
"dst_port": 123,
"health_check_endpoint": "<string>",
"health_check_protocol": "<string>",
"hostname": "<string>",
"id": "1bhw8r4pn73t1m5f7rn7a5pej2",
"location": "<string>",
"name": "<string>",
"src_port": 123,
"subnet": "<string>",
"vms": [
{
"boot_image": "<string>",
"id": "vmhfy8gff8c67hasb0eez2k1pd",
"ip4": "127.0.0.1",
"ip4_enabled": true,
"ip6": "2606:4700:3108::ac42:2835",
"location": "eu-central-h1",
"name": "my-vm-name",
"size": "<string>",
"state": "<string>",
"storage_size_gib": 123,
"unix_user": "<string>"
}
],
"stack": "<string>",
"cert_enabled": true
}{
"error": {
"code": 401,
"message": "There was an error logging in",
"type": "InvalidCredentials",
"details": {}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
ID of the project
^pj[0-9a-hj-km-np-tv-z]{24}$"pjkkmx0f2vke4h36nk9cm8v8q0"
The Ubicloud location/region
"eu-central-h1"
Load balancer ID or name Resource ID or name
^[a-z0-9](?:[a-z0-9\-]{0,61}[a-z0-9])?$Body
Algorithm of the Load Balancer
Destination port for the Load Balancer
Health check endpoint protocol
ID of Private Subnet
Source port for the Load Balancer
Networking stack of the Load Balancer (ipv4, ipv6, or dual)
Health check endpoint URL
Whether SSL certificates are enabled for the Load Balancer
Response
A Load Balancer
Algorithm of the Load Balancer
Destination port for the Load Balancer
Health check endpoint URL
Health check endpoint protocol
Hostname of the Load Balancer
ID of the Load Balancer
^1b[0-9a-hj-km-np-tv-z]{24}$"1bhw8r4pn73t1m5f7rn7a5pej2"
Location of the Load Balancer
Name of the Load Balancer
Source port for the Load Balancer
Subnet of the Load Balancer
Show child attributes
Show child attributes
Networking stack of the Load Balancer (ipv4, ipv6, or dual)
Whether SSL certificate is enabled