Add load balancer target
curl --request POST \
--url https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"target_uuid": "145cc106-e067-419a-85fd-333ded30f169",
"target_type": "vm"
}
'import requests
url = "https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets"
payload = {
"target_uuid": "145cc106-e067-419a-85fd-333ded30f169",
"target_type": "vm"
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_uuid: '145cc106-e067-419a-85fd-333ded30f169', target_type: 'vm'})
};
fetch('https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets"
payload := strings.NewReader("{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddJsonBody("{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets",
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([
'target_uuid' => '145cc106-e067-419a-85fd-333ded30f169',
'target_type' => 'vm'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"created_at": "2022-07-12 14:21:06",
"target_uuid": "145cc106-e067-419a-85fd-333ded30f169",
"target_type": "vm",
"target_ip_address": "10.61.10.2"
}Network Load Balancer
Add load balancer target
Add new target to load balancer. Location-specific endpoint.
POST
/
network
/
load_balancers
/
{load_balancer_uuid}
/
targets
Add load balancer target
curl --request POST \
--url https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data '
{
"target_uuid": "145cc106-e067-419a-85fd-333ded30f169",
"target_type": "vm"
}
'import requests
url = "https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets"
payload = {
"target_uuid": "145cc106-e067-419a-85fd-333ded30f169",
"target_type": "vm"
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({target_uuid: '145cc106-e067-419a-85fd-333ded30f169', target_type: 'vm'})
};
fetch('https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets"
payload := strings.NewReader("{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
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))
}require 'uri'
require 'net/http'
url = URI("https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}"
response = http.request(request)
puts response.read_bodyHttpResponse<String> response = Unirest.post("https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}")
.asString();using RestSharp;
var options = new RestClientOptions("https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("apikey", "<api-key>");
request.AddJsonBody("{\n \"target_uuid\": \"145cc106-e067-419a-85fd-333ded30f169\",\n \"target_type\": \"vm\"\n}", false);
var response = await client.PostAsync(request);
Console.WriteLine("{0}", response.Content);<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tenbytecloud.com/v1/network/load_balancers/{load_balancer_uuid}/targets",
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([
'target_uuid' => '145cc106-e067-419a-85fd-333ded30f169',
'target_type' => 'vm'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"created_at": "2022-07-12 14:21:06",
"target_uuid": "145cc106-e067-419a-85fd-333ded30f169",
"target_type": "vm",
"target_ip_address": "10.61.10.2"
}⌘I