tessera

Turns direct access on or off for a backend.

PATCH
/api/v1/admin/storage/backends/{name}

Why not another POST of the whole backend

That works and replaces the row, but it needs the URL and credentials sent again. Those are sealed and never shown, so flipping one switch would mean digging up the bucket's secret key again.

Errors

401 when nothing was signed in, 403 when the caller may not write settings, 404 when no backend has that name.

session
cookietessera_session<token>

Set by POST /auth/login. A browser sends it automatically; it is HttpOnly, so page scripts cannot read or set it.

name*string

Which backend

application/json
  1. body

Body of PATCH /admin/storage/backends/{name}.

direct_access*boolean

Whether browsers may be redirected to it directly.

Response Body

The backend as it now stands

application/json
  1. response

One backend, as the panel draws it.

Four booleans for four unrelated questions: where new uploads go, whether this one still accepts them, whether the process can reach it, and whether browsers may be redirected to it. Merging any pair into an enum would invent a state that does not exist, since a read-only backend can be the default and an unreachable one can be either.

access_key?|

The access key ID with all but four characters at each end hidden, or null when there is none or it is too short to show any of.

capacity_bytes?|

How much it may hold, or null for no limit.

Typed in by the operator: object stores have no capacity API, and on a free tier the limit belongs to the account's plan, which no API reports.

Formatint64
Range0 <= value
config*

The options that say where the store is, for the panel to show and edit. Credentials are never among them.

direct_access*boolean

Whether browsers are redirected to it directly, to download a file or write an upload's parts, instead of going through this server.

Only S3 and GCS support this. On anything else it may be true and change nothing.

is_default*boolean

Whether new uploads go here.

last_checked_at?|

When it was last called, or null before it has been since start-up.

Formatdate-time
last_error?|

Why the last call failed, or null when it answered.

name*string

What file_segments.backend records. Stable, and how everything else refers to it.

reachable*boolean

Whether it answered the last time it was called, or true before it has been.

false means shares held there fail until the operator fixes the credentials or the address, or the store comes back. Worth showing prominently, because nothing else about the row looks wrong.

Learned from the calls uploads and downloads make, so a backend in use is always current; one left idle is asked every fifteen minutes, and one that failed every five, until it answers.

read_only*boolean

Whether it still takes new content. Reads are unaffected.

url*string

Where it is, without credentials: no user, password, query or fragment. A local directory is its path.

used_bytes*integer

How much it is holding.

Not typed in and not asked of the store, but summed from the segments this instance wrote.

Formatint64
Range0 <= value
curl -X PATCH 'https://example.com/api/v1/admin/storage/backends/string' \  -H 'Content-Type: application/json' \  -d '{  "direct_access": true}'
{  "access_key": "string",  "capacity_bytes": 0,  "config": {    "account": "string",    "allow_http": true,    "endpoint": "string",    "region": "string"  },  "direct_access": true,  "is_default": true,  "last_checked_at": "2019-08-24T14:15:22Z",  "last_error": "string",  "name": "string",  "reachable": true,  "read_only": true,  "url": "string",  "used_bytes": 0}