Update a load balancer
curl --request PATCH \
--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_endpoint": "<string>",
"src_port": 123,
"vms": [
"<string>"
],
"stack": "<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_endpoint": "<string>",
"src_port": 123,
"vms": ["<string>"],
"stack": "<string>",
"cert_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
algorithm: '<string>',
dst_port: 123,
health_check_endpoint: '<string>',
src_port: 123,
vms: ['<string>'],
stack: '<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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'algorithm' => '<string>',
'dst_port' => 123,
'health_check_endpoint' => '<string>',
'src_port' => 123,
'vms' => [
'<string>'
],
'stack' => '<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_endpoint\": \"<string>\",\n \"src_port\": 123,\n \"vms\": [\n \"<string>\"\n ],\n \"stack\": \"<string>\",\n \"cert_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("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_endpoint\": \"<string>\",\n \"src_port\": 123,\n \"vms\": [\n \"<string>\"\n ],\n \"stack\": \"<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::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_endpoint\": \"<string>\",\n \"src_port\": 123,\n \"vms\": [\n \"<string>\"\n ],\n \"stack\": \"<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",
"maintenance_window_start_at": 123,
"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": {}
}
}Load Balancer
Update a load balancer
PATCH
/
project
/
{project_id}
/
location
/
{location}
/
load-balancer
/
{load_balancer_reference}
Update a load balancer
curl --request PATCH \
--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_endpoint": "<string>",
"src_port": 123,
"vms": [
"<string>"
],
"stack": "<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_endpoint": "<string>",
"src_port": 123,
"vms": ["<string>"],
"stack": "<string>",
"cert_enabled": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
algorithm: '<string>',
dst_port: 123,
health_check_endpoint: '<string>',
src_port: 123,
vms: ['<string>'],
stack: '<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 => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'algorithm' => '<string>',
'dst_port' => 123,
'health_check_endpoint' => '<string>',
'src_port' => 123,
'vms' => [
'<string>'
],
'stack' => '<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_endpoint\": \"<string>\",\n \"src_port\": 123,\n \"vms\": [\n \"<string>\"\n ],\n \"stack\": \"<string>\",\n \"cert_enabled\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("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_endpoint\": \"<string>\",\n \"src_port\": 123,\n \"vms\": [\n \"<string>\"\n ],\n \"stack\": \"<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::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"algorithm\": \"<string>\",\n \"dst_port\": 123,\n \"health_check_endpoint\": \"<string>\",\n \"src_port\": 123,\n \"vms\": [\n \"<string>\"\n ],\n \"stack\": \"<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",
"maintenance_window_start_at": 123,
"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
Path Parameters
Body
application/json
Response
A Load Balancer