{
  "$defs": {
    "Network": {
      "additionalProperties": false,
      "properties": {
        "bridge": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "vlan": {
          "default": null,
          "format": "uint16",
          "maximum": 65535,
          "minimum": 0,
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "NetworkDefaults": {
      "additionalProperties": false,
      "description": "One provider type per network role (ADR-0059 D3). Parsed and shown from\ncatalog 1.1.0 on; the network Kinds resolve through it from ADR-0059 F2.",
      "properties": {
        "dns": {
          "default": null,
          "description": "No provider serves this role yet (ADR-0059 F5): a value is refused.",
          "type": [
            "string",
            "null"
          ]
        },
        "gateway": {
          "default": null,
          "description": "The perimeter gateway of `kind: NetworkGateway` (today: `opnsense`).",
          "type": [
            "string",
            "null"
          ]
        },
        "ipam": {
          "default": null,
          "description": "No provider serves this role yet (ADR-0059 F5): a value is refused.",
          "type": [
            "string",
            "null"
          ]
        },
        "nat": {
          "default": null,
          "description": "No provider serves this role yet (ADR-0059 F5): a value is refused.",
          "type": [
            "string",
            "null"
          ]
        },
        "segment": {
          "default": null,
          "description": "The provider of `kind: NetworkZone` (today: `proxmox`).",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "OpnsenseAuth": {
      "additionalProperties": false,
      "description": "The API key pair, by reference: the key (an identifier, like a Proxmox\n`tokenId`) inline or in a file, the secret only in a 0600 file or a\n`kind: Secret` with `key` and `secret` fields.",
      "properties": {
        "key": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "keyFile": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "secretFile": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "secretRef": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "ProviderEntry": {
      "description": "One provider. Tagged by `type`, the same name `--backend` and a VM record use.",
      "oneOf": [
        {
          "additionalProperties": false,
          "description": "A local provider: listing it declares it; there is nothing to configure.",
          "properties": {
            "name": {
              "default": null,
              "description": "Reserved: defaults to the type; a different name is refused until a\nnode can carry two providers of one type.",
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "const": "libvirt",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "A local provider: listing it declares it; there is nothing to configure.",
          "properties": {
            "name": {
              "default": null,
              "description": "Reserved: defaults to the type; a different name is refused until a\nnode can carry two providers of one type.",
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "const": "cloud-hypervisor",
              "type": "string"
            }
          },
          "required": [
            "type"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "A Proxmox VE node reached through its API, as the vendor documents it.",
          "properties": {
            "auth": {
              "$ref": "#/$defs/ProxmoxAuth"
            },
            "name": {
              "default": null,
              "type": [
                "string",
                "null"
              ]
            },
            "network": {
              "$ref": "#/$defs/Network"
            },
            "node": {
              "type": "string"
            },
            "storage": {
              "$ref": "#/$defs/Storage"
            },
            "tls": {
              "$ref": "#/$defs/Tls"
            },
            "type": {
              "const": "proxmox",
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "url",
            "node",
            "auth"
          ],
          "type": "object"
        },
        {
          "additionalProperties": false,
          "description": "An OPNsense appliance reached through its REST API (ADR-0051, ADR-0059 F1).\nOnly a generated API key/secret pair authenticates (ADR-0051 phase 0).",
          "properties": {
            "auth": {
              "$ref": "#/$defs/OpnsenseAuth"
            },
            "name": {
              "default": null,
              "type": [
                "string",
                "null"
              ]
            },
            "tls": {
              "$ref": "#/$defs/Tls"
            },
            "type": {
              "const": "opnsense",
              "type": "string"
            },
            "url": {
              "type": "string"
            }
          },
          "required": [
            "type",
            "url",
            "auth"
          ],
          "type": "object"
        }
      ]
    },
    "ProxmoxAuth": {
      "additionalProperties": false,
      "description": "The credential, by reference only. The two value fields exist so they are\nrefused BY NAME, with the accepted forms, instead of as an unknown field.",
      "properties": {
        "passwordFile": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "secretRef": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "tokenId": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "tokenSecretFile": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "username": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "Storage": {
      "additionalProperties": false,
      "description": "Where a local image goes on the node (ADR-0057): the dir storage it is\nuploaded to (`import`, default `local`) and the storage its disk is\nimported onto (`disk`, default `local-lvm`).",
      "properties": {
        "disk": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "import": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": "object"
    },
    "Tls": {
      "additionalProperties": false,
      "properties": {
        "caFile": {
          "default": null,
          "type": [
            "string",
            "null"
          ]
        },
        "insecureSkipVerify": {
          "default": false,
          "type": "boolean"
        }
      },
      "type": "object"
    }
  },
  "$id": "https://angolardevops.github.io/delonix-runtime/schema/v1/providers.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "The parsed file.",
  "properties": {
    "apiVersion": {
      "const": "config.delonix.io/v1",
      "description": "The format version; this build reads only `config.delonix.io/v1`.",
      "type": "string"
    },
    "defaultProvider": {
      "default": null,
      "description": "The provider a request that names none goes to.",
      "type": [
        "string",
        "null"
      ]
    },
    "networkDefaults": {
      "anyOf": [
        {
          "$ref": "#/$defs/NetworkDefaults"
        },
        {
          "type": "null"
        }
      ],
      "description": "Which provider answers each network role when nothing names one\n(ADR-0059 D3). `defaultProvider` stays the compute default."
    },
    "providers": {
      "description": "One entry per provider type this node has.",
      "items": {
        "$ref": "#/$defs/ProviderEntry"
      },
      "type": "array"
    }
  },
  "required": [
    "apiVersion"
  ],
  "title": "Delonix providers file (config.delonix.io/v1)",
  "type": "object"
}
