Create Runbook
curl --request POST \
--url http://{host}:{port}/{basePath}/runbooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "runbook-disk-cleanup",
"category": "disk",
"description": "Automatic disk cleanup when usage exceeds 85%.",
"severity": [
"medium",
"high"
],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": false,
"steps": [
{
"name": "check-disk-usage",
"description": "Check current disk usage",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
},
{
"name": "cleanup-temp-files",
"description": "Remove temp files older than 7 days",
"action": "script",
"command": "find /data/tmp -mtime +7 -delete",
"timeout": "120s"
}
],
"matchConditions": {
"resourceTypes": [
"StatefulSet",
"Deployment"
],
"descriptionPatterns": [
"disk.*usage.*high",
"filesystem.*full"
],
"namespaces": [
"production",
"staging"
]
}
}
'{
"apiVersion": "v1",
"kind": "Runbook",
"metadata": {
"name": "runbook-disk-cleanup",
"createdAt": "2026-03-19T16:00:00Z",
"createdBy": "admin@empresa.com"
},
"spec": {
"category": "disk",
"description": "Limpeza automática de disco quando uso excede 85%",
"severity": ["medium", "high"],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": false,
"steps": [
{
"name": "check-disk-usage",
"description": "Verificar uso atual do disco",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
},
{
"name": "cleanup-temp-files",
"description": "Remover arquivos temporarios com mais de 7 dias",
"action": "script",
"command": "find /data/tmp -mtime +7 -delete",
"timeout": "120s"
},
{
"name": "verify-disk-usage",
"description": "Verificar uso de disco após limpeza",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
}
],
"matchConditions": {
"resourceTypes": ["StatefulSet", "Deployment"],
"descriptionPatterns": ["disk.*usage.*high", "filesystem.*full"],
"namespaces": ["production", "staging"]
}
}
}
Runbooks
Criar Runbook
Cria um novo runbook de remediação
POST
/
runbooks
Create Runbook
curl --request POST \
--url http://{host}:{port}/{basePath}/runbooks \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "runbook-disk-cleanup",
"category": "disk",
"description": "Automatic disk cleanup when usage exceeds 85%.",
"severity": [
"medium",
"high"
],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": false,
"steps": [
{
"name": "check-disk-usage",
"description": "Check current disk usage",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
},
{
"name": "cleanup-temp-files",
"description": "Remove temp files older than 7 days",
"action": "script",
"command": "find /data/tmp -mtime +7 -delete",
"timeout": "120s"
}
],
"matchConditions": {
"resourceTypes": [
"StatefulSet",
"Deployment"
],
"descriptionPatterns": [
"disk.*usage.*high",
"filesystem.*full"
],
"namespaces": [
"production",
"staging"
]
}
}
'{
"apiVersion": "v1",
"kind": "Runbook",
"metadata": {
"name": "runbook-disk-cleanup",
"createdAt": "2026-03-19T16:00:00Z",
"createdBy": "admin@empresa.com"
},
"spec": {
"category": "disk",
"description": "Limpeza automática de disco quando uso excede 85%",
"severity": ["medium", "high"],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": false,
"steps": [
{
"name": "check-disk-usage",
"description": "Verificar uso atual do disco",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
},
{
"name": "cleanup-temp-files",
"description": "Remover arquivos temporarios com mais de 7 dias",
"action": "script",
"command": "find /data/tmp -mtime +7 -delete",
"timeout": "120s"
},
{
"name": "verify-disk-usage",
"description": "Verificar uso de disco após limpeza",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
}
],
"matchConditions": {
"resourceTypes": ["StatefulSet", "Deployment"],
"descriptionPatterns": ["disk.*usage.*high", "filesystem.*full"],
"namespaces": ["production", "staging"]
}
}
}
Nome único do runbook (slug, ex:
runbook-disk-cleanup)Categoria:
oomkill, crashloop, latency, scaling, disk, network, customDescrição do objetivo do runbook
Lista de severidades alvo:
critical, high, medium, lowSe o runbook pode ser executado automaticamente
Se requer aprovação antes da execução
Se deve executar rollback automático em caso de falha
Lista de passos do runbook
Mostrar Propriedades do step
Mostrar Propriedades do step
Identificador único do passo
Descrição do passo
Tipo de ação:
kubectl, script, ai-analyze, notification, waitComando a ser executado (para ações
kubectl e script)Timeout do passo no formato Go duration
Se deve continuar para o próximo passo mesmo em caso de falha
{
"apiVersion": "v1",
"kind": "Runbook",
"metadata": {
"name": "runbook-disk-cleanup",
"createdAt": "2026-03-19T16:00:00Z",
"createdBy": "admin@empresa.com"
},
"spec": {
"category": "disk",
"description": "Limpeza automática de disco quando uso excede 85%",
"severity": ["medium", "high"],
"automated": true,
"approvalRequired": true,
"rollbackOnFailure": false,
"steps": [
{
"name": "check-disk-usage",
"description": "Verificar uso atual do disco",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
},
{
"name": "cleanup-temp-files",
"description": "Remover arquivos temporarios com mais de 7 dias",
"action": "script",
"command": "find /data/tmp -mtime +7 -delete",
"timeout": "120s"
},
{
"name": "verify-disk-usage",
"description": "Verificar uso de disco após limpeza",
"action": "kubectl",
"command": "exec -it $POD -- df -h /data",
"timeout": "30s"
}
],
"matchConditions": {
"resourceTypes": ["StatefulSet", "Deployment"],
"descriptionPatterns": ["disk.*usage.*high", "filesystem.*full"],
"namespaces": ["production", "staging"]
}
}
}
Autorizações
Bearer token issued by the operator. Format: Authorization: Bearer <token>.
Corpo
application/json
Exemplo:
"runbook-disk-cleanup"
Opções disponíveis:
oomkill, crashloop, latency, scaling, disk, network, custom Opções disponíveis:
critical, high, medium, low Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I