{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "FermiHDI Ingester Configuration",
  "type": "object",
  "properties": {
    "ingression_type": {
      "type": "string",
      "enum": ["kafka", "rabbitmq", "mqtt", "file", "s3"],
      "default": "kafka"
    },
    "input_format": {
      "type": "string",
      "enum": ["json", "rowbinary", "csv"],
      "default": "json"
    },
    "schema_file": {
      "type": "string",
      "default": "dataset_schema.json"
    },
    "batch_interval_seconds": {
      "type": ["integer", "null"]
    },
    "batch_id_field": {
      "type": "string",
      "default": ""
    },
                "round_batch_id_field": {
                    "description": "If true, rounds the extracted batch ID to the time index interval.",
                    "type": "boolean"
                },
    "tcp_max_session_duration_sec": {
      "type": "integer",
      "default": 600
    },
    "env": {
      "type": "string",
      "enum": ["production", "development"],
      "default": "production"
    },
    "node_name": {
      "type": "string",
      "default": "default-node"
    },
    "log_level": {
      "type": "string",
      "enum": ["DEBUG", "INFO", "WARN", "ERROR"],
      "default": "INFO"
    },
    "otel_collector_url": {
      "type": "string",
      "default": ""
    },
    "dms_url": {
      "type": "string",
      "default": "http://dms:6986"
    },
    "healthcheck_port": {
      "type": "integer",
      "default": 8081
    },
    "command_interface": {
      "type": "string",
      "description": "The IPv4 interface for the Command Network to bind to.",
      "default": "0.0.0.0"
    },
    "command_port": {
      "type": "integer",
      "description": "The primary operational TCP port over which the SCC pushes mTLS-secured query batches.",
      "default": 6986
    },
    "observability_interface": {
      "type": "string",
      "description": "The IPv4 interface for the Observability Network to bind to.",
      "default": "0.0.0.0"
    },
    "observability_port": {
      "type": "integer",
      "description": "Unsecured HTTP healthcheck server and telemetry metrics endpoint.",
      "default": 8080
    },
    "production_interface": {
      "type": "string",
      "description": "The physical PCIe network interface bound to the VFIO kernel module used for fast-path DPDK packet RX/TX. If 'none', uses posix system stack.",
      "default": "none"
    },
    "production_ip": {
      "type": "string",
      "description": "The IPv4 interface to bind DPDK/Seastar POSIX fallbacks onto.",
      "default": "0.0.0.0"
    },
    "production_port": {
      "type": "integer",
      "description": "The operational data ingress/egress port to bind the Production fast-path onto.",
      "default": 8000
    },
    "opt_in": {
      "type": "boolean",
      "default": false
    },
    "sentry_dsn": {
      "type": "string",
      "default": "http://fad1cbbe866a27d7be3964f73b478fa8@sentry-relay:3000/4511130313031680"
    },
    "bootstrap_token": {
      "type": "string",
      "default": "",
      "description": "V2 Token for native DMS cluster adoption (RSA-4096)."
    },
    "k8s_token": {
      "type": "string",
      "default": ""
    },
    "client_cert_file": {
      "type": "string",
      "default": ""
    },
    "client_key_file": {
      "type": "string",
      "default": ""
    },
    "pki_wrap_key": {
      "type": "string",
      "default": "",
      "description": "Optional AES key for encrypting persisted identity files."
    },

    "target_storage_clusters": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Manual list of Storage Cluster IDs to target."
    },
    "scc_targets": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "address": {"type": "string"},
          "port": {"type": "integer"},
          "description": {"type": "string"}
        },
        "required": ["address", "port"]
      }
    },
    "kafka": {
      "type": "object",
      "properties": {
        "brokers": {"type": "string"},
        "topic": {"type": "string"},
        "group_id": {"type": "string", "default": "fermihdi-ingest-default"}
      }
    },
    "rabbitmq": {
      "type": "object",
      "properties": {
        "url": {"type": "string"},
        "queue": {"type": "string"}
      }
    },
    "mqtt": {
      "type": "object",
      "properties": {
        "address": {"type": "string"},
        "client_id": {"type": "string"},
        "topic": {"type": "string"}
      }
    },
    "file": {
      "type": "object",
      "properties": {
        "directory": {"type": "string"},
        "sort_by": {"type": "string", "default": "alphanumeric"}
      }
    },
    "s3": {
      "type": "object",
      "properties": {
        "bucket": {"type": "string"},
        "prefix": {"type": "string"},
        "region": {"type": "string"},
        "access_key_id": {"type": "string"},
        "secret_access_key": {"type": "string"},
        "endpoint": {"type": "string"},
        "sort_by": {"type": "string", "default": "alphanumeric"}
      }
    }
  }
}
