{
  "components": {
    "schemas": {
      "Applied": {
        "description": "What rookery recorded on a host when it applied the configuration: its own\nversion, the plugins whose features the host has, and the provisioners\nthose features offer.",
        "properties": {
          "offers": {
            "items": {
              "$ref": "#/components/schemas/Offer"
            },
            "type": "array"
          },
          "plugins": {
            "items": {
              "$ref": "#/components/schemas/AppliedPlugin"
            },
            "type": "array"
          },
          "rookery": {
            "type": "string"
          },
          "tailnet": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/TailnetDevice",
                "description": "The host's device on the tailnet, as its Tailscale client saw it at\nthe end of the apply, when it is on one."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "rookery"
        ],
        "type": "object"
      },
      "AppliedPlugin": {
        "description": "A plugin as it was when a host's configuration was applied.",
        "properties": {
          "digest": {
            "description": "SHA-256 of its files, so a change without a new version shows too.",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "package": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "package",
          "version",
          "digest"
        ],
        "type": "object"
      },
      "Argument": {
        "properties": {
          "choices": {
            "description": "A command whose lines are the values to offer.",
            "type": "string"
          },
          "confirm": {
            "description": "For a yes or no: the question to answer yes to before the action\nruns with it on, instead of the action's own.",
            "type": "string"
          },
          "default": {
            "type": "string"
          },
          "fixed": {
            "description": "Why it keeps its default here and cannot be given another value,\nsuch as destroying a machine no provisioner made. The screens show\nit greyed and say this instead of changing it. Empty when it can be\nchanged.",
            "type": "string"
          },
          "help": {
            "description": "What it is for, in a sentence or two, beside its short label.",
            "type": "string"
          },
          "kind": {
            "description": "`resource` for an argument of a provisioner that sizes the machine:\nits CPUs, memory or disk. `text` for one whose value has several\nlines. `boolean` for a yes or no, which the screens show as a switch.\nEmpty for any other argument.",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "secret": {
            "description": "What is given is a secret, such as a password: it is not shown as it\nis typed, nor kept, nor written to a job's output.",
            "type": "boolean"
          },
          "values": {
            "description": "The values a provisioner's argument takes, when it is a choice of a\nfew. Empty for one that takes any text.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "CallFrame": {
        "description": "rookeryd to the serving program.",
        "properties": {
          "body": {},
          "from": {
            "$ref": "#/components/schemas/From"
          },
          "id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "method": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "method",
          "body",
          "from"
        ],
        "type": "object"
      },
      "Choices": {
        "properties": {
          "choices": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "choices"
        ],
        "type": "object"
      },
      "CommandLine": {
        "description": "A list of arguments, or one string for `sh -c`.",
        "oneOf": [
          {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          {
            "type": "string"
          }
        ]
      },
      "Config": {
        "description": "`/etc/rookery/rookeryd.json`.",
        "properties": {
          "agent": {
            "default": "agent",
            "description": "The agent account.",
            "type": "string"
          },
          "agent_env": {
            "default": "/usr/local/bin/agent-env",
            "description": "A wrapper that gives the agent its environment.",
            "type": "string"
          },
          "operator": {
            "default": "",
            "description": "The SSH user.",
            "type": "string"
          },
          "roots": {
            "default": [],
            "description": "Folders the file calls may touch.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "simulated": {
            "default": false,
            "description": "Whether the host is simulated: in single-user mode its commands then\nrun through `agent_env` too, and its version says so.",
            "type": "boolean"
          },
          "systemd": {
            "default": null,
            "description": "Whether the calls that need systemd work. Off in single-user mode\nunless set.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "units": {
            "default": [],
            "description": "Units whose state the stats report.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Done": {
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "type": "object"
      },
      "ErrorBody": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "ErrorDetail": {
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "message"
        ],
        "type": "object"
      },
      "FileEntry": {
        "properties": {
          "kind": {
            "description": "`file`, `dir`, `link` or `other`.",
            "type": "string"
          },
          "modified": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "size": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "kind",
          "size",
          "modified"
        ],
        "type": "object"
      },
      "Filesystem": {
        "properties": {
          "available": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "device": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "mount": {
            "type": "string"
          },
          "total": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "used": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "mount",
          "device",
          "kind",
          "total",
          "used",
          "available"
        ],
        "type": "object"
      },
      "From": {
        "description": "Who did something, as rookeryd saw it.",
        "properties": {
          "level": {
            "$ref": "#/components/schemas/Level"
          },
          "session": {
            "type": [
              "string",
              "null"
            ]
          },
          "uid": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "level",
          "uid"
        ],
        "type": "object"
      },
      "Gpu": {
        "properties": {
          "memory_total": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "memory_used": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "utilization": {
            "description": "Percent.",
            "format": "double",
            "type": "number"
          }
        },
        "required": [
          "name",
          "utilization",
          "memory_used",
          "memory_total"
        ],
        "type": "object"
      },
      "HostAction": {
        "description": "An action of the host's controller: an entry of `/etc/rookery/actions.json`.\nListed without `run`.",
        "properties": {
          "agent": {
            "description": "The agent may run it.",
            "type": "boolean"
          },
          "arguments": {
            "items": {
              "$ref": "#/components/schemas/Argument"
            },
            "type": "array"
          },
          "confirm": {
            "type": [
              "string",
              "null"
            ]
          },
          "extends": {
            "description": "Actions it is a step of; it then has no row of its own.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "group": {
            "type": "string"
          },
          "help": {
            "type": "string"
          },
          "input": {
            "description": "What the workstation sends on standard input: `secrets`.",
            "type": [
              "string",
              "null"
            ]
          },
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "run": {
            "type": "string"
          },
          "terminal": {
            "type": "boolean"
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "HostType": {
        "description": "What rookery does with a host: what its profile means it to be, or what it\nwas seen to be. They are in the order of how much of rookery each has.",
        "enum": [
          "ssh",
          "managed",
          "node",
          "workstation"
        ],
        "type": "string"
      },
      "Input": {
        "properties": {
          "data_b64": {
            "type": [
              "string",
              "null"
            ]
          },
          "eof": {
            "description": "Close a process's standard input.",
            "type": "boolean"
          },
          "text": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Interface": {
        "properties": {
          "name": {
            "type": "string"
          },
          "rx_bytes": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "tx_bytes": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "name",
          "rx_bytes",
          "tx_bytes"
        ],
        "type": "object"
      },
      "Keep": {
        "enum": [
          "none",
          "last",
          "log"
        ],
        "type": "string"
      },
      "KeptProfile": {
        "description": "The profile a host keeps of itself, at `/etc/rookery/profile.json`: the\nprofile as rookery holds it, without the enrollment key and without its\n`access`, how the rookery that wrote it reaches the host. A rookery that does\nnot have the host can take it over from this.",
        "properties": {
          "format": {
            "description": "The format of this document.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "host": {
            "description": "The name the host has in the rookery that wrote it.",
            "type": "string"
          },
          "instance": {
            "description": "The same in a document of format 1."
          },
          "machine": {
            "description": "The record of the machine rookery created for the host, as a resource,\nwhen it did."
          },
          "profile": {
            "description": "The profile."
          },
          "rookery": {
            "description": "The version of the rookery that wrote it.",
            "type": "string"
          },
          "written": {
            "description": "When it was written, in RFC 3339.",
            "type": "string"
          }
        },
        "required": [
          "format",
          "rookery",
          "host",
          "profile"
        ],
        "type": "object"
      },
      "Level": {
        "enum": [
          "host",
          "agent"
        ],
        "type": "string"
      },
      "Listing": {
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/FileEntry"
            },
            "type": "array"
          },
          "path": {
            "type": "string"
          }
        },
        "required": [
          "path",
          "entries"
        ],
        "type": "object"
      },
      "LogEntry": {
        "properties": {
          "cursor": {
            "description": "Give it back as `since` to go on from here.",
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "priority": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "time": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          }
        },
        "required": [
          "time",
          "unit",
          "priority",
          "message",
          "cursor"
        ],
        "type": "object"
      },
      "Memory": {
        "properties": {
          "available": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "total": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "used": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "total",
          "used",
          "available"
        ],
        "type": "object"
      },
      "Message": {
        "properties": {
          "body": {},
          "from": {
            "$ref": "#/components/schemas/From"
          },
          "id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "keep": {
            "$ref": "#/components/schemas/Keep"
          },
          "time": {
            "type": "string"
          },
          "topic": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "topic",
          "body",
          "keep",
          "from",
          "time"
        ],
        "type": "object"
      },
      "Messages": {
        "properties": {
          "messages": {
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "type": "array"
          },
          "next": {
            "description": "Pass as `since` for the rest, when there is more.",
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "messages"
        ],
        "type": "object"
      },
      "Method": {
        "properties": {
          "description": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "Offer": {
        "description": "Provisioners a feature of a host offers, as its tasks found them: rookery\nregisters each under a name of its own that names the host. The host\nserves this to anyone who may read it, so it holds public values only,\nsuch as a server's certificate, never a key.",
        "properties": {
          "aliases": {
            "additionalProperties": {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "description": "Other values of a setting that reach the same server, such as the\nname a rookery server on the host gives it: a provisioner registered by\nhand with one of them is named to its owner, who can make it the\nhost's.",
            "propertyNames": {
              "type": "string"
            },
            "type": "object"
          },
          "feature": {
            "description": "The feature, as `PLUGIN/FEATURE`.",
            "type": "string"
          },
          "fingerprint": {
            "description": "What the host says identifies the server, such as the fingerprint of\nits certificate, for the person who reads the report.",
            "type": "string"
          },
          "provisioners": {
            "description": "The plugin's provisioners it offers, by their ids in the plugin.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "secrets": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Values of the provisioners' secrets, such as the certificate of the\nserver to pin, kept as the provisioners' own.",
            "propertyNames": {
              "type": "string"
            },
            "type": "object"
          },
          "settings": {
            "additionalProperties": {
              "type": "string"
            },
            "description": "Values of the provisioners' own arguments. `{address}`, `{user}` and\n`{port}` stand for where rookery reaches the host and as whom.",
            "propertyNames": {
              "type": "string"
            },
            "type": "object"
          }
        },
        "required": [
          "feature",
          "provisioners"
        ],
        "type": "object"
      },
      "Output": {
        "properties": {
          "data_b64": {
            "type": "string"
          },
          "ended": {
            "description": "Nothing more will come.",
            "type": "boolean"
          },
          "first_offset": {
            "description": "Where what is still kept begins, when the start was dropped.",
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "lines": {
            "description": "The same as text, when read by lines.",
            "items": {
              "type": "string"
            },
            "type": [
              "array",
              "null"
            ]
          },
          "next_line": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "next_offset": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "offset": {
            "description": "The offset this answer starts at.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "data_b64",
          "offset",
          "next_offset",
          "next_line",
          "ended"
        ],
        "type": "object"
      },
      "Process": {
        "properties": {
          "command": {
            "type": "string"
          },
          "cpu_time": {
            "description": "Seconds of CPU used so far.",
            "format": "double",
            "type": "number"
          },
          "memory": {
            "description": "Resident memory in bytes.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "parent": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "pid": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "pid",
          "parent",
          "user",
          "command",
          "cpu_time",
          "memory"
        ],
        "type": "object"
      },
      "Publish": {
        "properties": {
          "body": {},
          "keep": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Keep"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object"
      },
      "PublishFrame": {
        "description": "What a client sends over the channel stream to publish.",
        "properties": {
          "body": {},
          "keep": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Keep"
              },
              {
                "type": "null"
              }
            ]
          },
          "topic": {
            "type": "string"
          }
        },
        "required": [
          "topic"
        ],
        "type": "object"
      },
      "ReplyFrame": {
        "description": "The serving program's answer.",
        "properties": {
          "error": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ErrorDetail"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "result": {}
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "Resize": {
        "properties": {
          "cols": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "rows": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "rows",
          "cols"
        ],
        "type": "object"
      },
      "RunAction": {
        "properties": {
          "arguments": {
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            },
            "type": "object"
          },
          "cols": {
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "input_b64": {
            "type": [
              "string",
              "null"
            ]
          },
          "rows": {
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "Screen": {
        "properties": {
          "cols": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "cursor_col": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "cursor_row": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "rows": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        },
        "required": [
          "rows",
          "cols",
          "text",
          "cursor_row",
          "cursor_col"
        ],
        "type": "object"
      },
      "Service": {
        "properties": {
          "agent": {
            "type": "boolean"
          },
          "declared": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "methods": {
            "items": {
              "$ref": "#/components/schemas/Method"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "uid": {
            "description": "Who serves it now.",
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "up": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "description",
          "agent",
          "methods",
          "declared",
          "up"
        ],
        "type": "object"
      },
      "ServiceSpec": {
        "description": "An entry of `/etc/rookery/services.json`.",
        "properties": {
          "agent": {
            "type": "boolean"
          },
          "description": {
            "type": "string"
          },
          "methods": {
            "items": {
              "$ref": "#/components/schemas/Method"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "run": {
            "type": "string"
          },
          "timeout": {
            "description": "Seconds a call may take.",
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "user": {
            "description": "`root` or `agent`.",
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "type": "object"
      },
      "Session": {
        "properties": {
          "action": {
            "description": "The action it was started for, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "cols": {
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "command": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ended": {
            "type": [
              "string",
              "null"
            ]
          },
          "exit_code": {
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/SessionKind"
          },
          "last_output": {
            "type": [
              "string",
              "null"
            ]
          },
          "lost": {
            "description": "It ended with rookeryd or the host, not by itself.",
            "type": "boolean"
          },
          "output_size": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "rows": {
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "started": {
            "type": "string"
          },
          "started_by": {
            "$ref": "#/components/schemas/From"
          },
          "steps": {
            "items": {
              "$ref": "#/components/schemas/Step"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          },
          "user": {
            "type": "string"
          },
          "viewers": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "id",
          "kind",
          "title",
          "command",
          "user",
          "started_by",
          "started"
        ],
        "type": "object"
      },
      "SessionKind": {
        "enum": [
          "process",
          "terminal"
        ],
        "type": "string"
      },
      "Signal": {
        "properties": {
          "signal": {
            "description": "`INT`, `TERM`, `HUP` or `KILL`.",
            "type": "string"
          }
        },
        "required": [
          "signal"
        ],
        "type": "object"
      },
      "StartSession": {
        "properties": {
          "cols": {
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "command": {
            "$ref": "#/components/schemas/CommandLine"
          },
          "cwd": {
            "type": [
              "string",
              "null"
            ]
          },
          "env": {
            "additionalProperties": {
              "type": "string"
            },
            "propertyNames": {
              "type": "string"
            },
            "type": "object"
          },
          "input": {
            "description": "Text for standard input; a process then sees the end of its input.",
            "type": [
              "string",
              "null"
            ]
          },
          "input_b64": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "$ref": "#/components/schemas/SessionKind"
          },
          "rows": {
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "timeout": {
            "description": "Seconds after which the command is ended.",
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "user": {
            "description": "`agent`, `operator` (the SSH user) or `root`.",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "command"
        ],
        "type": "object"
      },
      "Started": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Session"
          },
          {
            "properties": {
              "output_b64": {
                "description": "A terminal's bytes.",
                "type": [
                  "string",
                  "null"
                ]
              },
              "stderr_b64": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "stdout_b64": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "truncated": {
                "type": "boolean"
              }
            },
            "type": "object"
          }
        ],
        "description": "The answer to a start with `wait=`: the session and, when it has ended in\ntime, what it wrote."
      },
      "Stats": {
        "properties": {
          "cores": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "cpu": {
            "description": "Percent busy over 200 ms, all cores together.",
            "format": "double",
            "type": "number"
          },
          "filesystems": {
            "items": {
              "$ref": "#/components/schemas/Filesystem"
            },
            "type": "array"
          },
          "gpus": {
            "items": {
              "$ref": "#/components/schemas/Gpu"
            },
            "type": "array"
          },
          "hostname": {
            "type": "string"
          },
          "load": {
            "items": {
              "format": "double",
              "type": "number"
            },
            "type": "array"
          },
          "memory": {
            "$ref": "#/components/schemas/Memory"
          },
          "network": {
            "items": {
              "$ref": "#/components/schemas/Interface"
            },
            "type": "array"
          },
          "reboot_required": {
            "type": "boolean"
          },
          "sessions_running": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "swap": {
            "$ref": "#/components/schemas/Memory"
          },
          "units": {
            "items": {
              "$ref": "#/components/schemas/UnitState"
            },
            "type": "array"
          },
          "uptime": {
            "description": "Seconds.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "hostname",
          "load",
          "cpu",
          "cores",
          "memory",
          "swap",
          "filesystems",
          "network",
          "uptime",
          "reboot_required",
          "units",
          "sessions_running"
        ],
        "type": "object"
      },
      "Step": {
        "properties": {
          "exit_code": {
            "format": "int32",
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "name",
          "user"
        ],
        "type": "object"
      },
      "TailnetDevice": {
        "description": "A host's device on the tailnet, from `tailscale status --json`. It\nholds public values only, which the control server's API finds it by.",
        "properties": {
          "addresses": {
            "description": "Its addresses on the tailnet.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "dns_name": {
            "description": "Its MagicDNS name, such as `studio.example.ts.net`, without the final dot.",
            "type": "string"
          },
          "host_name": {
            "description": "The machine's own hostname, as the client reports it.",
            "type": "string"
          },
          "id": {
            "description": "The device's stable id: Tailscale's `nodeId`, or the number of\nHeadscale's node.",
            "type": "string"
          },
          "tailnet": {
            "description": "The tailnet's name, when the client knows it.",
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "type": "object"
      },
      "Topic": {
        "description": "An entry of `/etc/rookery/channels.json`.",
        "properties": {
          "days": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "keep": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Keep"
              },
              {
                "type": "null"
              }
            ]
          },
          "max": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "topic": {
            "type": "string"
          }
        },
        "required": [
          "topic"
        ],
        "type": "object"
      },
      "Unit": {
        "properties": {
          "active": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "load": {
            "type": "string"
          },
          "sub": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          }
        },
        "required": [
          "unit",
          "load",
          "active",
          "sub",
          "description"
        ],
        "type": "object"
      },
      "UnitState": {
        "properties": {
          "active": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          }
        },
        "required": [
          "unit",
          "active"
        ],
        "type": "object"
      },
      "Version": {
        "properties": {
          "api": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "applied": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Applied",
                "description": "What the host's configuration was last applied from, when rookery\nrecorded it."
              },
              {
                "type": "null"
              }
            ]
          },
          "mode": {
            "description": "`system` or `single`.",
            "type": "string"
          },
          "simulated": {
            "description": "Whether it is simulated, as `rookery serve --simulate` and its hosts\nare: nothing it does reaches a real machine.",
            "type": "boolean"
          },
          "type": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/HostType",
                "description": "What was installed on the host, by that record: `managed` when\nonly the controller was, `workstation` for a whole profile. Absent\nwhen the host keeps no record."
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "version",
          "api"
        ],
        "type": "object"
      }
    }
  },
  "info": {
    "description": "The API of a host's rookeryd, over its unix sockets. Streams are in the AsyncAPI document.",
    "license": {
      "name": "MIT"
    },
    "title": "rookeryd",
    "version": "0.6.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/actions": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_actions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/HostAction"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The actions the caller may run, in the order of the file.",
        "tags": [
          "actions"
        ]
      }
    },
    "/v1/actions/{action}": {
      "post": {
        "description": "Host and agent level.",
        "operationId": "post_v1_actions__action_",
        "parameters": [
          {
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A duration such as 30s, at most 10m: answer when the command has ended, with what it wrote.",
            "in": "query",
            "name": "wait",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RunAction"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Started"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Run an action. It and what extends it are the steps of one session.",
        "tags": [
          "actions"
        ]
      }
    },
    "/v1/actions/{action}/choices/{argument}": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_actions__action__choices__argument_",
        "parameters": [
          {
            "in": "path",
            "name": "action",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "argument",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Choices"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The values to offer for an argument.",
        "tags": [
          "actions"
        ]
      }
    },
    "/v1/applied/profile": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_applied_profile",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeptProfile"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The profile the host keeps of itself, as the last apply or the first boot wrote it.",
        "tags": [
          "applied"
        ]
      }
    },
    "/v1/channel": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_channel",
        "parameters": [
          {
            "description": "Only topics starting with this.",
            "in": "query",
            "name": "topic",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Messages after this id; default 0.",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Most messages; default 100, at most 1000.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "With a WebSocket handshake: the stream `channel` of the AsyncAPI document."
          },
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Messages"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Kept messages after `since`.",
        "tags": [
          "channel"
        ]
      }
    },
    "/v1/channel/{topic}": {
      "post": {
        "description": "Host and agent level.",
        "operationId": "post_v1_channel___topic_",
        "parameters": [
          {
            "in": "path",
            "name": "topic",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Publish"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Publish a message on a topic.",
        "tags": [
          "channel"
        ]
      }
    },
    "/v1/endpoints/{address}/{port}": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_endpoints__address___port_",
        "parameters": [
          {
            "in": "path",
            "name": "address",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "port",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "With a WebSocket handshake: the stream `endpoint` of the AsyncAPI document."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Only as a WebSocket, and only for rookery serve itself: a TCP connection to an address on a network of the host's own interfaces, such as a container on a bridge. Never loopback, link-local or a metadata address. One that nothing answers on is an error before the handshake.",
        "tags": [
          "endpoints"
        ]
      }
    },
    "/v1/files": {
      "delete": {
        "description": "Host level only.",
        "operationId": "delete_v1_files",
        "parameters": [
          {
            "description": "An absolute path under a root.",
            "in": "query",
            "name": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true for a folder with its contents.",
            "in": "query",
            "name": "recursive",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Remove a file or an empty folder; never a root itself.",
        "tags": [
          "files"
        ]
      },
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_files",
        "parameters": [
          {
            "description": "An absolute path under a root.",
            "in": "query",
            "name": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "A folder's entries (a Listing), or a file's content; Range is honoured. As the agent, under the configured roots.",
        "tags": [
          "files"
        ]
      },
      "put": {
        "description": "Host level only.",
        "operationId": "put_v1_files",
        "parameters": [
          {
            "description": "An absolute path under a root.",
            "in": "query",
            "name": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true to replace an existing file.",
            "in": "query",
            "name": "overwrite",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "format": "binary",
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Write one file, creating its folders.",
        "tags": [
          "files"
        ]
      }
    },
    "/v1/logs": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_logs",
        "parameters": [
          {
            "description": "Only this unit.",
            "in": "query",
            "name": "unit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A cursor from an earlier entry, or a time.",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Most entries; default 100.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "With a WebSocket handshake: the stream `logs` of the AsyncAPI document."
          },
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LogEntry"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Journal entries.",
        "tags": [
          "logs"
        ]
      }
    },
    "/v1/ports/{port}": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_ports__port_",
        "parameters": [
          {
            "in": "path",
            "name": "port",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "With a WebSocket handshake: the stream `port` of the AsyncAPI document."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Only as a WebSocket: a TCP connection to a port on the host's loopback. A port that nothing listens on is an error before the handshake.",
        "tags": [
          "ports"
        ]
      }
    },
    "/v1/power/{verb}": {
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_power__verb_",
        "parameters": [
          {
            "in": "path",
            "name": "verb",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true to do it although sessions run.",
            "in": "query",
            "name": "force",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Reboot the host or power it off. Refused while sessions run.",
        "tags": [
          "power"
        ]
      }
    },
    "/v1/processes": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_processes",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Process"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The processes, from /proc.",
        "tags": [
          "processes"
        ]
      }
    },
    "/v1/processes/{pid}/signal": {
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_processes__pid__signal",
        "parameters": [
          {
            "in": "path",
            "name": "pid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Signal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Send a signal to a process.",
        "tags": [
          "processes"
        ]
      }
    },
    "/v1/reload": {
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_reload",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Read the configuration files again. Sessions go on.",
        "tags": [
          "reload"
        ]
      }
    },
    "/v1/screenshot": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_screenshot",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "image/png": {
                "schema": {
                  "format": "binary",
                  "type": "string"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The shared desktop as PNG.",
        "tags": [
          "screenshot"
        ]
      }
    },
    "/v1/services": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_services",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Service"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The services that can be called, and whether each is up.",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{plugin}/{name}/serve": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_services__plugin___name__serve",
        "parameters": [
          {
            "in": "path",
            "name": "plugin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "With a WebSocket handshake: the stream `serve` of the AsyncAPI document."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Only as a WebSocket: for the program that answers the service's calls.",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/services/{plugin}/{name}/{method}": {
      "post": {
        "description": "Host and agent level.",
        "operationId": "post_v1_services__plugin___name___method_",
        "parameters": [
          {
            "in": "path",
            "name": "plugin",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "method",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {}
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {}
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Call a method of the service PLUGIN/NAME: JSON in, JSON out.",
        "tags": [
          "services"
        ]
      }
    },
    "/v1/sessions": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_sessions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Session"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "All sessions, running and ended.",
        "tags": [
          "sessions"
        ]
      },
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_sessions",
        "parameters": [
          {
            "description": "A duration such as 30s, at most 10m: answer when the command has ended, with what it wrote.",
            "in": "query",
            "name": "wait",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartSession"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Started"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Start a session.",
        "tags": [
          "sessions"
        ]
      }
    },
    "/v1/sessions/{id}": {
      "delete": {
        "description": "Host level only.",
        "operationId": "delete_v1_sessions__id_",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "End it if it runs (HUP, after five seconds KILL) and forget it with its transcript.",
        "tags": [
          "sessions"
        ]
      },
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_sessions__id_",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "101": {
            "description": "With a WebSocket handshake: the stream `session` of the AsyncAPI document."
          },
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "One session's state. The agent sees those it started through an action.",
        "tags": [
          "sessions"
        ]
      }
    },
    "/v1/sessions/{id}/input": {
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_sessions__id__input",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Input"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Write to standard input or type into the terminal. Never recorded.",
        "tags": [
          "sessions"
        ]
      }
    },
    "/v1/sessions/{id}/output": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_sessions__id__output",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "stdout, stderr or merged (default), for a process.",
            "in": "query",
            "name": "stream",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Byte offset to read from.",
            "in": "query",
            "name": "since",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Most bytes to return; default 1 MB.",
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Read lines from this line number (a process only).",
            "in": "query",
            "name": "line",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many lines; default 100.",
            "in": "query",
            "name": "count",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The last so many lines.",
            "in": "query",
            "name": "tail",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Output"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The transcript, by bytes or by lines.",
        "tags": [
          "sessions"
        ]
      }
    },
    "/v1/sessions/{id}/resize": {
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_sessions__id__resize",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Resize"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Give a terminal a new size.",
        "tags": [
          "sessions"
        ]
      }
    },
    "/v1/sessions/{id}/screen": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_sessions__id__screen",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "text (default) or ansi, which keeps colours.",
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "That many lines of screen and scrollback instead.",
            "in": "query",
            "name": "tail",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Screen"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "A terminal as it looks now, as text.",
        "tags": [
          "sessions"
        ]
      }
    },
    "/v1/sessions/{id}/signal": {
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_sessions__id__signal",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Signal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Send INT, TERM, HUP or KILL to the session's process group.",
        "tags": [
          "sessions"
        ]
      }
    },
    "/v1/stats": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_stats",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Load, CPU, memory, filesystems, network, GPU and unit states, read now.",
        "tags": [
          "stats"
        ]
      }
    },
    "/v1/units": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_units",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Unit"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The units and their state.",
        "tags": [
          "units"
        ]
      }
    },
    "/v1/units/{unit}": {
      "get": {
        "description": "Host level only.",
        "operationId": "get_v1_units__unit_",
        "parameters": [
          {
            "in": "path",
            "name": "unit",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "type": "string"
                  },
                  "type": "object"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "One unit's properties, as systemctl show gives them.",
        "tags": [
          "units"
        ]
      }
    },
    "/v1/units/{unit}/{verb}": {
      "post": {
        "description": "Host level only.",
        "operationId": "post_v1_units__unit___verb_",
        "parameters": [
          {
            "in": "path",
            "name": "unit",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "verb",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Done"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "Start, stop, restart, reload, enable or disable a unit.",
        "tags": [
          "units"
        ]
      }
    },
    "/v1/version": {
      "get": {
        "description": "Host and agent level.",
        "operationId": "get_v1_version",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Version"
                }
              }
            },
            "description": "Done."
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            },
            "description": "An error."
          }
        },
        "summary": "The version of rookeryd and of its API.",
        "tags": [
          "version"
        ]
      }
    }
  }
}
