Adds a backend. A name that is already taken is refused.
The new backend is open and usable from the next request. The pool is rebuilt now, not at the next restart, since avoiding "add a bucket, then restart" is the point of this feature.
It is asked whether it answers before the response, which says so in
reachable and last_error. One that does not is stored anyway: it may
not be up yet. Only a URL that cannot be a store at all is refused.
Errors
400 when the URL will not open, 401 when nothing was signed in, 403
when the caller may not write settings, 404 when this instance has no
administration, 409 when the name is taken.
sessiontessera_session<token>Set by POST /auth/login. A browser sends it automatically; it is HttpOnly, so page scripts cannot read or set it.
application/json- body
Body of POST /admin/storage/backends.
capacity_bytes?|How much it may hold. Omit or send null for no limit.
int640 <= valuedirect_access?booleanWhether browsers may be redirected to it directly. Only if browsers can
reach it; see [BackendResponse::direct_access].
name*stringWhat to call it. A name already in use is refused with 409; replace
a backend with PUT /admin/storage/backends/{name}.
options?Backend-specific options, passed to object_store unchanged:
aws_endpoint, aws_region, aws_access_key_id,
aws_secret_access_key and the like.
read_only?booleanWhether it should stop taking new content.
url*stringWhere it is. Sealed before it is stored.
For S3, GCS and Azure the credentials go in options: object_store
takes only the bucket from an s3:// URL and ignores a key:secret@.
The backend as it now stands
application/json- 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.
int640 <= valueconfig*The options that say where the store is, for the panel to show and edit. Credentials are never among them.
direct_access*booleanWhether 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*booleanWhether new uploads go here.
last_checked_at?|When it was last called, or null before it has been since start-up.
date-timelast_error?|Why the last call failed, or null when it answered.
name*stringWhat file_segments.backend records. Stable, and how everything else
refers to it.
reachable*booleanWhether 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*booleanWhether it still takes new content. Reads are unaffected.
url*stringWhere it is, without credentials: no user, password, query or fragment. A local directory is its path.
used_bytes*integerHow much it is holding.
Not typed in and not asked of the store, but summed from the segments this instance wrote.
int640 <= valuecurl -X POST 'https://example.com/api/v1/admin/storage/backends' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "url": "string"}'{ "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}