Update Runbook
curl --request PUT \
--url http://{host}:{port}/{basePath}/runbooks/{name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"severity": [
"<string>"
],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": true,
"steps": [
{
"name": "<string>",
"description": "<string>",
"command": "<string>",
"timeout": "60s",
"continueOnFailure": false
}
],
"matchConditions": {
"resourceTypes": [
"<string>"
],
"descriptionPatterns": [
"<string>"
],
"namespaces": [
"<string>"
]
}
}
'import requests
url = "http://{host}:{port}/{basePath}/runbooks/{name}"
payload = {
"description": "<string>",
"severity": ["<string>"],
"automated": True,
"approvalRequired": True,
"rollbackOnFailure": True,
"steps": [
{
"name": "<string>",
"description": "<string>",
"command": "<string>",
"timeout": "60s",
"continueOnFailure": False
}
],
"matchConditions": {
"resourceTypes": ["<string>"],
"descriptionPatterns": ["<string>"],
"namespaces": ["<string>"]
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
severity: ['<string>'],
automated: true,
approvalRequired: true,
rollbackOnFailure: true,
steps: [
{
name: '<string>',
description: '<string>',
command: '<string>',
timeout: '60s',
continueOnFailure: false
}
],
matchConditions: {
resourceTypes: ['<string>'],
descriptionPatterns: ['<string>'],
namespaces: ['<string>']
}
})
};
fetch('http://{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 => "http://{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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'severity' => [
'<string>'
],
'automated' => true,
'approvalRequired' => true,
'rollbackOnFailure' => true,
'steps' => [
[
'name' => '<string>',
'description' => '<string>',
'command' => '<string>',
'timeout' => '60s',
'continueOnFailure' => false
]
],
'matchConditions' => [
'resourceTypes' => [
'<string>'
],
'descriptionPatterns' => [
'<string>'
],
'namespaces' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://{host}:{port}/{basePath}/runbooks/{name}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"severity\": [\n \"<string>\"\n ],\n \"automated\": true,\n \"approvalRequired\": true,\n \"rollbackOnFailure\": true,\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"timeout\": \"60s\",\n \"continueOnFailure\": false\n }\n ],\n \"matchConditions\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"descriptionPatterns\": [\n \"<string>\"\n ],\n \"namespaces\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://{host}:{port}/{basePath}/runbooks/{name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"severity\": [\n \"<string>\"\n ],\n \"automated\": true,\n \"approvalRequired\": true,\n \"rollbackOnFailure\": true,\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"timeout\": \"60s\",\n \"continueOnFailure\": false\n }\n ],\n \"matchConditions\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"descriptionPatterns\": [\n \"<string>\"\n ],\n \"namespaces\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{basePath}/runbooks/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"severity\": [\n \"<string>\"\n ],\n \"automated\": true,\n \"approvalRequired\": true,\n \"rollbackOnFailure\": true,\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"timeout\": \"60s\",\n \"continueOnFailure\": false\n }\n ],\n \"matchConditions\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"descriptionPatterns\": [\n \"<string>\"\n ],\n \"namespaces\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "Runbook",
"metadata": {
"name": "runbook-oomkill-standard",
"updatedAt": "2026-03-19T16:30:00Z",
"updatedBy": "admin@empresa.com",
"version": "1.4.0"
},
"spec": {
"category": "oomkill",
"description": "Remediação padrão para eventos OOMKill — ajusta memory limits com análise de histórico",
"severity": ["high", "critical"],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": true,
"steps": [
{
"name": "diagnose-memory-usage",
"description": "Coletar métricas de uso de memória do container",
"action": "kubectl",
"command": "top pod $POD --containers",
"timeout": "30s"
},
{
"name": "analyze-memory-history",
"description": "Analisar histórico de consumo de memória via Prometheus",
"action": "ai-analyze",
"timeout": "60s"
},
{
"name": "patch-resource-limits",
"description": "Atualizar memory limit do Deployment",
"action": "kubectl",
"command": "patch deployment $DEPLOYMENT -p '{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"$CONTAINER\",\"resources\":{\"limits\":{\"memory\":\"$NEW_LIMIT\"}}}]}}}}'",
"timeout": "120s"
},
{
"name": "verify-stability",
"description": "Verificar estabilidade do pod após patch",
"action": "wait",
"timeout": "180s"
}
]
}
}
Runbooks
Atualizar Runbook
Atualiza um runbook de remediação existente
PUT
/
runbooks
/
{name}
Update Runbook
curl --request PUT \
--url http://{host}:{port}/{basePath}/runbooks/{name} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"severity": [
"<string>"
],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": true,
"steps": [
{
"name": "<string>",
"description": "<string>",
"command": "<string>",
"timeout": "60s",
"continueOnFailure": false
}
],
"matchConditions": {
"resourceTypes": [
"<string>"
],
"descriptionPatterns": [
"<string>"
],
"namespaces": [
"<string>"
]
}
}
'import requests
url = "http://{host}:{port}/{basePath}/runbooks/{name}"
payload = {
"description": "<string>",
"severity": ["<string>"],
"automated": True,
"approvalRequired": True,
"rollbackOnFailure": True,
"steps": [
{
"name": "<string>",
"description": "<string>",
"command": "<string>",
"timeout": "60s",
"continueOnFailure": False
}
],
"matchConditions": {
"resourceTypes": ["<string>"],
"descriptionPatterns": ["<string>"],
"namespaces": ["<string>"]
}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
severity: ['<string>'],
automated: true,
approvalRequired: true,
rollbackOnFailure: true,
steps: [
{
name: '<string>',
description: '<string>',
command: '<string>',
timeout: '60s',
continueOnFailure: false
}
],
matchConditions: {
resourceTypes: ['<string>'],
descriptionPatterns: ['<string>'],
namespaces: ['<string>']
}
})
};
fetch('http://{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 => "http://{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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'severity' => [
'<string>'
],
'automated' => true,
'approvalRequired' => true,
'rollbackOnFailure' => true,
'steps' => [
[
'name' => '<string>',
'description' => '<string>',
'command' => '<string>',
'timeout' => '60s',
'continueOnFailure' => false
]
],
'matchConditions' => [
'resourceTypes' => [
'<string>'
],
'descriptionPatterns' => [
'<string>'
],
'namespaces' => [
'<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://{host}:{port}/{basePath}/runbooks/{name}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"severity\": [\n \"<string>\"\n ],\n \"automated\": true,\n \"approvalRequired\": true,\n \"rollbackOnFailure\": true,\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"timeout\": \"60s\",\n \"continueOnFailure\": false\n }\n ],\n \"matchConditions\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"descriptionPatterns\": [\n \"<string>\"\n ],\n \"namespaces\": [\n \"<string>\"\n ]\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://{host}:{port}/{basePath}/runbooks/{name}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"severity\": [\n \"<string>\"\n ],\n \"automated\": true,\n \"approvalRequired\": true,\n \"rollbackOnFailure\": true,\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"timeout\": \"60s\",\n \"continueOnFailure\": false\n }\n ],\n \"matchConditions\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"descriptionPatterns\": [\n \"<string>\"\n ],\n \"namespaces\": [\n \"<string>\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://{host}:{port}/{basePath}/runbooks/{name}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"severity\": [\n \"<string>\"\n ],\n \"automated\": true,\n \"approvalRequired\": true,\n \"rollbackOnFailure\": true,\n \"steps\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"command\": \"<string>\",\n \"timeout\": \"60s\",\n \"continueOnFailure\": false\n }\n ],\n \"matchConditions\": {\n \"resourceTypes\": [\n \"<string>\"\n ],\n \"descriptionPatterns\": [\n \"<string>\"\n ],\n \"namespaces\": [\n \"<string>\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"apiVersion": "v1",
"kind": "Runbook",
"metadata": {
"name": "runbook-oomkill-standard",
"updatedAt": "2026-03-19T16:30:00Z",
"updatedBy": "admin@empresa.com",
"version": "1.4.0"
},
"spec": {
"category": "oomkill",
"description": "Remediação padrão para eventos OOMKill — ajusta memory limits com análise de histórico",
"severity": ["high", "critical"],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": true,
"steps": [
{
"name": "diagnose-memory-usage",
"description": "Coletar métricas de uso de memória do container",
"action": "kubectl",
"command": "top pod $POD --containers",
"timeout": "30s"
},
{
"name": "analyze-memory-history",
"description": "Analisar histórico de consumo de memória via Prometheus",
"action": "ai-analyze",
"timeout": "60s"
},
{
"name": "patch-resource-limits",
"description": "Atualizar memory limit do Deployment",
"action": "kubectl",
"command": "patch deployment $DEPLOYMENT -p '{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"$CONTAINER\",\"resources\":{\"limits\":{\"memory\":\"$NEW_LIMIT\"}}}]}}}}'",
"timeout": "120s"
},
{
"name": "verify-stability",
"description": "Verificar estabilidade do pod após patch",
"action": "wait",
"timeout": "180s"
}
]
}
}
string
obrigatório
Nome único do runbook (ex:
runbook-oomkill-standard)string
Nova descrição do runbook
string[]
Lista atualizada de severidades alvo
boolean
Se o runbook pode ser executado automaticamente
boolean
Se requer aprovação antes da execução
boolean
Se deve executar rollback automático em caso de falha
object[]
Lista atualizada de passos do runbook
Mostrar Propriedades do step
Mostrar Propriedades do step
object
{
"apiVersion": "v1",
"kind": "Runbook",
"metadata": {
"name": "runbook-oomkill-standard",
"updatedAt": "2026-03-19T16:30:00Z",
"updatedBy": "admin@empresa.com",
"version": "1.4.0"
},
"spec": {
"category": "oomkill",
"description": "Remediação padrão para eventos OOMKill — ajusta memory limits com análise de histórico",
"severity": ["high", "critical"],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": true,
"steps": [
{
"name": "diagnose-memory-usage",
"description": "Coletar métricas de uso de memória do container",
"action": "kubectl",
"command": "top pod $POD --containers",
"timeout": "30s"
},
{
"name": "analyze-memory-history",
"description": "Analisar histórico de consumo de memória via Prometheus",
"action": "ai-analyze",
"timeout": "60s"
},
{
"name": "patch-resource-limits",
"description": "Atualizar memory limit do Deployment",
"action": "kubectl",
"command": "patch deployment $DEPLOYMENT -p '{\"spec\":{\"template\":{\"spec\":{\"containers\":[{\"name\":\"$CONTAINER\",\"resources\":{\"limits\":{\"memory\":\"$NEW_LIMIT\"}}}]}}}}'",
"timeout": "120s"
},
{
"name": "verify-stability",
"description": "Verificar estabilidade do pod após patch",
"action": "wait",
"timeout": "180s"
}
]
}
}
Autorizações
Bearer token issued by the operator. Format: Authorization: Bearer <token>.
Parâmetros de caminho
Unique runbook name.
Exemplo:
"runbook-oomkill-standard"
Corpo
application/json
⌘I