{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudworldmodel-ai/json-schema/cloudworldmodel-ai-chaos-scenario-schema.json",
  "title": "ChaosScenario",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudworldmodel-ai-chaos-engineering-api-openapi.yml#/components/schemas/ChaosScenario",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique scenario identifier"
    },
    "name": {
      "type": "string",
      "description": "Human-readable scenario name"
    },
    "description": {
      "type": "string",
      "description": "What this scenario tests"
    },
    "injections": {
      "type": "array",
      "description": "Failure injections in this scenario",
      "items": {
        "$ref": "#/$defs/ChaosInjectionConfig"
      }
    },
    "expectedVulnerabilities": {
      "type": "array",
      "description": "Vulnerabilities this scenario typically detects",
      "items": {
        "type": "string"
      }
    }
  },
  "$defs": {
    "ChaosInjectionConfig": {
      "type": "object",
      "required": [
        "type",
        "targetId",
        "injectionTime"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "kill_instance",
            "network_delay",
            "database_slowdown",
            "database_overload",
            "cpu_spike",
            "memory_pressure",
            "zone_outage",
            "eks_spot_interruption"
          ],
          "description": "Type of failure to inject"
        },
        "targetId": {
          "type": "string",
          "description": "ID of the resource to target (or zone ID for zone_outage)"
        },
        "injectionTime": {
          "type": "integer",
          "description": "Simulation step when failure should be injected"
        },
        "duration": {
          "type": "integer",
          "description": "How long the failure lasts (in steps, optional)"
        },
        "severity": {
          "type": "number",
          "description": "Severity multiplier (0.0-1.0, optional)"
        }
      }
    }
  }
}