{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/flopsindex-com/json-schema/flopsindex-com-facility-submission-schema.json",
  "title": "FacilitySubmission",
  "description": "Monthly facility instrumentation — Contributor Tech Ref §10.3 Table 37/§10.5.\n\nBounds per §12.2 FacilitySubmission Validation:\n  * measured_pue in [1.05, 2.50] (physical plausibility)\n  * facility_kw, it_kw > 0 (zero indicates missing meter)\n  * |measured_pue - facility_kw/it_kw| <= 0.05 (consistency)\n  * inlet_temp_avg_c in [10, 40] (ASHRAE TC 9.9 envelope plausibility)\n  * each FacilityEvent: ended_at >= started_at",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/flopsindex-com-openapi.json#/components/schemas/FacilitySubmission",
  "properties": {
    "facility_id": {
      "type": "string",
      "minLength": 1,
      "title": "Facility Id",
      "description": "Operator-side facility ID; hashed on ingest."
    },
    "region": {
      "$ref": "#/$defs/Region"
    },
    "period_start": {
      "type": "string",
      "title": "Period Start"
    },
    "period_end": {
      "type": "string",
      "title": "Period End"
    },
    "measured_pue": {
      "type": "number",
      "maximum": 2.5,
      "minimum": 1.05,
      "title": "Measured Pue"
    },
    "facility_kw": {
      "type": "number",
      "maximum": 200000.0,
      "exclusiveMinimum": 0.0,
      "title": "Facility Kw"
    },
    "it_kw": {
      "type": "number",
      "maximum": 200000.0,
      "exclusiveMinimum": 0.0,
      "title": "It Kw"
    },
    "cooling_kw": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 200000.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Cooling Kw"
    },
    "inlet_temp_avg_c": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 40.0,
          "minimum": 10.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Inlet Temp Avg C"
    },
    "inlet_temp_p95_c": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 50.0,
          "minimum": 10.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Inlet Temp P95 C"
    },
    "rack_count": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100000.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Rack Count"
    },
    "gpu_rack_count": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 100000.0,
          "minimum": 0.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Gpu Rack Count"
    },
    "availability_events": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/FacilityEvent"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Availability Events"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "facility_id",
    "region",
    "period_start",
    "period_end",
    "measured_pue",
    "facility_kw",
    "it_kw"
  ],
  "$defs": {
    "FacilityEvent": {
      "properties": {
        "event_type": {
          "type": "string",
          "enum": [
            "power_outage",
            "cooling_failure",
            "thermal_excursion",
            "network_cutover",
            "planned_maintenance"
          ],
          "title": "Event Type"
        },
        "started_at": {
          "type": "string",
          "title": "Started At",
          "description": "ISO UTC timestamp"
        },
        "ended_at": {
          "type": "string",
          "title": "Ended At",
          "description": "ISO UTC timestamp; must be >= started_at"
        },
        "affected_rack_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Affected Rack Count"
        },
        "root_cause": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 200
            },
            {
              "type": "null"
            }
          ],
          "title": "Root Cause"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "event_type",
        "started_at",
        "ended_at"
      ],
      "title": "FacilityEvent",
      "description": "Availability event — see Contributor Tech Ref §10.4 Table 54.\n\nInline form: nested inside FacilitySubmission.availability_events.\nStandalone form: posted to /v2/submit/facility/event (FacilityEventSubmission\nbelow). This model carries only the event-shape fields; the standalone\nsubmission adds the parent facility_id + region scope so the event can\nbe linked to a facility without an enclosing FacilitySubmission."
    },
    "Region": {
      "type": "string",
      "enum": [
        "us_east",
        "us_west",
        "eu_west",
        "ap_southeast",
        "africa",
        "global"
      ],
      "title": "Region"
    }
  }
}