{
  "components": {
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "The call failed."
      }
    },
    "schemas": {
      "Document": {
        "additionalProperties": false,
        "description": "A whole deployment: one node or an HA pair.",
        "properties": {
          "backup": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Backup"
              },
              {
                "type": "null"
              }
            ],
            "description": "Scheduled backups of the node bundle."
          },
          "cluster": {
            "$ref": "#/components/schemas/Document.Cluster",
            "description": "Node names and pair-wide settings."
          },
          "dhcp": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Dhcp"
              },
              {
                "type": "null"
              }
            ],
            "description": "DHCPv4 service per network."
          },
          "dns": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Dns"
              },
              {
                "type": "null"
              }
            ],
            "description": "Recursive DNS for the served networks."
          },
          "forwards": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Forward"
            },
            "description": "Inbound port forwards (DNAT).",
            "type": "object"
          },
          "logging": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Logging"
              },
              {
                "type": "null"
              }
            ],
            "description": "Rule-log defaults and remote forwarding."
          },
          "management": {
            "$ref": "#/components/schemas/Document.Management",
            "description": "Which network is management, and the anti-lockout switch."
          },
          "metrics": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Metrics"
              },
              {
                "type": "null"
              }
            ],
            "description": "Metrics collection."
          },
          "networks": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Network"
            },
            "description": "Layer-2 segments, keyed by network name (also the interface name).",
            "type": "object"
          },
          "ntp": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Ntp"
              },
              {
                "type": "null"
              }
            ],
            "description": "Time service."
          },
          "objects": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Object"
            },
            "description": "Named address and port sets, referenced from rules as `@name`.",
            "type": "object"
          },
          "policy": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Policy"
            },
            "description": "Zone-pair policies keyed by `\"from->to\"`.",
            "type": "object"
          },
          "ports": {
            "additionalProperties": {
              "additionalProperties": {
                "$ref": "#/components/schemas/Document.Port"
              },
              "type": "object"
            },
            "description": "Per node: port role name to the hardware it is bound to.",
            "type": "object"
          },
          "provider_options": {
            "additionalProperties": true,
            "description": "Per-provider passthrough settings, keyed by provider name. Not\nbuilt yet: any entry is rejected.",
            "type": "object"
          },
          "raw": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.RawEntry"
            },
            "description": "Raw nft statements placed at named hook points.",
            "type": "object"
          },
          "schema": {
            "description": "The oldest schema revision that reads this document: the newest\nrevision among the fields it uses. Set when the document is\napplied; a release refuses one newer than it reads.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          "tls": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Tls"
              },
              {
                "type": "null"
              }
            ],
            "description": "Certificates."
          },
          "updates": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Updates"
              },
              {
                "type": "null"
              }
            ],
            "description": "OS image update policy."
          },
          "vpn": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Vpn"
            },
            "description": "Remote-access WireGuard instances.",
            "type": "object"
          },
          "vpn_clients": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.VpnClient"
            },
            "description": "WireGuard tunnels this node connects to as a client, of a service\nit does not run (a VPN provider, a cloud host, another\norganisation's hub): chosen networks' traffic leaves through the\ntunnel instead of the WAN (#149).",
            "type": "object",
            "x-since": 4
          },
          "zones": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Zone"
            },
            "description": "Named groups of networks. `self` is built in and cannot be defined.",
            "type": "object"
          }
        },
        "required": [
          "schema",
          "cluster",
          "management"
        ],
        "title": "Sparewall configuration document",
        "type": "object"
      },
      "Document.Acme": {
        "additionalProperties": false,
        "properties": {
          "ca": {
            "description": "PEM of the CA that signs the directory's TLS certificate, for a\nprivate CA (default: the system trust store).",
            "type": [
              "string",
              "null"
            ]
          },
          "challenge": {
            "description": "`dns-01` (default) or `http-01`.",
            "type": [
              "string",
              "null"
            ]
          },
          "directory": {
            "type": "string"
          },
          "dns": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.AcmeDns"
              },
              {
                "type": "null"
              }
            ]
          },
          "eab": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Eab"
              },
              {
                "type": "null"
              }
            ],
            "description": "External Account Binding key ID and secret reference."
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "directory"
        ],
        "type": "object"
      },
      "Document.AcmeDns": {
        "additionalProperties": false,
        "properties": {
          "credentials": {
            "description": "Secret reference, `secret:<name>`. For `rfc2136`, the TSIG key as\n`algorithm:name:secret`; for lego, the provider's credentials as\n`KEY=value` lines.",
            "type": [
              "string",
              "null"
            ]
          },
          "options": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "For `rfc2136`, `server` (host[:port]) and `zone`; for lego, the\nprovider's other environment variables (`GCE_PROJECT`), and lego's\nown (`LEGO_DNS_RESOLVERS`).",
            "type": "object"
          },
          "provider": {
            "description": "`rfc2136` (built in), or a lego provider code such as `gcloud`,\n`cloudflare` or `route53` (https://go-acme.github.io/lego/dns/).",
            "type": "string"
          }
        },
        "required": [
          "provider"
        ],
        "type": "object"
      },
      "Document.Action": {
        "enum": [
          "accept",
          "drop",
          "reject"
        ],
        "type": "string"
      },
      "Document.Backup": {
        "additionalProperties": false,
        "properties": {
          "credentials": {
            "description": "Secret reference for repository credentials (not the password).",
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "generations": {
            "description": "Generations to include. Default 20.",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "repository": {
            "description": "restic repository URL.",
            "type": [
              "string",
              "null"
            ]
          },
          "retention": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Retention"
              },
              {
                "type": "null"
              }
            ],
            "description": "What the repository keeps of this node's snapshots: after each\nsuccessful send the node runs `restic forget` on its own snapshots\n(`--host <node> --tag sparewall`) with these keep rules, restic's own\nnames. Without it, a repository keeps `hourly: 48, daily: 30,\nweekly: 12, monthly: 24`; `enabled: false` keeps everything (#140).",
            "x-since": 3
          },
          "schedule": {
            "description": "systemd calendar expression. Default `hourly`.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "Document.Bond": {
        "additionalProperties": false,
        "properties": {
          "hash_policy": {
            "description": "Transmit hash policy, e.g. `layer3+4`.",
            "type": [
              "string",
              "null"
            ]
          },
          "lacp_rate": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.LacpRate"
              },
              {
                "type": "null"
              }
            ],
            "description": "LACP rate (802.3ad only)."
          },
          "members": {
            "description": "Member NICs, each a permanent MAC address or udev path.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "miimon": {
            "description": "Link monitoring interval, e.g. `100ms`.",
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "$ref": "#/components/schemas/Document.BondMode",
            "description": "Bonding mode."
          },
          "primary": {
            "description": "Preferred member (active-backup only).",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "members",
          "mode"
        ],
        "type": "object"
      },
      "Document.BondMode": {
        "enum": [
          "802.3ad",
          "active-backup"
        ],
        "type": "string"
      },
      "Document.Cake": {
        "additionalProperties": false,
        "properties": {
          "bandwidth": {
            "description": "Egress bandwidth, e.g. `900mbit`.",
            "type": "string"
          }
        },
        "required": [
          "bandwidth"
        ],
        "type": "object"
      },
      "Document.Certificate": {
        "additionalProperties": false,
        "properties": {
          "acme": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Acme"
              },
              {
                "type": "null"
              }
            ]
          },
          "names": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "names"
        ],
        "type": "object"
      },
      "Document.Cidr": {
        "description": "IPv4 address with prefix length, e.g. 192.0.2.1/24",
        "pattern": "^\\d{1,3}(\\.\\d{1,3}){3}/\\d{1,2}$",
        "type": "string"
      },
      "Document.Cluster": {
        "additionalProperties": false,
        "properties": {
          "conntrack": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.ConntrackSizing"
              },
              {
                "type": "null"
              }
            ],
            "description": "Connection-tracking sizing, identical on both nodes."
          },
          "hold": {
            "description": "Stage beside the gateway this replaces: everything runs, but no\ngateway address is claimed (VRRP instances held in FAULT, or not\ninstalled standalone) and DHCP offers nothing. Set false to cut over.",
            "type": "boolean"
          },
          "nodes": {
            "description": "One node name (standalone) or two (an HA pair). Each is also that\nnode's hostname: up to 31 lowercase letters, digits and '-',\nstarting with a letter and not ending with '-'.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sync_keys": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Each node's sync-tunnel WireGuard public key, from `sparewall status`.",
            "type": "object"
          },
          "sync_network": {
            "description": "The network with role `sync` that carries the pair's WireGuard tunnel.",
            "type": [
              "string",
              "null"
            ]
          },
          "sync_port": {
            "description": "UDP port of the sync tunnel.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "vrrp": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Vrrp"
              },
              {
                "type": "null"
              }
            ],
            "description": "VRRP settings for a pair."
          }
        },
        "required": [
          "nodes"
        ],
        "type": "object"
      },
      "Document.ConntrackSizing": {
        "additionalProperties": false,
        "properties": {
          "buckets": {
            "description": "Hash table buckets (`nf_conntrack_buckets`).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "max": {
            "description": "`nf_conntrack_max`.",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "tcp_established_timeout": {
            "description": "Established-TCP timeout in seconds. Default 86400.",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Document.Dhcp": {
        "additionalProperties": {
          "$ref": "#/components/schemas/Document.DhcpNetwork"
        },
        "description": "DHCPv4: service-wide settings plus one entry per served network.",
        "properties": {
          "ha": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.DhcpHa"
              },
              {
                "type": "null"
              }
            ],
            "description": "HA mode for a pair. Default `hot-standby`."
          },
          "lease_time": {
            "description": "Default lease time in seconds.",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "ping_check": {
            "description": "Ping an address before offering it, and skip it if something\nanswers: a host still using it without a lease here (after a\nrestore, or when replacing another DHCP server). Default true; turn\nit off on networks that filter ICMP echo.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "provider": {
            "description": "Implementation: `kea` (the default). `networkd` is not built yet.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Document.DhcpHa": {
        "enum": [
          "hot-standby",
          "off"
        ],
        "type": "string"
      },
      "Document.DhcpNetwork": {
        "additionalProperties": false,
        "properties": {
          "lease_time": {
            "description": "Lease time in seconds for this network.",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "options": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.DhcpOptions"
              },
              {
                "type": "null"
              }
            ],
            "description": "Options; router, DNS and NTP default to the gateway address."
          },
          "ping_check": {
            "description": "Ping before offering on this network (default: `dhcp.ping_check`).",
            "type": [
              "boolean",
              "null"
            ]
          },
          "pool": {
            "description": "Address range, `first-last`.",
            "type": "string"
          },
          "reservations": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Reservation"
            },
            "default": {},
            "description": "Fixed leases by name.",
            "type": "object"
          }
        },
        "required": [
          "pool"
        ],
        "type": "object"
      },
      "Document.DhcpOptions": {
        "additionalProperties": false,
        "properties": {
          "dns": {
            "items": {
              "format": "ipv4",
              "type": "string"
            },
            "type": "array"
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "ntp": {
            "items": {
              "format": "ipv4",
              "type": "string"
            },
            "type": "array"
          },
          "router": {
            "format": "ipv4",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Document.Dns": {
        "additionalProperties": false,
        "properties": {
          "domain": {
            "description": "Local domain for reservation names.",
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "forwarders": {
            "description": "Forward to these servers instead of recursing.",
            "items": {
              "format": "ipv4",
              "type": "string"
            },
            "type": "array"
          },
          "networks": {
            "description": "Networks to serve; default every network with DHCP.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "provider": {
            "description": "Implementation: `unbound` (the default).",
            "type": [
              "string",
              "null"
            ]
          },
          "records": {
            "additionalProperties": {
              "format": "ipv4",
              "type": "string"
            },
            "description": "Extra local A records, name to address.",
            "type": "object"
          }
        },
        "required": [
          "enabled"
        ],
        "type": "object"
      },
      "Document.DynamicKind": {
        "enum": [
          "address",
          "prefix"
        ],
        "type": "string"
      },
      "Document.DynamicSource": {
        "additionalProperties": false,
        "properties": {
          "network": {
            "description": "The network whose addresses fill the set.",
            "type": "string"
          },
          "source": {
            "$ref": "#/components/schemas/Document.DynamicKind",
            "description": "`address` for the node's own address, `prefix` for the subnet."
          }
        },
        "required": [
          "network"
        ],
        "type": "object"
      },
      "Document.Eab": {
        "additionalProperties": false,
        "properties": {
          "hmac": {
            "type": "string"
          },
          "kid": {
            "type": "string"
          }
        },
        "required": [
          "kid",
          "hmac"
        ],
        "type": "object"
      },
      "Document.Forward": {
        "additionalProperties": false,
        "description": "An inbound port forward.",
        "properties": {
          "dport": {
            "$ref": "#/components/schemas/Document.Match",
            "description": "Port(s) on the firewall."
          },
          "dst": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Match"
              },
              {
                "type": "null"
              }
            ],
            "description": "Original destination; default any address of the arriving zone."
          },
          "from": {
            "description": "Zone the connections arrive from. Default `wan`.",
            "type": [
              "string",
              "null"
            ]
          },
          "hairpin": {
            "description": "Inside zones whose clients may also use the forward by its outside\naddress (NAT reflection), e.g. `[users]`. Needs `dst`. Clients on\nthe server's own network are also source-NATed to the firewall's\naddress there, so that replies come back through it.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "log": {
            "description": "Log forwarded connections.",
            "type": "boolean"
          },
          "proto": {
            "description": "`tcp` or `udp`.",
            "type": "string"
          },
          "src": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Match"
              },
              {
                "type": "null"
              }
            ],
            "description": "Allowed sources."
          },
          "to": {
            "description": "Internal address to forward to.",
            "format": "ipv4",
            "type": "string"
          },
          "to_port": {
            "description": "Internal port; default unchanged.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "proto",
          "dport",
          "to"
        ],
        "type": "object"
      },
      "Document.Ipv6Mode": {
        "enum": [
          "dhcpv6",
          "ra",
          "static",
          "delegated"
        ],
        "type": "string"
      },
      "Document.LacpRate": {
        "enum": [
          "slow",
          "fast"
        ],
        "type": "string"
      },
      "Document.Logging": {
        "additionalProperties": false,
        "properties": {
          "connections": {
            "description": "Record connection start/end with NAT mappings.",
            "type": "boolean"
          },
          "group": {
            "description": "nflog group used for rule logging. Default 0.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "remote": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.RemoteLog"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "Document.Management": {
        "additionalProperties": false,
        "properties": {
          "anti_lockout": {
            "description": "Always accept SSH and HTTPS from the management network to `self`.\nOnly an `admin` may turn this off.",
            "type": "boolean"
          },
          "network": {
            "description": "The network with role `management`.",
            "type": "string"
          },
          "sources": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Match"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who on the management network reaches SSH and HTTPS through the\nanti-lockout rule: addresses, prefixes, ranges or `@objects`, of\neither family. Each family is admitted from the sources it names,\nIPv6 where the management network has it (schema revision 6). Unset,\nevery host there does. Worth setting when the management network is\nalso an ordinary one, such as a two-NIC box's LAN (#177).",
            "x-since": 3
          },
          "ssh": {
            "$ref": "#/components/schemas/Document.ManagementSsh",
            "description": "SSH to the node."
          },
          "web": {
            "description": "Serve the web UI and the HTTP API (`sparewall-httpd`) on the HTTPS\nport, next to the health endpoints. Off by default; reached only\nwhere HTTPS is, the management network.",
            "type": "boolean",
            "x-since": 2
          }
        },
        "required": [
          "network"
        ],
        "type": "object"
      },
      "Document.ManagementSsh": {
        "additionalProperties": false,
        "properties": {
          "password": {
            "description": "Also accept the `admin` password (`sparewall passwd`) over SSH, not\nonly keys. Off by default: the password is the console's\nbreak-glass path.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Document.Match": {
        "anyOf": [
          {
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          {
            "type": "string"
          },
          {
            "items": {
              "$ref": "#/components/schemas/Document.MatchItem"
            },
            "type": "array"
          }
        ],
        "description": "A match value: a scalar, a list, or an `@object` reference. An IPv6\naddress in one needs schema revision 5 (`x-since-ipv6`): earlier\nreleases read only IPv4 there.",
        "x-since-ipv6": 5
      },
      "Document.MatchItem": {
        "anyOf": [
          {
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          {
            "type": "string"
          }
        ],
        "x-since-ipv6": 5
      },
      "Document.Metrics": {
        "additionalProperties": false,
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/Document.MetricsMode",
            "description": "`external`: `/metrics` answers the management network without a\ntoken, for an external Prometheus. `local`: each node also keeps\nits own history in a local Prometheus, which the API queries\n(`org.sparewall.Metrics`); `/metrics` needs a token, as it does\nwithout a `metrics` section. `off`: not served.",
            "x-since-values": {
              "local": 4
            }
          },
          "retention": {
            "description": "With `mode: local`, how long history is kept, in Prometheus's units\n(`15d`, `12h`, `1y`). Default `15d`.",
            "type": [
              "string",
              "null"
            ],
            "x-since": 4
          },
          "retention_size": {
            "description": "With `mode: local`, the most history may take on disk (`512MB`,\n`2GB`): past it, the oldest goes first, whatever `retention` says.\nDefault `1GB`.",
            "type": [
              "string",
              "null"
            ],
            "x-since": 4
          }
        },
        "required": [
          "mode"
        ],
        "type": "object"
      },
      "Document.MetricsMode": {
        "enum": [
          "external",
          "local",
          "off"
        ],
        "type": "string"
      },
      "Document.Nat": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Document.NatMode",
            "description": "`masquerade`"
          },
          {
            "description": "`{ snat: 203.0.113.5 }`",
            "properties": {
              "snat": {
                "format": "ipv4",
                "type": "string"
              }
            },
            "required": [
              "snat"
            ],
            "type": "object"
          }
        ]
      },
      "Document.NatMode": {
        "enum": [
          "masquerade"
        ],
        "type": "string"
      },
      "Document.Network": {
        "additionalProperties": false,
        "description": "One layer-2 segment.",
        "properties": {
          "addresses": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Cidr"
            },
            "description": "Each node's own address on this network, in CIDR form.",
            "type": "object"
          },
          "cake": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Cake"
              },
              {
                "type": "null"
              }
            ],
            "description": "WAN shaping with CAKE, e.g. `{ egress: 900mbit }`."
          },
          "dhcp_client": {
            "description": "Obtain this node's address by DHCP (WAN or management only).",
            "type": "boolean"
          },
          "dns": {
            "description": "Upstream DNS servers learned statically on this network.",
            "items": {
              "format": "ipv4",
              "type": "string"
            },
            "type": "array"
          },
          "extra_vips": {
            "description": "More addresses that move with the gateway address (in its VRRP\ninstance in a pair; static standalone), for forwards and SNAT, e.g.\na mail server's public address. In the gateway address's subnet.",
            "items": {
              "$ref": "#/components/schemas/Document.Cidr"
            },
            "type": "array"
          },
          "gateway": {
            "description": "Upstream gateway (default route) for a static WAN or a management\nnetwork with its own upstream.",
            "format": "ipv4",
            "type": [
              "string",
              "null"
            ]
          },
          "ipv6": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.NetworkIpv6"
              },
              {
                "type": "null"
              }
            ],
            "description": "IPv6 on this network (#211). Unset, the network has link-local\nIPv6 addresses only, and routes none. Not on the sync network\n(`x-except-roles`, for editors).",
            "x-except-roles": [
              "sync"
            ],
            "x-since": 5
          },
          "lldp": {
            "description": "Emit and receive LLDP on this network. Default true on untagged ports.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "mtu": {
            "description": "MTU of this network's interface.",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "port": {
            "description": "The port role this network rides on.",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/Document.NetworkRole",
            "description": "What the network is for. Default `service`."
          },
          "vip": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Cidr"
              },
              {
                "type": "null"
              }
            ],
            "description": "The gateway address clients use. Moved by VRRP in a pair, a plain\nstatic address on a standalone node."
          },
          "vlan": {
            "description": "802.1Q VLAN ID; omit for the untagged network of a port.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "vmac": {
            "description": "On a pair's WAN with private node addresses and a static block:\ncarry the gateway addresses and the public route behind the VRRP\nvirtual MAC (`00:00:5e:00:01:<vrid>`), so a handover changes no MAC\nthe upstream sees (the default). `false` puts them on the nodes'\nown MACs, for an upstream that limits the MACs it learns on a port.\nNot `cluster.vrrp.use_vmac`, keepalived's own virtual MAC for the\nother networks' instances.",
            "type": "boolean",
            "x-since": 3
          },
          "vrid": {
            "description": "VRRP virtual router ID (1-255), unique across the deployment.",
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "port"
        ],
        "type": "object"
      },
      "Document.NetworkIpv6": {
        "additionalProperties": false,
        "description": "How a network gets its IPv6 addresses. Which fields apply depends on\n`mode` and on the network's role: each field's `x-modes` lists the\nmodes it applies to, and `x-role` the networks: `wan`, or `inside`\n(neither a WAN nor the sync network), for editors (the web UI shows a\nfield only where it applies).",
        "properties": {
          "addresses": {
            "additionalProperties": {
              "format": "ipv6",
              "type": "string"
            },
            "description": "`static` on a standalone node's WAN: its own address, in `prefix`.",
            "type": "object",
            "x-modes": [
              "static"
            ],
            "x-role": "wan"
          },
          "dns": {
            "description": "On an inside network: the resolvers its router advertisements\nname (RDNSS), in place of the node, whatever DHCPv4 hands out; an\nempty list names none. Unset, they name the node where DHCPv4\ndoes, and none otherwise.",
            "items": {
              "format": "ipv6",
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ],
            "x-modes": [
              "delegated",
              "static"
            ],
            "x-role": "inside"
          },
          "gateway": {
            "description": "`static` on a WAN: the upstream router, in `prefix` or link-local\n(`fe80::1`).",
            "format": "ipv6",
            "type": [
              "string",
              "null"
            ],
            "x-modes": [
              "static"
            ],
            "x-role": "wan"
          },
          "mode": {
            "$ref": "#/components/schemas/Document.Ipv6Mode",
            "description": "On a WAN: `dhcpv6` (an address by DHCPv6 or SLAAC, as the\nupstream's router advertisements say, and a delegated prefix for\nthe inside networks), `ra` (an address by SLAAC only, no delegated\nprefix) or `static`. On another network: `delegated` (a /64 of the\nWAN's delegated prefix) or `static`."
          },
          "prefix": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Prefix6"
              },
              {
                "type": "null"
              }
            ],
            "description": "`static`: the network's prefix. A /64 on an inside network; on a\nWAN, the upstream link's prefix.",
            "x-modes": [
              "static"
            ]
          },
          "prefix_length": {
            "description": "`dhcpv6`: the length of the prefix to ask the ISP to delegate, 48\nto 64. Default 56. The ISP may delegate another.",
            "format": "uint8",
            "maximum": 255,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ],
            "x-modes": [
              "dhcpv6"
            ]
          },
          "subnet_id": {
            "description": "`delegated`: which /64 of the delegated prefix this network takes,\ncounting from 0 (a /56 has 256). Unique among the networks.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ],
            "x-modes": [
              "delegated"
            ]
          },
          "vip": {
            "description": "`static` on a pair's WAN: the address the ISP routes the site to,\nwhich moves with the gateway (the nodes have no IPv6 address of\ntheir own there).",
            "format": "ipv6",
            "type": [
              "string",
              "null"
            ],
            "x-modes": [
              "static"
            ],
            "x-role": "wan"
          }
        },
        "required": [
          "mode"
        ],
        "type": "object"
      },
      "Document.NetworkRole": {
        "enum": [
          "service",
          "wan",
          "management",
          "sync"
        ],
        "type": "string"
      },
      "Document.Ntp": {
        "additionalProperties": false,
        "properties": {
          "serve": {
            "description": "Networks to serve time on.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "servers": {
            "description": "Upstream servers or pools.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Document.Object": {
        "additionalProperties": false,
        "description": "A named set: static elements, or a dynamic set filled by networkd.",
        "properties": {
          "dynamic": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.DynamicSource"
              },
              {
                "type": "null"
              }
            ],
            "description": "Fill from a network's addresses instead (`ipv4` and `ipv6`): the\nnode's own, or the network's prefix."
          },
          "elements": {
            "description": "Static elements: addresses, prefixes or ranges for `ipv4` and\n`ipv6`, ports or ranges for `port`.",
            "items": {
              "$ref": "#/components/schemas/Document.MatchItem"
            },
            "type": "array"
          },
          "suffixes": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "description": "`ipv6`: hosts in a network's IPv6 prefix, by the network and their\nsuffix, the address's last 64 bits (`users: [\"::20\"]`). They follow\nthe prefix, so a rule for a host survives the ISP renumbering a\ndelegated one (schema revision 6). Each host configures its own\naddress, with that suffix.",
            "type": "object",
            "x-since": 5
          },
          "type": {
            "$ref": "#/components/schemas/Document.ObjectKind",
            "description": "Element type.",
            "x-since-values": {
              "ipv6": 5
            }
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "Document.ObjectKind": {
        "enum": [
          "ipv4",
          "ipv6",
          "port"
        ],
        "type": "string"
      },
      "Document.Offload": {
        "additionalProperties": false,
        "properties": {
          "gro": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "gso": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "rx_checksum": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tso": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "tx_checksum": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Document.Policy": {
        "additionalProperties": false,
        "description": "Policy for traffic from one zone to another.",
        "properties": {
          "action": {
            "$ref": "#/components/schemas/Document.Action",
            "description": "What happens to traffic no rule matched."
          },
          "log": {
            "description": "Log traffic that reaches the default action.",
            "type": "boolean"
          },
          "nat": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Nat"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source NAT applied to this zone pair."
          },
          "rules": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Rule"
            },
            "description": "Named rules, evaluated by ascending `order`.",
            "type": "object"
          }
        },
        "required": [
          "action"
        ],
        "type": "object"
      },
      "Document.Port": {
        "additionalProperties": false,
        "description": "What a port role is bound to on one node.",
        "properties": {
          "bond": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Bond"
              },
              {
                "type": "null"
              }
            ],
            "description": "A bond of several NICs."
          },
          "mtu": {
            "description": "MTU of the port (VLAN networks may set their own, no larger).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "nic": {
            "description": "One NIC, matched by permanent MAC address (`52:54:00:aa:00:01`) or by\nudev path (`pci-0000:01:00.0`).",
            "type": [
              "string",
              "null"
            ]
          },
          "offload": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Offload"
              },
              {
                "type": "null"
              }
            ],
            "description": "NIC offload overrides for misbehaving drivers."
          }
        },
        "type": "object"
      },
      "Document.Prefix6": {
        "description": "IPv6 prefix, e.g. 2001:db8:0:1::/64",
        "pattern": "^[0-9A-Fa-f:.]+/\\d{1,3}$",
        "type": "string"
      },
      "Document.RawAt": {
        "anyOf": [
          {
            "properties": {
              "pair": {
                "description": "Zone pair, `\"from->to\"`.",
                "type": "string"
              },
              "position": {
                "$ref": "#/components/schemas/Document.RawPosition"
              }
            },
            "required": [
              "pair",
              "position"
            ],
            "type": "object"
          },
          {
            "properties": {
              "hook": {
                "$ref": "#/components/schemas/Document.RawHook"
              }
            },
            "required": [
              "hook"
            ],
            "type": "object"
          }
        ]
      },
      "Document.RawEntry": {
        "additionalProperties": false,
        "description": "A raw nft statement placed at a hook point.",
        "properties": {
          "at": {
            "$ref": "#/components/schemas/Document.RawAt",
            "description": "Where the statement goes."
          },
          "nft": {
            "description": "The nft statement, without a trailing comment.",
            "type": "string"
          },
          "order": {
            "description": "Position among raw entries at the same point.",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "at",
          "order",
          "nft"
        ],
        "type": "object"
      },
      "Document.RawHook": {
        "oneOf": [
          {
            "const": "prerouting-raw",
            "description": "Prerouting at raw priority (`notrack`, early drops).",
            "type": "string"
          },
          {
            "const": "forward",
            "description": "Forward, before zone dispatch (global blocks, MSS clamping).",
            "type": "string"
          },
          {
            "const": "input",
            "description": "Input, before zone dispatch.",
            "type": "string"
          },
          {
            "const": "postrouting",
            "description": "Postrouting at source-NAT priority (custom SNAT, marks).",
            "type": "string"
          }
        ]
      },
      "Document.RawPosition": {
        "enum": [
          "before",
          "after"
        ],
        "type": "string"
      },
      "Document.RemoteLog": {
        "additionalProperties": false,
        "properties": {
          "ca": {
            "description": "syslog only: PEM of the CA that signs the collector's certificate,\nfor a private CA (default: the system trust store).",
            "type": [
              "string",
              "null"
            ],
            "x-since": 4
          },
          "certificate": {
            "description": "syslog only, with `tls`: this node's client certificate for a\ncollector that requires one (RELP over TLS always does), as a\nsecret reference, `secret:<name>`: the private key and the\ncertificate (with any intermediates), PEM, in one secret.",
            "type": [
              "string",
              "null"
            ],
            "x-since": 4
          },
          "destination": {
            "description": "For journal-upload, a URL or `host:port`. For syslog, `host` or\n`host:port`; the port defaults to 514 (`udp`, `tcp`), 6514 (`tcp`\nwith `tls`) or 2514 (`relp`).",
            "type": "string"
          },
          "protocol": {
            "description": "syslog only: `udp` (the default; messages can be lost), `tcp`, or\n`relp` (acknowledged delivery).",
            "type": [
              "string",
              "null"
            ]
          },
          "provider": {
            "description": "`journal-upload` (the default): systemd-journal-upload to a\nsystemd-journal-remote collector. `syslog`: rsyslog, to a syslog\ncollector (RFC 5424), over `protocol`.",
            "type": [
              "string",
              "null"
            ],
            "x-since-values": {
              "syslog": 4
            }
          },
          "tls": {
            "description": "Encrypt, and check the collector's certificate: its name must be\nthe destination's host. syslog: with `tcp` or `relp`.",
            "type": "boolean"
          }
        },
        "required": [
          "destination"
        ],
        "type": "object"
      },
      "Document.Reservation": {
        "additionalProperties": false,
        "properties": {
          "address": {
            "format": "ipv4",
            "type": "string"
          },
          "hostname": {
            "description": "Hostname to hand out (and publish in local DNS).",
            "type": [
              "string",
              "null"
            ]
          },
          "mac": {
            "type": "string"
          }
        },
        "required": [
          "mac",
          "address"
        ],
        "type": "object"
      },
      "Document.Retention": {
        "additionalProperties": false,
        "description": "restic's keep rules (`restic forget --keep-*`): a snapshot is kept if\nany rule keeps it.",
        "properties": {
          "daily": {
            "description": "… days (`--keep-daily`).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "enabled": {
            "description": "`false` keeps every snapshot: prune elsewhere.",
            "type": "boolean"
          },
          "hourly": {
            "description": "The newest snapshot of each of the last N hours (`--keep-hourly`).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "last": {
            "description": "The newest N snapshots (`--keep-last`).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "monthly": {
            "description": "… months (`--keep-monthly`).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "weekly": {
            "description": "… weeks (`--keep-weekly`).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "yearly": {
            "description": "… years (`--keep-yearly`).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Document.Rule": {
        "additionalProperties": false,
        "properties": {
          "action": {
            "$ref": "#/components/schemas/Document.Action",
            "description": "What to do with matching packets."
          },
          "comment": {
            "description": "Free-form note, not rendered.",
            "type": [
              "string",
              "null"
            ]
          },
          "dport": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Match"
              },
              {
                "type": "null"
              }
            ],
            "description": "Destination port(s): a number, `low-high`, a list, or `@object`."
          },
          "dst": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Match"
              },
              {
                "type": "null"
              }
            ],
            "description": "Destination, as for `src`."
          },
          "icmp_type": {
            "description": "ICMP type names, e.g. `echo-request` (proto `icmp` or `icmpv6`).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "limit": {
            "description": "Rate limit, e.g. `10/second` or `100/minute burst 20`.",
            "type": [
              "string",
              "null"
            ]
          },
          "log": {
            "description": "Log matching packets.",
            "type": "boolean"
          },
          "order": {
            "description": "Position within the zone pair; leave gaps (100, 200, ...).",
            "format": "uint32",
            "minimum": 0,
            "type": "integer"
          },
          "proto": {
            "description": "`tcp`, `udp`, `icmp`, `icmpv6` or another protocol name nft knows.\n`icmp` is IPv4's and `icmpv6` IPv6's, so either limits the rule to\nits family.",
            "type": [
              "string",
              "null"
            ]
          },
          "sport": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Match"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source port(s): a number, `low-high`, a list, or `@object`."
          },
          "src": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.Match"
              },
              {
                "type": "null"
              }
            ],
            "description": "Source: an address, a prefix, a range, a list of them, or\n`@object`, of either family. The rule applies to the families its\naddresses (and `proto`) allow: with only IPv4 ones, to IPv4 only."
          }
        },
        "required": [
          "order",
          "action"
        ],
        "type": "object"
      },
      "Document.Tls": {
        "additionalProperties": false,
        "properties": {
          "certificates": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.Certificate"
            },
            "default": {},
            "type": "object"
          }
        },
        "type": "object"
      },
      "Document.UpdateMode": {
        "enum": [
          "manual",
          "windowed"
        ],
        "type": "string"
      },
      "Document.Updates": {
        "additionalProperties": false,
        "properties": {
          "channel": {
            "description": "`stable` or `testing`.",
            "type": [
              "string",
              "null"
            ]
          },
          "check": {
            "description": "Check the channel for a newer image every few hours, and log when\none appears (on by default). `false` keeps the node from contacting\nthe registry on its own, for an air-gapped site; `sparewall upgrade\n--check` still asks when run.",
            "type": "boolean",
            "x-since": 3
          },
          "mode": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Document.UpdateMode"
              },
              {
                "type": "null"
              }
            ],
            "description": "`manual` (the default): upgrades run when asked for, with\n`sparewall upgrade`. `windowed`: the pair's master (or a standalone\nnode) upgrades by itself when `window` opens and the channel offers\na newer image, through the same health-gated sequence (#84).",
            "x-since-values": {
              "windowed": 3
            }
          },
          "window": {
            "description": "When a scheduled upgrade may start: a systemd calendar expression\n(`Sun *-*-* 03:00`), in the node's time zone (UTC unless set).\nRequired with `mode: windowed`.",
            "type": [
              "string",
              "null"
            ]
          },
          "window_minutes": {
            "description": "How many minutes after the window opens an upgrade may still start\n(default 60).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ],
            "x-since": 3
          }
        },
        "type": "object"
      },
      "Document.Vpn": {
        "additionalProperties": false,
        "properties": {
          "addresses": {
            "description": "Tunnel addresses of the firewall.",
            "items": {
              "$ref": "#/components/schemas/Document.Cidr"
            },
            "type": "array"
          },
          "client_allowed_ips": {
            "description": "Networks routed through the tunnel in client configs; default all.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "dns": {
            "description": "DNS servers pushed in client configs.",
            "items": {
              "format": "ipv4",
              "type": "string"
            },
            "type": "array"
          },
          "endpoint": {
            "description": "Public name or address clients connect to.",
            "type": "string"
          },
          "extra_ports": {
            "description": "More UDP ports clients may use from networks that block the listen\nport, e.g. `[53, 443]`: redirected to it on the WAN gateway address.",
            "items": {
              "format": "uint16",
              "maximum": 65535,
              "minimum": 0,
              "type": "integer"
            },
            "type": "array"
          },
          "listen_port": {
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": "integer"
          },
          "peers": {
            "additionalProperties": {
              "$ref": "#/components/schemas/Document.VpnPeer"
            },
            "default": {},
            "type": "object"
          },
          "zone": {
            "description": "The zone the tunnel interface belongs to.",
            "type": "string"
          }
        },
        "required": [
          "listen_port",
          "endpoint",
          "addresses",
          "zone"
        ],
        "type": "object"
      },
      "Document.VpnClient": {
        "additionalProperties": false,
        "properties": {
          "addresses": {
            "description": "The tunnel addresses the service assigned.",
            "items": {
              "$ref": "#/components/schemas/Document.Cidr"
            },
            "type": "array"
          },
          "dns": {
            "description": "DNS servers DHCP hands to the routed networks, unless a network\nsets its own (`dhcp.<network>.options.dns`): usually the service's\nresolvers, which are reached through the tunnel.",
            "items": {
              "format": "ipv4",
              "type": "string"
            },
            "type": "array"
          },
          "peer": {
            "$ref": "#/components/schemas/Document.VpnClientPeer"
          },
          "private_key": {
            "description": "This node's private key, as the service issued it: a cluster\nsecret, `secret:<name>` (in a pair both nodes are the same client).",
            "type": "string"
          },
          "route": {
            "$ref": "#/components/schemas/Document.VpnClientRoute",
            "description": "What leaves through the tunnel."
          },
          "zone": {
            "description": "The zone the tunnel interface belongs to: policies from the routed\nnetworks' zones to it let their traffic through.",
            "type": "string"
          }
        },
        "required": [
          "private_key",
          "addresses",
          "zone",
          "peer",
          "route"
        ],
        "type": "object"
      },
      "Document.VpnClientPeer": {
        "additionalProperties": false,
        "properties": {
          "endpoint": {
            "description": "`host:port`, an address or a DNS name.",
            "type": "string"
          },
          "keepalive": {
            "description": "Seconds between keepalives (default 25): they keep the service's\nNAT mapping open, and let health tell a dead tunnel.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "preshared_key": {
            "description": "A preshared key, if the service issued one: `secret:<name>`.",
            "type": [
              "string",
              "null"
            ]
          },
          "public_key": {
            "type": "string"
          }
        },
        "required": [
          "public_key",
          "endpoint"
        ],
        "type": "object"
      },
      "Document.VpnClientRoute": {
        "additionalProperties": false,
        "properties": {
          "kill_switch": {
            "description": "While the tunnel is down, drop these networks' traffic to the WAN\nrather than let it leave there (default true).",
            "type": "boolean"
          },
          "networks": {
            "description": "The networks whose traffic to anywhere but this node's own\nnetworks leaves through the tunnel. The node's own traffic, and\nevery other network's, keeps the WAN.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "networks"
        ],
        "type": "object"
      },
      "Document.VpnPeer": {
        "additionalProperties": false,
        "properties": {
          "addresses": {
            "description": "The peer's tunnel address, and for a site-to-site peer the networks\nbehind it, which are routed through the tunnel.",
            "items": {
              "$ref": "#/components/schemas/Document.Cidr"
            },
            "type": "array"
          },
          "endpoint": {
            "description": "`host:port`, an address or a DNS name: a site-to-site peer, which\nthis node connects to as well as accepting it. A name is resolved\nagain while the peer does not answer.",
            "type": [
              "string",
              "null"
            ]
          },
          "keepalive": {
            "description": "Seconds between keepalives to the peer (WireGuard's\n`PersistentKeepalive`): it keeps a NAT mapping open, and keeps a\nsite-to-site tunnel up, so that after a failover the new master\nstarts it again within this time.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ],
            "x-since": 4
          },
          "preshared_key": {
            "description": "WireGuard preshared key, a cluster secret: `secret:<name>`. The\nclient must be configured with the same key (`wg genpsk`).",
            "type": [
              "string",
              "null"
            ]
          },
          "public_key": {
            "type": "string"
          }
        },
        "required": [
          "public_key",
          "addresses"
        ],
        "type": "object"
      },
      "Document.Vrrp": {
        "additionalProperties": false,
        "properties": {
          "advert_interval_cs": {
            "description": "Advertisement interval in centiseconds (VRRPv3). Default 100 (1 s).",
            "format": "uint32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "preempt_delay_s": {
            "description": "Fail back by itself: the node with the higher priority takes the\ngateway addresses back once it has been up and eligible for this\nmany seconds (1-1000). Unset (the default), the pair never\npreempts, so it cannot bounce while that node flaps; move the\naddresses with `sparewall failover` instead. The delay is then the\nonly protection against flapping.",
            "format": "uint16",
            "maximum": 65535,
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "priority": {
            "additionalProperties": {
              "format": "uint8",
              "maximum": 255,
              "minimum": 0,
              "type": "integer"
            },
            "description": "VRRP priority per node; give the larger node the higher value.",
            "type": "object"
          },
          "unicast": {
            "description": "Send adverts unicast to the peer instead of multicast.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "use_vmac": {
            "description": "Use VRRP virtual MAC addresses.",
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Document.Zone": {
        "additionalProperties": false,
        "properties": {
          "networks": {
            "default": [],
            "description": "Member networks.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Error": {
        "description": "A Varlink error: its name and parameters, and a message in words. The HTTP status follows the error (422 ValidationFailed, 409 Conflict, NotPending and ConfirmTimeout, 401 PermissionDenied without credentials and 403 with them, 404 NotFound, MethodNotFound and InterfaceNotFound, 503 PeerUnreachable and ServiceUnavailable, 400 NotSupported, InvalidParameter and malformed calls, 500 the rest; the gateway's own: 502 Unavailable, 404 NotFound, 405 MethodNotAllowed, 413 TooLarge).",
        "oneOf": [
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.ApplyFailed"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.ApplyFailed",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.ConfirmTimeout"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "rolled_back_to": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "rolled_back_to"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.ConfirmTimeout",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.Conflict"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "current": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "current"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.Conflict",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.NotFound"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "id"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.NotFound",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.NotPending"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "id"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.NotPending",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.NotSupported"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.NotSupported",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.PeerUnreachable"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "peer": {
                    "type": "string"
                  }
                },
                "required": [
                  "peer"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.PeerUnreachable",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.PermissionDenied"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "`role` is `none` on a connection not bound to a token.",
                "properties": {
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "role"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.PermissionDenied",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.ServiceUnavailable"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "A service the call needs is not answering (the local Prometheus, for `org.sparewall.Metrics`).",
                "properties": {
                  "message": {
                    "type": "string"
                  },
                  "service": {
                    "type": "string"
                  }
                },
                "required": [
                  "service",
                  "message"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.ServiceUnavailable",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Firewall.ValidationFailed"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "properties": {
                  "errors": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "errors"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Firewall.ValidationFailed",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Httpd.MethodNotAllowed"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "description": "Calls are POST; files are GET.",
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Httpd.MethodNotAllowed",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Httpd.NotFound"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "description": "No call or file has this path.",
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Httpd.NotFound",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Httpd.TooLarge"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "description": "The request body is over the gateway's limit.",
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Httpd.TooLarge",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.sparewall.Httpd.Unavailable"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "description": "The coordinator did not answer the gateway.",
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.sparewall.Httpd.Unavailable",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.varlink.service.ExpectedMore"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "Method is expected to be called with 'more' set to true, but wasn't.",
                "properties": {},
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.varlink.service.ExpectedMore",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.varlink.service.ExpectedUpgrade"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "Method is expected to be called with 'upgrade' set to true, but wasn't.",
                "properties": {},
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.varlink.service.ExpectedUpgrade",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.varlink.service.InterfaceNotFound"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "The requested interface was not found.",
                "properties": {
                  "interface": {
                    "description": "The interface that was not found.",
                    "type": "string"
                  }
                },
                "required": [
                  "interface"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.varlink.service.InterfaceNotFound",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.varlink.service.InvalidParameter"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "One of the passed parameters is invalid.",
                "properties": {
                  "parameter": {
                    "description": "The parameter that is invalid.",
                    "type": "string"
                  }
                },
                "required": [
                  "parameter"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.varlink.service.InvalidParameter",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.varlink.service.MethodNotFound"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "The requested method was not found.",
                "properties": {
                  "method": {
                    "description": "The method that was not found.",
                    "type": "string"
                  }
                },
                "required": [
                  "method"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.varlink.service.MethodNotFound",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.varlink.service.MethodNotImplemented"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "The interface defines the requested method, but the service does not implement it.",
                "properties": {
                  "method": {
                    "description": "The method that is not implemented.",
                    "type": "string"
                  }
                },
                "required": [
                  "method"
                ],
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.varlink.service.MethodNotImplemented",
            "type": "object"
          },
          {
            "properties": {
              "error": {
                "const": "org.varlink.service.PermissionDenied"
              },
              "message": {
                "type": "string"
              },
              "parameters": {
                "additionalProperties": false,
                "description": "Client is denied access.",
                "properties": {},
                "type": "object"
              }
            },
            "required": [
              "error",
              "parameters"
            ],
            "title": "org.varlink.service.PermissionDenied",
            "type": "object"
          }
        ],
        "properties": {
          "error": {
            "enum": [
              "org.sparewall.Firewall.ApplyFailed",
              "org.sparewall.Firewall.ConfirmTimeout",
              "org.sparewall.Firewall.Conflict",
              "org.sparewall.Firewall.NotFound",
              "org.sparewall.Firewall.NotPending",
              "org.sparewall.Firewall.NotSupported",
              "org.sparewall.Firewall.PeerUnreachable",
              "org.sparewall.Firewall.PermissionDenied",
              "org.sparewall.Firewall.ServiceUnavailable",
              "org.sparewall.Firewall.ValidationFailed",
              "org.sparewall.Httpd.MethodNotAllowed",
              "org.sparewall.Httpd.NotFound",
              "org.sparewall.Httpd.TooLarge",
              "org.sparewall.Httpd.Unavailable",
              "org.varlink.service.ExpectedMore",
              "org.varlink.service.ExpectedUpgrade",
              "org.varlink.service.InterfaceNotFound",
              "org.varlink.service.InvalidParameter",
              "org.varlink.service.MethodNotFound",
              "org.varlink.service.MethodNotImplemented",
              "org.varlink.service.PermissionDenied"
            ],
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "parameters": {
            "type": "object"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "org.sparewall.Auth.TokenInfo": {
        "additionalProperties": false,
        "properties": {
          "created": {
            "type": "string"
          },
          "expires": {
            "description": "Unix time it expires, if ever.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "last_used": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "role": {
            "description": "`monitor`, `viewer`, `operator` or `admin`.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "role",
          "created"
        ],
        "type": "object"
      },
      "org.sparewall.Auth.UserInfo": {
        "additionalProperties": false,
        "description": "A named user (design: \"Browser authentication\").",
        "properties": {
          "locked": {
            "description": "No password: the user cannot log in.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "updated": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "role",
          "locked",
          "updated"
        ],
        "type": "object"
      },
      "org.sparewall.Diagnostics.LogEntry": {
        "additionalProperties": false,
        "description": "One journal entry of Sparewall's own units.",
        "properties": {
          "fields": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "The entry's other fields, such as an upgrade's `F_STEP` and `F_DETAIL` or a rule hit's `F_RULE`; not the journal's own (`_PID`, `__CURSOR` and the like).",
            "type": "object"
          },
          "identifier": {
            "description": "The program that logged it (`SYSLOG_IDENTIFIER`).",
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "type": "string"
          },
          "priority": {
            "description": "syslog priority: 0 (emerg) to 7 (debug).",
            "format": "int64",
            "type": "integer"
          },
          "time": {
            "description": "When it was logged (RFC 3339, in microseconds).",
            "type": "string"
          },
          "unit": {
            "description": "The unit it came from (`sparewalld.service`), or `selinux` for a denial of the coordinator's domain.",
            "type": "string"
          },
          "usec": {
            "description": "Microseconds since the Unix epoch.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "time",
          "usec",
          "unit",
          "priority",
          "message",
          "fields"
        ],
        "type": "object"
      },
      "org.sparewall.Diagnostics.Neighbour": {
        "additionalProperties": false,
        "description": "An entry of the neighbour table (ARP, NDP).",
        "properties": {
          "address": {
            "type": "string"
          },
          "family": {
            "description": "`4` or `6`.",
            "type": "string"
          },
          "iface": {
            "type": "string"
          },
          "mac": {
            "type": [
              "string",
              "null"
            ]
          },
          "network": {
            "description": "The network the interface carries, if the document has it.",
            "type": [
              "string",
              "null"
            ]
          },
          "router": {
            "description": "It says it is a router (IPv6).",
            "type": "boolean"
          },
          "state": {
            "description": "`REACHABLE`, `STALE`, `DELAY`, `PROBE`, `FAILED`, `INCOMPLETE`, `PERMANENT`, `NOARP`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "address",
          "family",
          "iface",
          "state",
          "router"
        ],
        "type": "object"
      },
      "org.sparewall.Diagnostics.Route": {
        "additionalProperties": false,
        "description": "A route, from any table but the local one.",
        "properties": {
          "destination": {
            "description": "A prefix, or `default`.",
            "type": "string"
          },
          "expires": {
            "description": "Seconds left, for one that expires.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "family": {
            "description": "`4` or `6`.",
            "type": "string"
          },
          "flags": {
            "description": "`linkdown`, `onlink`…",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "gateway": {
            "type": [
              "string",
              "null"
            ]
          },
          "iface": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "description": "`unicast`, `unreachable`, `blackhole`…",
            "type": "string"
          },
          "metric": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "network": {
            "description": "The network the interface carries, if the document has it.",
            "type": [
              "string",
              "null"
            ]
          },
          "protocol": {
            "description": "Who added it: `kernel`, `dhcp`, `ra`, `static`, `keepalived`…",
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "description": "The source address it prefers.",
            "type": [
              "string",
              "null"
            ]
          },
          "table": {
            "description": "`main`, or another table's number.",
            "type": "string"
          }
        },
        "required": [
          "destination",
          "family",
          "table",
          "kind",
          "flags"
        ],
        "type": "object"
      },
      "org.sparewall.Diagnostics.RuleHit": {
        "additionalProperties": false,
        "description": "A hit of a rule, policy default or forward with `log: true`.",
        "properties": {
          "dport": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "dst": {
            "type": [
              "string",
              "null"
            ]
          },
          "in_iface": {
            "description": "The interfaces it came in on and was going out of.",
            "type": [
              "string",
              "null"
            ]
          },
          "out_iface": {
            "type": [
              "string",
              "null"
            ]
          },
          "packet": {
            "description": "One line: `tcp 192.0.2.7:51234 -> 10.0.0.2:443 in=wan0 out=lan0`.",
            "type": "string"
          },
          "proto": {
            "description": "`tcp`, `udp`, `icmp`, or the protocol's number.",
            "type": [
              "string",
              "null"
            ]
          },
          "rule": {
            "description": "`users->self:ssh`, `guests->users:default` or `forward:web`.",
            "type": "string"
          },
          "sport": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "src": {
            "type": [
              "string",
              "null"
            ]
          },
          "time": {
            "description": "When it was logged (RFC 3339, in microseconds).",
            "type": "string"
          },
          "usec": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "time",
          "usec",
          "rule",
          "packet"
        ],
        "type": "object"
      },
      "org.sparewall.Firewall.Generation": {
        "additionalProperties": false,
        "description": "One configuration generation.",
        "properties": {
          "applied": {
            "description": "When it was created (RFC 3339).",
            "type": "string"
          },
          "author": {
            "type": "string"
          },
          "base": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "confirmed": {
            "description": "False while it waits for `Confirm`.",
            "type": "boolean"
          },
          "hash": {
            "description": "SHA-256 of the canonical document (empty for bootstrap).",
            "type": "string"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "schema": {
            "format": "int64",
            "type": "integer"
          },
          "summary": {
            "description": "One line per changed path.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "hash",
          "schema",
          "author",
          "applied",
          "confirmed",
          "summary"
        ],
        "type": "object"
      },
      "org.sparewall.Firewall.HealthCheck": {
        "additionalProperties": false,
        "properties": {
          "level": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "level",
          "message"
        ],
        "type": "object"
      },
      "org.sparewall.Secrets.SecretInfo": {
        "additionalProperties": false,
        "properties": {
          "class": {
            "description": "`node` or `cluster`.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "updated": {
            "type": "string"
          },
          "version": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "name",
          "class",
          "version",
          "updated"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "session": {
        "description": "A browser session from org.sparewall.Auth.Login. Requests with it must also carry the X-Sparewall-Request header.",
        "in": "cookie",
        "name": "sparewall_session",
        "type": "apiKey"
      },
      "token": {
        "description": "An API token (`sparewall token create`).",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The Sparewall coordinator's Varlink interfaces over HTTPS, as sparewall-httpd serves them. Each call is checked against the role of the caller's API token or session (x-sparewall-role).",
    "license": {
      "identifier": "GPL-3.0-only",
      "name": "GPL-3.0-only"
    },
    "title": "Sparewall",
    "version": "0.1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/call/org.sparewall.Auth.Bind": {
      "post": {
        "description": "Bind this connection to a token (an API token or a session's): later calls act with its role. Needed first on the restricted socket.",
        "operationId": "Auth.Bind",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "name": {
                      "description": "The token's name.",
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "name",
                    "role"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Bind this connection to a token (an API token or a session's): later calls act with its role.",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "none"
      }
    },
    "/call/org.sparewall.Auth.CreateToken": {
      "post": {
        "description": "Create an API token with `role`, expiring after `expires_days` if given. The token is shown once.",
        "operationId": "Auth.CreateToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "expires_days": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "role"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "info": {
                      "$ref": "#/components/schemas/org.sparewall.Auth.TokenInfo"
                    },
                    "token": {
                      "description": "Shown once; only its hash is kept.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "token",
                    "info"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Create an API token with `role`, expiring after `expires_days` if given.",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Auth.ListTokens": {
      "post": {
        "description": "API tokens (never their values).",
        "operationId": "Auth.ListTokens",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "tokens": {
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Auth.TokenInfo"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "tokens"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "API tokens (never their values).",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Auth.ListUsers": {
      "post": {
        "description": "Users and their roles, `admin` first.",
        "operationId": "Auth.ListUsers",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "users": {
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Auth.UserInfo"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "users"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Users and their roles, `admin` first.",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Auth.Login": {
      "post": {
        "description": "Check a user's password and open a session of 12 hours; the connection is bound to it. Failed logins are rate-limited per user.",
        "operationId": "Auth.Login",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "password": {
                    "type": "string"
                  },
                  "user": {
                    "type": "string"
                  }
                },
                "required": [
                  "user",
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "expires": {
                      "description": "Unix time the session ends.",
                      "format": "int64",
                      "type": "integer"
                    },
                    "role": {
                      "type": "string"
                    },
                    "token": {
                      "description": "The session token, shown once.",
                      "type": "string"
                    },
                    "user": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "token",
                    "user",
                    "role",
                    "expires"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Check a user's password and open a session of 12 hours; the connection is bound to it.",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "none"
      }
    },
    "/call/org.sparewall.Auth.Logout": {
      "post": {
        "description": "End the session this connection is bound to.",
        "operationId": "Auth.Logout",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "End the session this connection is bound to.",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "monitor"
      }
    },
    "/call/org.sparewall.Auth.RemoveUser": {
      "post": {
        "description": "Remove a user and end its sessions.",
        "operationId": "Auth.RemoveUser",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Remove a user and end its sessions.",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Auth.RevokeToken": {
      "post": {
        "description": "Revoke an API token at once.",
        "operationId": "Auth.RevokeToken",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Revoke an API token at once.",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Auth.SetUser": {
      "post": {
        "description": "Add a user, or change its role or password (a crypt(3) hash; `!` locks it, empty keeps it). Ends the user's sessions.",
        "operationId": "Auth.SetUser",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "password_hash": {
                    "type": "string"
                  },
                  "role": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "role",
                  "password_hash"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Add a user, or change its role or password (a crypt(3) hash; `!` locks it, empty keeps it).",
        "tags": [
          "org.sparewall.Auth"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Cluster.Failover": {
      "post": {
        "description": "Move a pair's gateway addresses to `to` (default: the node with the higher VRRP priority). Returns when the move is done, or why it did not happen.",
        "operationId": "Cluster.Failover",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "to": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "master": {
                      "description": "The node that holds the gateway addresses now.",
                      "type": "string"
                    },
                    "message": {
                      "description": "What happened, in words.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "master",
                    "message"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Move a pair's gateway addresses to `to` (default: the node with the higher VRRP priority).",
        "tags": [
          "org.sparewall.Cluster"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Diagnostics.Capture": {
      "post": {
        "description": "Capture packets on `network` as a pcap (#265), matching `filter` (pcap-filter syntax), for `seconds` (default 30, at most 300) or until `max_size` bytes (default 8 MiB, at most 32 MiB), whichever comes first. With `more`, the pcap's bytes as they come; without, all of it in one reply. One capture runs on a node at a time, and each is recorded in the journal.",
        "operationId": "Diagnostics.Capture",
        "parameters": [
          {
            "description": "Stream replies as an RFC 7464 JSON text sequence (application/json-seq) until the connection closes.",
            "in": "query",
            "name": "more",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "filter": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "max_size": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "network": {
                    "type": "string"
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "seconds": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "network"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "bytes": {
                      "description": "The capture's size so far, in bytes.",
                      "format": "int64",
                      "type": "integer"
                    },
                    "data": {
                      "description": "The next of the pcap's bytes, in base64: empty in the last reply of a stream.",
                      "type": "string"
                    },
                    "end": {
                      "description": "Why it ended, in the last reply: `time` (its time limit), `size` (its size limit; the packet past it is left out) or `stopped` (tcpdump stopped, the interface gone, say).",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "packets": {
                      "description": "Packets captured so far.",
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "data",
                    "bytes",
                    "packets"
                  ],
                  "type": "object"
                }
              },
              "application/json-seq": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "bytes": {
                      "description": "The capture's size so far, in bytes.",
                      "format": "int64",
                      "type": "integer"
                    },
                    "data": {
                      "description": "The next of the pcap's bytes, in base64: empty in the last reply of a stream.",
                      "type": "string"
                    },
                    "end": {
                      "description": "Why it ended, in the last reply: `time` (its time limit), `size` (its size limit; the packet past it is left out) or `stopped` (tcpdump stopped, the interface gone, say).",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "packets": {
                      "description": "Packets captured so far.",
                      "format": "int64",
                      "type": "integer"
                    }
                  },
                  "required": [
                    "data",
                    "bytes",
                    "packets"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Capture packets on `network` as a pcap (#265), matching `filter` (pcap-filter syntax), for `seconds` (default 30, at most 300) or until `max_size` bytes (default 8 MiB, at most 32 MiB), whichever comes first.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Diagnostics.FollowHits": {
      "post": {
        "description": "New hits as they are logged, filtered as `Hits` is, until the caller goes.",
        "operationId": "Diagnostics.FollowHits",
        "parameters": [
          {
            "description": "Stream replies as an RFC 7464 JSON text sequence (application/json-seq) until the connection closes.",
            "in": "query",
            "name": "more",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "address": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "pair": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "port": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "rule": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "hit": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/org.sparewall.Diagnostics.RuleHit"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Absent in the first reply, which says the follow has started."
                    }
                  },
                  "type": "object"
                }
              },
              "application/json-seq": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "hit": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/org.sparewall.Diagnostics.RuleHit"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Absent in the first reply, which says the follow has started."
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "New hits as they are logged, filtered as `Hits` is, until the caller goes.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Diagnostics.FollowLogs": {
      "post": {
        "description": "New entries of Sparewall's units as they are logged, filtered as `Logs` is, until the caller goes.",
        "operationId": "Diagnostics.FollowLogs",
        "parameters": [
          {
            "description": "Stream replies as an RFC 7464 JSON text sequence (application/json-seq) until the connection closes.",
            "in": "query",
            "name": "more",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "grep": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "priority": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "units": {
                    "items": {
                      "type": "string"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "entry": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/org.sparewall.Diagnostics.LogEntry"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Absent in the first reply, which says the follow has started."
                    }
                  },
                  "type": "object"
                }
              },
              "application/json-seq": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "entry": {
                      "anyOf": [
                        {
                          "$ref": "#/components/schemas/org.sparewall.Diagnostics.LogEntry"
                        },
                        {
                          "type": "null"
                        }
                      ],
                      "description": "Absent in the first reply, which says the follow has started."
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "New entries of Sparewall's units as they are logged, filtered as `Logs` is, until the caller goes.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Diagnostics.Hits": {
      "post": {
        "description": "Hits of rules, policy defaults and forwards with `log: true`, newest first: `rule` exactly (`users->self:ssh`, `guests->users:default`, `forward:web`), a zone `pair`, an `address` or prefix at either end, a `port` at either end. `before`, a reply's `older` as it is, pages back.",
        "operationId": "Diagnostics.Hits",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "address": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "before": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "pair": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "port": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "rule": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "since": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "until": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "hits": {
                      "description": "Newest first.",
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Diagnostics.RuleHit"
                      },
                      "type": "array"
                    },
                    "older": {
                      "description": "Pass as `before`, as it is, for older hits; absent when there are none.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "hits"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Hits of rules, policy defaults and forwards with `log: true`, newest first: `rule` exactly (`users->self:ssh`, `guests->users:default`, `forward:web`), a zone `pair`, an `address` or prefix at either end, a `port` at either end.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Diagnostics.Logs": {
      "post": {
        "description": "Entries of Sparewall's units (and `selinux`, the denials of the coordinator's domain), newest first. `before`, a reply's `older` as it is, pages back; `priority` keeps that one and worse; `grep` matches the message's text, in any case.",
        "operationId": "Diagnostics.Logs",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "before": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "grep": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "priority": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "since": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "units": {
                    "items": {
                      "type": "string"
                    },
                    "type": [
                      "array",
                      "null"
                    ]
                  },
                  "until": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "entries": {
                      "description": "Newest first.",
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Diagnostics.LogEntry"
                      },
                      "type": "array"
                    },
                    "older": {
                      "description": "Pass as `before`, as it is, for older entries; absent when there are none.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "units": {
                      "description": "The units one may ask for, `selinux` included.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "entries",
                    "units"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Entries of Sparewall's units (and `selinux`, the denials of the coordinator's domain), newest first.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Diagnostics.Lookup": {
      "post": {
        "description": "Look `name` up from the node: a `record` type (default A; an address in reverse), through `server` or the node's own resolver.",
        "operationId": "Diagnostics.Lookup",
        "parameters": [
          {
            "description": "Stream replies as an RFC 7464 JSON text sequence (application/json-seq) until the connection closes.",
            "in": "query",
            "name": "more",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "record": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "server": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "exit": {
                      "description": "The tool's exit status, in the last reply.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "lines": {
                      "description": "Lines of output: one each as they come when streamed, all at once otherwise.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "lines"
                  ],
                  "type": "object"
                }
              },
              "application/json-seq": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "exit": {
                      "description": "The tool's exit status, in the last reply.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "lines": {
                      "description": "Lines of output: one each as they come when streamed, all at once otherwise.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "lines"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Look `name` up from the node: a `record` type (default A; an address in reverse), through `server` or the node's own resolver.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Diagnostics.Neighbours": {
      "post": {
        "description": "The neighbour table (ARP and NDP), of one network or all, each entry with the network its interface carries.",
        "operationId": "Diagnostics.Neighbours",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "network": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "cut": {
                      "description": "More than a reply holds: the rest were left out.",
                      "type": "boolean"
                    },
                    "neighbours": {
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Diagnostics.Neighbour"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "neighbours",
                    "cut"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "The neighbour table (ARP and NDP), of one network or all, each entry with the network its interface carries.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Diagnostics.Ping": {
      "post": {
        "description": "Ping `host` from the node: from its own address on `network` if named, `count` times (default 4, at most 10). With `more`, each line as it comes, then the exit status.",
        "operationId": "Diagnostics.Ping",
        "parameters": [
          {
            "description": "Stream replies as an RFC 7464 JSON text sequence (application/json-seq) until the connection closes.",
            "in": "query",
            "name": "more",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "count": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "host": {
                    "type": "string"
                  },
                  "network": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "host"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "exit": {
                      "description": "The tool's exit status, in the last reply.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "lines": {
                      "description": "Lines of output: one each as they come when streamed, all at once otherwise.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "lines"
                  ],
                  "type": "object"
                }
              },
              "application/json-seq": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "exit": {
                      "description": "The tool's exit status, in the last reply.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "lines": {
                      "description": "Lines of output: one each as they come when streamed, all at once otherwise.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "lines"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Ping `host` from the node: from its own address on `network` if named, `count` times (default 4, at most 10).",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Diagnostics.Routes": {
      "post": {
        "description": "Routes from every table but the local one, of one network or all, of one family (`4`, `6`) or both, each with the network its interface carries.",
        "operationId": "Diagnostics.Routes",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "family": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "network": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "cut": {
                      "description": "More than a reply holds: the rest were left out.",
                      "type": "boolean"
                    },
                    "routes": {
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Diagnostics.Route"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "routes",
                    "cut"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Routes from every table but the local one, of one network or all, of one family (`4`, `6`) or both, each with the network its interface carries.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Diagnostics.Traceroute": {
      "post": {
        "description": "Trace the route to `host` from the node, from its own address on `network` if named: numeric, one probe a hop, at most 20 hops.",
        "operationId": "Diagnostics.Traceroute",
        "parameters": [
          {
            "description": "Stream replies as an RFC 7464 JSON text sequence (application/json-seq) until the connection closes.",
            "in": "query",
            "name": "more",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "host": {
                    "type": "string"
                  },
                  "network": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "node": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "host"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "exit": {
                      "description": "The tool's exit status, in the last reply.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "lines": {
                      "description": "Lines of output: one each as they come when streamed, all at once otherwise.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "lines"
                  ],
                  "type": "object"
                }
              },
              "application/json-seq": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "exit": {
                      "description": "The tool's exit status, in the last reply.",
                      "format": "int64",
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "lines": {
                      "description": "Lines of output: one each as they come when streamed, all at once otherwise.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "lines"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Trace the route to `host` from the node, from its own address on `network` if named: numeric, one probe a hop, at most 20 hops.",
        "tags": [
          "org.sparewall.Diagnostics"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Firewall.AckHealth": {
      "post": {
        "description": "Acknowledge a check that stays degraded until someone has seen it (`selinux`).",
        "operationId": "Firewall.AckHealth",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Acknowledge a check that stays degraded until someone has seen it (`selinux`).",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Firewall.Apply": {
      "post": {
        "description": "Replace the configuration with `config`. `base` is the generation it was derived from: Conflict if another change landed meanwhile. With `confirm_seconds`, the change reverts unless confirmed (`Confirm`) in time. `dry_run` validates, renders and checks it without running it. In a pair the peer must be reachable, or `allow_diverge` set.",
        "operationId": "Firewall.Apply",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "allow_diverge": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "base": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "config": {
                    "$ref": "#/components/schemas/Document"
                  },
                  "confirm_seconds": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "dry_run": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "required": [
                  "config",
                  "base"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "changed": {
                      "description": "Subsystems whose configuration changed.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "confirm_seconds": {
                      "description": "Seconds until an unconfirmed generation reverts (0 if confirmed).",
                      "format": "int64",
                      "type": "integer"
                    },
                    "diff": {
                      "description": "One line per changed document path.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "generation": {
                      "$ref": "#/components/schemas/org.sparewall.Firewall.Generation"
                    },
                    "unchanged": {
                      "description": "The document was identical to the active one.",
                      "type": "boolean"
                    },
                    "warnings": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "generation",
                    "changed",
                    "diff",
                    "warnings",
                    "unchanged",
                    "confirm_seconds"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Replace the configuration with `config`.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Firewall.Backup": {
      "post": {
        "description": "Write a backup bundle now, and send it to `backup.repository` if one is set.",
        "operationId": "Firewall.Backup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "digest": {
                      "type": "string"
                    },
                    "path": {
                      "type": "string"
                    },
                    "secrets": {
                      "description": "Cluster secrets sealed in the bundle (none without a backup password).",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "snapshot": {
                      "description": "The restic snapshot, when sent to `backup.repository`.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "path",
                    "digest",
                    "secrets"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Write a backup bundle now, and send it to `backup.repository` if one is set.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Firewall.Confirm": {
      "post": {
        "description": "Keep generation `id`, which waits for confirmation.",
        "operationId": "Firewall.Confirm",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "format": "int64",
                    "type": "integer"
                  }
                },
                "required": [
                  "id"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Keep generation `id`, which waits for confirmation.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Firewall.Export": {
      "post": {
        "description": "A generation's document alone (default: the active one).",
        "operationId": "Firewall.Export",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "config": {
                      "$ref": "#/components/schemas/Document"
                    }
                  },
                  "required": [
                    "config"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "A generation's document alone (default: the active one).",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Firewall.GetConfig": {
      "post": {
        "description": "A generation's document and record (default: the active one).",
        "operationId": "Firewall.GetConfig",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "config": {
                      "$ref": "#/components/schemas/Document"
                    },
                    "generation": {
                      "$ref": "#/components/schemas/org.sparewall.Firewall.Generation"
                    }
                  },
                  "required": [
                    "config",
                    "generation"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "A generation's document and record (default: the active one).",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Firewall.Health": {
      "post": {
        "description": "This node's health level and VRRP role; with `verbose`, each check.",
        "operationId": "Firewall.Health",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "verbose": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "checks": {
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Firewall.HealthCheck"
                      },
                      "type": [
                        "array",
                        "null"
                      ]
                    },
                    "level": {
                      "description": "`ok`, `degraded` or `failed`.",
                      "type": "string"
                    },
                    "role": {
                      "description": "`standalone`, `bootstrap`, `MASTER` or `BACKUP`.",
                      "type": "string"
                    }
                  },
                  "required": [
                    "level",
                    "role"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "This node's health level and VRRP role; with `verbose`, each check.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "monitor"
      }
    },
    "/call/org.sparewall.Firewall.History": {
      "post": {
        "description": "Generations, newest first, up to `limit`.",
        "operationId": "Firewall.History",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "limit": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "generations": {
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Firewall.Generation"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "generations"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Generations, newest first, up to `limit`.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Firewall.Merge": {
      "post": {
        "description": "Change the configuration with a JSON merge patch (RFC 7396) on generation `base`, as `Apply` does.",
        "operationId": "Firewall.Merge",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "allow_diverge": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "base": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "confirm_seconds": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "dry_run": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "patch": {
                    "type": "object"
                  }
                },
                "required": [
                  "patch",
                  "base"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "changed": {
                      "description": "Subsystems whose configuration changed.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "confirm_seconds": {
                      "description": "Seconds until an unconfirmed generation reverts (0 if confirmed).",
                      "format": "int64",
                      "type": "integer"
                    },
                    "diff": {
                      "description": "One line per changed document path.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "generation": {
                      "$ref": "#/components/schemas/org.sparewall.Firewall.Generation"
                    },
                    "unchanged": {
                      "description": "The document was identical to the active one.",
                      "type": "boolean"
                    },
                    "warnings": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "generation",
                    "changed",
                    "diff",
                    "warnings",
                    "unchanged",
                    "confirm_seconds"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Change the configuration with a JSON merge patch (RFC 7396) on generation `base`, as `Apply` does.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Firewall.Patch": {
      "post": {
        "description": "Change the configuration with a JSON patch (RFC 6902) on generation `base`, as `Apply` does.",
        "operationId": "Firewall.Patch",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "allow_diverge": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "base": {
                    "format": "int64",
                    "type": "integer"
                  },
                  "confirm_seconds": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "dry_run": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "ops": {
                    "type": "object"
                  }
                },
                "required": [
                  "ops",
                  "base"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "changed": {
                      "description": "Subsystems whose configuration changed.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "confirm_seconds": {
                      "description": "Seconds until an unconfirmed generation reverts (0 if confirmed).",
                      "format": "int64",
                      "type": "integer"
                    },
                    "diff": {
                      "description": "One line per changed document path.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "generation": {
                      "$ref": "#/components/schemas/org.sparewall.Firewall.Generation"
                    },
                    "unchanged": {
                      "description": "The document was identical to the active one.",
                      "type": "boolean"
                    },
                    "warnings": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "generation",
                    "changed",
                    "diff",
                    "warnings",
                    "unchanged",
                    "confirm_seconds"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Change the configuration with a JSON patch (RFC 6902) on generation `base`, as `Apply` does.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Firewall.Rollback": {
      "post": {
        "description": "Return to generation `id` (default: the one before the active one) as a new generation; an unconfirmed change is discarded instead.",
        "operationId": "Firewall.Rollback",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "allow_diverge": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "id": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "generation": {
                      "$ref": "#/components/schemas/org.sparewall.Firewall.Generation"
                    }
                  },
                  "required": [
                    "generation"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Return to generation `id` (default: the one before the active one) as a new generation; an unconfirmed change is discarded instead.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Firewall.Status": {
      "post": {
        "description": "The node's state: generations and hashes, pair sync, links, VRRP, connection tracking, the certificate it serves, and health.",
        "operationId": "Firewall.Status",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "conntrack": {
                      "type": "object"
                    },
                    "health": {
                      "type": "object"
                    },
                    "ipv6": {
                      "description": "Each network with IPv6 (#216), by name: `iface`, `mode`, the interface's global `addresses`, the prefixes `delegated` to it by DHCPv6 and its `default_gateway`; an inside network also its advertised `prefixes`. Lifetimes are seconds left. Absent when no network has IPv6, and from nodes older than 0.6.0.",
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "links": {
                      "type": "object"
                    },
                    "node": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "services": {
                      "type": "object"
                    },
                    "sync": {
                      "description": "Active generation, pending confirmation, hashes.",
                      "type": "object"
                    },
                    "tls": {
                      "description": "The certificate served on the management network.",
                      "type": "object"
                    },
                    "update": {
                      "description": "The background update check (#188): whether it is on, the image it checks, what that offers (`none`, `newer`, `rebuild`, `different`), its version and digest, when it last ran and succeeded, and its last error. Absent from nodes older than 0.4.0.",
                      "type": [
                        "object",
                        "null"
                      ]
                    },
                    "vrrp": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "node",
                    "role",
                    "sync",
                    "links",
                    "vrrp",
                    "conntrack",
                    "services",
                    "tls",
                    "health"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "The node's state: generations and hashes, pair sync, links, VRRP, connection tracking, the certificate it serves, and health.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Firewall.Subscribe": {
      "post": {
        "description": "Events as they happen: applied and rolled-back generations, peer and health changes, upgrade steps. The first reply confirms the subscription.",
        "operationId": "Firewall.Subscribe",
        "parameters": [
          {
            "description": "Stream replies as an RFC 7464 JSON text sequence (application/json-seq) until the connection closes.",
            "in": "query",
            "name": "more",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "event": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "event"
                  ],
                  "type": "object"
                }
              },
              "application/json-seq": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "event": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "event"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Events as they happen: applied and rolled-back generations, peer and health changes, upgrade steps.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Firewall.Sync": {
      "post": {
        "description": "In a pair, make both nodes run the configuration of `from_node`: this node (push it to the peer) or the peer (take the peer's).",
        "operationId": "Firewall.Sync",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "from_node": {
                    "type": "string"
                  }
                },
                "required": [
                  "from_node"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "generation": {
                      "$ref": "#/components/schemas/org.sparewall.Firewall.Generation"
                    }
                  },
                  "required": [
                    "generation"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "In a pair, make both nodes run the configuration of `from_node`: this node (push it to the peer) or the peer (take the peer's).",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "operator"
      }
    },
    "/call/org.sparewall.Firewall.Validate": {
      "post": {
        "description": "Check a document without applying it: errors (as ValidationFailed, each naming its path) or warnings.",
        "operationId": "Firewall.Validate",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "config": {
                    "type": "object"
                  }
                },
                "required": [
                  "config"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "warnings": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "warnings"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Check a document without applying it: errors (as ValidationFailed, each naming its path) or warnings.",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Firewall.VpnClientConfig": {
      "post": {
        "description": "A WireGuard client configuration for remote-access peer `peer` (on `port`, one of the instance's ports, if given).",
        "operationId": "Firewall.VpnClientConfig",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "instance": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "peer": {
                    "type": "string"
                  },
                  "port": {
                    "format": "int64",
                    "type": [
                      "integer",
                      "null"
                    ]
                  }
                },
                "required": [
                  "peer"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "config": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "config"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "A WireGuard client configuration for remote-access peer `peer` (on `port`, one of the instance's ports, if given).",
        "tags": [
          "org.sparewall.Firewall"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Metrics.Query": {
      "post": {
        "description": "Evaluate a PromQL expression at `time` (RFC 3339 or Unix seconds; default now) over this node's history, kept with `metrics.mode: local`.",
        "operationId": "Metrics.Query",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "query": {
                    "type": "string"
                  },
                  "time": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "query"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "result": {
                      "description": "Prometheus's `data.result`. A vector is `[{metric, value: [time, \"value\"]}]`, a matrix `[{metric, values: [[time, \"value\"], ...]}]`, a scalar or a string `[time, \"value\"]`.",
                      "type": "object"
                    },
                    "result_type": {
                      "description": "`vector`, `matrix`, `scalar` or `string`.",
                      "type": "string"
                    },
                    "warnings": {
                      "description": "What Prometheus noted about the query (its warnings and infos).",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "result_type",
                    "result",
                    "warnings"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Evaluate a PromQL expression at `time` (RFC 3339 or Unix seconds; default now) over this node's history, kept with `metrics.mode: local`.",
        "tags": [
          "org.sparewall.Metrics"
        ],
        "x-sparewall-role": "monitor"
      }
    },
    "/call/org.sparewall.Metrics.QueryRange": {
      "post": {
        "description": "Evaluate a PromQL expression from `start` to `end` (RFC 3339 or Unix seconds), every `step` (a duration such as `1m`, or seconds), over this node's history.",
        "operationId": "Metrics.QueryRange",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "end": {
                    "type": "string"
                  },
                  "query": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string"
                  },
                  "step": {
                    "type": "string"
                  }
                },
                "required": [
                  "query",
                  "start",
                  "end",
                  "step"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "result": {
                      "description": "Prometheus's `data.result`. A vector is `[{metric, value: [time, \"value\"]}]`, a matrix `[{metric, values: [[time, \"value\"], ...]}]`, a scalar or a string `[time, \"value\"]`.",
                      "type": "object"
                    },
                    "result_type": {
                      "description": "`vector`, `matrix`, `scalar` or `string`.",
                      "type": "string"
                    },
                    "warnings": {
                      "description": "What Prometheus noted about the query (its warnings and infos).",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "result_type",
                    "result",
                    "warnings"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Evaluate a PromQL expression from `start` to `end` (RFC 3339 or Unix seconds), every `step` (a duration such as `1m`, or seconds), over this node's history.",
        "tags": [
          "org.sparewall.Metrics"
        ],
        "x-sparewall-role": "monitor"
      }
    },
    "/call/org.sparewall.Secrets.CheckBackupPassword": {
      "post": {
        "description": "Whether `password` is the stored backup password, and whether it opens the newest bundle on the node (#142). Nothing derived from the stored secret is returned; a wrong one is answered slowly.",
        "operationId": "Secrets.CheckBackupPassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "password": {
                    "type": "string"
                  }
                },
                "required": [
                  "password"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "bundle": {
                      "description": "The newest bundle on the node, if there is one.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "matches_stored": {
                      "description": "Whether it is the stored `backup-password`.",
                      "type": "boolean"
                    },
                    "notes": {
                      "description": "Why a check could not be made (no stored password, no bundle).",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "opens_bundle": {
                      "description": "Whether it opens that bundle's sealed secrets (which may predate a change of the password); absent without a bundle with secrets.",
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "secrets": {
                      "description": "The secrets it opens there.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "matches_stored",
                    "secrets",
                    "notes"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Whether `password` is the stored backup password, and whether it opens the newest bundle on the node (#142).",
        "tags": [
          "org.sparewall.Secrets"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Secrets.Delete": {
      "post": {
        "description": "Delete a secret on this node.",
        "operationId": "Secrets.Delete",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {},
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Delete a secret on this node.",
        "tags": [
          "org.sparewall.Secrets"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Secrets.List": {
      "post": {
        "description": "Secrets' names, classes and versions, never their values.",
        "operationId": "Secrets.List",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {},
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "secrets": {
                      "items": {
                        "$ref": "#/components/schemas/org.sparewall.Secrets.SecretInfo"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "secrets"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Secrets' names, classes and versions, never their values.",
        "tags": [
          "org.sparewall.Secrets"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Secrets.Set": {
      "post": {
        "description": "Store a secret (a cluster secret unless `cluster` is false). Values can never be read back.",
        "operationId": "Secrets.Set",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "cluster": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "value"
                ],
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "secret": {
                      "$ref": "#/components/schemas/org.sparewall.Secrets.SecretInfo"
                    }
                  },
                  "required": [
                    "secret"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Store a secret (a cluster secret unless `cluster` is false).",
        "tags": [
          "org.sparewall.Secrets"
        ],
        "x-sparewall-role": "admin"
      }
    },
    "/call/org.sparewall.Upgrade.Check": {
      "post": {
        "description": "Whether a newer image is available on the channel (or `image`, a full reference).",
        "operationId": "Upgrade.Check",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "channel": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "image": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "available": {
                      "type": "boolean"
                    },
                    "booted": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "next_window": {
                      "description": "When the next maintenance window opens (RFC 3339, UTC), with `updates.mode: windowed` (#84). Absent otherwise, and from nodes older than 0.4.0.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "note": {
                      "description": "Why the target is or is not offered, when it is not plainly newer: older than this node, the same version, or no version to compare.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "running": {
                      "description": "This node's Sparewall version.",
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "target": {
                      "type": "string"
                    },
                    "version": {
                      "description": "The target's Sparewall version, if its image says.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "target",
                    "available"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Whether a newer image is available on the channel (or `image`, a full reference).",
        "tags": [
          "org.sparewall.Upgrade"
        ],
        "x-sparewall-role": "viewer"
      }
    },
    "/call/org.sparewall.Upgrade.Start": {
      "post": {
        "description": "Start a rolling, health-gated upgrade; progress arrives as events (`Subscribe`).",
        "operationId": "Upgrade.Start",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "allow_downgrade": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  },
                  "channel": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "image": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "type": "object"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "plan": {
                      "description": "What happens next, in words.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "plan"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "The reply."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "summary": "Start a rolling, health-gated upgrade; progress arrives as events (`Subscribe`).",
        "tags": [
          "org.sparewall.Upgrade"
        ],
        "x-sparewall-role": "admin"
      }
    }
  },
  "security": [
    {
      "token": []
    },
    {
      "session": []
    }
  ],
  "tags": [
    {
      "name": "org.sparewall.Firewall"
    },
    {
      "name": "org.sparewall.Secrets"
    },
    {
      "name": "org.sparewall.Upgrade"
    },
    {
      "name": "org.sparewall.Cluster"
    },
    {
      "name": "org.sparewall.Auth"
    },
    {
      "name": "org.sparewall.Metrics"
    },
    {
      "name": "org.sparewall.Diagnostics"
    }
  ]
}
