{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bernstein-run/json-schema/bernstein-run-cluster-status-response-schema.json",
  "title": "ClusterStatusResponse",
  "description": "Response for GET /cluster/status.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bernstein-run-cluster-api-openapi.yml#/components/schemas/ClusterStatusResponse",
  "properties": {
    "topology": {
      "type": "string",
      "title": "Topology"
    },
    "total_nodes": {
      "type": "integer",
      "title": "Total Nodes"
    },
    "online_nodes": {
      "type": "integer",
      "title": "Online Nodes"
    },
    "offline_nodes": {
      "type": "integer",
      "title": "Offline Nodes"
    },
    "total_capacity": {
      "type": "integer",
      "title": "Total Capacity"
    },
    "available_slots": {
      "type": "integer",
      "title": "Available Slots"
    },
    "active_agents": {
      "type": "integer",
      "title": "Active Agents"
    },
    "nodes": {
      "items": {
        "$ref": "#/$defs/NodeResponse"
      },
      "type": "array",
      "title": "Nodes"
    }
  },
  "type": "object",
  "required": [
    "topology",
    "total_nodes",
    "online_nodes",
    "offline_nodes",
    "total_capacity",
    "available_slots",
    "active_agents",
    "nodes"
  ],
  "$defs": {
    "NodeCapacitySchema": {
      "properties": {
        "max_agents": {
          "type": "integer",
          "title": "Max Agents",
          "default": 6
        },
        "available_slots": {
          "type": "integer",
          "title": "Available Slots",
          "default": 6
        },
        "active_agents": {
          "type": "integer",
          "title": "Active Agents",
          "default": 0
        },
        "gpu_available": {
          "type": "boolean",
          "title": "Gpu Available",
          "default": false
        },
        "supported_models": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Supported Models"
        }
      },
      "type": "object",
      "title": "NodeCapacitySchema",
      "description": "Advertised capacity of a cluster node."
    },
    "NodeResponse": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "url": {
          "type": "string",
          "title": "Url"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "capacity": {
          "$ref": "#/$defs/NodeCapacitySchema"
        },
        "last_heartbeat": {
          "type": "number",
          "title": "Last Heartbeat"
        },
        "registered_at": {
          "type": "number",
          "title": "Registered At"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "title": "Labels"
        },
        "cell_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Cell Ids"
        }
      },
      "type": "object",
      "required": [
        "id",
        "name",
        "url",
        "status",
        "capacity",
        "last_heartbeat",
        "registered_at",
        "labels",
        "cell_ids"
      ],
      "title": "NodeResponse",
      "description": "Serialised node in API responses."
    }
  }
}