{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/peppolstatus-com/json-schema/peppolstatus-com-uptime-page-schema.json",
  "title": "UptimePage",
  "description": "A page of uptime aggregate buckets.",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/peppolstatus-com-hosts-api-openapi.yml#/components/schemas/UptimePage",
  "type": "object",
  "required": [
    "items",
    "next_cursor"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UptimeBucket"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Opaque cursor for the next page, or null on the last page."
    }
  },
  "$defs": {
    "HostRole": {
      "type": "string",
      "enum": [
        "SMP",
        "AP"
      ]
    },
    "UptimeBucket": {
      "type": "object",
      "required": [
        "resolution",
        "hostname",
        "role",
        "location",
        "bucket_start",
        "checks_total",
        "up",
        "degraded",
        "down",
        "uptime_pct",
        "phases"
      ],
      "properties": {
        "resolution": {
          "type": "string",
          "enum": [
            "hourly",
            "daily",
            "monthly"
          ]
        },
        "hostname": {
          "type": "string"
        },
        "role": {
          "$ref": "#/$defs/HostRole"
        },
        "location": {
          "type": "string"
        },
        "bucket_start": {
          "type": "string",
          "format": "date-time"
        },
        "checks_total": {
          "type": "integer"
        },
        "up": {
          "type": "integer"
        },
        "degraded": {
          "type": "integer"
        },
        "down": {
          "type": "integer"
        },
        "uptime_pct": {
          "type": "number"
        },
        "phases": {
          "$ref": "#/$defs/UptimePhasePercentiles"
        }
      }
    },
    "UptimePercentiles": {
      "type": "object",
      "description": "Latency percentiles for one phase, whole milliseconds.",
      "required": [
        "p50",
        "p95",
        "p99"
      ],
      "properties": {
        "p50": {
          "type": "number"
        },
        "p95": {
          "type": "number"
        },
        "p99": {
          "type": "number"
        }
      }
    },
    "UptimePhasePercentiles": {
      "type": "object",
      "required": [
        "dns",
        "tcp",
        "tls",
        "http",
        "total"
      ],
      "properties": {
        "dns": {
          "$ref": "#/$defs/UptimePercentiles"
        },
        "tcp": {
          "$ref": "#/$defs/UptimePercentiles"
        },
        "tls": {
          "$ref": "#/$defs/UptimePercentiles"
        },
        "http": {
          "$ref": "#/$defs/UptimePercentiles"
        },
        "total": {
          "$ref": "#/$defs/UptimePercentiles"
        }
      }
    }
  }
}