Skip to main content
POST
/
api
/
v1
/
runbooks
Create Runbook
curl --request POST \
  --url https://api.example.com/api/v1/runbooks \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "category": "<string>",
  "description": "<string>",
  "severity": [
    "<string>"
  ],
  "automated": true,
  "approvalRequired": true,
  "rollbackOnFailure": true,
  "steps": [
    {
      "name": "<string>",
      "description": "<string>",
      "action": "<string>",
      "command": "<string>",
      "timeout": "<string>",
      "continueOnFailure": true
    }
  ],
  "matchConditions": {
    "resourceTypes": [
      "<string>"
    ],
    "descriptionPatterns": [
      "<string>"
    ],
    "namespaces": [
      "<string>"
    ]
  }
}
'
{
  "apiVersion": "v1",
  "kind": "Runbook",
  "metadata": {
    "name": "runbook-disk-cleanup",
    "createdAt": "2026-03-19T16:00:00Z",
    "createdBy": "admin@empresa.com"
  },
  "spec": {
    "category": "disk",
    "description": "Limpeza automatica 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 apos 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"]
    }
  }
}
name
string
required
Unique runbook name (slug, e.g., runbook-disk-cleanup)
category
string
required
Category: oomkill, crashloop, latency, scaling, disk, network, custom
description
string
required
Description of the runbook’s objective
severity
string[]
required
List of target severities: critical, high, medium, low
automated
boolean
default:"false"
Whether the runbook can be executed automatically
approvalRequired
boolean
default:"true"
Whether approval is required before execution
rollbackOnFailure
boolean
default:"true"
Whether to perform automatic rollback on failure
steps
object[]
required
List of runbook steps
matchConditions
object
Conditions for automatic matching with incidents
{
  "apiVersion": "v1",
  "kind": "Runbook",
  "metadata": {
    "name": "runbook-disk-cleanup",
    "createdAt": "2026-03-19T16:00:00Z",
    "createdBy": "admin@empresa.com"
  },
  "spec": {
    "category": "disk",
    "description": "Limpeza automatica 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 apos 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"]
    }
  }
}