{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://runninglake.com/schema/v1alpha1/queue.json",
  "title": "Queue",
  "description": "A Queue as RunningLake's configuration repository declares it, at queues/<name>.yaml. Generated from the Go types the control plane decodes this file into, so it checks the shape the gate reads — field names and types, and which fields may exist. The gate also applies rules no schema can express — required fields inside spec among them — so a file this schema accepts can still be refused by `rl diff`. Take #/properties/spec for the spec alone.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "apiVersion",
    "kind",
    "metadata"
  ],
  "properties": {
    "apiVersion": {
      "type": "string",
      "const": "runninglake.io/v1alpha1",
      "description": "The config schema's version, which is independent of the HTTP API's (rule unsupported-api-version)."
    },
    "kind": {
      "type": "string",
      "const": "Queue",
      "description": "The kind this file declares. A kind that disagrees with the file's path is refused (rule kind-mismatch)."
    },
    "metadata": {
      "required": [
        "name"
      ],
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "type": "string",
          "pattern": "^[a-z0-9_-]{1,63}$",
          "description": "The resource's name, which is also its path segment. It must be the name this file's path gives it (rule name-mismatch)."
        },
        "labels": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "annotations": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "spec": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": false,
      "properties": {
        "team": {
          "description": "The team this queue is for, as a label recorded with the queue. It is not a membership and is not sent to the plane.",
          "type": [
            "string",
            "null"
          ]
        },
        "nominalCpu": {
          "description": "The CPU quota of this queue, as a Kubernetes quantity such as \"8\". Required with nominalMemory (rule queue-floor-required). Applied to a plane whose release supports queues; it is a quota in the plane's scheduler and does not itself provision machines.",
          "type": [
            "string",
            "null"
          ]
        },
        "nominalMemory": {
          "description": "The memory quota of this queue, as a Kubernetes quantity such as \"32Gi\". Required with nominalCpu (rule queue-floor-required).",
          "type": [
            "string",
            "null"
          ]
        },
        "borrowingCpu": {
          "description": "The most CPU this queue may borrow from other queues in the plane, as a Kubernetes quantity. Leave it out to set no limit of its own.",
          "type": [
            "string",
            "null"
          ]
        },
        "borrowingMemory": {
          "description": "The most memory this queue may borrow from other queues in the plane, as a Kubernetes quantity. Leave it out to set no limit of its own.",
          "type": [
            "string",
            "null"
          ]
        },
        "monthlyCapUsd": {
          "description": "The monthly cap for this queue in US dollars. Leave it out for no cap; 0 is a cap of zero, and the two are different values. Recorded with the queue; nothing enforces it yet.",
          "type": [
            "number",
            "null"
          ]
        }
      }
    }
  }
}
