{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://varexis.tech/schemas/index-query-v1.json",
  "title": "VAREXIS INDEX qualify_workload Query v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "stream_type",
    "volume",
    "required_events",
    "hardware_class",
    "capability",
    "conditions",
    "evidence_requirements"
  ],
  "properties": {
    "stream_type": {
      "type": "string",
      "minLength": 1
    },
    "volume": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "value",
        "unit"
      ],
      "properties": {
        "value": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "unit": {
          "type": "string",
          "minLength": 1
        }
      }
    },
    "required_events": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "uniqueItems": true
    },
    "hardware_class": {
      "type": "string",
      "minLength": 1
    },
    "capability": {
      "type": "string",
      "minLength": 1
    },
    "conditions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "field",
          "operator",
          "value"
        ],
        "properties": {
          "field": {
            "type": "string",
            "minLength": 1
          },
          "operator": {
            "type": "string",
            "enum": [
              "eq",
              "neq",
              "in",
              "not_in",
              "gte",
              "lte",
              "contains"
            ]
          },
          "value": {
            "type": [
              "string",
              "number",
              "integer",
              "boolean",
              "array",
              "null"
            ]
          }
        }
      }
    },
    "evidence_requirements": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "sealed_run_required",
        "independent_replication_required",
        "max_age_days"
      ],
      "properties": {
        "sealed_run_required": {
          "type": "boolean"
        },
        "independent_replication_required": {
          "type": "boolean"
        },
        "max_age_days": {
          "type": "integer",
          "minimum": 0
        }
      }
    }
  }
}
