curl --request POST \
--url https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id} \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"Name": "<string>",
"Enabled": true,
"HealthCheckSettings": {
"Enabled": true,
"Path": "<string>"
},
"Latitude": 123,
"Longitude": 123,
"Weight": 123,
"Priority": 123
}
'import requests
url = "https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}"
payload = {
"Name": "<string>",
"Enabled": True,
"HealthCheckSettings": {
"Enabled": True,
"Path": "<string>"
},
"Latitude": 123,
"Longitude": 123,
"Weight": 123,
"Priority": 123
}
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Name: '<string>',
Enabled: true,
HealthCheckSettings: {Enabled: true, Path: '<string>'},
Latitude: 123,
Longitude: 123,
Weight: 123,
Priority: 123
})
};
fetch('https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}', 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.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}",
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([
'Name' => '<string>',
'Enabled' => true,
'HealthCheckSettings' => [
'Enabled' => true,
'Path' => '<string>'
],
'Latitude' => 123,
'Longitude' => 123,
'Weight' => 123,
'Priority' => 123
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"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.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"Enabled\": true,\n \"HealthCheckSettings\": {\n \"Enabled\": true,\n \"Path\": \"<string>\"\n },\n \"Latitude\": 123,\n \"Longitude\": 123,\n \"Weight\": 123,\n \"Priority\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<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))
}HttpResponse<String> response = Unirest.post("https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Name\": \"<string>\",\n \"Enabled\": true,\n \"HealthCheckSettings\": {\n \"Enabled\": true,\n \"Path\": \"<string>\"\n },\n \"Latitude\": 123,\n \"Longitude\": 123,\n \"Weight\": 123,\n \"Priority\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Name\": \"<string>\",\n \"Enabled\": true,\n \"HealthCheckSettings\": {\n \"Enabled\": true,\n \"Path\": \"<string>\"\n },\n \"Latitude\": 123,\n \"Longitude\": 123,\n \"Weight\": 123,\n \"Priority\": 123\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Name": "<string>",
"Enabled": true,
"Latitude": 123,
"Longitude": 123,
"Weight": 123,
"Priority": 123,
"OriginLoadBalancingMethod": 0,
"Origins": [
{
"Id": 123,
"Name": "<string>",
"Weight": 123,
"Enabled": true,
"HealthStatus": 0,
"OriginType": 0,
"EdgeScriptId": 123,
"StorageZoneId": 123,
"StandardOrigin": {
"OriginUrl": "<string>",
"HostHeader": "<string>",
"VerifySsl": true
},
"MagicContainersOrigin": {
"AppId": "<string>",
"EndPointId": "<string>"
}
}
],
"HealthCheckSettings": {
"Enabled": true,
"Path": "<string>"
}
}{
"ErrorKey": "<string>",
"Field": "<string>",
"Message": "<string>"
}{
"ErrorKey": "<string>",
"Field": "<string>",
"Message": "<string>"
}Update an origin group in a Load Balancer profile
curl --request POST \
--url https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id} \
--header 'AccessKey: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"Name": "<string>",
"Enabled": true,
"HealthCheckSettings": {
"Enabled": true,
"Path": "<string>"
},
"Latitude": 123,
"Longitude": 123,
"Weight": 123,
"Priority": 123
}
'import requests
url = "https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}"
payload = {
"Name": "<string>",
"Enabled": True,
"HealthCheckSettings": {
"Enabled": True,
"Path": "<string>"
},
"Latitude": 123,
"Longitude": 123,
"Weight": 123,
"Priority": 123
}
headers = {
"AccessKey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {AccessKey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Name: '<string>',
Enabled: true,
HealthCheckSettings: {Enabled: true, Path: '<string>'},
Latitude: 123,
Longitude: 123,
Weight: 123,
Priority: 123
})
};
fetch('https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}', 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.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}",
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([
'Name' => '<string>',
'Enabled' => true,
'HealthCheckSettings' => [
'Enabled' => true,
'Path' => '<string>'
],
'Latitude' => 123,
'Longitude' => 123,
'Weight' => 123,
'Priority' => 123
]),
CURLOPT_HTTPHEADER => [
"AccessKey: <api-key>",
"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.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}"
payload := strings.NewReader("{\n \"Name\": \"<string>\",\n \"Enabled\": true,\n \"HealthCheckSettings\": {\n \"Enabled\": true,\n \"Path\": \"<string>\"\n },\n \"Latitude\": 123,\n \"Longitude\": 123,\n \"Weight\": 123,\n \"Priority\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("AccessKey", "<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))
}HttpResponse<String> response = Unirest.post("https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}")
.header("AccessKey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Name\": \"<string>\",\n \"Enabled\": true,\n \"HealthCheckSettings\": {\n \"Enabled\": true,\n \"Path\": \"<string>\"\n },\n \"Latitude\": 123,\n \"Longitude\": 123,\n \"Weight\": 123,\n \"Priority\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bunny.net/loadbalancer/{loadBalancerId}/origingroup/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["AccessKey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Name\": \"<string>\",\n \"Enabled\": true,\n \"HealthCheckSettings\": {\n \"Enabled\": true,\n \"Path\": \"<string>\"\n },\n \"Latitude\": 123,\n \"Longitude\": 123,\n \"Weight\": 123,\n \"Priority\": 123\n}"
response = http.request(request)
puts response.read_body{
"Id": 123,
"Name": "<string>",
"Enabled": true,
"Latitude": 123,
"Longitude": 123,
"Weight": 123,
"Priority": 123,
"OriginLoadBalancingMethod": 0,
"Origins": [
{
"Id": 123,
"Name": "<string>",
"Weight": 123,
"Enabled": true,
"HealthStatus": 0,
"OriginType": 0,
"EdgeScriptId": 123,
"StorageZoneId": 123,
"StandardOrigin": {
"OriginUrl": "<string>",
"HostHeader": "<string>",
"VerifySsl": true
},
"MagicContainersOrigin": {
"AppId": "<string>",
"EndPointId": "<string>"
}
}
],
"HealthCheckSettings": {
"Enabled": true,
"Path": "<string>"
}
}{
"ErrorKey": "<string>",
"Field": "<string>",
"Message": "<string>"
}{
"ErrorKey": "<string>",
"Field": "<string>",
"Message": "<string>"
}Authorizations
API Access Key authorization header
Body
The model for updating the origin group
The name of the origin group
Set to true if the origin group is enabled
Health check settings for monitoring origins in the group
Show child attributes
Show child attributes
The load balancing method used for selecting origins within the group
0, 1, 2, 3 The latitude of the origin group location
The longitude of the origin group location
The weight of the origin group used for weighted load balancing
The priority of the origin group used for failover load balancing
Response
The updated origin group
The unique ID of the origin group
The name of the origin group
Set to true if the origin group is enabled
The latitude of the origin group location
The longitude of the origin group location
The weight of the origin group used for weighted load balancing
The priority of the origin group used for failover load balancing
The load balancing method used for selecting origins within the group
0, 1, 2, 3 The list of origins associated with the origin group
Show child attributes
Show child attributes
Health settings for the origin group
Show child attributes
Show child attributes
Was this page helpful?