curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/incidents \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/incidents"
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}/incidents', 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}/incidents",
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}/incidents"
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}/incidents")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/incidents")
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": "IncidentList",
"metadata": {
"totalCount": 42,
"page": 1,
"pageSize": 20
},
"items": [
{
"name": "payment-service-oom-kill-1773933600",
"namespace": "production",
"severity": "high",
"source": "watcher",
"signalType": "oom_kill",
"resource": {
"kind": "Deployment",
"name": "payment-service",
"namespace": "production"
},
"description": "Auto-detected oom_kill anomaly: container restarted after OOMKill (value=5, threshold=3)",
"riskScore": 65,
"state": "Analyzing",
"detectedAt": "2026-03-19T15:20:00Z",
"remediationAttempts": 0,
"maxRemediationAttempts": 5,
"creationTimestamp": "2026-03-19T15:20:00Z",
"labels": {
"platform.chatcli.io/inc-id": "INC-20260319-001",
"platform.chatcli.io/resource": "payment-service",
"platform.chatcli.io/signal": "oom_kill"
}
},
{
"name": "api-gateway-latency-1773929400",
"namespace": "staging",
"severity": "medium",
"source": "watcher",
"signalType": "latency",
"resource": {
"kind": "Deployment",
"name": "api-gateway",
"namespace": "staging"
},
"description": "Auto-detected latency anomaly: p99 latency above threshold (value=1.8s, threshold=1s)",
"riskScore": 30,
"state": "Resolved",
"detectedAt": "2026-03-19T14:10:00Z",
"resolvedAt": "2026-03-19T14:35:00Z",
"resolution": "Restarted deployment; latency back under threshold",
"remediationAttempts": 1,
"maxRemediationAttempts": 5,
"creationTimestamp": "2026-03-19T14:10:00Z",
"labels": {
"platform.chatcli.io/inc-id": "INC-20260319-002",
"platform.chatcli.io/resource": "api-gateway",
"platform.chatcli.io/signal": "latency"
}
}
]
}
Listar Incidentes
Retorna a lista de incidentes (recursos Issue) com filtros opcionais e paginação
curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/incidents \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/incidents"
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}/incidents', 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}/incidents",
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}/incidents"
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}/incidents")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/incidents")
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": "IncidentList",
"metadata": {
"totalCount": 42,
"page": 1,
"pageSize": 20
},
"items": [
{
"name": "payment-service-oom-kill-1773933600",
"namespace": "production",
"severity": "high",
"source": "watcher",
"signalType": "oom_kill",
"resource": {
"kind": "Deployment",
"name": "payment-service",
"namespace": "production"
},
"description": "Auto-detected oom_kill anomaly: container restarted after OOMKill (value=5, threshold=3)",
"riskScore": 65,
"state": "Analyzing",
"detectedAt": "2026-03-19T15:20:00Z",
"remediationAttempts": 0,
"maxRemediationAttempts": 5,
"creationTimestamp": "2026-03-19T15:20:00Z",
"labels": {
"platform.chatcli.io/inc-id": "INC-20260319-001",
"platform.chatcli.io/resource": "payment-service",
"platform.chatcli.io/signal": "oom_kill"
}
},
{
"name": "api-gateway-latency-1773929400",
"namespace": "staging",
"severity": "medium",
"source": "watcher",
"signalType": "latency",
"resource": {
"kind": "Deployment",
"name": "api-gateway",
"namespace": "staging"
},
"description": "Auto-detected latency anomaly: p99 latency above threshold (value=1.8s, threshold=1s)",
"riskScore": 30,
"state": "Resolved",
"detectedAt": "2026-03-19T14:10:00Z",
"resolvedAt": "2026-03-19T14:35:00Z",
"resolution": "Restarted deployment; latency back under threshold",
"remediationAttempts": 1,
"maxRemediationAttempts": 5,
"creationTimestamp": "2026-03-19T14:10:00Z",
"labels": {
"platform.chatcli.io/inc-id": "INC-20260319-002",
"platform.chatcli.io/resource": "api-gateway",
"platform.chatcli.io/signal": "latency"
}
}
]
}
Issue projetado no formato de incidente abaixo. Os filtros são de igualdade exata e combinados com AND.
requiresHumanAction é true quando o incidente está Contained (o operator silenciou o workload e uma pessoa precisa restaurá-lo), e requiredAction diz o que fazer. chaosInduced / chaosExperiment aparecem quando o incidente foi correlacionado a um ChaosExperiment ativo. Campos opcionais vazios são omitidos.{
"apiVersion": "v1",
"kind": "IncidentList",
"metadata": {
"totalCount": 42,
"page": 1,
"pageSize": 20
},
"items": [
{
"name": "payment-service-oom-kill-1773933600",
"namespace": "production",
"severity": "high",
"source": "watcher",
"signalType": "oom_kill",
"resource": {
"kind": "Deployment",
"name": "payment-service",
"namespace": "production"
},
"description": "Auto-detected oom_kill anomaly: container restarted after OOMKill (value=5, threshold=3)",
"riskScore": 65,
"state": "Analyzing",
"detectedAt": "2026-03-19T15:20:00Z",
"remediationAttempts": 0,
"maxRemediationAttempts": 5,
"creationTimestamp": "2026-03-19T15:20:00Z",
"labels": {
"platform.chatcli.io/inc-id": "INC-20260319-001",
"platform.chatcli.io/resource": "payment-service",
"platform.chatcli.io/signal": "oom_kill"
}
},
{
"name": "api-gateway-latency-1773929400",
"namespace": "staging",
"severity": "medium",
"source": "watcher",
"signalType": "latency",
"resource": {
"kind": "Deployment",
"name": "api-gateway",
"namespace": "staging"
},
"description": "Auto-detected latency anomaly: p99 latency above threshold (value=1.8s, threshold=1s)",
"riskScore": 30,
"state": "Resolved",
"detectedAt": "2026-03-19T14:10:00Z",
"resolvedAt": "2026-03-19T14:35:00Z",
"resolution": "Restarted deployment; latency back under threshold",
"remediationAttempts": 1,
"maxRemediationAttempts": 5,
"creationTimestamp": "2026-03-19T14:10:00Z",
"labels": {
"platform.chatcli.io/inc-id": "INC-20260319-002",
"platform.chatcli.io/resource": "api-gateway",
"platform.chatcli.io/signal": "latency"
}
}
]
}
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).