Clients and versions
Anything that talks to a wall other than its own page is a client of the API. These rules keep it working from one version of qKVM to the next, saying the same things the page says.
The rules
- Ask
GET /healthzfirst. It needs no sign-in.apilists the versions of the interface the wall speaks: wherev1is not listed, say so plainly and send nothing else.lockedsays the wall reaches no device until somebody signs in. - Take what you know, leave the rest. Within
v1nothing is taken away. A state or code you have not met is shown as a problem, with the sentence the wall sent; a word ofcanyou have not met is left out. - Go by
can, never by the kind of device. A new kind of device brings new words, and a client that goes bycanshows the right buttons for it without having heard of it. - Use the wall's words.
words.json, served by every wall at/static/words.json, holds the states and their labels, device trouble codes, refusal codes with their statuses, the kinds of device, and the words ofcan. Build from it, or check against it. - Leave the page's own to the page. Setting a wall up, its settings, accounts, Web Push and updates are done in a browser.
Check a wall
qkvm.conformance holds a running wall to the promise of the API. It only reads: it sends nothing but GET, and opens no live line and no console.
python -P -m qkvm.conformance https://192.168.1.20:8787 --token-file token.txt --cafile cert.pem
| Option | What it does | Default |
|---|---|---|
--token-file | a file holding a viewer's or operator's token for scripts, alone on one line | required |
--cafile | the wall's own certificate, tls/cert.pem from its data folder | public authorities |
--every-machine | reads every machine, not one of each kind | off |
--no-pictures | asks for no picture | off |
--strict | expects all of it, whatever the wall's version | off |
- The token is sent to that wall alone and never written out. Over plain HTTP, the check says the token crossed the network unencrypted.
- Behind a proxy that signs people in (
--sso-header), check the wall's own address. - A request or field promised since a later version than the wall's is skipped. One the wall added since is a
note.
What it says
A line for each thing it looked at (ok, FAIL, note or skip), and at the end how many of each.
| Exit status | Means |
|---|---|
| 0 | the wall answered everything as promised |
| 1 | it did not |
| 2 | could not check: out of reach, certificate not trusted, token not taken, wall locked, or older than 0.2.0 |
In your release tests
Run the check from the qKVM version your client was written against (pip install qkvm==<version> in an environment of its own is enough). Run it against a wall of every version the client is to work with, set up with machines and a token for scripts. Stop the release on any exit status but 0.