Capacity Forecast
curl --request GET \
--url http://{host}:{port}/{basePath}/analytics/capacity \
--header 'Authorization: <api-key>'import requests
url = "http://{host}:{port}/{basePath}/analytics/capacity"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('http://{host}:{port}/{basePath}/analytics/capacity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{host}:{port}/{basePath}/analytics/capacity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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 := "http://{host}:{port}/{basePath}/analytics/capacity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://{host}:{port}/{basePath}/analytics/capacity")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{basePath}/analytics/capacity")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "CapacityForecastList",
"metadata": {
"totalCount": 2,
"page": 1,
"pageSize": 2
},
"items": [
{
"Resource": {"Kind": "Deployment", "Name": "payment-service", "Namespace": "production"},
"Urgency": "urgent",
"Recommendation": "Memory exhaustion projected in 5 days. Scale up or optimize memory usage.",
"IsBottleneck": true
},
{
"Resource": {"Kind": "StatefulSet", "Name": "redis-cluster", "Namespace": "data"},
"Urgency": "plan",
"Recommendation": "CPU trend increasing. Plan capacity review within 30 days."
}
]
}
Analytics
Previsao de Capacidade
Retorna previsoes de capacidade de recursos com base em tendencias historicas — identifica recursos em risco de esgotamento
GET
/
analytics
/
capacity
Capacity Forecast
curl --request GET \
--url http://{host}:{port}/{basePath}/analytics/capacity \
--header 'Authorization: <api-key>'import requests
url = "http://{host}:{port}/{basePath}/analytics/capacity"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('http://{host}:{port}/{basePath}/analytics/capacity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "62437",
CURLOPT_URL => "http://{host}:{port}/{basePath}/analytics/capacity",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$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 := "http://{host}:{port}/{basePath}/analytics/capacity"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://{host}:{port}/{basePath}/analytics/capacity")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{basePath}/analytics/capacity")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "CapacityForecastList",
"metadata": {
"totalCount": 2,
"page": 1,
"pageSize": 2
},
"items": [
{
"Resource": {"Kind": "Deployment", "Name": "payment-service", "Namespace": "production"},
"Urgency": "urgent",
"Recommendation": "Memory exhaustion projected in 5 days. Scale up or optimize memory usage.",
"IsBottleneck": true
},
{
"Resource": {"Kind": "StatefulSet", "Name": "redis-cluster", "Namespace": "data"},
"Urgency": "plan",
"Recommendation": "CPU trend increasing. Plan capacity review within 30 days."
}
]
}
string
Filtrar por namespace do Kubernetes
string
Data inicial no formato RFC3339
string
Data final no formato RFC3339 (padrão: agora). A janela de análise padrão e de 7 dias.
Campos da Previsao
| Campo | Descrição |
|---|---|
Resource | O recurso Kubernetes (kind, name, namespace) |
Urgency | urgent (esgotamento em menos de 7 dias), plan (7-30 dias), stable (mais de 30 dias) |
Recommendation | Recomendacao gerada automaticamente com base na urgencia |
IsBottleneck | Se este recurso está correlacionado com incidentes ativos |
{
"apiVersion": "v1",
"kind": "CapacityForecastList",
"metadata": {
"totalCount": 2,
"page": 1,
"pageSize": 2
},
"items": [
{
"Resource": {"Kind": "Deployment", "Name": "payment-service", "Namespace": "production"},
"Urgency": "urgent",
"Recommendation": "Memory exhaustion projected in 5 days. Scale up or optimize memory usage.",
"IsBottleneck": true
},
{
"Resource": {"Kind": "StatefulSet", "Name": "redis-cluster", "Namespace": "data"},
"Urgency": "plan",
"Recommendation": "CPU trend increasing. Plan capacity review within 30 days."
}
]
}
Autorizações
Bearer token issued by the operator. Format: Authorization: Bearer <token>.
Parâmetros de consulta
Filter by namespace.
Start date (RFC3339).
End date (RFC3339).
⌘I