Feature: the API

An API Written Down as a Promise

Everything the page does, it does through /api/v1/, and so can a script, a monitoring system or a program of your own: the Desktop App is one. What v1 promises is written down, listed for programs, and checked against a running wall by a tool.

The Promise

Added to, never taken from

Within v1, requests, fields, states, codes and words are added. None is taken away or given another meaning.

A v2 beside it

A change that would break a program gets /api/v2/ beside v1, which is served on for at least twelve months and two minor releases, with Deprecation and Sunset headers.

A list for programs

qkvm/api_v1.json, in every install: each promised request, who may ask it, what it answers and since which version. qKVM's tests fail where code and list differ.

Refusals a program can read

Every refusal is a code for a program and a sentence for a person. Where a command went out and no answer came, it may have been done: no blind retry of a power button.

Hold a Wall to It

qkvm.conformance reads only: it sends nothing but GET, presses nothing, and opens no live line and no console. Run it in a client's release tests against every wall version the client is to work with.

  1. Make a tokenA viewer's or an operator's, alone on the line of a file of its own.
  2. Run the checkpython -P -m qkvm.conformance https://wall:8787 --token-file token.txt
  3. Read the linesok, FAIL, note or skip for each thing it looked at, by field and kind, never a value.
  4. Stop on the codeExit 0 as promised, 1 where not, 2 where it could not check.

What a Program Gets

What each machine can do

Each machine says what it can be asked in words: keys, power, media, live, locator and more. A client never guesses from the kind of device.

words.json

One file of states, codes and labels, served by every wall, so no two programs call one thing by two names.

The live protocol

A pass, then a WebSocket: H.264 or JPEG down, keys and the mouse up, every message and the 16-byte frame header written down.

The machine you meant

An action or a live pass can carry the machine's target. Where the tile was pointed at another machine meanwhile, nothing is sent.

Tokens for scripts

A bearer token, viewer or operator, held to machines and groups, for 1 to 3650 days or until taken back.

History

For each machine: a summary with its share online, its states, power events, sensor samples, and averaged series.

Prometheus metrics

GET /metrics behind a token of its own: machines by state, and for each whether it answers, its picture, when last seen and how warm it is.

A health check

GET /healthz with no sign-in: the version, the API versions it speaks, and whether it waits for a sign-in after a restart.

Details and Limits

Three ways in
A person with a cookie and the X-QKVM header, a script with its token, a wall screen with its link. A token is never an admin.
A person only
Virtual media, a way into a server's console, and typing a saved text are never done by a token.
Bodies
JSON, 64 KiB at most; an image upload 16 GB at most. A refusal names the field and the rule, never the value.
The page's own
Setting a wall up, its settings, accounts and updates are the page's own requests and change with it: a program written against them is written against one version.
Manners
Ask no more often than the wall's interval, and not for a window nobody sees. A program that stops asking lets a JetKVM's one viewer go.