curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/aiinsights/{name} \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/aiinsights/{name}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('{scheme}://{host}:{port}/{basePath}/aiinsights/{name}', 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 => "{scheme}://{host}:{port}/{basePath}/aiinsights/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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 := "{scheme}://{host}:{port}/{basePath}/aiinsights/{name}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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("{scheme}://{host}:{port}/{basePath}/aiinsights/{name}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/aiinsights/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "AIInsight",
"spec": {
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"issueRef": "payment-service-oom-kill-1773933600",
"provider": "CLAUDEAI",
"model": "claude-sonnet-4-6",
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations.",
"generatedAt": "2026-03-19T15:21:00Z",
"creationTimestamp": "2026-03-19T15:20:05Z"
},
"status": {
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"generatedAt": "2026-03-19T15:21:00Z",
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations."
},
"resourceMeta": {
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"uid": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"creationTimestamp": "2026-03-19T15:20:05Z"
}
}
Obter AI Insight
Retorna a análise completa da IA para um insight específico, incluindo todos os contextos de enriquecimento e ações sugeridas
curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/aiinsights/{name} \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/aiinsights/{name}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('{scheme}://{host}:{port}/{basePath}/aiinsights/{name}', 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 => "{scheme}://{host}:{port}/{basePath}/aiinsights/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <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 := "{scheme}://{host}:{port}/{basePath}/aiinsights/{name}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<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("{scheme}://{host}:{port}/{basePath}/aiinsights/{name}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/aiinsights/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "AIInsight",
"spec": {
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"issueRef": "payment-service-oom-kill-1773933600",
"provider": "CLAUDEAI",
"model": "claude-sonnet-4-6",
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations.",
"generatedAt": "2026-03-19T15:21:00Z",
"creationTimestamp": "2026-03-19T15:20:05Z"
},
"status": {
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"generatedAt": "2026-03-19T15:21:00Z",
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations."
},
"resourceMeta": {
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"uid": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"creationTimestamp": "2026-03-19T15:20:05Z"
}
}
<issue>-insight (ex.: payment-service-oom-kill-1773933600-insight)default (outros namespaces não são pesquisados), então informe o namespace do insight explicitamente.Campos da Resposta
spec traz o item completo do insight (os campos de Listar AI Insights, incluindo issueRef, provider e model); status é o status Kubernetes bruto do recurso, com os campos de análise abaixo.
| Campo | Descrição |
|---|---|
analysis | Texto de análise de causa raiz gerado pela IA |
confidence | Score de confiança de 0.0 a 1.0 |
recommendations | Sugestões legíveis por humanos |
suggestedActions | Ações concretas com tipo e parâmetros |
logAnalysis | Achados estruturados da análise de logs dos pods |
metricsContext | Dados de métricas Prometheus correlacionados com o incidente |
sourceCodeContext | Trechos relevantes do código-fonte do repositório da aplicação |
gitOpsContext | Status do Helm/ArgoCD/Flux no momento da análise |
cascadeAnalysis | Análise de falha em cascata entre serviços |
blastRadiusPrediction | Impacto previsto das ações de remediação sugeridas |
{
"apiVersion": "v1",
"kind": "AIInsight",
"spec": {
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"issueRef": "payment-service-oom-kill-1773933600",
"provider": "CLAUDEAI",
"model": "claude-sonnet-4-6",
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations.",
"generatedAt": "2026-03-19T15:21:00Z",
"creationTimestamp": "2026-03-19T15:20:05Z"
},
"status": {
"analysis": "The payment-service deployment is experiencing OOMKill events. Root cause: memory leak in the webhook handler that fails to close HTTP response bodies on validation errors, causing heap accumulation. The leak correlates with a recent deployment (revision 42) that introduced the payment notification webhook handler.",
"confidence": 0.91,
"recommendations": [
"Increase memory limit from 512Mi to 1Gi as immediate mitigation",
"Restart pods to reclaim leaked memory",
"Review webhook handler code for unclosed response bodies"
],
"suggestedActions": [
{
"name": "Increase memory limit",
"action": "AdjustResources",
"description": "Increase memory limit to prevent further OOMKills while the code fix is deployed",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "Restart deployment",
"action": "RestartDeployment",
"description": "Restart pods to reclaim leaked memory immediately"
}
],
"generatedAt": "2026-03-19T15:21:00Z",
"logAnalysis": "1 Go panic stack trace detected; 12 critical error patterns (OOMKilled, memory allocation failure); Primary exception: runtime: out of memory",
"gitOpsContext": "Helm release 'payment' chart=payment-service version=2.3.1 status=deployed revision=42",
"cascadeAnalysis": "Cascade chain: production/payment-service(root_cause) -> production/api-gateway(victim). The api-gateway is receiving 503 responses from payment-service.",
"blastRadiusPrediction": "AdjustResources: Low risk. Affects 3 pods, 1 service (payment-svc). No PDB violations."
},
"resourceMeta": {
"name": "payment-service-oom-kill-1773933600-insight",
"namespace": "production",
"uid": "9a8b7c6d-5e4f-4a3b-8c2d-1e0f9a8b7c6d",
"creationTimestamp": "2026-03-19T15:20:05Z"
}
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "AI insight not found: aiinsights.platform.chatcli.io \"payment-service-oom-kill-1773933600-insight\" not found"
}
Autorizações
API key sent in the X-API-Key header. Keys are read from the Secret chatcli-operator-secrets, key api-keys (fallback: ConfigMap chatcli-operator-config, key api-keys) in the operator namespace, as a YAML list of {key, role, name, description} (name is the identity recorded on approval decisions); the operator chart creates it only with apiKeys.create: true. Roles: viewer < operator < admin — any other role string is denied everywhere. Changes are picked up within about 30 seconds; deleting both the Secret and the ConfigMap revokes every key. With no keys configured every /api/ call returns 401, unless CHATCLI_OPERATOR_DEV_MODE=true, which grants admin without a key (development only).
Parâmetros de caminho
AIInsight name.
"payment-oom-insight"
Parâmetros de consulta
Namespace of the object. Defaults to default — pass it for objects in any other namespace.