Skip to main content
PUT
/
api
/
v1
/
runbooks
/
{name}
Update Runbook
curl --request PUT \
  --url https://api.example.com/api/v1/runbooks/{name} \
  --header 'Content-Type: application/json' \
  --data '
{
  "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-oomkill-standard",
    "updatedAt": "2026-03-19T16:30:00Z",
    "updatedBy": "admin@empresa.com",
    "version": "1.4.0"
  },
  "spec": {
    "category": "oomkill",
    "description": "Remediacao padrao para eventos OOMKill — ajusta memory limits com analise de historico",
    "severity": ["high", "critical"],
    "automated": true,
    "approvalRequired": true,
    "rollbackOnFailure": true,
    "steps": [
      {
        "name": "diagnose-memory-usage",
        "description": "Coletar metricas de uso de memoria do container",
        "action": "kubectl",
        "command": "top pod $POD --containers",
        "timeout": "30s"
      },
      {
        "name": "analyze-memory-history",
        "description": "Analisar historico de consumo de memoria 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 apos patch",
        "action": "wait",
        "timeout": "180s"
      }
    ]
  }
}
name
string
required
Unique runbook name (e.g., runbook-oomkill-standard)
description
string
New runbook description
severity
string[]
Updated list of target severities
automated
boolean
Whether the runbook can be executed automatically
approvalRequired
boolean
Whether approval is required before execution
rollbackOnFailure
boolean
Whether to perform automatic rollback on failure
steps
object[]
Updated list of runbook steps
matchConditions
object
Updated conditions for automatic matching
{
  "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": "Remediacao padrao para eventos OOMKill — ajusta memory limits com analise de historico",
    "severity": ["high", "critical"],
    "automated": true,
    "approvalRequired": true,
    "rollbackOnFailure": true,
    "steps": [
      {
        "name": "diagnose-memory-usage",
        "description": "Coletar metricas de uso de memoria do container",
        "action": "kubectl",
        "command": "top pod $POD --containers",
        "timeout": "30s"
      },
      {
        "name": "analyze-memory-history",
        "description": "Analisar historico de consumo de memoria 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 apos patch",
        "action": "wait",
        "timeout": "180s"
      }
    ]
  }
}