curl --request PATCH \
--url https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"admin_state_up": true,
"delay": 10,
"domain_name": "example.com",
"expected_codes": "200,301,302",
"http_method": "CONNECT",
"http_version": "1.1",
"max_retries": 2,
"max_retries_down": 2,
"timeout": 5,
"url_path": "/"
}
'import requests
url = "https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor"
payload = {
"admin_state_up": True,
"delay": 10,
"domain_name": "example.com",
"expected_codes": "200,301,302",
"http_method": "CONNECT",
"http_version": "1.1",
"max_retries": 2,
"max_retries_down": 2,
"timeout": 5,
"url_path": "/"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
admin_state_up: true,
delay: 10,
domain_name: 'example.com',
expected_codes: '200,301,302',
http_method: 'CONNECT',
http_version: '1.1',
max_retries: 2,
max_retries_down: 2,
timeout: 5,
url_path: '/'
})
};
fetch('https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor', 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.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor",
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([
'admin_state_up' => true,
'delay' => 10,
'domain_name' => 'example.com',
'expected_codes' => '200,301,302',
'http_method' => 'CONNECT',
'http_version' => '1.1',
'max_retries' => 2,
'max_retries_down' => 2,
'timeout' => 5,
'url_path' => '/'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <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.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor"
payload := strings.NewReader("{\n \"admin_state_up\": true,\n \"delay\": 10,\n \"domain_name\": \"example.com\",\n \"expected_codes\": \"200,301,302\",\n \"http_method\": \"CONNECT\",\n \"http_version\": \"1.1\",\n \"max_retries\": 2,\n \"max_retries_down\": 2,\n \"timeout\": 5,\n \"url_path\": \"/\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"admin_state_up\": true,\n \"delay\": 10,\n \"domain_name\": \"example.com\",\n \"expected_codes\": \"200,301,302\",\n \"http_method\": \"CONNECT\",\n \"http_version\": \"1.1\",\n \"max_retries\": 2,\n \"max_retries_down\": 2,\n \"timeout\": 5,\n \"url_path\": \"/\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"admin_state_up\": true,\n \"delay\": 10,\n \"domain_name\": \"example.com\",\n \"expected_codes\": \"200,301,302\",\n \"http_method\": \"CONNECT\",\n \"http_version\": \"1.1\",\n \"max_retries\": 2,\n \"max_retries_down\": 2,\n \"timeout\": 5,\n \"url_path\": \"/\"\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}Update load balancer pool health monitor
Updates the health monitor of a load balancer pool, such as its check intervals, timeouts, and the thresholds used to mark pool members as healthy or unhealthy. Only the supplied fields are changed. Returns 404 if the pool has no health monitor attached. If a provided field already matches the current health monitor state it is skipped, and when no field changes anything no task is created and an empty task list is returned.
curl --request PATCH \
--url https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"admin_state_up": true,
"delay": 10,
"domain_name": "example.com",
"expected_codes": "200,301,302",
"http_method": "CONNECT",
"http_version": "1.1",
"max_retries": 2,
"max_retries_down": 2,
"timeout": 5,
"url_path": "/"
}
'import requests
url = "https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor"
payload = {
"admin_state_up": True,
"delay": 10,
"domain_name": "example.com",
"expected_codes": "200,301,302",
"http_method": "CONNECT",
"http_version": "1.1",
"max_retries": 2,
"max_retries_down": 2,
"timeout": 5,
"url_path": "/"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
admin_state_up: true,
delay: 10,
domain_name: 'example.com',
expected_codes: '200,301,302',
http_method: 'CONNECT',
http_version: '1.1',
max_retries: 2,
max_retries_down: 2,
timeout: 5,
url_path: '/'
})
};
fetch('https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor', 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.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor",
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([
'admin_state_up' => true,
'delay' => 10,
'domain_name' => 'example.com',
'expected_codes' => '200,301,302',
'http_method' => 'CONNECT',
'http_version' => '1.1',
'max_retries' => 2,
'max_retries_down' => 2,
'timeout' => 5,
'url_path' => '/'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <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.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor"
payload := strings.NewReader("{\n \"admin_state_up\": true,\n \"delay\": 10,\n \"domain_name\": \"example.com\",\n \"expected_codes\": \"200,301,302\",\n \"http_method\": \"CONNECT\",\n \"http_version\": \"1.1\",\n \"max_retries\": 2,\n \"max_retries_down\": 2,\n \"timeout\": 5,\n \"url_path\": \"/\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<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.patch("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"admin_state_up\": true,\n \"delay\": 10,\n \"domain_name\": \"example.com\",\n \"expected_codes\": \"200,301,302\",\n \"http_method\": \"CONNECT\",\n \"http_version\": \"1.1\",\n \"max_retries\": 2,\n \"max_retries_down\": 2,\n \"timeout\": 5,\n \"url_path\": \"/\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/lbpools/{project_id}/{region_id}/{pool_id}/healthmonitor")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"admin_state_up\": true,\n \"delay\": 10,\n \"domain_name\": \"example.com\",\n \"expected_codes\": \"200,301,302\",\n \"http_method\": \"CONNECT\",\n \"http_version\": \"1.1\",\n \"max_retries\": 2,\n \"max_retries_down\": 2,\n \"timeout\": 5,\n \"url_path\": \"/\"\n}"
response = http.request(request)
puts response.read_body{
"tasks": [
"d478ae29-dedc-4869-82f0-96104425f565"
]
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Path Parameters
Project ID
1
Region ID
1
Pool ID
"00000000-0000-4000-8000-000000000000"
Body
Administrative state of the resource. Omit to leave unchanged; false disables the resource so it will not process traffic.
true
false
The time, in seconds, between sending probes to members. Omit to leave unchanged.
1 <= x <= 214748364710
Domain name for HTTP host header. Can only be used together with HTTP or HTTPS health monitor type. Omit to leave unchanged. Set to null to clear the current value.
^[A-Za-z0-9._-]{1,253}$"example.com"
Expected HTTP response codes. Can be a single code, a comma-separated list of codes, or a single range of codes. Can only be used together with HTTP or HTTPS health monitor type. For example, 200, 200,202,401,403,404, or 200-204. Omit to leave unchanged. Set to null to clear the current value.
^(\d{3}(\s*,\s*\d{3})*)$|^(\d{3}-\d{3})$"200,301,302"
HTTP method. Can only be used together with HTTP or HTTPS health monitor type. Omit to leave unchanged. Set to null to clear the current value.
CONNECT, DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT, TRACE "CONNECT"
HTTP version. Can only be used together with HTTP or HTTPS health monitor type. Supported values: 1.0, 1.1. Omit to leave unchanged. Set to null to clear the current value.
1.0, 1.1 "1.1"
Number of successes before the member is switched to ONLINE state. Omit to leave unchanged.
1 <= x <= 102
Number of failures before the member is switched to ERROR state. Omit to leave unchanged.
1 <= x <= 102
The maximum time to connect. Must be less than the delay value. Omit to leave unchanged.
0 <= x <= 21474835
The HTTP path the health monitor requests on each member. Can only be used with HTTP or HTTPS health monitor type.
Must start with / and contain only plain path segments. Query strings (?), fragments (#), percent-encoding (%), and consecutive slashes (//) are not allowed.
Examples of valid paths:
/— check the root (most common)/healthz— a dedicated health endpoint
Omit to leave unchanged. Set to null to clear the current value.
^/([^/?#%]+(/[^/?#%]+)*/?)?$"/"
Response
OK
List of task IDs representing asynchronous operations. Use these IDs to monitor operation progress:
GET /v1/tasks/{task_id}- Check individual task status and details Poll task status until completion (FINISHED/ERROR) before proceeding with dependent operations.
["d478ae29-dedc-4869-82f0-96104425f565"]
Was this page helpful?