Get Runbook
curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/runbooks/{name} \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/runbooks/{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}/runbooks/{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}/runbooks/{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}/runbooks/{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}/runbooks/{name}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/runbooks/{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": "Runbook",
"spec": {
"name": "oomkill-standard",
"namespace": "production",
"description": "Standard remediation for OOMKill: raise the memory limit and restart the Deployment",
"trigger": {
"signalType": "oom_kill",
"severity": "high",
"resourceKind": "Deployment"
},
"steps": [
{
"name": "raise-memory-limit",
"action": "AdjustResources",
"description": "Raise the container memory limit",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "restart",
"action": "RestartDeployment",
"description": "Restart pods to reclaim memory"
}
],
"maxAttempts": 3,
"creationTimestamp": "2026-01-10T08:00:00Z"
},
"resourceMeta": {
"name": "oomkill-standard",
"namespace": "production",
"uid": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
"creationTimestamp": "2026-01-10T08:00:00Z"
}
}
Runbooks
Obter Runbook
Retorna um recurso Runbook
GET
/
runbooks
/
{name}
Get Runbook
curl --request GET \
--url {scheme}://{host}:{port}/{basePath}/runbooks/{name} \
--header 'X-API-Key: <api-key>'import requests
url = "{scheme}://{host}:{port}/{basePath}/runbooks/{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}/runbooks/{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}/runbooks/{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}/runbooks/{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}/runbooks/{name}")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("{scheme}://{host}:{port}/{basePath}/runbooks/{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": "Runbook",
"spec": {
"name": "oomkill-standard",
"namespace": "production",
"description": "Standard remediation for OOMKill: raise the memory limit and restart the Deployment",
"trigger": {
"signalType": "oom_kill",
"severity": "high",
"resourceKind": "Deployment"
},
"steps": [
{
"name": "raise-memory-limit",
"action": "AdjustResources",
"description": "Raise the container memory limit",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "restart",
"action": "RestartDeployment",
"description": "Restart pods to reclaim memory"
}
],
"maxAttempts": 3,
"creationTimestamp": "2026-01-10T08:00:00Z"
},
"resourceMeta": {
"name": "oomkill-standard",
"namespace": "production",
"uid": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
"creationTimestamp": "2026-01-10T08:00:00Z"
}
}
string
obrigatório
Nome do runbook (ex.:
oomkill-standard)string
padrão:"default"
Namespace do runbook. O padrão é
default (outros namespaces não são pesquisados).spec traz o runbook no mesmo formato de Listar Runbooks; resourceMeta traz os metadados do Kubernetes (uid, labels, annotations). Não há status.
{
"apiVersion": "v1",
"kind": "Runbook",
"spec": {
"name": "oomkill-standard",
"namespace": "production",
"description": "Standard remediation for OOMKill: raise the memory limit and restart the Deployment",
"trigger": {
"signalType": "oom_kill",
"severity": "high",
"resourceKind": "Deployment"
},
"steps": [
{
"name": "raise-memory-limit",
"action": "AdjustResources",
"description": "Raise the container memory limit",
"params": {
"memory_limit": "1Gi"
}
},
{
"name": "restart",
"action": "RestartDeployment",
"description": "Restart pods to reclaim memory"
}
],
"maxAttempts": 3,
"creationTimestamp": "2026-01-10T08:00:00Z"
},
"resourceMeta": {
"name": "oomkill-standard",
"namespace": "production",
"uid": "3c4d5e6f-7a8b-4c9d-8e0f-1a2b3c4d5e6f",
"creationTimestamp": "2026-01-10T08:00:00Z"
}
}
{
"apiVersion": "v1",
"kind": "Error",
"error": "Not Found",
"code": 404,
"message": "runbook not found: runbooks.platform.chatcli.io \"oomkill-standard\" 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, description}; no chart creates it. Roles: viewer < operator < admin — any other role string is denied everywhere. Changes are picked up within about 30 seconds. 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
Runbook name.
Exemplo:
"oom-standard"
Parâmetros de consulta
Namespace of the object. Defaults to default — pass it for objects in any other namespace.