Readiness
curl --request GET \
--url https://your-yahont-domain.com/api/health/readyimport requests
url = "https://your-yahont-domain.com/api/health/ready"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://your-yahont-domain.com/api/health/ready', 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://your-yahont-domain.com/api/health/ready",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-yahont-domain.com/api/health/ready"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://your-yahont-domain.com/api/health/ready")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-yahont-domain.com/api/health/ready")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyРазное
Проверка готовности
Readiness probe. Wire this to readinessProbe and to load balancers.
Sync endpoints run in the anyio threadpool, so a saturated pool means the server cannot serve real traffic even though the event loop still turns. This handler stays async on purpose: a sync handler would borrow a token of the pool it is measuring, adding load exactly when there is none to spare, and would queue rather than answer. Liveness lives at /health.
Readiness
curl --request GET \
--url https://your-yahont-domain.com/api/health/readyimport requests
url = "https://your-yahont-domain.com/api/health/ready"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://your-yahont-domain.com/api/health/ready', 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://your-yahont-domain.com/api/health/ready",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-yahont-domain.com/api/health/ready"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://your-yahont-domain.com/api/health/ready")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-yahont-domain.com/api/health/ready")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyАутентификация не требуется.
Проба готовности (readiness). Она не проходит, когда сервер API не может связаться со своими зависимостями.
Так балансировщик нагрузки перестаёт направлять трафик на эту реплику. Для проверки работоспособности (liveness)
используйте Проверку состояния.
Response
200 - application/json
Successful Response

